mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 13:17:55 +08:00
try to cross compile x86_64-apple from aarch64
This commit is contained in:
+9
-10
@@ -8,6 +8,8 @@ let
|
||||
system = systems.${target};
|
||||
|
||||
buildPackages = import (fetchTarball "https://github.com/soywod/nixpkgs/archive/master.tar.gz") { };
|
||||
inherit (buildPackages) stdenv binutils mktemp gnutar zip;
|
||||
|
||||
pkgs = import (fetchTarball "https://github.com/soywod/nixpkgs/archive/master.tar.gz") {
|
||||
crossSystem = {
|
||||
isStatic = true;
|
||||
@@ -50,17 +52,14 @@ let
|
||||
buildFeatures = lib.strings.splitString "," features;
|
||||
};
|
||||
|
||||
# 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 = buildPackages.stdenv.mkDerivation {
|
||||
# HACK: https://github.com/NixOS/nixpkgs/issues/177129
|
||||
empty-libgcc_eh = stdenv.mkDerivation {
|
||||
pname = "empty-libgcc_eh";
|
||||
version = "0";
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p "$out"/lib
|
||||
ls "${buildPackages.binutils}"/bin/ -al
|
||||
"${buildPackages.binutils}/bin/${buildPackages.binutils.targetPrefix}ar" r "$out"/lib/libgcc_eh.a
|
||||
"${lib.getExe' binutils "ar"}" r "$out"/lib/libgcc_eh.a
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -73,8 +72,8 @@ himalaya.overrideAttrs (drv: {
|
||||
propagatedBuildInputs = (drv.propagatedBuildInputs or [ ])
|
||||
++ lib.optional hostPlatform.isWindows empty-libgcc_eh;
|
||||
|
||||
postInstall = drv.postInstall + lib.optionalString hostPlatform.isWindows ''
|
||||
export WINEPREFIX="$(${lib.getExe' buildPackages.mktemp "mktemp"} -d)"
|
||||
postInstall = (drv.postInstall or "") + lib.optionalString hostPlatform.isWindows ''
|
||||
export WINEPREFIX="$(${lib.getExe' mktemp "mktemp"} -d)"
|
||||
'' + ''
|
||||
mkdir -p $out/bin/share/{applications,completions,man,services}
|
||||
cp assets/himalaya.desktop $out/bin/share/applications/
|
||||
@@ -88,10 +87,10 @@ himalaya.overrideAttrs (drv: {
|
||||
${himalayaExe} completion powershell > ./share/completions/himalaya.powershell
|
||||
${himalayaExe} completion zsh > ./share/completions/himalaya.zsh
|
||||
|
||||
${lib.getExe buildPackages.gnutar} -czf himalaya.tgz himalaya* share
|
||||
${lib.getExe gnutar} -czf himalaya.tgz himalaya* share
|
||||
mv himalaya.tgz ../
|
||||
|
||||
${lib.getExe buildPackages.zip} -r himalaya.zip himalaya* share
|
||||
${lib.getExe zip} -r himalaya.zip himalaya* share
|
||||
mv himalaya.zip ../
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user