build,python: Fix build with setuptools 72.2.0+

* lang/python/setup.py.in (BuildExtFirstHack.run): Extend members of the
extension instead of lists that were passed to the extension.
--

setuptools 72.2.0 integrated changes in distutils which included
"Support for Pathlike objects in data files and extensions". With this
change the extensions now take a copy of the sources list passed to the
constructor instead of keeping a reference to the passed list. Hence,
modifying the sources list that was passed to the extension didn't
change the sources list of the extension anymore. This is fixed by
modifying the sources list of the extension directly. For consistency
we do the same for the swig_opts list.

GnuPG-bug-id: 7281
This commit is contained in:
Ingo Klöcker 2024-09-02 15:33:25 +02:00
parent 569348ee84
commit ecd0c86d62
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9

View File

@ -217,9 +217,9 @@ class BuildExtFirstHack(build):
def run(self): def run(self):
self._generate() self._generate()
swig_sources.extend((self._in_build_base('gpgme.i'), swige.sources.extend((self._in_build_base('gpgme.i'),
self._in_build_base('helpers.c'))) self._in_build_base('helpers.c')))
swig_opts.extend([ swige.swig_opts.extend([
'-I' + self.build_base, '-outdir', '-I' + self.build_base, '-outdir',
os.path.join(self.build_lib, 'gpg') os.path.join(self.build_lib, 'gpg')
]) ])