2022-06-26 10:26:21 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchzip
|
2021-04-05 15:23:46 +00:00
|
|
|
, meson, ninja, pkg-config
|
|
|
|
, python3
|
|
|
|
, icu
|
|
|
|
, libuuid
|
|
|
|
, xapian
|
|
|
|
, xz
|
|
|
|
, zstd
|
|
|
|
, gtest
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zimlib";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "9.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openzim";
|
|
|
|
repo = "libzim";
|
|
|
|
rev = version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-yWnW/+CaQwbemrNLzvQpXw5yvW2Q6LtwDgvA58+fVUs=";
|
2022-06-26 10:26:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testData = fetchzip rec {
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.version = "0.5";
|
2022-06-26 10:26:21 +00:00
|
|
|
url = "https://github.com/openzim/zim-testing-suite/releases/download/v${passthru.version}/zim-testing-suite-${passthru.version}.tar.gz";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-hCIFT1WPDjhoZMlsR2cFbt4NhmIJ4DX1H/tDCIv4NjQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
pkg-config
|
|
|
|
ninja
|
|
|
|
python3
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
icu
|
|
|
|
libuuid
|
|
|
|
xapian
|
|
|
|
xz
|
|
|
|
zstd
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs scripts
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
mesonFlags = [ "-Dtest_data_dir=${testData}" ];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (
|
|
|
|
lib.optionals (stdenv.cc.isGNU) [
|
|
|
|
"-Wno-error=mismatched-new-delete"
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-05 15:23:46 +00:00
|
|
|
gtest
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library for reading and writing ZIM files";
|
|
|
|
homepage = "https://www.openzim.org/wiki/Zimlib";
|
|
|
|
license = licenses.gpl2;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ greg ];
|
2024-07-27 06:49:29 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|