about summary refs log tree commit diff
path: root/pkgs/applications/misc/kiwix
diff options
context:
space:
mode:
authorcolin <colin@uninsane.org>2022-12-16 00:19:54 +0000
committercolin <colin@uninsane.org>2023-01-13 05:07:17 +0000
commitf45dd59576c3d5e03074c6c6f19c184bd368c8e8 (patch)
tree329a13ca733027e105340b41eba952c685b0f503 /pkgs/applications/misc/kiwix
parentfa9cc1b2a0f60805ced5e66367f4210cb43b1806 (diff)
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
```
Diffstat (limited to 'pkgs/applications/misc/kiwix')
-rw-r--r--pkgs/applications/misc/kiwix/default.nix2
-rw-r--r--pkgs/applications/misc/kiwix/lib.nix2
-rw-r--r--pkgs/applications/misc/kiwix/tools.nix41
3 files changed, 43 insertions, 2 deletions
diff --git a/pkgs/applications/misc/kiwix/default.nix b/pkgs/applications/misc/kiwix/default.nix
index 49c0155bf9852..600ea299d18fe 100644
--- a/pkgs/applications/misc/kiwix/default.nix
+++ b/pkgs/applications/misc/kiwix/default.nix
@@ -40,7 +40,7 @@ mkDerivation rec {
   meta = with lib; {
     description = "An offline reader for Web content";
     homepage = "https://kiwix.org";
-    license = licenses.gpl3;
+    license = licenses.gpl3Plus;
     platforms = platforms.linux;
     maintainers = with maintainers; [ ajs124 ];
   };
diff --git a/pkgs/applications/misc/kiwix/lib.nix b/pkgs/applications/misc/kiwix/lib.nix
index ffbcd1bb3016b..84fede08f31b6 100644
--- a/pkgs/applications/misc/kiwix/lib.nix
+++ b/pkgs/applications/misc/kiwix/lib.nix
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "Common code base for all Kiwix ports";
     homepage = "https://kiwix.org";
-    license = licenses.gpl3;
+    license = licenses.gpl3Plus;
     platforms = platforms.linux;
     maintainers = with maintainers; [ colinsane ];
   };
diff --git a/pkgs/applications/misc/kiwix/tools.nix b/pkgs/applications/misc/kiwix/tools.nix
new file mode 100644
index 0000000000000..fe70f5b317a29
--- /dev/null
+++ b/pkgs/applications/misc/kiwix/tools.nix
@@ -0,0 +1,41 @@
+{ lib
+, fetchFromGitHub
+, icu
+, libkiwix
+, meson
+, ninja
+, pkg-config
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "kiwix-tools";
+  version = "3.4.0";
+
+  src = fetchFromGitHub {
+    owner = "kiwix";
+    repo = "kiwix-tools";
+    rev = version;
+    sha256 = "sha256-r3/aTH/YoDuYpKLPakP4toS3OtiRueTUjmR34rdmr+w=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    icu
+    libkiwix
+  ];
+
+  meta = with lib; {
+    description = "Command line Kiwix tools: kiwix-serve, kiwix-manage, ...";
+    homepage = "https://kiwix.org";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ colinsane ];
+  };
+}
+