1{ lib, stdenv, fetchFromGitHub, fetchzip
2, meson, ninja, pkg-config
3, python3
4, icu
5, libuuid
6, xapian
7, xz
8, zstd
9, gtest
10}:
11
12stdenv.mkDerivation rec {
13 pname = "zimlib";
14 version = "8.2.0";
15
16 src = fetchFromGitHub {
17 owner = "openzim";
18 repo = "libzim";
19 rev = version;
20 sha256 = "sha256-ab7UUF+I0/xaGChvdjylEQRHLOjmtg/wk+/JEGehGLE=";
21 };
22
23 testData = fetchzip rec {
24 passthru.version = "0.4";
25 url = "https://github.com/openzim/zim-testing-suite/releases/download/v${passthru.version}/zim-testing-suite-${passthru.version}.tar.gz";
26 sha256 = "sha256-2eJqmvs/GrvOD/pq8dTubaiO9ZpW2WqTNQByv354Z0w=";
27 };
28
29 nativeBuildInputs = [
30 meson
31 pkg-config
32 ninja
33 python3
34 ];
35
36 propagatedBuildInputs = [
37 icu
38 libuuid
39 xapian
40 xz
41 zstd
42 ];
43
44 postPatch = ''
45 patchShebangs scripts
46 '';
47
48 mesonFlags = [ "-Dtest_data_dir=${testData}" ];
49
50 nativeCheckInputs = [
51 gtest
52 ];
53
54 doCheck = true;
55
56 meta = with lib; {
57 description = "Library for reading and writing ZIM files";
58 homepage = "https://www.openzim.org/wiki/Zimlib";
59 license = licenses.gpl2;
60 maintainers = with maintainers; [ greg ];
61 platforms = platforms.linux;
62 };
63}