diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d6f5cf --- /dev/null +++ b/.gitignore @@ -0,0 +1,73 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Flask +app_settings.cfg + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# virtualenv +venv/ + +# Vim +*~ +*.sw? + +# Node +node_modules + +# Mac OS +*.DS_Store +*.xcworkspace diff --git a/dev-scripts/build-debian-pkg b/dev-scripts/build-debian-pkg new file mode 100755 index 0000000..aafc594 --- /dev/null +++ b/dev-scripts/build-debian-pkg @@ -0,0 +1,45 @@ +#!/bin/bash + +# Build uStreamer Debian package. +# +# Usage: +# build-debian-pkg [target architectures] +# +# target architecture: A comma-separated list of architectures that Docker +# accepts for its --platform argument. If omitted, defaults to +# "linux/arm/v7,linux/amd64". The only supported targets are linux/arm/v7 and +# linux/amd64. +# +# Examples +# build-debian-pkg "linux/arm/v7" +# build-debian-pkg "linux/arm/v7,linux/amd64" + +# Exit on first failure. +set -e + +# Echo commands before executing them, by default to stderr. +set -x + +# Exit on unset variable. +set -u + +readonly BUILD_TARGETS="${1:-linux/arm/v7,linux/amd64}" + +PKG_VERSION="$(date '+%Y%m%d%H%M%S')" +readonly PKG_VERSION + +# Use plain Docker build progress output when we're running in CI. +DOCKER_PROGRESS='auto' +if [[ -n "${CI:-}" ]]; then + DOCKER_PROGRESS='plain' +fi +readonly DOCKER_PROGRESS + +DOCKER_BUILDKIT=1 docker buildx build \ + --file Dockerfile \ + --platform "${BUILD_TARGETS}" \ + --build-arg PKG_VERSION="${PKG_VERSION}" \ + --target=artifact \ + --progress="${DOCKER_PROGRESS}" \ + --output "type=local,dest=$(pwd)/build/" \ + . diff --git a/dev-scripts/enable-multiarch-docker b/dev-scripts/enable-multiarch-docker new file mode 100755 index 0000000..e39b20c --- /dev/null +++ b/dev-scripts/enable-multiarch-docker @@ -0,0 +1,33 @@ +#!/bin/bash + +# Configure Docker to support multiarch builds, allowing it to use QEMU to build +# images targeting different CPU architectures. + +# Exit script on first failure. +set -e + +# Echo commands before executing them, by default to stderr. +set -x + +# Exit on unset variable. +set -u + +# Enable multiarch builds with QEMU. +docker run \ + --rm \ + --privileged \ + multiarch/qemu-user-static \ + --reset \ + -p yes + +# Create multiarch build context. +docker context create builder + +# Create multiplatform builder. +docker buildx create builder \ + --name builder \ + --driver docker-container \ + --use + +# Ensure builder has booted. +docker buildx inspect --bootstrap