2022-10-24 18:06:21 +08:00
|
|
|
arch=("any")
|
2024-05-17 15:31:02 +08:00
|
|
|
mingw_arch=("clang64")
|
2022-10-24 18:06:21 +08:00
|
|
|
pkgver=${DRV_VERSION}
|
|
|
|
url="https://m-labs.hk"
|
|
|
|
source=("source.tar")
|
|
|
|
sha256sums=("SKIP")
|
|
|
|
|
|
|
|
build() {
|
2024-05-17 15:31:02 +08:00
|
|
|
mkdir clang64
|
|
|
|
export PYTHONPATH=`pwd`/clang64/lib/python3.11/site-packages
|
2022-10-24 18:06:21 +08:00
|
|
|
chmod +w -R source
|
|
|
|
cd source
|
2024-08-02 10:30:03 +08:00
|
|
|
wine-msys2-build python -m build --wheel --skip-dependency-check --no-isolation
|
|
|
|
}
|
2022-10-24 18:06:21 +08:00
|
|
|
|
2024-08-02 10:30:03 +08:00
|
|
|
package() {
|
|
|
|
cd source
|
2024-08-13 17:04:03 +08:00
|
|
|
wine-msys2-build python -m installer --destdir="${pkgdir}" --prefix="clang64/" dist/*.whl
|
2022-10-24 18:06:21 +08:00
|
|
|
# patch broken shebangs (Z:/nix/store/...)
|
2024-08-02 10:30:03 +08:00
|
|
|
for entrypoint in ${pkgdir}/bin/*-script.py; do
|
2022-10-24 18:06:21 +08:00
|
|
|
[ -f "$entrypoint" ] || continue
|
|
|
|
sed -i "1s|#!.*|#!python|" $entrypoint
|
|
|
|
done
|
2024-08-02 10:30:03 +08:00
|
|
|
for entrypoint in ${pkgdir}/bin/*-script.pyw; do
|
2022-10-24 18:06:21 +08:00
|
|
|
[ -f "$entrypoint" ] || continue
|
|
|
|
sed -i "1s|#!.*|#!pythonw|" $entrypoint
|
|
|
|
done
|
|
|
|
}
|