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
|
2024-10-30 13:35:48 +08:00
|
|
|
export PYTHONPATH=`pwd`/clang64/lib/python3.12/site-packages
|
2022-10-24 18:06:21 +08:00
|
|
|
chmod +w -R source
|
|
|
|
cd source
|
2024-05-17 15:31:02 +08:00
|
|
|
wine-msys2-build python setup.py install --single-version-externally-managed --prefix=../clang64 --record=setuptools-sucks.txt
|
2022-10-24 18:06:21 +08:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# setuptools creates this file if it doesn't already exist, which causes conflicts between pacman packages
|
|
|
|
# see: https://corte.si/posts/code/setuptoolssucks/
|
2024-11-16 15:17:44 +08:00
|
|
|
rm -f clang64/lib/python3.12/site-packages/easy-install.pth
|
2022-10-24 18:06:21 +08:00
|
|
|
# patch broken shebangs (Z:/nix/store/...)
|
2024-05-17 15:31:02 +08:00
|
|
|
for entrypoint in clang64/bin/*-script.py; do
|
2022-10-24 18:06:21 +08:00
|
|
|
[ -f "$entrypoint" ] || continue
|
|
|
|
sed -i "1s|#!.*|#!python|" $entrypoint
|
|
|
|
done
|
2024-05-17 15:31:02 +08:00
|
|
|
for entrypoint in clang64/bin/*-script.pyw; do
|
2022-10-24 18:06:21 +08:00
|
|
|
[ -f "$entrypoint" ] || continue
|
|
|
|
sed -i "1s|#!.*|#!pythonw|" $entrypoint
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2024-05-17 15:31:02 +08:00
|
|
|
cp -R clang64 ${pkgdir}
|
2022-10-24 18:06:21 +08:00
|
|
|
}
|