diff --git a/default.nix b/default.nix index 71350afa..6b1e147f 100644 --- a/default.nix +++ b/default.nix @@ -48,15 +48,32 @@ let libiconv = pkgs.pkgsStatic.libiconv; buildNoDefaultFeatures = !defaultFeatures; buildFeatures = lib.strings.splitString "," features; - binutils = pkgs.buildPackages.binutils; + }; + + # HACK: work around https://github.com/NixOS/nixpkgs/issues/177129 + # Though this is an issue between Clang and GCC, + # so it may not get fixed anytime soon... + empty-libgcc_eh = pkgs.buildPackages.stdenv.mkDerivation { + pname = "empty-libgcc_eh"; + version = "0"; + dontUnpack = true; + installPhase = '' + mkdir -p "$out"/lib + ls "${pkgs.buildPackags.binutils}"/bin/ -al + "${pkgs.buildPackags.binutils}/bin/ar" r "$out"/lib/libgcc_eh.a + ''; }; in + himalaya.overrideAttrs (drv: { version = "1.0.0"; - postInstall = lib.optionalString hostPlatform.isWindows '' + propagatedBuildInputs = drv.propagatedBuildInputs + ++ lib.optional hostPlatform.isWindows empty-libgcc_eh; + + postInstall = (builtins.trace drv drv).postInstall ++ lib.optionalString hostPlatform.isWindows '' export WINEPREFIX="$(${lib.getExe' pkgs.buildPackages.mktemp "mktemp"} -d)" '' + '' mkdir -p $out/bin/share/{applications,completions,man,services} diff --git a/package.nix b/package.nix index 6c69b64e..87995b42 100644 --- a/package.nix +++ b/package.nix @@ -13,24 +13,8 @@ , gpgme , buildNoDefaultFeatures ? false , buildFeatures ? [ ] -, binutils }: -let - # HACK: work around https://github.com/NixOS/nixpkgs/issues/177129 - # Though this is an issue between Clang and GCC, - # so it may not get fixed anytime soon... - empty-libgcc_eh = stdenv.mkDerivation { - pname = "empty-libgcc_eh"; - version = "0"; - dontUnpack = true; - installPhase = '' - mkdir -p "$out"/lib - "${lib.getExe' binutils "ar"}" r "$out"/lib/libgcc_eh.a - ''; - }; -in - rustPlatform.buildRustPackage rec { inherit buildNoDefaultFeatures buildFeatures; @@ -55,7 +39,6 @@ rustPlatform.buildRustPackage rec { ++ lib.optional (installManPages || installShellCompletions) installShellFiles; buildInputs = [ ] - ++ lib.optional hostPlatform.isWindows empty-libgcc_eh ++ lib.optional hostPlatform.isDarwin libiconv ++ lib.optionals hostPlatform.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ Security ]) ++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch