2017-03-07 13:14:14 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper, pkgconfig
|
2016-11-02 16:05:37 +00:00
|
|
|
, zip, python, zlib, which, icu, libmicrohttpd, lzma, aria2, wget, bc
|
2018-07-21 01:44:44 +01:00
|
|
|
, libuuid, libX11, libXext, libXt, libXrender, glib, dbus, dbus-glib
|
2019-05-22 12:03:39 +01:00
|
|
|
, gtk2, gdk-pixbuf, pango, cairo, freetype, fontconfig, alsaLib, atk, cmake
|
2017-03-07 13:03:08 +00:00
|
|
|
, xapian, ctpp2, zimlib
|
2015-09-22 01:11:53 +01:00
|
|
|
}:
|
|
|
|
|
2016-09-03 14:45:00 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2015-09-22 01:11:53 +01:00
|
|
|
let
|
|
|
|
xulrunner64_tar = fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-x86_64.tar.bz2";
|
2015-09-22 01:11:53 +01:00
|
|
|
sha256 = "0i3m30gm5z7qmas14id6ypvbmnb2k7jhz8aby2wz5vvv49zqmx3s";
|
|
|
|
};
|
|
|
|
xulrunnersdk64_tar = fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-x86_64.sdk.tar.bz2";
|
2015-09-22 01:11:53 +01:00
|
|
|
sha256 = "0z90v7c4mq15g5klmsj8vs2r10fbygj3qzynx4952hkv8ihw8n3a";
|
|
|
|
};
|
|
|
|
xulrunner32_tar = fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-i686.tar.bz2";
|
2015-09-22 01:11:53 +01:00
|
|
|
sha256 = "0yln6pxz8f6b9wm9124sx049z8mgi17lgd63rcv2hnix825y8gjb";
|
|
|
|
};
|
|
|
|
xulrunnersdk32_tar = fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-i686.sdk.tar.bz2";
|
2015-09-22 01:11:53 +01:00
|
|
|
sha256 = "1h9vcbvf8wgds6i2z20y7krpys0mqsqhv1ijyfljanp6vyll9fvi";
|
|
|
|
};
|
|
|
|
|
2018-08-20 20:11:29 +01:00
|
|
|
xulrunner = if stdenv.hostPlatform.system == "x86_64-linux"
|
2016-09-03 14:45:00 +01:00
|
|
|
then { tar = xulrunner64_tar; sdk = xulrunnersdk64_tar; }
|
|
|
|
else { tar = xulrunner32_tar; sdk = xulrunnersdk32_tar; };
|
2015-09-22 01:11:53 +01:00
|
|
|
|
2016-09-03 14:45:00 +01:00
|
|
|
pugixml = stdenv.mkDerivation rec {
|
|
|
|
version = "1.2";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "pugixml";
|
2016-09-03 14:45:00 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "http://download.kiwix.org/dev/${pname}-${version}.tar.gz";
|
2016-09-03 14:45:00 +01:00
|
|
|
sha256 = "0sqk0vdwjq44jxbbkj1cy8qykrmafs1sickzldb2w2nshsnjshhg";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ cmake ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
# not a nice src archive: all the files are in the root :(
|
2019-08-15 13:41:18 +01:00
|
|
|
mkdir ${pname}-${version}
|
|
|
|
cd ${pname}-${version}
|
2016-09-03 14:45:00 +01:00
|
|
|
tar -xf ${src}
|
|
|
|
|
|
|
|
# and the build scripts are in there :'(
|
|
|
|
cd scripts
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2015-09-22 01:11:53 +01:00
|
|
|
in
|
2016-09-03 14:45:00 +01:00
|
|
|
|
2015-09-22 01:11:53 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "kiwix";
|
2015-09-22 01:11:53 +01:00
|
|
|
version = "0.9";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://download.kiwix.org/src/kiwix-${version}-src.tar.xz";
|
|
|
|
sha256 = "0577phhy2na59cpcqjgldvksp0jwczyg0l6c9ghnr19i375l7yqc";
|
|
|
|
};
|
|
|
|
|
2017-09-14 20:24:37 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2015-09-22 01:11:53 +01:00
|
|
|
buildInputs = [
|
2017-09-14 20:24:37 +01:00
|
|
|
zip python zlib xapian which icu libmicrohttpd
|
2017-08-18 16:09:51 +01:00
|
|
|
lzma zimlib ctpp2 aria2 wget bc libuuid makeWrapper pugixml
|
2015-09-22 01:11:53 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
postUnpack = ''
|
2016-09-03 14:45:00 +01:00
|
|
|
cd kiwix*
|
2015-09-22 01:11:53 +01:00
|
|
|
mkdir static
|
|
|
|
cp Makefile.in static/
|
|
|
|
|
|
|
|
cd src/dependencies
|
|
|
|
|
2016-09-03 14:45:00 +01:00
|
|
|
tar -xf ${xulrunner.tar}
|
|
|
|
tar -xf ${xulrunner.sdk}
|
2015-09-22 01:11:53 +01:00
|
|
|
|
|
|
|
cd ../../..
|
|
|
|
'';
|
|
|
|
|
2016-09-03 14:45:00 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-staticbins"
|
|
|
|
];
|
2015-09-22 01:11:53 +01:00
|
|
|
|
2017-03-07 13:03:08 +00:00
|
|
|
postInstall = ''
|
2015-09-22 01:11:53 +01:00
|
|
|
cp -r src/dependencies/xulrunner $out/lib/kiwix
|
|
|
|
|
2016-09-03 14:45:00 +01:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/lib/kiwix/xulrunner/xulrunner
|
2015-09-22 01:11:53 +01:00
|
|
|
|
|
|
|
rm $out/bin/kiwix
|
|
|
|
makeWrapper $out/lib/kiwix/kiwix-launcher $out/bin/kiwix \
|
2019-05-22 12:03:39 +01:00
|
|
|
--suffix LD_LIBRARY_PATH : ${makeLibraryPath [stdenv.cc.cc libX11 libXext libXt libXrender glib dbus dbus-glib gtk2 gdk-pixbuf pango cairo freetype fontconfig alsaLib atk]} \
|
2015-09-22 01:11:53 +01:00
|
|
|
--suffix PATH : ${aria2}/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "An offline reader for Web content";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://kiwix.org";
|
2015-09-22 01:11:53 +01:00
|
|
|
license = licenses.gpl3;
|
2017-03-06 21:21:28 +00:00
|
|
|
platforms = platforms.linux;
|
2015-09-22 01:11:53 +01:00
|
|
|
maintainers = with maintainers; [ robbinch ];
|
2018-10-15 23:35:52 +01:00
|
|
|
knownVulnerabilities = [
|
|
|
|
"CVE-2015-1032"
|
|
|
|
];
|
2015-09-22 01:11:53 +01:00
|
|
|
};
|
|
|
|
}
|