From 68fc06fa64e318c82b73d18ed363c6d820756254 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Wed, 26 Mar 2025 10:24:10 +0100 Subject: [PATCH] sdl2-compat: symlink package config specification file into sdl2.pc Previously, replacing SDL2 with sdl2-compat with dependents on the SDL2 pkgconfig file would just break. An example for this breakage is pkgs.ffmpeg.override { SDL2 = pkgs.sdl2-compat; }. This is fixed by symlinking the missing sdl2.pc file to point to sdl2_compat.pc. This is analogous to #388304 (aa8bb53991267915eb10b5dedf566712e56699d0) --- pkgs/by-name/sd/sdl2-compat/package.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/sd/sdl2-compat/package.nix b/pkgs/by-name/sd/sdl2-compat/package.nix index 396e7ea8919e..0b28b9200e9e 100644 --- a/pkgs/by-name/sd/sdl2-compat/package.nix +++ b/pkgs/by-name/sd/sdl2-compat/package.nix @@ -40,9 +40,7 @@ stdenv.mkDerivation (finalAttrs: { libX11 ]; - checkInputs = [ - libGL - ]; + checkInputs = [ libGL ]; outputs = [ "out" @@ -67,6 +65,12 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./find-headers.patch ]; setupHook = ./setup-hook.sh; + postFixup = '' + # allow as a drop in replacement for SDL2 + # Can be removed after treewide switch from pkg-config to pkgconf + ln -s $dev/lib/pkgconfig/sdl2_compat.pc $dev/lib/pkgconfig/sdl2.pc + ''; + passthru = { tests = let