mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-18 05:47:54 +08:00
move windows hack to default.nix
This commit is contained in:
+19
-2
@@ -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}
|
||||
|
||||
-17
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user