From a20c0d5675c121f644b62d41c07024c703f2a426 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Fri, 9 Feb 2024 21:12:46 +0800 Subject: [PATCH] xz: Add meta.pkgConfigModules --- pkgs/tools/compression/xz/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix index 9e195a0aa7db..e02be74b60d3 100644 --- a/pkgs/tools/compression/xz/default.nix +++ b/pkgs/tools/compression/xz/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchurl , enableStatic ? stdenv.hostPlatform.isStatic , writeScript +, testers }: # Note: this package is used for bootstrapping fetchurl, and thus @@ -8,12 +9,12 @@ # cgit) that are needed here should be included directly in Nixpkgs as # files. -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "xz"; version = "5.4.6"; src = fetchurl { - url = "https://github.com/tukaani-project/xz/releases/download/v${version}/xz-${version}.tar.bz2"; + url = with finalAttrs; "https://github.com/tukaani-project/xz/releases/download/v${version}/xz-${version}.tar.bz2"; sha256 = "sha256-kThRsnTo4dMXgeyUnxwj6NvPDs9uc6JDbcIXad0+b0k="; }; @@ -47,8 +48,11 @@ stdenv.mkDerivation rec { new_version="$(curl -s https://tukaani.org/xz/ | pcregrep -o1 '>xz-([0-9.]+)[.]tar[.]bz2' | head -n1)" - update-source-version ${pname} "$new_version" + update-source-version ${finalAttrs.pname} "$new_version" ''; + tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + }; }; meta = with lib; { @@ -72,5 +76,6 @@ stdenv.mkDerivation rec { license = with licenses; [ gpl2Plus lgpl21Plus ]; maintainers = with maintainers; [ sander ]; platforms = platforms.all; + pkgConfigModules = [ "liblzma" ]; }; -} +})