From 6b692b2b3a4e07df26dbb86e640ac0e592581d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=B7=F0=9D=92=89=F0=9D=92=8A=F0=9D=92=8D?= =?UTF-8?q?=F0=9D=92=90=F0=9D=92=84=F0=9D=92=82=F0=9D=92=8D=F0=9D=92=9A?= =?UTF-8?q?=F0=9D=92=94=F0=9D=92=95?= Date: Mon, 18 May 2026 17:56:11 -0400 Subject: [PATCH] wesnoth: simplified wrapping --- pkgs/by-name/we/wesnoth/package.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/we/wesnoth/package.nix b/pkgs/by-name/we/wesnoth/package.nix index 36575f71fc1d..a4bf88f118b5 100644 --- a/pkgs/by-name/we/wesnoth/package.nix +++ b/pkgs/by-name/we/wesnoth/package.nix @@ -1,7 +1,6 @@ { lib, stdenv, - stdenvNoCC, fetchFromGitHub, cmake, pkg-config, @@ -9,6 +8,7 @@ SDL2_image, SDL2_mixer, SDL2_net, + makeBinaryWrapper, SDL2_ttf, pango, gettext, @@ -55,7 +55,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake pkg-config - ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeBinaryWrapper ]; buildInputs = [ SDL2 @@ -122,13 +123,10 @@ stdenv.mkDerivation (finalAttrs: { # Make the game and dedicated server binary available for shell users mkdir -p "$out/bin" ln -s "$app_contents/MacOS/wesnothd${suffix}" "$out/bin/wesnothd${suffix}" + # Symlinking the game binary is unsifficient as it would be unable to # find the bundle resources - cat << EOF > "$out/bin/wesnoth${suffix}" - #!${stdenvNoCC.shell} - open -na "$app_bundle" --args "\$@" - EOF - chmod +x "$out/bin/wesnoth${suffix}" + makeBinaryWrapper "$app_bundle/Contents/MacOS/wesnoth${suffix}" "$out/bin/wesnoth${suffix}" ''; passthru.updateScript = nix-update-script {