remove wine dep from build

This commit is contained in:
Clément DOUIN
2024-11-27 11:56:40 +01:00
parent 085aea0fe9
commit 9e15acf14f
2 changed files with 6 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ himalaya.overrideAttrs (drv: {
# NOTE: manual wineprefix update is somehow needed:
# <https://github.com/NixOS/nixpkgs/issues/321332>
postInstall = (drv.postInstall or "") + lib.optionalString hostPlatform.isWindows ''
${lib.getExe' wine "wineboot"} --init
export WINEPREFIX="$(${lib.getExe mktemp} -d)"
'' + ''
mkdir -p $out/bin/share/{applications,completions,man,services}
cp assets/himalaya.desktop $out/bin/share/applications/

View File

@@ -84,12 +84,16 @@
mkCrossApp = system: crossConfig:
let
pkgs = import nixpkgs { inherit system; };
mktemp = "${lib.getExe pkgs.mktemp} -d";
emulator = crossPkgs.hostPlatform.emulator pkgs;
crossSystem = { config = crossConfig; isStatic = true; };
crossPkgs = import nixpkgs { inherit system crossSystem; };
crossPkgName = "cross-${crossPkgs.hostPlatform.system}";
crossPkgExe = lib.getExe self.packages.${system}.${crossPkgName};
program = lib.getExe (pkgs.writeShellScriptBin "himalaya" "${emulator} ${crossPkgExe} $@");
program = lib.getExe (pkgs.writeShellScriptBin "himalaya" ''
${lib.optionalString crossPkgs.hostPlatform.isWindows "export WINEPREFIX=$(${mktemp})"}
${emulator} ${crossPkgExe} $@
'');
in
{ "${crossPkgName}" = { inherit program; type = "app"; }; };
in