about summary refs log tree commit diff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorRodney Lorrimar <dev@rodney.id.au>2024-02-09 21:12:46 +0800
committerRodney Lorrimar <dev@rodney.id.au>2024-02-22 13:57:43 +0800
commita20c0d5675c121f644b62d41c07024c703f2a426 (patch)
tree42bf668a03cdd88f89b14379802a6256ab00a71e /pkgs/tools/compression
parent35a202a65e4825f77c67de26879069b540e7b41f (diff)
xz: Add meta.pkgConfigModules
Diffstat (limited to 'pkgs/tools/compression')
-rw-r--r--pkgs/tools/compression/xz/default.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix
index 9e195a0aa7db1..e02be74b60d30 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</a>' |
           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" ];
   };
-}
+})