mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 21:37:55 +08:00
try to cross compile x86_64-apple from aarch64
This commit is contained in:
@@ -12,31 +12,31 @@ jobs:
|
||||
include:
|
||||
- system: aarch64-macos
|
||||
target: aarch64-apple-darwin
|
||||
os: macos-14
|
||||
- system: aarch64-linux
|
||||
target: aarch64-unknown-linux-musl
|
||||
os: ubuntu-latest
|
||||
- system: armv6l-linux
|
||||
target: armv6l-unknown-linux-musleabihf
|
||||
os: ubuntu-latest
|
||||
- system: armv7l-linux
|
||||
target: armv7l-unknown-linux-musleabihf
|
||||
os: ubuntu-latest
|
||||
- system: i686-linux
|
||||
target: i686-unknown-linux-musl
|
||||
os: ubuntu-latest
|
||||
- system: i686-windows
|
||||
target: i686-w64-mingw32
|
||||
os: ubuntu-latest
|
||||
os: macos-latest
|
||||
# - system: aarch64-linux
|
||||
# target: aarch64-unknown-linux-musl
|
||||
# os: ubuntu-latest
|
||||
# - system: armv6l-linux
|
||||
# target: armv6l-unknown-linux-musleabihf
|
||||
# os: ubuntu-latest
|
||||
# - system: armv7l-linux
|
||||
# target: armv7l-unknown-linux-musleabihf
|
||||
# os: ubuntu-latest
|
||||
# - system: i686-linux
|
||||
# target: i686-unknown-linux-musl
|
||||
# os: ubuntu-latest
|
||||
# - system: i686-windows
|
||||
# target: i686-w64-mingw32
|
||||
# os: ubuntu-latest
|
||||
- system: x86_64-macos
|
||||
target: x86_64-apple-darwin
|
||||
os: macos-13
|
||||
- system: x86_64-linux
|
||||
target: x86_64-unknown-linux-musl
|
||||
os: ubuntu-latest
|
||||
- system: x86_64-windows
|
||||
target: x86_64-w64-mingw32
|
||||
os: ubuntu-latest
|
||||
os: macos-latest
|
||||
# - system: x86_64-linux
|
||||
# target: x86_64-unknown-linux-musl
|
||||
# os: ubuntu-latest
|
||||
# - system: x86_64-windows
|
||||
# target: x86_64-w64-mingw32
|
||||
# os: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
+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 ../
|
||||
'';
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ rustPlatform.buildRustPackage rec {
|
||||
++ lib.optional (installManPages || installShellCompletions) installShellFiles;
|
||||
|
||||
buildInputs = [ ]
|
||||
++ lib.optionals hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ Security ])
|
||||
++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch
|
||||
++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) gpgme;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user