This commit is contained in:
Clément DOUIN
2024-11-23 21:31:34 +01:00
parent d9699a3cb9
commit dc5ca1999b
2 changed files with 10 additions and 4 deletions
+1
View File
@@ -43,6 +43,7 @@ let
installManPages = false;
notmuch = hostPkgs.notmuch;
gpgme = hostPkgs.gpgme;
pkgsCross = pkgs.pkgsCross;
stdenv =
if hostPlatform.isWindows
then pkgs.pkgsCross.mingwW64.stdenv
+9 -4
View File
@@ -11,6 +11,7 @@
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, notmuch
, gpgme
, pkgsCross
, buildNoDefaultFeatures ? false
, buildFeatures ? [ ]
, cargoLock ? null
@@ -33,11 +34,12 @@ rustPlatform.buildRustPackage rec {
# NIX_BUILD_CORES = 4;
# "CARGO_TARGET_${builtins.replaceStrings ["-"] ["_"] (lib.strings.toUpper stdenv.hostPlatform.config)}_LINKER" = "${stdenv.cc.targetPrefix}cc";
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
TARGET_CC = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER = "${pkgsCross.mingwW64.stdenv.cc.targetPrefix}cc";
# TARGET_CC = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
# CARGO_BUILD_RUSTFLAGS = [ "-Ctarget-feature=+crt-static" ];
CARGO_CFG_TARGET_FEATURE = "crt-static";
CARGO_BUILD_RUSTFLAGS = [ "-Clinker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" ];
# CARGO_BUILD_RUSTFLAGS = [ "-Clinker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" ];
CARGO_BUILD_TARGET = hostPlatform.config;
doCheck = false;
cargoTestFlags = [
@@ -46,7 +48,10 @@ rustPlatform.buildRustPackage rec {
"--lib"
];
depsBuildBuild = lib.optionals hostPlatform.isWindows [ stdenv.cc windows.pthreads ];
depsBuildBuild = lib.optionals hostPlatform.isWindows [
pkgsCross.mingwW64.stdenv.cc
pkgsCross.mingwW64.windows.pthreads
];
nativeBuildInputs = [ ]
++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) pkg-config