forked from M-Labs/nac3
1
0
Fork 0

flake: unbreak Windows library link (WIP)

This commit is contained in:
Sebastien Bourdeauducq 2021-12-02 20:00:45 +08:00
parent a6275fbb57
commit aab43b1c07
1 changed files with 9 additions and 2 deletions

View File

@ -68,12 +68,19 @@
name = "nac3artiq";
src = self;
inherit cargoSha256;
buildInputs = [ pkgs-mingw.libffi ];
buildInputs = [ pkgs-mingw.libffi pkgs-mingw.zlib pkgs-mingw.windows.mcfgthreads ];
configurePhase =
''
export PYO3_CONFIG_FILE=${pyo3-mingw-config}
mkdir llvm-cfg
ln -s ${pkgs-mingw.llvm_12.dev}/bin/llvm-config-native llvm-cfg/llvm-config
cat << EOF > llvm-cfg/llvm-config
#!${pkgs.bash}/bin/bash
set -e
# gross hack to work around llvm-config asking for the wrong system libraries
exec ${pkgs-mingw.llvm_12.dev}/bin/llvm-config-native \$@ | ${pkgs.gnused}/bin/sed s/-lrt\ -ldl/-lmcfgthread\ -lz/
EOF
chmod +x llvm-cfg/llvm-config
export PATH=$PATH:`pwd`/llvm-cfg
'';
cargoBuildFlags = [ "--package" "nac3artiq" ];