about summary refs log tree commit diff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-02-23 05:09:55 +0100
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2024-02-23 05:09:55 +0100
commit5f5062d1ef49274c6eae6e96366ad8200517548a (patch)
tree4cacf1b1d99b1fc85319f0a51f36fffad38beea3 /pkgs/tools/compression
parent674880be880b735307c2e308270e043bd174cd41 (diff)
parentcbc4211f0afffe6dfd2478a62615dd5175a13f9a (diff)
Merge branch 'master' into staging-next
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" ];
   };
-}
+})