nixpkgs/pkgs/applications/misc/kiwix/lib.nix
colin f45dd59576 kiwix-tools: init at 3.4.0
this provides the `kiwix-serve` tool asked for in
<https://github.com/NixOS/nixpkgs/issues/35009>,
but does not implement the systemd service requested.

package contents:
- bin/kiwix-manage
- bin/kiwix-search
- bin/kiwix-serve

tested by invoking `kiwix-serve` and connecting to it in a web browser:

```sh
nix build '.#kiwix-tools'
wget 'https://dumps.wikimedia.org/other/kiwix/zim/wikipedia/wikipedia_en_simple_all_mini_2022-11.zim'
./result/bin/kiwix-serve -p 1080 ./wikipedia_en_simple_all_mini_2022-11.zim
curl http://localhost:1080
```
2023-01-13 05:07:17 +00:00

63 lines
940 B
Nix

{ lib, stdenv, fetchFromGitHub
, meson, ninja, pkg-config
, python3
, curl
, icu
, libzim
, pugixml
, zlib
, libmicrohttpd
, mustache-hpp
, gtest
}:
stdenv.mkDerivation rec {
pname = "libkiwix";
version = "12.0.0";
src = fetchFromGitHub {
owner = "kiwix";
repo = pname;
rev = version;
sha256 = "sha256-4FxLxJxVhqbeNqX4vorHkROUuRURvE6AXlteIZCEBtc=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
python3
];
buildInputs = [
icu
zlib
mustache-hpp
];
propagatedBuildInputs = [
curl
libmicrohttpd
libzim
pugixml
];
checkInputs = [
gtest
];
doCheck = true;
postPatch = ''
patchShebangs scripts
'';
meta = with lib; {
description = "Common code base for all Kiwix ports";
homepage = "https://kiwix.org";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ colinsane ];
};
}