python-windows: Add libffi dependency

pull/174/head
Jeremy Rand 2 years ago
parent 68c386eec3
commit 75aac284e6
No known key found for this signature in database
GPG Key ID: EB03139A459DD06E

@ -10,6 +10,20 @@ openssldir=/var/tmp/dist/openssl/openssl
cp -a $openssldir/include/openssl /var/tmp/dist/mingw-w64/[% c("arch") %]-w64-mingw32/include/openssl
cp -a $openssldir/lib/* $openssldir/bin/*.dll /var/tmp/dist/mingw-w64/[% c("arch") %]-w64-mingw32/lib/
# Required for "import ctypes"
tar -C /var/tmp/dist -xf [% c('input_files_by_name/libffi-src') %]
pushd /var/tmp/dist/*libffi*
# The Python devs got high on LSD and appear to have committed the libffi
# source code from a Windows machine, which stripped off all the +x bits.
# Kids, drugs and coding don't mix.
chmod -R +x ./
./configure --host=[% c("arch") %]-w64-mingw32
# Always errors on this step, but still produces the .dll files we want.
make || true
cp ./[% c("arch") %]-w64-mingw32/include/*.h /var/tmp/dist/mingw-w64/[% c("arch") %]-w64-mingw32/include
cp ./[% c("arch") %]-w64-mingw32/.libs/* /var/tmp/dist/mingw-w64/[% c("arch") %]-w64-mingw32/lib/
popd
mkdir -p /var/tmp/build
tar -C /var/tmp/build -xf [% c('input_files_by_name/python') %]
tar -C /var/tmp/build -xf [% c('input_files_by_name/meson') %]
@ -65,8 +79,8 @@ ninja -C builddir install
find $distdir -name '*.a' -exec rm '{}' +
# These files don't reproduce, and are useless
# Required for "import ssl"
cp $openssldir/bin/*.dll $gcclibs/*.dll $distdir/bin/
# Required for "import ssl" and "import ctypes"
cp $openssldir/bin/*.dll /var/tmp/dist/*libffi*/[% c("arch") %]-w64-mingw32/.libs/*.dll $gcclibs/*.dll $distdir/bin/
cd /var/tmp/dist
[% c('tar', {

@ -14,6 +14,10 @@ var:
- zip
- git # maybe possible to omit these
compiler: mingw-w64
post_pkginst: |
mkdir -p /usr/i686-w64-mingw32/sys-root/mingw/lib/libffi-3.1/
# Yes, Meson uses "i686" in the sysroot name even for 64-bit. v0v
ln -s -T /var/tmp/dist/cpython-source-deps-libffi-3.4.2/[% c("arch") %]-w64-mingw32/include /usr/i686-w64-mingw32/sys-root/mingw/lib/libffi-3.1/include
input_files:
- project: container-image
@ -53,4 +57,7 @@ input_files:
- filename: omit-build-timestamp.patch
- name: openssl
project: openssl
- name: libffi-src
URL: https://github.com/python/cpython-source-deps/archive/refs/tags/libffi-3.4.2.tar.gz
sha256sum: 9f9edfbb59a142a8624cec574eeac0caf98c2e51a15e6c9f099b83aaf0942c22

Loading…
Cancel
Save