git.iko.soy/typeable/nixpkgs
on master help sign in
zathura: cleanup and hide zathuraCollection

Fixes #17787.

commit211adbeb389c5930fe132bb3c631160b92e76d0f authorNikolay Amiantov <ab@fmap.me> dateFri 26 Aug 2016, 03:42 (10 years ago) parent8d10928
10 files changed+77−100
pkgs/applications/misc/zathura/builder.sh−21 pkgs/applications/misc/zathura/core/default.nix+13−14 pkgs/applications/misc/zathura/icon.xpm → pkgs/applications/misc/zathura/core/icon.xpm pkgs/applications/misc/zathura/default.nix+18−47 pkgs/applications/misc/zathura/djvu/default.nix+7−7 pkgs/applications/misc/zathura/pdf-mupdf/default.nix+3−2 pkgs/applications/misc/zathura/pdf-poppler/default.nix+1−1 pkgs/applications/misc/zathura/ps/default.nix+1−1 pkgs/applications/misc/zathura/wrapper.nix+31 pkgs/top-level/all-packages.nix+3−7
pkgs/applications/misc/zathura/builder.shdeleted−21
@@ -1,21 +0,0 @@
1−source $stdenv/setup
2−
3−mkdir -pv $out/bin/
4−mkdir -pv $out/share/
5−mkdir -pv $out/share/applications/
6−mkdir -pv $out/share/pixmaps/
7−
8−cat > $out/bin/zathura <<EOF
9−#!/bin/sh
10−exec $zathura_core/bin/zathura --plugins-dir=$plugins_path "\$@"
11−EOF
12−
13−cp -rv $zathura_core/share/man $out/share
14−cp -rv $zathura_core/share/locale $out/share
15−cp -rv $icon $out/share/pixmaps/pwmt.xpm
16−
17−cat $zathura_core/share/applications/zathura.desktop > $out/share/applications/zathura.desktop
18−echo "Icon=pwmt" >> $out/share/applications/zathura.desktop
19−
20−chmod 755 $out/bin/zathura
21−
pkgs/applications/misc/zathura/core/default.nix+13−14
@@ -1,6 +1,6 @@
1−{ stdenv, lib, fetchurl, pkgconfig, gtk, girara, ncurses, gettext, docutils, file, makeWrapper, zathura_icon, sqlite, glib
2−, synctexSupport ? true, texlive ? null
3−}:
1+{ stdenv, lib, fetchurl, pkgconfig, gtk, girara, ncurses, gettext, docutils
2+, file, makeWrapper, sqlite, glib
3+, synctexSupport ? true, texlive ? null }:
44
55assert synctexSupport -> texlive != null;
66
@@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
1313 sha256 = "0fyb5hak0knqvg90rmdavwcmilhnrwgg1s5ykx9wd3skbpi8nsh8";
1414 };
1515
16+ icon = ./icon.xpm;
17+
1618 buildInputs = [ pkgconfig file gtk girara gettext makeWrapper sqlite glib
1719 ] ++ lib.optional synctexSupport texlive.bin.core;
1820
@@ -27,23 +29,20 @@ stdenv.mkDerivation rec {
2729
2830 postInstall = ''
2931 wrapProgram "$out/bin/zathura" \
30− --prefix PATH ":" "${file}/bin" \
32+ --prefix PATH ":" "${lib.makeBinPath [ file ]}" \
3133 --prefix XDG_CONFIG_DIRS ":" "$out/etc"
3234
35+ install -Dm644 $icon $out/share/pixmaps/pwmt.xpm
3336 mkdir -pv $out/etc
34− echo "set window-icon ${zathura_icon}" > $out/etc/zathurarc
37+ echo "set window-icon $out/share/pixmaps/pwmt.xpm" > $out/etc/zathurarc
38+ echo "Icon=pwmt" >> $out/share/applications/zathura.desktop
3539 '';
3640
37− meta = {
41+ meta = with stdenv.lib; {
3842 homepage = http://pwmt.org/projects/zathura/;
3943 description = "A core component for zathura PDF viewer";
40− license = stdenv.lib.licenses.zlib;
41− platforms = stdenv.lib.platforms.linux;
42− maintainers = [ stdenv.lib.maintainers.garbas ];
43−
44− # Set lower priority in order to provide user with a wrapper script called
45− # 'zathura' instead of real zathura executable. The wrapper will build
46− # plugin path argument before executing the original.
47− priority = 1;
44+ license = licenses.zlib;
45+ platforms = platforms.linux;
46+ maintainers = with maintainers; [ garbas ];
4847 };
4948}
pkgs/applications/misc/zathura/icon.xpm → pkgs/applications/misc/zathura/core/icon.xpmrenamed

The content is the same.

pkgs/applications/misc/zathura/default.nix+18−47
@@ -1,59 +1,30 @@
1−{ callPackage, lib, pkgs, fetchurl, stdenv, useMupdf, synctexSupport ? true }:
1+{ pkgs, useMupdf ? true, synctexSupport ? true }:
22
3−rec {
4− inherit stdenv;
3+let
4+ callPackage = pkgs.newScope self;
55
6− icon = ./icon.xpm;
7−
8− zathura_core = callPackage ./core {
9− gtk = pkgs.gtk3;
10− zathura_icon = icon;
11− inherit synctexSupport;
12− };
13−
14− zathura_pdf_poppler = callPackage ./pdf-poppler { };
15−
16− zathura_pdf_mupdf = callPackage ./pdf-mupdf {
17− gtk = pkgs.gtk3;
18− };
19−
20− zathura_djvu = callPackage ./djvu {
6+ self = rec {
217 gtk = pkgs.gtk3;
22− };
238
24− zathura_ps = callPackage ./ps {
25− gtk = pkgs.gtk3;
26− };
27−
28− zathuraWrapper = stdenv.mkDerivation {
29−
30− inherit zathura_core icon;
9+ zathura_core = callPackage ./core {
10+ inherit synctexSupport;
11+ };
3112
32− name = "zathura-${zathura_core.version}";
13+ zathura_pdf_poppler = callPackage ./pdf-poppler { };
3314
34− plugins_path = stdenv.lib.makeLibraryPath [
35− zathura_djvu
36− zathura_ps
37− (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler)
38− ];
15+ zathura_pdf_mupdf = callPackage ./pdf-mupdf { };
3916
40− builder = ./builder.sh;
17+ zathura_djvu = callPackage ./djvu { };
4118
42− preferLocalBuild = true;
19+ zathura_ps = callPackage ./ps { };
4320
44− meta = with lib; {
45− homepage = http://pwmt.org/projects/zathura/;
46− description = "A highly customizable and functional PDF viewer";
47− longDescription = ''
48− Zathura is a highly customizable and functional PDF viewer based on the
49− poppler rendering library and the gtk+ toolkit. The idea behind zathura
50− is an application that provides a minimalistic and space saving interface
51− as well as an easy usage that mainly focuses on keyboard interaction.
52− '';
53− license = licenses.zlib;
54− platforms = platforms.linux;
55− maintainers = with maintainers;[ garbas smironov ];
21+ zathuraWrapper = callPackage ./wrapper.nix {
22+ plugins = [
23+ zathura_djvu
24+ zathura_ps
25+ (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler)
26+ ];
5627 };
5728 };
58−}
5929
30+in self.zathuraWrapper
pkgs/applications/misc/zathura/djvu/default.nix+7−7
@@ -12,18 +12,18 @@ stdenv.mkDerivation rec {
1212
1313 patches = [ ./gtkflags.patch ];
1414
15− makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
15+ makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ];
1616
17− meta = {
17+ meta = with stdenv.lib; {
1818 homepage = http://pwmt.org/projects/zathura/;
1919 description = "A zathura DJVU plugin";
2020 longDescription = ''
21− The zathura-djvu plugin adds DjVu support to zathura by using the
22− djvulibre library.
21+ The zathura-djvu plugin adds DjVu support to zathura by using the
22+ djvulibre library.
2323 '';
24− license = stdenv.lib.licenses.zlib;
25− platforms = stdenv.lib.platforms.linux;
26− maintainers = [ stdenv.lib.maintainers.garbas ];
24+ license = licenses.zlib;
25+ platforms = platforms.linux;
26+ maintainers = with maintainers; [ garbas ];
2727 };
2828}
2929
pkgs/applications/misc/zathura/pdf-mupdf/default.nix+3−2
@@ -1,4 +1,5 @@
1−{ stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk, girara, mupdf, openssl, libjpeg, jbig2dec, openjpeg, fetchpatch}:
1+{ stdenv, lib, fetchurl, pkgconfig, zathura_core, gtk, girara, mupdf, openssl
2+, libjpeg, jbig2dec, openjpeg, fetchpatch }:
23
34stdenv.mkDerivation rec {
45 version = "0.3.0";
@@ -15,7 +16,7 @@ stdenv.mkDerivation rec {
1516
1617 patches = [(fetchpatch {
1718 name = "mupdf-1.9.patch";
18− url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/mupdf-1.9.patch?h=packages/zathura-pdf-mupdf";
19+ url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/mupdf-1.9.patch?h=packages/zathura-pdf-mupdf&id=385ad96261b7297fdebbee6f4b22ec20dda8d65e";
1920 sha256 = "185wgg0z4b0z5aybcnnyvbs50h43imn5xz3nqmya4rk4v5bwy49y";
2021 })];
2122
pkgs/applications/misc/zathura/pdf-poppler/default.nix+1−1
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
1111
1212 buildInputs = [ pkgconfig poppler zathura_core girara ];
1313
14− makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
14+ makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ];
1515
1616 meta = with lib; {
1717 homepage = http://pwmt.org/projects/zathura/;
pkgs/applications/misc/zathura/ps/default.nix+1−1
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
1212
1313 patches = [ ./gtkflags.patch ];
1414
15− makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
15+ makeFlags = [ "PREFIX=$(out)" "PLUGINDIR=$(out)/lib" ];
1616
1717 meta = with lib; {
1818 homepage = http://pwmt.org/projects/zathura/;
pkgs/applications/misc/zathura/wrapper.nixnew file+31
@@ -0,0 +1,31 @@
1+{ symlinkJoin, lib, makeWrapper, zathura_core, plugins ? [] }:
2+
3+let
4+ pluginsPath = lib.makeLibraryPath plugins;
5+
6+in symlinkJoin {
7+ name = "zathura-with-plugins-${zathura_core.version}";
8+
9+ paths = [ zathura_core ];
10+
11+ buildInputs = [ makeWrapper ];
12+
13+ postBuild = ''
14+ wrapProgram $out/bin/zathura \
15+ --add-flags --plugins-dir=${pluginsPath}
16+ '';
17+
18+ meta = with lib; {
19+ homepage = http://pwmt.org/projects/zathura/;
20+ description = "A highly customizable and functional PDF viewer";
21+ longDescription = ''
22+ Zathura is a highly customizable and functional PDF viewer based on the
23+ poppler rendering library and the gtk+ toolkit. The idea behind zathura
24+ is an application that provides a minimalistic and space saving interface
25+ as well as an easy usage that mainly focuses on keyboard interaction.
26+ '';
27+ license = licenses.zlib;
28+ platforms = platforms.linux;
29+ maintainers = with maintainers;[ garbas smironov ];
30+ };
31+}
pkgs/top-level/all-packages.nix+3−7
@@ -15540,13 +15540,9 @@ in
1554015540
1554115541 zam-plugins = callPackage ../applications/audio/zam-plugins { };
1554215542
15543− zathuraCollection = recurseIntoAttrs
15544− (callPackage ../applications/misc/zathura {
15545− callPackage = newScope pkgs.zathuraCollection;
15546− useMupdf = config.zathura.useMupdf or true;
15547− });
15548−
15549− zathura = zathuraCollection.zathuraWrapper;
15543+ zathura = callPackage ../applications/misc/zathura {
15544+ useMupdf = config.zathura.useMupdf or true;
15545+ };
1555015546
1555115547 zed = callPackage ../applications/editors/zed { };
1555215548