From d9699a3cb90bdb2f04145048d8d34b97ee71bf6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Sat, 23 Nov 2024 21:09:17 +0100 Subject: [PATCH] test b --- default.nix | 6 +++--- package.nix | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/default.nix b/default.nix index 14df74b8..42e7848d 100644 --- a/default.nix +++ b/default.nix @@ -33,7 +33,7 @@ let }; himalaya = import ./package.nix { - inherit lib rustPlatform; + inherit lib hostPlatform rustPlatform; fetchFromGitHub = hostPkgs.fetchFromGitHub; pkg-config = hostPkgs.pkg-config; darwin = hostPkgs.darwin; @@ -45,8 +45,8 @@ let gpgme = hostPkgs.gpgme; stdenv = if hostPlatform.isWindows - then hostPkgs.pkgsCross.mingwW64.stdenv - else hostPkgs.stdenv; + then pkgs.pkgsCross.mingwW64.stdenv + else pkgs.stdenv; }; in diff --git a/package.nix b/package.nix index 0ff5c3f6..db5340f4 100644 --- a/package.nix +++ b/package.nix @@ -1,6 +1,7 @@ { lib , rustPlatform , fetchFromGitHub +, hostPlatform , stdenv , pkg-config , darwin @@ -30,12 +31,13 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-YS8IamapvmdrOPptQh2Ef9Yold0IK1XIeGs0kDIQ5b8="; - NIX_BUILD_CORES = 4; + # 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.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_BUILD_RUSTFLAGS = [ "-Ctarget-feature=+crt-static" ]; CARGO_CFG_TARGET_FEATURE = "crt-static"; + CARGO_BUILD_RUSTFLAGS = [ "-Clinker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" ]; doCheck = false; cargoTestFlags = [ @@ -44,14 +46,14 @@ rustPlatform.buildRustPackage rec { "--lib" ]; - depsBuildBuild = lib.optionals stdenv.hostPlatform.isWindows [ stdenv.cc windows.pthreads ]; + depsBuildBuild = lib.optionals hostPlatform.isWindows [ stdenv.cc windows.pthreads ]; nativeBuildInputs = [ ] ++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) pkg-config ++ lib.optional (installManPages || installShellCompletions) installShellFiles; buildInputs = [ ] - ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ Security ]) + ++ lib.optionals hostPlatform.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ Security ]) ++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch ++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) gpgme;