mirror of
https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
synced 2026-10-25 12:39:18 +03:00
Optionally vendor libgpiod source into sdist so that the Python module can be built from source, even with a missing or mismatched system libgpiod. Add two new environment variables "LINK_SYSTEM_LIBGPIOD" and "LIBGPIOD_VERSION" to control what kind of package setup.py will build. In order to build an sdist or wheel package with a vendored libgpiod a version must be specified via the "LIBGPIOD_VERSION" environment variable. This will instruct setup.py to verify the given version against the list in sha256sums.asc and ensure it meets or exceeds a LIBGPIOD_MINIMUM_VERSION required for compatibility with the bindings. It will then fetch the tarball matching the requested version from mirrors.edge.kernel.org, verify the sha256 signature, unpack it, and copy the lib and include directories into the package root so they can be included in sdist or used to build a binary wheel. eg: LIBGPIOD_VERSION=2.1.0 python3 setup.py sdist Will build a source distribution with gpiod version 2.1.0 source included. It will also save the gpiod version into "libgpiod-version.txt" so that it can be passed to the build when the sdist is built by pip. Requiring an explicit version ensures that the Python bindings - which can be changed and versions independent of libgpiod - are built against a stable libgpiod release. In order to force a package with vendored gpiod source to link the system libgpiod, the "LINK_SYSTEM_LIBGPIOD" environment variable can be used: eg: LINK_SYSTEM_LIBGPIOD=1 pip install libgpiod Signed-off-by: Phil Howard <phil@gadgetoid.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
172 B
172 B