Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / zziplib / default.nix
blobe90df0888a0db78c93cf3c83b5ac84a7eb2a8f2c
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , perl
7 , pkg-config
8 , python3
9 , xmlto
10 , zip
11 , zlib
14 stdenv.mkDerivation rec {
15   pname = "zziplib";
16   version = "0.13.72";
18   src = fetchFromGitHub {
19     owner = "gdraheim";
20     repo = pname;
21     rev = "v${version}";
22     hash = "sha256-Ht3fBgdrTm4mCi5uhgQPNtpGzADoRVOpSuGPsIS6y0Q=";
23   };
25   patches = [
26     # apply https://github.com/gdraheim/zziplib/pull/113
27     (fetchpatch {
28       url = "https://github.com/gdraheim/zziplib/commit/82a7773cd17828a3b0a4f5f552ae80c1cc8777c7.diff";
29       sha256 = "0ifqdzxwb5d19mziy9j6lhl8wj95jpxzm0d2c6y3bgwa931avd3y";
30     })
31     (fetchpatch {
32       url = "https://github.com/gdraheim/zziplib/commit/1cd611514c5f9559eb9dfc191d678dfc991f66db.diff";
33       sha256 = "11w9qa46xq49l113k266dnv8izzdk1fq4y54yy5w8zps8zd3xfny";
34     })
35     (fetchpatch {
36       url = "https://github.com/gdraheim/zziplib/commit/e47b1e1da952a92f917db6fb19485b8a0b1a42f3.diff";
37       sha256 = "0d032hkmi3s3db12z2zbppl2swa3gdpbj0c6w13ylv2g2ixglrwg";
38     })
39     # Fixes invalid pointer conversions that cause compilation to fail with clang 15+
40     (fetchpatch {
41       url = "https://github.com/gdraheim/zziplib/commit/38e4d5f561318fa825e6544c2ef55ac5899c81b0.diff";
42       sha256 = "sha256-VJuFyiPhuAZlDxmNHBty+JbYwG85ea5u2sv7HZRHMwo=";
43     })
44   ];
46   nativeBuildInputs = [
47     cmake
48     perl
49     pkg-config
50     python3
51     xmlto
52     zip
53   ];
54   buildInputs = [
55     zlib
56   ];
58   # test/zziptests.py requires network access
59   # (https://github.com/gdraheim/zziplib/issues/24)
60   cmakeFlags = [
61     "-DZZIP_TESTCVE=OFF"
62     "-DBUILD_SHARED_LIBS=True"
63     "-DBUILD_STATIC_LIBS=False"
64     "-DBUILD_TESTS=OFF"
65     "-DMSVC_STATIC_RUNTIME=OFF"
66     "-DZZIPSDL=OFF"
67     "-DZZIPTEST=OFF"
68     "-DZZIPWRAP=OFF"
69     "-DBUILDTESTS=OFF"
70   ];
72   meta = with lib; {
73     homepage = "https://github.com/gdraheim/zziplib";
74     description = "Library to extract data from files archived in a zip file";
75     longDescription = ''
76       The zziplib library is intentionally lightweight, it offers the ability to
77       easily extract data from files archived in a single zip file.
78       Applications can bundle files into a single zip archive and access them.
79       The implementation is based only on the (free) subset of compression with
80       the zlib algorithm which is actually used by the zip/unzip tools.
81     '';
82     license = with licenses; [ lgpl2Plus mpl11 ];
83     maintainers = with maintainers; [ AndersonTorres ];
84     platforms = platforms.unix;
85   };