diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/zathura')
8 files changed, 300 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/zathura/cb/default.nix b/nixpkgs/pkgs/applications/misc/zathura/cb/default.nix new file mode 100644 index 000000000000..ea2c74fda370 --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/cb/default.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchurl, meson, ninja, pkg-config, zathura_core +, girara, gettext, libarchive }: + +stdenv.mkDerivation rec { + pname = "zathura-cb"; + version = "0.1.10"; + + src = fetchurl { + url = "https://pwmt.org/projects/${pname}/download/${pname}-${version}.tar.xz"; + sha256 = "1j5v32f9ki35v1jc7a067anhlgqplzrp4fqvznlixfhcm0bwmc49"; + }; + + nativeBuildInputs = [ meson ninja pkg-config gettext ]; + buildInputs = [ libarchive zathura_core girara ]; + + PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + + meta = with lib; { + homepage = "https://pwmt.org/projects/zathura-cb/"; + description = "A zathura CB plugin"; + longDescription = '' + The zathura-cb plugin adds comic book support to zathura. + ''; + license = licenses.zlib; + platforms = platforms.unix; + maintainers = with maintainers; [ jlesquembre ]; + }; +} diff --git a/nixpkgs/pkgs/applications/misc/zathura/core/default.nix b/nixpkgs/pkgs/applications/misc/zathura/core/default.nix new file mode 100644 index 000000000000..321ef367c5fe --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/core/default.nix @@ -0,0 +1,52 @@ +{ lib, stdenv, fetchurl, meson, ninja, wrapGAppsHook, pkg-config +, appstream-glib, desktop-file-utils, python3 +, gtk, girara, gettext, libxml2, check +, sqlite, glib, texlive, libintl, libseccomp +, file, librsvg +, gtk-mac-integration +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "zathura"; + version = "0.5.2"; + + src = fetchurl { + url = "https://pwmt.org/projects/zathura/download/zathura-${finalAttrs.version}.tar.xz"; + sha256 = "15314m9chmh5jkrd9vk2h2gwcwkcffv2kjcxkd4v3wmckz5sfjy6"; + }; + + outputs = [ "bin" "man" "dev" "out" ]; + + # Flag list: + # https://github.com/pwmt/zathura/blob/master/meson_options.txt + mesonFlags = [ + "-Dsqlite=enabled" + "-Dmanpages=enabled" + "-Dconvert-icon=enabled" + "-Dsynctex=enabled" + # Make sure tests are enabled for doCheck + (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) + (lib.mesonEnable "seccomp" stdenv.hostPlatform.isLinux) + ]; + + nativeBuildInputs = [ + meson ninja pkg-config desktop-file-utils python3.pythonOnBuildForHost.pkgs.sphinx + gettext wrapGAppsHook libxml2 appstream-glib + ]; + + buildInputs = [ + gtk girara libintl sqlite glib file librsvg check + texlive.bin.core + ] ++ lib.optional stdenv.isLinux libseccomp + ++ lib.optional stdenv.isDarwin gtk-mac-integration; + + doCheck = !stdenv.isDarwin; + + meta = with lib; { + homepage = "https://git.pwmt.org/pwmt/zathura"; + description = "A core component for zathura PDF viewer"; + license = licenses.zlib; + platforms = platforms.unix; + maintainers = with maintainers; [ globin ]; + }; +}) diff --git a/nixpkgs/pkgs/applications/misc/zathura/default.nix b/nixpkgs/pkgs/applications/misc/zathura/default.nix new file mode 100644 index 000000000000..67fe3032d05c --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/default.nix @@ -0,0 +1,33 @@ +{ config, pkgs +# zathura_pdf_mupdf fails to load _opj_create_decompress at runtime on Darwin (https://github.com/NixOS/nixpkgs/pull/61295#issue-277982980) +, useMupdf ? config.zathura.useMupdf or (!pkgs.stdenv.isDarwin) }: + +let + callPackage = pkgs.newScope self; + + self = rec { + gtk = pkgs.gtk3; + + zathura_core = callPackage ./core { }; + + zathura_pdf_poppler = callPackage ./pdf-poppler { }; + + zathura_pdf_mupdf = callPackage ./pdf-mupdf { }; + + zathura_djvu = callPackage ./djvu { }; + + zathura_ps = callPackage ./ps { }; + + zathura_cb = callPackage ./cb { }; + + zathuraWrapper = callPackage ./wrapper.nix { + plugins = [ + zathura_djvu + zathura_ps + zathura_cb + (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler) + ]; + }; + }; + +in self diff --git a/nixpkgs/pkgs/applications/misc/zathura/djvu/default.nix b/nixpkgs/pkgs/applications/misc/zathura/djvu/default.nix new file mode 100644 index 000000000000..f0fe09486324 --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/djvu/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gtk, zathura_core, girara, djvulibre, gettext }: + +stdenv.mkDerivation rec { + pname = "zathura-djvu"; + version = "0.2.9"; + + src = fetchurl { + url = "https://pwmt.org/projects/${pname}/download/${pname}-${version}.tar.xz"; + sha256 = "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"; + }; + + nativeBuildInputs = [ meson ninja pkg-config ]; + buildInputs = [ djvulibre gettext zathura_core gtk girara ]; + + PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + + meta = with lib; { + homepage = "https://pwmt.org/projects/zathura-djvu/"; + description = "A zathura DJVU plugin"; + longDescription = '' + The zathura-djvu plugin adds DjVu support to zathura by using the + djvulibre library. + ''; + license = licenses.zlib; + platforms = platforms.unix; + maintainers = with maintainers; [ ]; + }; +} + diff --git a/nixpkgs/pkgs/applications/misc/zathura/pdf-mupdf/default.nix b/nixpkgs/pkgs/applications/misc/zathura/pdf-mupdf/default.nix new file mode 100644 index 000000000000..f6eb5cfd45e1 --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/pdf-mupdf/default.nix @@ -0,0 +1,63 @@ +{ stdenv, lib, meson, ninja, fetchurl, cairo +, girara +, gtk-mac-integration +, gumbo +, jbig2dec +, libjpeg +, mupdf +, openjpeg +, pkg-config +, zathura_core +, tesseract +, leptonica +, mujs +, gitUpdater +}: + +stdenv.mkDerivation rec { + version = "0.4.1"; + pname = "zathura-pdf-mupdf"; + + src = fetchurl { + url = "https://pwmt.org/projects/${pname}/download/${pname}-${version}.tar.xz"; + hash = "sha256-+YKgHWUj+iVmk4EYTAamJe2/15YcvbBxHcz9ucQCrC8="; + }; + + nativeBuildInputs = [ meson ninja pkg-config ]; + + buildInputs = [ + cairo + girara + gumbo + jbig2dec + libjpeg + mupdf + openjpeg + zathura_core + tesseract + leptonica + mujs + ] ++ lib.optional stdenv.isDarwin gtk-mac-integration; + + PKG_CONFIG_ZATHURA_PLUGINDIR= "lib/zathura"; + + postPatch = '' + sed -i -e '/^mupdfthird =/d' -e 's/, mupdfthird//g' meson.build + ''; + + passthru.updateScript = gitUpdater { + url = "https://git.pwmt.org/pwmt/zathura-pdf-mupdf.git"; + }; + + meta = with lib; { + homepage = "https://pwmt.org/projects/zathura-pdf-mupdf/"; + description = "A zathura PDF plugin (mupdf)"; + longDescription = '' + The zathura-pdf-mupdf plugin adds PDF support to zathura by + using the mupdf rendering library. + ''; + license = licenses.zlib; + platforms = platforms.unix; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/nixpkgs/pkgs/applications/misc/zathura/pdf-poppler/default.nix new file mode 100644 index 000000000000..e482241bbd6c --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/pdf-poppler/default.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchurl, meson, ninja, pkg-config, zathura_core, girara, poppler }: + +stdenv.mkDerivation rec { + pname = "zathura-pdf-poppler"; + version = "0.3.1"; + + src = fetchurl { + url = "https://pwmt.org/projects/${pname}/download/${pname}-${version}.tar.xz"; + sha256 = "12qhkshpp1wjfpjmjccsyi6wscqyqvaa19j85prjpyf65i9jg0gf"; + }; + + nativeBuildInputs = [ meson ninja pkg-config zathura_core ]; + buildInputs = [ poppler girara ]; + + PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + + meta = with lib; { + homepage = "https://pwmt.org/projects/zathura-pdf-poppler/"; + description = "A zathura PDF plugin (poppler)"; + longDescription = '' + The zathura-pdf-poppler plugin adds PDF support to zathura by + using the poppler rendering library. + ''; + license = licenses.zlib; + platforms = platforms.unix; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/applications/misc/zathura/ps/default.nix b/nixpkgs/pkgs/applications/misc/zathura/ps/default.nix new file mode 100644 index 000000000000..180001b52aeb --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/ps/default.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, fetchurl, meson, ninja, pkg-config, zathura_core, girara, libspectre, gettext }: + +stdenv.mkDerivation rec { + pname = "zathura-ps"; + version = "0.2.7"; + + src = fetchurl { + url = "https://pwmt.org/projects/${pname}/download/${pname}-${version}.tar.xz"; + sha256 = "0ilf63wxn1yzis9m3qs8mxbk316yxdzwxrrv86wpiygm9hhgk5sq"; + }; + + nativeBuildInputs = [ meson ninja pkg-config gettext ]; + buildInputs = [ libspectre zathura_core girara ]; + + PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; + + meta = with lib; { + homepage = "https://pwmt.org/projects/zathura-ps/"; + description = "A zathura PS plugin"; + longDescription = '' + The zathura-ps plugin adds PS support to zathura by using the + libspectre library. + ''; + license = licenses.zlib; + platforms = platforms.unix; + maintainers = with maintainers; [ ]; + }; +} + diff --git a/nixpkgs/pkgs/applications/misc/zathura/wrapper.nix b/nixpkgs/pkgs/applications/misc/zathura/wrapper.nix new file mode 100644 index 000000000000..60ff0bd68854 --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/zathura/wrapper.nix @@ -0,0 +1,38 @@ +{ symlinkJoin, lib, makeWrapper, zathura_core, file, plugins ? [] }: +symlinkJoin { + name = "zathura-with-plugins-${zathura_core.version}"; + + paths = with zathura_core; [ man dev out ] ++ plugins; + + nativeBuildInputs = [ makeWrapper ]; + + postBuild = let + fishCompletion = "share/fish/vendor_completions.d/zathura.fish"; + in '' + makeWrapper ${zathura_core.bin}/bin/zathura $out/bin/zathura \ + --prefix PATH ":" "${lib.makeBinPath [ file ]}" \ + --prefix ZATHURA_PLUGINS_PATH : "$out/lib/zathura" + + # zathura fish completion references the zathura_core derivation to + # check for supported plugins which live in the wrapper derivation, + # so we need to fix the path to reference $out instead. + rm "$out/${fishCompletion}" + substitute "${zathura_core.out}/${fishCompletion}" "$out/${fishCompletion}" \ + --replace "${zathura_core.out}" "$out" + ''; + + meta = with lib; { + homepage = "https://git.pwmt.org/pwmt/zathura/"; + description = "A highly customizable and functional PDF viewer"; + longDescription = '' + Zathura is a highly customizable and functional PDF viewer based on the + poppler rendering library and the GTK toolkit. The idea behind zathura + is an application that provides a minimalistic and space saving interface + as well as an easy usage that mainly focuses on keyboard interaction. + ''; + license = licenses.zlib; + platforms = platforms.unix; + maintainers = with maintainers; [ smironov globin TethysSvensson ]; + mainProgram = "zathura"; + }; +} |