Add icdm-root

This commit is contained in:
Greg Hellings
2023-03-07 17:17:24 -06:00
parent 7a1958c6e5
commit a5860e8076
15 changed files with 377 additions and 1 deletions
+3
View File
@@ -58,9 +58,12 @@ in rec {
xonsh-direnv = cp ./xonsh-direnv.nix {};
};
enwiki-dump = super.callPackage ./enwiki-dump.nix {};
hms = super.callPackage ./hms.nix {
pkgs = self.pkgs;
};
kiwix-tools = super.callPackage ./kiwix-tools.nix {};
libkiwix = super.callPackage ./libkiwix.nix {};
xonsh = super.xonsh.overridePythonAttrs (old: rec{
python3 = self.gregpy;
+55
View File
@@ -0,0 +1,55 @@
{ pkgs, ... }:
let
version = "2022.07.20";
date = builtins.replaceStrings ["."] [""] version;
in pkgs.writeShellScriptBin "wiki-data" ''
set -eo pipefail
function process_file {
file="''${lang}''${1}"
destfile=/var/tmp/''${file}
curl -C - -o "''${destfile}" "https://dumps.wikimedia.your.org/''${lang}wiki/${date}/''${file}"
bzcat "''${destfile}" | ${pkgs.php}/bin/php ${pkgs.mediawiki}/share/mediawiki/maintenance/importDump.php --report 500 | tee "/var/log/mediawiki-''${lang}-import"
rm "''${destfile}"
}
function zim_fetch {
dest="/srv/zims"
mkdir -p "''${dest}"
file="''${1}"
echo "Downloading ''${file}"
transmission-remote -w "''${dest}" -a https://download.kiwix.org/zim/''${file}.zim.torrent
}
#process_file "wiki-${date}-pages-articles-multistream.xml.bz2"
#process_file "wiki-${date}-pages-meta-current.xml.bz2"
#process_file "wiki-${date}-pages-articles.xml.bz2"
zim_fetch wikipedia_en_all_maxi
zim_fetch wikipedia_fr_all_maxi
zim_fetch wikipedia_ht_all_maxi
zim_fetch wiktionary_en_all_maxi
zim_fetch wiktionary_fr_all_maxi
zim_fetch wikiversity_en_all_maxi
zim_fetch wikiversity_fr_all_maxi
zim_fetch wikibooks_en_all_maxi
zim_fetch wikibooks_fr_all_maxi
zim_fetch wikisource_en_all_maxi
zim_fetch wikisource_fr_all_maxi
zim_fetch ted_en_science
zim_fetch ted_en_technology
zim_fetch phet_en
zim_fetch phet_fr
zim_fetch phet_ht
zim_fetch gutenberg_en_all
zim_fetch gutenberg_fr_all
''
+48
View File
@@ -0,0 +1,48 @@
{ lib, pkgs, stdenv
, cmake
, meson
, ninja
, pkg-config
, curl
, libkiwix
, libmicrohttpd
, pugixml
, zimlib
, ...}:
stdenv.mkDerivation rec {
pname = "kiwix-tools";
version = "3.1.2";
src = pkgs.fetchFromGitHub {
owner = "kiwix";
repo = pname;
rev = version;
# For 3.3.0
#sha256 = "sha256-jeIyHTbgGrYknLaTNNSFVFo9zXyyGZU6dIVv49bEhBw=";
sha256 = "sha256-i3wr0VZCeH3aRCgphIyn6U91Ja+qVT4NVAzJSmniu8o=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
curl
libkiwix
libmicrohttpd
pugixml
zimlib
];
meta = with lib; {
description = "An offline read for Web content tools (HTTP server, search, etc)";
homepage = "https://kiwix.org";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = [ "Greg Hellings <greg.hellings@gmail.com>" ];
};
}
+62
View File
@@ -0,0 +1,62 @@
{ lib, pkgs, stdenv
, curl
, icu
, pugixml
, mustache-hpp
, libmicrohttpd
, zimlib
, zlib
, bash
, gcc
, gtest
, meson
, ninja
, pkg-config
, python3
, ...}:
stdenv.mkDerivation rec {
pname = "libkiwix";
version = "9.4.1";
src = pkgs.fetchFromGitHub {
owner = "kiwix";
repo = pname;
rev = version;
sha256 = "sha256-vE8bJrNx0oojTgcDhlr+SyfzdpigCZ0pQ2cPYaiZlgw=";
};
nativeBuildInputs = [
bash
gcc
gtest
meson
ninja
pkg-config
python3
];
buildInputs = [
curl
icu
libmicrohttpd
mustache-hpp
pugixml
zimlib
zlib
];
mesonFlags = [ "--debug" ];
# Built-in python script uses /usr/bin/env
patchPhase = "patchShebangs --build scripts/kiwix-compile-resources";
meta = with lib; {
description = "Kiwix file library for use by other applications";
homepage = "https://kiwix.org";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = [ "Greg Hellings <greg.hellings@gmail.com>" ];
};
}