From 83b01dd4ecc38725be5ae3639d0bcb4c4cd2d697 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 18 Sep 2022 11:48:40 +0100 Subject: [PATCH] SDL2_mixer: add "dev" output `SDL2_mixer` is a a popular game dependency. Split it's `dev` output to separate store path to reduce runtime closure size. While at it amend a few games's include paths. --- pkgs/development/libraries/SDL2_mixer/default.nix | 2 ++ pkgs/games/eduke32/default.nix | 2 +- pkgs/games/ivan/default.nix | 2 +- pkgs/games/srb2/default.nix | 4 ++-- pkgs/games/srb2kart/default.nix | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/SDL2_mixer/default.nix b/pkgs/development/libraries/SDL2_mixer/default.nix index 2d1ef9853819..7e562dddf0fd 100644 --- a/pkgs/development/libraries/SDL2_mixer/default.nix +++ b/pkgs/development/libraries/SDL2_mixer/default.nix @@ -47,6 +47,8 @@ stdenv.mkDerivation rec { timidity ]; + outputs = [ "out" "dev" ]; + # fix default path to timidity.cfg so MIDI files could be played postPatch = '' substituteInPlace timidity/options.h \ diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index 4eb46e0ac155..ec65db97ce43 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -58,7 +58,7 @@ in stdenv.mkDerivation rec { done ''; - NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_mixer}/include/SDL2"; + NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2}/include/SDL2 -I${lib.getDev SDL2_mixer}/include/SDL2"; makeFlags = [ "SDLCONFIG=${SDL2}/bin/sdl2-config" diff --git a/pkgs/games/ivan/default.nix b/pkgs/games/ivan/default.nix index 53e1b3cf00e1..80dc182127d1 100644 --- a/pkgs/games/ivan/default.nix +++ b/pkgs/games/ivan/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { cmakeFlags = ["-DCMAKE_CXX_FLAGS=-DWIZARD"]; # Help CMake find SDL_mixer.h - NIX_CFLAGS_COMPILE = "-I${SDL2_mixer}/include/SDL2"; + NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2_mixer}/include/SDL2"; # Create "ivan.desktop" file ivanDesktop = makeDesktopItem { diff --git a/pkgs/games/srb2/default.nix b/pkgs/games/srb2/default.nix index 57488bdb8b16..26bc4eae96c9 100644 --- a/pkgs/games/srb2/default.nix +++ b/pkgs/games/srb2/default.nix @@ -60,8 +60,8 @@ in stdenv.mkDerivation rec { "-DSRB2_ASSET_DIRECTORY=/build/source/assets" "-DGME_INCLUDE_DIR=${game-music-emu}/include" "-DOPENMPT_INCLUDE_DIR=${libopenmpt.dev}/include" - "-DSDL2_MIXER_INCLUDE_DIR=${SDL2_mixer}/include/SDL2" - "-DSDL2_INCLUDE_DIR=${SDL2.dev}/include/SDL2" + "-DSDL2_MIXER_INCLUDE_DIR=${lib.getDev SDL2_mixer}/include/SDL2" + "-DSDL2_INCLUDE_DIR=${lib.getDev SDL2}/include/SDL2" ]; patches = [ diff --git a/pkgs/games/srb2kart/default.nix b/pkgs/games/srb2kart/default.nix index e5a29aa56549..cb68125addaa 100644 --- a/pkgs/games/srb2kart/default.nix +++ b/pkgs/games/srb2kart/default.nix @@ -52,8 +52,8 @@ in stdenv.mkDerivation rec { cmakeFlags = [ #"-DSRB2_ASSET_DIRECTORY=/build/source/assets" "-DGME_INCLUDE_DIR=${game-music-emu}/include" - "-DSDL2_MIXER_INCLUDE_DIR=${SDL2_mixer}/include/SDL2" - "-DSDL2_INCLUDE_DIR=${SDL2.dev}/include/SDL2" + "-DSDL2_MIXER_INCLUDE_DIR=${lib.getDev SDL2_mixer}/include/SDL2" + "-DSDL2_INCLUDE_DIR=${lib.getDev SDL2}/include/SDL2" ]; patches = [