From d9f938cc6dbd5c1b7123af33d3bfb7e1acef5174 Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Mon, 14 Apr 2025 12:40:30 -0400 Subject: [PATCH 1/2] allegro5: split outputs -> out, dev This avoids referencing apple-sdk in the main output on macOS/Darwin, which saves over a gigabyte of closure size on programs built with Allegro 5. Resolves #397472. --- pkgs/development/libraries/allegro/5.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/allegro/5.nix b/pkgs/development/libraries/allegro/5.nix index b8c0b72062ac..77930cf53163 100644 --- a/pkgs/development/libraries/allegro/5.nix +++ b/pkgs/development/libraries/allegro/5.nix @@ -100,6 +100,11 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ]; + outputs = [ + "out" + "dev" + ]; + meta = with lib; { description = "Game programming library"; homepage = "https://liballeg.org/"; From 7ef2fa3b1b15836e345d7d69eb7a10eb74af47fd Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:17:56 -0400 Subject: [PATCH 2/2] allegro5: add `fixDarwinDylibNames` Allows Allegro-based programs on macOS/Darwin to locate the libraries at runtime, without needing a wrapper to set `DYLD_LIBRARY_PATH`. --- pkgs/development/libraries/allegro/5.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/allegro/5.nix b/pkgs/development/libraries/allegro/5.nix index 77930cf53163..55778e37df0d 100644 --- a/pkgs/development/libraries/allegro/5.nix +++ b/pkgs/development/libraries/allegro/5.nix @@ -4,6 +4,7 @@ cmake, enet, fetchFromGitHub, + fixDarwinDylibNames, flac, freetype, gtk3, @@ -49,10 +50,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-agE3K+6VhhG/LO52fiesCsOq1fNYVRhdW7aKdPCbTOo="; }; - nativeBuildInputs = [ - cmake - pkg-config - ]; + nativeBuildInputs = + [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; buildInputs = [