2017-02-15 15:01:40 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, pkgconfig
|
|
|
|
, gtk, girara, ncurses, gettext, docutils
|
2018-02-14 20:52:15 +01:00
|
|
|
, file, sqlite, glib, texlive, libintlOrEmpty
|
|
|
|
, gtk-mac-integration, synctexSupport ? true
|
2017-02-15 15:01:40 +01:00
|
|
|
}:
|
2016-06-10 16:04:22 +02:00
|
|
|
|
|
|
|
assert synctexSupport -> texlive != null;
|
2012-05-14 23:43:46 +02:00
|
|
|
|
2017-02-15 15:01:40 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2012-05-14 23:43:46 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2017-02-15 15:01:40 +01:00
|
|
|
name = "zathura-core-${version}";
|
2017-12-31 02:01:21 +01:00
|
|
|
version = "0.3.8";
|
2012-05-14 23:43:46 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-02-15 15:01:40 +01:00
|
|
|
url = "http://pwmt.org/projects/zathura/download/zathura-${version}.tar.gz";
|
2017-12-31 02:01:21 +01:00
|
|
|
sha256 = "0dz5pky3vmf3s2cp2rv1c099gb1s49p9xlgm3ghyy4pzyxc8bgs6";
|
2012-05-14 23:43:46 +02:00
|
|
|
};
|
|
|
|
|
2016-08-26 02:42:08 +02:00
|
|
|
icon = ./icon.xpm;
|
|
|
|
|
2018-02-14 20:52:15 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
|
|
|
] ++ optional stdenv.isDarwin [ libintlOrEmpty ];
|
|
|
|
|
2017-02-15 15:01:40 +01:00
|
|
|
buildInputs = [
|
2017-09-14 21:24:37 +02:00
|
|
|
file gtk girara
|
2017-02-15 15:01:40 +01:00
|
|
|
gettext makeWrapper sqlite glib
|
2018-02-14 20:52:15 +01:00
|
|
|
] ++ optional synctexSupport texlive.bin.core
|
|
|
|
++ optional stdenv.isDarwin [ gtk-mac-integration ];
|
2016-03-01 20:41:31 +01:00
|
|
|
|
2018-02-14 20:52:15 +01:00
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
|
2016-04-16 18:57:59 +02:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
|
2012-05-14 23:43:46 +02:00
|
|
|
|
2014-10-23 13:57:30 +02:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
2017-12-31 02:01:21 +01:00
|
|
|
"RSTTOMAN=${docutils}/bin/rst2man.py"
|
2014-10-23 13:57:30 +02:00
|
|
|
"VERBOSE=1"
|
2016-02-01 18:18:39 +01:00
|
|
|
"TPUT=${ncurses.out}/bin/tput"
|
2017-02-15 15:01:40 +01:00
|
|
|
(optionalString synctexSupport "WITH_SYNCTEX=1")
|
|
|
|
];
|
2012-05-14 23:43:46 +02:00
|
|
|
|
2013-04-26 13:21:56 +02:00
|
|
|
postInstall = ''
|
2014-02-20 10:31:16 +01:00
|
|
|
wrapProgram "$out/bin/zathura" \
|
2017-02-15 15:01:40 +01:00
|
|
|
--prefix PATH ":" "${makeBinPath [ file ]}" \
|
2014-02-20 10:31:16 +01:00
|
|
|
--prefix XDG_CONFIG_DIRS ":" "$out/etc"
|
|
|
|
|
2016-08-26 02:42:08 +02:00
|
|
|
install -Dm644 $icon $out/share/pixmaps/pwmt.xpm
|
2014-02-20 10:31:16 +01:00
|
|
|
mkdir -pv $out/etc
|
2016-08-26 02:42:08 +02:00
|
|
|
echo "set window-icon $out/share/pixmaps/pwmt.xpm" > $out/etc/zathurarc
|
|
|
|
echo "Icon=pwmt" >> $out/share/applications/zathura.desktop
|
2013-04-26 13:21:56 +02:00
|
|
|
'';
|
|
|
|
|
2017-02-15 15:01:40 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://pwmt.org/projects/zathura/;
|
2012-08-16 16:33:25 +02:00
|
|
|
description = "A core component for zathura PDF viewer";
|
2017-02-15 15:01:40 +01:00
|
|
|
license = licenses.zlib;
|
2018-02-14 20:52:15 +01:00
|
|
|
platforms = platforms.unix;
|
2016-08-26 02:42:08 +02:00
|
|
|
maintainers = with maintainers; [ garbas ];
|
2012-05-14 23:43:46 +02:00
|
|
|
};
|
|
|
|
}
|