flake: fix Windows build, now finding LLVM and Python

This commit is contained in:
Sebastien Bourdeauducq 2021-12-01 18:30:26 +08:00
parent 701ca36e99
commit 31fba04cee
1 changed files with 19 additions and 5 deletions

View File

@ -24,6 +24,21 @@
mkdir $out mkdir $out
tar xvf ${msys2-python-tar} -C $out tar xvf ${msys2-python-tar} -C $out
''; '';
pyo3-mingw-config = pkgs.writeTextFile {
name = "pyo3-mingw-config";
text =
''
implementation=CPython
version=3.9
shared=true
abi3=false
lib_name=python3.9
lib_dir=${msys2-python}/mingw64/lib
pointer_width=64
build_flags=WITH_THREAD
suppress_build_script_link_lines=false
'';
};
in rec { in rec {
inherit nixpkgs-patched; inherit nixpkgs-patched;
@ -53,13 +68,12 @@
name = "nac3artiq"; name = "nac3artiq";
src = self; src = self;
inherit cargoSha256; inherit cargoSha256;
nativeBuildInputs = [ pkgs-mingw.llvm_12 ];
buildInputs = [ pkgs-mingw.libffi pkgs-mingw.libxml2 pkgs-mingw.llvm_12 ];
configurePhase = configurePhase =
'' ''
export PYO3_CROSS_PYTHON_VERSION=3.9 export PYO3_CONFIG_FILE=${pyo3-mingw-config}
export PYO3_CROSS_LIB_DIR=${msys2-python}/mingw64/lib mkdir llvm-cfg
echo Using Python $PYO3_CROSS_PYTHON_VERSION in $PYO3_CROSS_LIB_DIR ln -s ${pkgs-mingw.llvm_12.dev}/bin/llvm-config-native llvm-cfg/llvm-config
export PATH=$PATH:`pwd`/llvm-cfg
''; '';
cargoBuildFlags = [ "--package" "nac3artiq" ]; cargoBuildFlags = [ "--package" "nac3artiq" ];
doCheck = false; doCheck = false;