From bea06ddf3546721446744b732265c4683b8533b9 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 15 Dec 2022 13:51:48 +0000 Subject: [PATCH 1/3] kiwix: 2.2.1 -> 2.3.1 changelog: - 2.3.1 - Fix the AppImage packaging. Now published AppImages work correctly on recent distrubution (mgautierfr 905) - Improve zim file picker (kelson42 886) - Do not show ServiceWorker zim file from the remote catalog (kelson42 887) - 2.3.0 - Fix downloading of file bigger than 4G (Juzz0 855) - Hide top widget and topbar in fullscreen (Juzz0 859) - Add shortcuts for navigating tabs (Ctrl-tab, Ctrl-shift-tab) (Juzz0 867) - Do not use deprecated method QWebEngineDownloadItem::setPath (Juzz0 853) - Fix compilation with last version of libkiwix (mgautierfr 858) - Fix README.md (psypherium 860) - Update translations. - 2.2.2 - Remove usage of deprecated libkiwix function (Juzz0 mgautiefr 831) - Adapt kiwix-desktop to last libkiwix api (mgautierfr 842, veloman-yunkan 844) - Do not search (and crash) on a zim file without fulltext index (mgautierfr 830) - Update translations. - [Flathub] Update link to screenshot libkiwix changelog: libkiwix now requires libzim to be compiled with xapian support. kiwix-desktop fails to link of xapian isn't also found there, so i made this part of `propagatedBuildInputs`. `xz` also needed to be propagated, otherwise libkiwix would fail with ``` > meson.build:38:0: ERROR: Could not generate cargs for libzim: > Package liblzma was not found in the pkg-config search path. ``` additionally, upstream renamed the repo to `libkiwix`. the old `kiwix-lib` repo redirects to `libkiwix`, so i updated pname to reflect this. --- pkgs/applications/misc/kiwix/default.nix | 4 ++-- pkgs/applications/misc/kiwix/lib.nix | 10 +++++----- pkgs/development/libraries/libzim/default.nix | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/misc/kiwix/default.nix b/pkgs/applications/misc/kiwix/default.nix index 7f13494f65f5..3263f0f992d1 100644 --- a/pkgs/applications/misc/kiwix/default.nix +++ b/pkgs/applications/misc/kiwix/default.nix @@ -11,13 +11,13 @@ mkDerivation rec { pname = "kiwix"; - version = "2.2.1"; + version = "2.3.1"; src = fetchFromGitHub { owner = pname; repo = "${pname}-desktop"; rev = version; - sha256 = "sha256-ks2d/guMp5pb2tiwGxNp3htQVm65MsYvZ/6tNjGXNr8="; + sha256 = "sha256-ghx4pW6IkWPzZXk0TtMGeQZIzm9HEN3mR4XQFJ1xHDo="; }; nativeBuildInputs = [ diff --git a/pkgs/applications/misc/kiwix/lib.nix b/pkgs/applications/misc/kiwix/lib.nix index 37f8203e047a..4e3ff063aa57 100644 --- a/pkgs/applications/misc/kiwix/lib.nix +++ b/pkgs/applications/misc/kiwix/lib.nix @@ -3,8 +3,8 @@ , python3 , curl , icu +, libzim , pugixml -, zimlib , zlib , libmicrohttpd , mustache-hpp @@ -12,14 +12,14 @@ }: stdenv.mkDerivation rec { - pname = "kiwix-lib"; - version = "10.1.1"; + pname = "libkiwix"; + version = "12.0.0"; src = fetchFromGitHub { owner = "kiwix"; repo = pname; rev = version; - sha256 = "sha256-ECvdraN1J5XJQLeZDngxO5I7frwZ8+W8tFpbB7o8UeM="; + sha256 = "sha256-4FxLxJxVhqbeNqX4vorHkROUuRURvE6AXlteIZCEBtc="; }; nativeBuildInputs = [ @@ -38,8 +38,8 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ curl libmicrohttpd + libzim pugixml - zimlib ]; checkInputs = [ diff --git a/pkgs/development/libraries/libzim/default.nix b/pkgs/development/libraries/libzim/default.nix index 23c3e902608a..1787af0a4014 100644 --- a/pkgs/development/libraries/libzim/default.nix +++ b/pkgs/development/libraries/libzim/default.nix @@ -5,6 +5,8 @@ , meson , ninja , pkg-config +, python3 +, xapian , xz , zstd }: @@ -24,19 +26,27 @@ stdenv.mkDerivation rec { ninja meson pkg-config + python3 ]; buildInputs = [ icu - xz zstd ]; + propagatedBuildInputs = [ + xapian + xz + ]; + + postPatch = '' + patchShebangs scripts + ''; + mesonFlags = [ # Tests are located at https://github.com/openzim/zim-testing-suite # "...some tests need up to 16GB of memory..." "-Dtest_data_dir=none" - "-Dwith_xapian=false" ]; meta = with lib; { From fa9cc1b2a0f60805ced5e66367f4210cb43b1806 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 16 Dec 2022 00:05:53 +0000 Subject: [PATCH 2/3] kiwix: split libkiwix out its own toplevel package this allows libkiwix to be more easily used by non-nixpkgs consumers. --- pkgs/applications/misc/kiwix/default.nix | 4 ++-- pkgs/applications/misc/kiwix/lib.nix | 10 +++++++++- pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/kiwix/default.nix b/pkgs/applications/misc/kiwix/default.nix index 3263f0f992d1..49c0155bf985 100644 --- a/pkgs/applications/misc/kiwix/default.nix +++ b/pkgs/applications/misc/kiwix/default.nix @@ -1,5 +1,5 @@ { lib, mkDerivation, fetchFromGitHub -, callPackage +, libkiwix , pkg-config , qmake , qtbase @@ -26,11 +26,11 @@ mkDerivation rec { ]; buildInputs = [ + libkiwix qtbase qtwebengine qtsvg qtimageformats - (callPackage ./lib.nix {}) ]; qtWrapperArgs = [ diff --git a/pkgs/applications/misc/kiwix/lib.nix b/pkgs/applications/misc/kiwix/lib.nix index 4e3ff063aa57..ffbcd1bb3016 100644 --- a/pkgs/applications/misc/kiwix/lib.nix +++ b/pkgs/applications/misc/kiwix/lib.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub +{ lib, stdenv, fetchFromGitHub , meson, ninja, pkg-config , python3 , curl @@ -51,4 +51,12 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs scripts ''; + + meta = with lib; { + description = "Common code base for all Kiwix ports"; + homepage = "https://kiwix.org"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ colinsane ]; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 887b29613371..4266a723337f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30172,6 +30172,8 @@ with pkgs; leo-editor = libsForQt5.callPackage ../applications/editors/leo-editor { }; + libkiwix = callPackage ../applications/misc/kiwix/lib.nix { }; + libowfat = callPackage ../development/libraries/libowfat { }; libowlevelzs = callPackage ../development/libraries/libowlevelzs { }; From f45dd59576c3d5e03074c6c6f19c184bd368c8e8 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 16 Dec 2022 00:19:54 +0000 Subject: [PATCH 3/3] kiwix-tools: init at 3.4.0 this provides the `kiwix-serve` tool asked for in , 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 ``` --- pkgs/applications/misc/kiwix/default.nix | 2 +- pkgs/applications/misc/kiwix/lib.nix | 2 +- pkgs/applications/misc/kiwix/tools.nix | 41 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/misc/kiwix/tools.nix diff --git a/pkgs/applications/misc/kiwix/default.nix b/pkgs/applications/misc/kiwix/default.nix index 49c0155bf985..600ea299d18f 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 ffbcd1bb3016..84fede08f31b 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 000000000000..fe70f5b317a2 --- /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 ]; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4266a723337f..d33baeb92953 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29952,6 +29952,8 @@ with pkgs; kiwix = libsForQt5.callPackage ../applications/misc/kiwix { }; + kiwix-tools = callPackage ../applications/misc/kiwix/tools.nix { }; + klayout = libsForQt5.callPackage ../applications/misc/klayout { }; klee = callPackage ../applications/science/logic/klee (with llvmPackages_11; {