From 4c56be2a7e100a5afe2c4b859740be96f5d5ea62 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 5 Nov 2023 16:55:33 +0100 Subject: [PATCH] SDL2_ttf: record provided pkg-config modules in meta This is verified using testers.hasPkgConfigModules which leads to a slight refactor of the expression. --- pkgs/development/libraries/SDL2_ttf/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/SDL2_ttf/default.nix b/pkgs/development/libraries/SDL2_ttf/default.nix index d2dd8d53929e..e46b9d9c537a 100644 --- a/pkgs/development/libraries/SDL2_ttf/default.nix +++ b/pkgs/development/libraries/SDL2_ttf/default.nix @@ -1,11 +1,11 @@ -{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2, freetype, harfbuzz, libGL }: +{ lib, stdenv, pkg-config, darwin, fetchurl, SDL2, freetype, harfbuzz, libGL, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "SDL2_ttf"; version = "2.20.2"; src = fetchurl { - url = "https://www.libsdl.org/projects/SDL_ttf/release/${pname}-${version}.tar.gz"; + url = "https://www.libsdl.org/projects/SDL_ttf/release/${finalAttrs.pname}-${finalAttrs.version}.tar.gz"; sha256 = "sha256-ncce2TSHUhsQeixKnKa/Q/ti9r3dXCawVea5FBiiIFM="; }; @@ -18,10 +18,15 @@ stdenv.mkDerivation rec { ++ lib.optional (!stdenv.isDarwin) libGL ++ lib.optional stdenv.isDarwin darwin.libobjc; + passthru.tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + }; + meta = with lib; { description = "Support for TrueType (.ttf) font files with Simple Directmedia Layer"; platforms = platforms.unix; license = licenses.zlib; homepage = "https://github.com/libsdl-org/SDL_ttf"; + pkgConfigModules = [ "SDL2_ttf" ]; }; -} +})