1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-06 17:11:03 +01:00

xmonad: fix binary name lookup on armv7l when cross-compiled (#6795)

This commit is contained in:
Sorki 2025-04-10 22:28:09 +02:00 committed by GitHub
parent 8638a0b287
commit 543caa313a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,6 +111,12 @@ in
config = config =
let let
# GHC sets OS_ARCH to arm in case of armv7l, need to coerce
executableSystemSuffix =
if pkgs.stdenv.hostPlatform.isArmv7 then
"arm-${lib.toLower pkgs.stdenv.hostPlatform.uname.system}"
else
pkgs.stdenv.hostPlatform.system;
xmonadBin = "${ xmonadBin = "${
pkgs.runCommandLocal "xmonad-compile" pkgs.runCommandLocal "xmonad-compile"
@ -141,15 +147,15 @@ in
# The resulting binary name depends on the arch and os # The resulting binary name depends on the arch and os
# https://github.com/xmonad/xmonad/blob/56b0f850bc35200ec23f05c079eca8b0a1f90305/src/XMonad/Core.hs#L565-L572 # https://github.com/xmonad/xmonad/blob/56b0f850bc35200ec23f05c079eca8b0a1f90305/src/XMonad/Core.hs#L565-L572
if [ -f "$XMONAD_DATA_DIR/xmonad-${pkgs.stdenv.hostPlatform.system}" ]; then if [ -f "$XMONAD_DATA_DIR/xmonad-${executableSystemSuffix}" ]; then
# xmonad 0.15.0 # xmonad 0.15.0
mv "$XMONAD_DATA_DIR/xmonad-${pkgs.stdenv.hostPlatform.system}" $out/bin/ mv "$XMONAD_DATA_DIR/xmonad-${executableSystemSuffix}" $out/bin/
else else
# xmonad 0.17.0 (https://github.com/xmonad/xmonad/commit/9813e218b034009b0b6d09a70650178980e05d54) # xmonad 0.17.0 (https://github.com/xmonad/xmonad/commit/9813e218b034009b0b6d09a70650178980e05d54)
mv "$XMONAD_CACHE_DIR/xmonad-${pkgs.stdenv.hostPlatform.system}" $out/bin/ mv "$XMONAD_CACHE_DIR/xmonad-${executableSystemSuffix}" $out/bin/
fi fi
'' ''
}/bin/xmonad-${pkgs.stdenv.hostPlatform.system}"; }/bin/xmonad-${executableSystemSuffix}";
in in
mkIf cfg.enable (mkMerge [ mkIf cfg.enable (mkMerge [