From dc943556f246d85c6f289e035a38d6e751fa4284 Mon Sep 17 00:00:00 2001 From: Adam Thompson-Sharpe Date: Tue, 17 Mar 2026 14:04:39 -0400 Subject: [PATCH] kiwix-apple: init at 3.13.0 Adds a package for the macOS version of the kiwix reader. The kiwix-desktop source code (used for the existing kiwix package) does not support macOS; a separate repository () is used instead. The package requires Xcode to build, so the release binary is sourced from a DMG file instead of building the package from source. --- pkgs/by-name/ki/kiwix-apple/package.nix | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 pkgs/by-name/ki/kiwix-apple/package.nix diff --git a/pkgs/by-name/ki/kiwix-apple/package.nix b/pkgs/by-name/ki/kiwix-apple/package.nix new file mode 100644 index 000000000000..87fd06b546dc --- /dev/null +++ b/pkgs/by-name/ki/kiwix-apple/package.nix @@ -0,0 +1,51 @@ +{ + lib, + stdenvNoCC, + fetchurl, + makeBinaryWrapper, + nix-update-script, + undmg, +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "kiwix-apple"; + version = "3.13.0"; + + src = fetchurl { + url = "https://download.kiwix.org/release/kiwix-macos/kiwix-macos_${finalAttrs.version}.dmg"; + hash = "sha256-f9Un5ufiwwDiMesdw2dtnHWLM4ZtGMnFcGMuR3aIvHs="; + }; + + sourceRoot = "."; + + strictDeps = true; + + nativeBuildInputs = [ + makeBinaryWrapper + undmg + ]; + + postInstall = '' + mkdir -p $out/Applications + cp -r Kiwix.app $out/Applications + makeWrapper $out/Applications/Kiwix.app/Contents/MacOS/Kiwix $out/bin/${finalAttrs.meta.mainProgram} + ''; + + passthru.updateScript = nix-update-script { + extraArgs = [ + "--url=https://github.com/kiwix/kiwix-apple" + "--version-regex=(.*\\..*\\..*)" # matches arbitrary tags otherwise + ]; + }; + + meta = { + changelog = "https://github.com/kiwix/kiwix-apple/blob/${finalAttrs.version}/CHANGELOG.md"; + description = "Offline reader for Web content"; + downloadPage = "https://get.kiwix.org/en/solutions/applications/kiwix-reader/"; + homepage = "https://get.kiwix.org/en/solutions/applications/"; + license = lib.licenses.gpl3Plus; + mainProgram = "kiwix"; + maintainers = with lib.maintainers; [ MysteryBlokHed ]; + platforms = lib.platforms.darwin; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + }; +})