diff options
author | sternenseemann <sternenseemann@systemli.org> | 2023-11-05 16:51:57 +0100 |
---|---|---|
committer | sternenseemann <sternenseemann@systemli.org> | 2023-11-05 16:51:57 +0100 |
commit | d32cb37277093e405e93e3cd69807a3a07873e80 (patch) | |
tree | 22fb73d56e5c020d33040f4ec40409ffad9eb17c /pkgs/development/libraries/SDL2 | |
parent | 73c05bde44613703e901c835132dadec3efe38b4 (diff) |
sdl2: record provided pkg-config modules in meta
This is verified using testers.hasPkgConfigModules which leads to a slight refactor of the expression.
Diffstat (limited to 'pkgs/development/libraries/SDL2')
-rw-r--r-- | pkgs/development/libraries/SDL2/default.nix | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index 7b741b803de0b..d74ab371bb147 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/pkgs/development/libraries/SDL2/default.nix @@ -49,19 +49,21 @@ , audiofile , libiconv , withStatic ? false +# passthru.tests +, testers }: # NOTE: When editing this expression see if the same change applies to # SDL expression too -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "SDL2"; version = "2.28.3"; src = fetchFromGitHub { owner = "libsdl-org"; repo = "SDL"; - rev = "release-${version}"; + rev = "release-${finalAttrs.version}"; hash = "sha256-/kQ2IyvAfmZ+zIUt1WuEIeX0nYPGXDlAQk2qDsQnFFs="; }; dontDisableStatic = if withStatic then 1 else 0; @@ -96,7 +98,7 @@ stdenv.mkDerivation rec { ++ lib.optionals x11Support [ libX11 ]; propagatedBuildInputs = lib.optionals x11Support [ xorgproto ] - ++ dlopenPropagatedBuildInputs; + ++ finalAttrs.dlopenPropagatedBuildInputs; dlopenBuildInputs = lib.optionals alsaSupport [ alsa-lib audiofile ] ++ lib.optional dbusSupport dbus @@ -109,7 +111,7 @@ stdenv.mkDerivation rec { ++ lib.optionals drmSupport [ libdrm mesa ]; buildInputs = [ libiconv ] - ++ dlopenBuildInputs + ++ finalAttrs.dlopenBuildInputs ++ lib.optional ibusSupport ibus ++ lib.optionals waylandSupport [ wayland-protocols ] ++ lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ]; @@ -156,7 +158,7 @@ stdenv.mkDerivation rec { # list the symbols used in this way. postFixup = let - rpath = lib.makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs); + rpath = lib.makeLibraryPath (finalAttrs.dlopenPropagatedBuildInputs ++ finalAttrs.dlopenBuildInputs); in lib.optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") '' for lib in $out/lib/*.so* ; do @@ -171,6 +173,9 @@ stdenv.mkDerivation rec { passthru = { inherit openglSupport; updateScript = nix-update-script { extraArgs = ["--version-regex" "release-(.*)"]; }; + tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + }; }; meta = with lib; { @@ -180,5 +185,6 @@ stdenv.mkDerivation rec { license = licenses.zlib; platforms = platforms.all; maintainers = with maintainers; [ cpages ]; + pkgConfigModules = [ "sdl2" ]; }; -} +}) |