2022-04-05 10:12:29 +08:00
|
|
|
arch=("any")
|
|
|
|
mingw_arch=("mingw64")
|
|
|
|
pkgver=${DRV_VERSION}
|
|
|
|
url="https://m-labs.hk"
|
|
|
|
source=("source.tar")
|
|
|
|
sha256sums=("SKIP")
|
|
|
|
|
|
|
|
build() {
|
|
|
|
mkdir mingw64
|
|
|
|
export PYTHONPATH=`pwd`/mingw64/lib/python3.9/site-packages
|
|
|
|
chmod +w -R source
|
|
|
|
cd source
|
2022-04-05 17:23:52 +08:00
|
|
|
wine-msys2-build python setup.py install --single-version-externally-managed --prefix=../mingw64 --record=setuptools-sucks.txt
|
2022-04-05 10:12:29 +08:00
|
|
|
cd ..
|
2022-04-05 18:04:49 +08:00
|
|
|
|
|
|
|
# setuptools creates this file if it doesn't already exist, which causes conflicts between pacman packages
|
|
|
|
# see: https://corte.si/posts/code/setuptoolssucks/
|
2022-04-05 16:26:08 +08:00
|
|
|
rm -f mingw64/lib/python3.9/site-packages/easy-install.pth
|
2022-04-05 18:04:49 +08:00
|
|
|
# patch broken shebangs (Z:/nix/store/...)
|
|
|
|
for entrypoint in mingw64/bin/*-script.py; do
|
|
|
|
[ -f "$entrypoint" ] || continue
|
|
|
|
sed -i "1s|#!.*|#!python|" $entrypoint
|
|
|
|
done
|
|
|
|
for entrypoint in mingw64/bin/*-script.pyw; do
|
|
|
|
[ -f "$entrypoint" ] || continue
|
|
|
|
sed -i "1s|#!.*|#!pythonw|" $entrypoint
|
|
|
|
done
|
2022-04-05 10:12:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cp -R mingw64 ${pkgdir}
|
|
|
|
}
|