base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / li / libzip / package.nix
blob759edc288e473670f6cec846915d48bc1ef17990
1 { lib, stdenv
2 , cmake
3 , fetchurl
4 , perl
5 , zlib
6 , groff
7 , withBzip2 ? false
8 , bzip2
9 , withLZMA ? false
10 , xz
11 , withOpenssl ? false
12 , openssl
13 , withZstd ? false
14 , zstd
15 , testers
18 stdenv.mkDerivation (finalAttrs: {
19   pname = "libzip";
20   version = "1.11.1";
22   src = fetchurl {
23     url = "https://libzip.org/download/libzip-${finalAttrs.version}.tar.gz";
24     hash = "sha256-wOb6UqYroR79MCYikNxpcJR67zLgzClO5Q6QBc6sCSo=";
25   };
27   outputs = [ "out" "dev" "man" ];
29   nativeBuildInputs = [ cmake perl groff ];
30   propagatedBuildInputs = [ zlib ];
31   buildInputs = lib.optionals withLZMA [ xz ]
32     ++ lib.optionals withBzip2 [ bzip2 ]
33     ++ lib.optionals withOpenssl [ openssl ]
34     ++ lib.optionals withZstd [ zstd ];
36   # Don't build the regression tests because they don't build with
37   # pkgsStatic and are not executed anyway.
38   cmakeFlags = [ "-DBUILD_REGRESS=0" ];
40   preCheck = ''
41     # regress/runtest is a generated file
42     patchShebangs regress
43   '';
45   passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
47   meta = with lib; {
48     homepage = "https://libzip.org/";
49     description = "C library for reading, creating and modifying zip archives";
50     license = licenses.bsd3;
51     pkgConfigModules = [ "libzip" ];
52     platforms = platforms.unix;
53     changelog = "https://github.com/nih-at/libzip/blob/v${finalAttrs.version}/NEWS.md";
54   };