Get ICDM working

Update libkiwix, kiwixtools, zimlib to latest upstream
Update flake.nix to easily build stable/unstable systems
This commit is contained in:
Greg Hellings
2023-03-15 00:43:31 -05:00
parent d2d8f3b6a3
commit 2e17c25781
5 changed files with 71 additions and 14 deletions
+9 -8
View File
@@ -35,10 +35,12 @@
inputs.ffmac.overlay
];
unstable = args: (machine (args // { channel = nixunstable; }));
machine = {
system ? "x86_64-linux",
name,
channel ? stable
channel ? stable,
extraMods ? []
}:
let
nixpkgs = channel;
@@ -47,7 +49,6 @@
modules = [
{ nixpkgs.overlays = overlays; }
agenix.nixosModule
wsl.nixosModules.wsl
./modules-all
./modules-linux
./hosts/${name}
@@ -58,7 +59,7 @@
inherit nixpkgs;
};
}
];
] ++ extraMods;
specialArgs = {
home-manager = inputs.home-manager;
inherit nixpkgs;
@@ -67,16 +68,16 @@
in {
nixosConfigurations = {
"2maccabees" = machine { system = "aarch64-linux"; name = "2maccabees"; channel = nixunstable; };
jude = machine { name = "jude"; channel = nixunstable; };
"icdm-root" = machine { name = "icdm-root"; };
"2maccabees" = unstable { system = "aarch64-linux"; name = "2maccabees"; };
jude = unstable { name = "jude"; };
"icdm-root" = unstable { name = "icdm-root"; };
"linode" = machine { name = "linode"; };
"lappy" = machine { name = "lappy"; };
"iso" = machine { name = "iso"; };
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
"nixos" = machine { name = "wsl"; system = "aarch64-linux"; channel = nixunstable; };
"nixos" = unstable { name = "wsl"; system = "aarch64-linux"; extraMods = [ wsl.nixosModules.wsl ]; };
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer'
"nixos-arm" = machine { name = "wsl"; system = "aarch64-linux"; channel = nixunstable; };
"nixos-arm" = unstable { name = "wsl"; system = "aarch64-linux"; extraMods = [ wsl.nixosModules.wsl ]; };
};
darwinConfigurations =
+1
View File
@@ -64,6 +64,7 @@ in rec {
};
kiwix-tools = super.callPackage ./kiwix-tools.nix {};
libkiwix = super.callPackage ./libkiwix.nix {};
zimlib = super.callPackage ./zimlib.nix {};
xonsh = super.xonsh.overridePythonAttrs (old: rec{
python3 = self.gregpy;
+1 -3
View File
@@ -19,9 +19,7 @@ stdenv.mkDerivation rec {
owner = "kiwix";
repo = pname;
rev = version;
# For 3.3.0
#sha256 = "sha256-jeIyHTbgGrYknLaTNNSFVFo9zXyyGZU6dIVv49bEhBw=";
sha256 = "sha256-i3wr0VZCeH3aRCgphIyn6U91Ja+qVT4NVAzJSmniu8o=";
sha256 = "sha256-r3/aTH/YoDuYpKLPakP4toS3OtiRueTUjmR34rdmr+w=";
};
nativeBuildInputs = [
+3 -3
View File
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
owner = "kiwix";
repo = pname;
rev = version;
sha256 = "sha256-vE8bJrNx0oojTgcDhlr+SyfzdpigCZ0pQ2cPYaiZlgw=";
sha256 = "sha256-4FxLxJxVhqbeNqX4vorHkROUuRURvE6AXlteIZCEBtc=";
};
nativeBuildInputs = [
@@ -47,10 +47,10 @@ stdenv.mkDerivation rec {
zlib
];
mesonFlags = [ "--debug" ];
mesonFlags = [ "--debug" "-Dc_args=-I${zimlib}/include/" ];
# Built-in python script uses /usr/bin/env
patchPhase = "patchShebangs --build scripts/kiwix-compile-resources";
patchPhase = "patchShebangs --build scripts/*";
meta = with lib; {
description = "Kiwix file library for use by other applications";
+57
View File
@@ -0,0 +1,57 @@
{ lib, stdenv, fetchFromGitHub
, meson, ninja, pkg-config
, python3
, icu
, libuuid
, xapian
, xz
, zstd
, gtest
}:
stdenv.mkDerivation rec {
pname = "zimlib";
version = "8.1.0";
src = fetchFromGitHub {
owner = "openzim";
repo = "libzim";
rev = version;
sha256 = "sha256-ab7UUF+I0/xaGChvdjylEQRHLOjmtg/wk+/JEGehGLE=";
};
nativeBuildInputs = [
meson
pkg-config
ninja
python3
];
propagatedBuildInputs = [
icu
libuuid
xapian
xz
zstd
];
postPatch = ''
patchShebangs scripts
'';
mesonFlags = [ "-Dtest_data_dir=none" ];
checkInputs = [
gtest
];
doCheck = true;
meta = with lib; {
description = "Library for reading and writing ZIM files";
homepage = "https://www.openzim.org/wiki/Zimlib";
license = licenses.gpl2;
maintainers = with maintainers; [ ajs124 ];
platforms = platforms.linux;
};
}