msys2: modernize python install script
This commit is contained in:
parent
9e85187ead
commit
50abd84278
|
@ -10,23 +10,19 @@ build() {
|
||||||
export PYTHONPATH=`pwd`/clang64/lib/python3.11/site-packages
|
export PYTHONPATH=`pwd`/clang64/lib/python3.11/site-packages
|
||||||
chmod +w -R source
|
chmod +w -R source
|
||||||
cd source
|
cd source
|
||||||
wine-msys2-build python setup.py install --single-version-externally-managed --prefix=../clang64 --record=setuptools-sucks.txt
|
wine-msys2-build python -m build --wheel --skip-dependency-check --no-isolation
|
||||||
cd ..
|
}
|
||||||
|
|
||||||
# setuptools creates this file if it doesn't already exist, which causes conflicts between pacman packages
|
package() {
|
||||||
# see: https://corte.si/posts/code/setuptoolssucks/
|
cd source
|
||||||
rm -f clang64/lib/python3.11/site-packages/easy-install.pth
|
wine-msys2-build python -m installer --destdir="${pkgdir}" dist/*.whl
|
||||||
# patch broken shebangs (Z:/nix/store/...)
|
# patch broken shebangs (Z:/nix/store/...)
|
||||||
for entrypoint in clang64/bin/*-script.py; do
|
for entrypoint in ${pkgdir}/bin/*-script.py; do
|
||||||
[ -f "$entrypoint" ] || continue
|
[ -f "$entrypoint" ] || continue
|
||||||
sed -i "1s|#!.*|#!python|" $entrypoint
|
sed -i "1s|#!.*|#!python|" $entrypoint
|
||||||
done
|
done
|
||||||
for entrypoint in clang64/bin/*-script.pyw; do
|
for entrypoint in ${pkgdir}/bin/*-script.pyw; do
|
||||||
[ -f "$entrypoint" ] || continue
|
[ -f "$entrypoint" ] || continue
|
||||||
sed -i "1s|#!.*|#!pythonw|" $entrypoint
|
sed -i "1s|#!.*|#!pythonw|" $entrypoint
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
|
||||||
cp -R clang64 ${pkgdir}
|
|
||||||
}
|
|
||||||
|
|
|
@ -595,9 +595,9 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
(pkgs.fetchurl {
|
(pkgs.fetchurl {
|
||||||
url = "https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-python-regex-2024.5.15-1-any.pkg.tar.zst";
|
url = "https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-python-regex-2024.7.24-1-any.pkg.tar.zst";
|
||||||
name = "mingw-w64-clang-x86_64-python-regex";
|
name = "mingw-w64-clang-x86_64-python-regex";
|
||||||
sha256 = "0abds3p4cbax0qx0vw71ajyjacv5j7hm42qikrij9hj19axzr8an";
|
sha256 = "12651vpnlimnb2srf5fd7jq0yqr4iyw5gwpwxjrjqp7dmzyhqxwq";
|
||||||
})
|
})
|
||||||
|
|
||||||
(pkgs.fetchurl {
|
(pkgs.fetchurl {
|
||||||
|
|
|
@ -14,7 +14,8 @@ fakeroot pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf -Syy
|
||||||
pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf \
|
pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf \
|
||||||
--cachedir $MSYS2DIR/msys/cache --sync --print-format "%l %n" \
|
--cachedir $MSYS2DIR/msys/cache --sync --print-format "%l %n" \
|
||||||
mingw-w64-clang-x86_64-cc mingw-w64-clang-x86_64-python3.11 \
|
mingw-w64-clang-x86_64-cc mingw-w64-clang-x86_64-python3.11 \
|
||||||
mingw-w64-clang-x86_64-python-numpy mingw-w64-clang-x86_64-python-setuptools > $MSYS2DIR/packages.txt
|
mingw-w64-clang-x86_64-python-numpy \
|
||||||
|
mingw-w64-clang-x86_64-python-setuptools mingw-w64-clang-x86_64-python-build mingw-w64-clang-x86_64-python-installer > $MSYS2DIR/packages.txt
|
||||||
|
|
||||||
cat artiq_dependencies.txt comtools_dependencies.txt pythonparser_dependencies.txt sipyco_dependencies.txt | pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf \
|
cat artiq_dependencies.txt comtools_dependencies.txt pythonparser_dependencies.txt sipyco_dependencies.txt | pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf \
|
||||||
--cachedir $MSYS2DIR/msys/cache --sync --print-format "%l %n" - > $MSYS2DIR/artiq_dependency_packages.txt
|
--cachedir $MSYS2DIR/msys/cache --sync --print-format "%l %n" - > $MSYS2DIR/artiq_dependency_packages.txt
|
||||||
|
|
|
@ -221,4 +221,28 @@
|
||||||
name = "mingw-w64-clang-x86_64-python-setuptools";
|
name = "mingw-w64-clang-x86_64-python-setuptools";
|
||||||
sha256 = "1d2l3bnbmhl0a2an9fpwa83hbsm7szfxjr9vg8df45cnwgpxrxjb";
|
sha256 = "1d2l3bnbmhl0a2an9fpwa83hbsm7szfxjr9vg8df45cnwgpxrxjb";
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(pkgs.fetchurl {
|
||||||
|
url = "https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-python-packaging-24.1-1-any.pkg.tar.zst";
|
||||||
|
name = "mingw-w64-clang-x86_64-python-packaging";
|
||||||
|
sha256 = "103gjfj7lqy3bgmvl12v7y6szwqk02hs3ribiqxavzk8hswsky6a";
|
||||||
|
})
|
||||||
|
|
||||||
|
(pkgs.fetchurl {
|
||||||
|
url = "https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-python-pyproject-hooks-1.1.0-1-any.pkg.tar.zst";
|
||||||
|
name = "mingw-w64-clang-x86_64-python-pyproject-hooks";
|
||||||
|
sha256 = "0ksb7pmwh0d1s5ic9srgx2cq01szsg49qm82bw04v2d0820s7df8";
|
||||||
|
})
|
||||||
|
|
||||||
|
(pkgs.fetchurl {
|
||||||
|
url = "https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-python-build-1.2.1-2-any.pkg.tar.zst";
|
||||||
|
name = "mingw-w64-clang-x86_64-python-build";
|
||||||
|
sha256 = "1lkwj5hksz68gqcwhxswr5zr748479vrq7j6ini90lpbilhw59vs";
|
||||||
|
})
|
||||||
|
|
||||||
|
(pkgs.fetchurl {
|
||||||
|
url = "https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-python-installer-0.7.0-3-any.pkg.tar.zst";
|
||||||
|
name = "mingw-w64-clang-x86_64-python-installer";
|
||||||
|
sha256 = "1xcaxnrzzla909ip7bijsbl0m7ck8bw4sxn2kvl7bhs0ja84sj3q";
|
||||||
|
})
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue