On Mon, Oct 16, 2023 at 5:18 PM Phil Howard <phil@xxxxxxxxxxxxx> wrote: > > 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 optional environment variable "LINK_SYSTEM_LIBGPIOD=1" > so that the sdist package can optionally be built and > linked against a compatible system libgpiod. > > eg: LINK_SYSTEM_LIBGPIOD=1 pip install libgpiod > > Update build to add an additional sdist target for upload > to pypi. Call setup.py with "GPIOD_VERSION_STR" set, which > triggers a vendored package build. "GPIOD_VERSION_STR" is > saved to "gpiod-version-str.txt" and included in the sdist > for standalone builds. > > "GPIOD_VERSION_STR" must be specified in order to produce > a standalone buildable sdist package, this requirement > implicitly preserves the old build behaviour. > > Signed-off-by: Phil Howard <phil@xxxxxxxxxxxxx> > --- I just realized one issue with this. Even if we indicate the version of libgpiod as v2.0.2 using the environment variable but actually create it from the master branch then the build-in code will really be the development branch not v2.0.2 stable release. This is precisely the kind of issue that linking to system lib allows to avoid. :) Anyway, maybe we would need an additional environment variable that could be used to point setup.py to the actual source tree we want to use, which may be different from the tree we're using to generate the sdist package? Typically we'd want to release the pypi package with the most recent stable release of libgpiod. Bart