1{ lib
2, stdenv
3, fetchFromGitHub
4, icu
5, meson
6, ninja
7, pkg-config
8, python3
9, xapian
10, xz
11, zstd
12}:
13
14stdenv.mkDerivation rec {
15 pname = "libzim";
16 version = "8.2.0";
17
18 src = fetchFromGitHub {
19 owner = "openzim";
20 repo = pname;
21 rev = "refs/tags/${version}";
22 hash = "sha256-Xh1SQNmG4lQ3f/g+i5m36LJO9JlPzP4bNqhyyKT7NEA=";
23 };
24
25 nativeBuildInputs = [
26 ninja
27 meson
28 pkg-config
29 python3
30 ];
31
32 buildInputs = [
33 icu
34 zstd
35 ];
36
37 propagatedBuildInputs = [
38 xapian
39 xz
40 ];
41
42 postPatch = ''
43 patchShebangs scripts
44 '';
45
46 mesonFlags = [
47 # Tests are located at https://github.com/openzim/zim-testing-suite
48 # "...some tests need up to 16GB of memory..."
49 "-Dtest_data_dir=none"
50 ];
51
52 meta = with lib; {
53 description = "Reference implementation of the ZIM specification";
54 homepage = "https://github.com/openzim/libzim";
55 changelog = "https://github.com/openzim/libzim/releases/tag/${version}";
56 license = licenses.gpl2Plus;
57 maintainers = with maintainers; [ fab ];
58 };
59}