From 61167e9c2a42b05b508dec15f27e0d100e01326d Mon Sep 17 00:00:00 2001 From: Lord-Valen Date: Sun, 26 May 2024 14:02:58 -0400 Subject: [PATCH] zathuraPkgs: run nixfmt-rfc-style --- pkgs/applications/misc/zathura/cb/default.nix | 29 +++++++-- .../misc/zathura/core/default.nix | 63 +++++++++++++++---- pkgs/applications/misc/zathura/default.nix | 13 ++-- .../misc/zathura/djvu/default.nix | 29 +++++++-- .../misc/zathura/pdf-mupdf/default.nix | 46 ++++++++------ .../misc/zathura/pdf-poppler/default.nix | 24 ++++++- pkgs/applications/misc/zathura/ps/default.nix | 29 +++++++-- pkgs/applications/misc/zathura/wrapper.nix | 52 ++++++++++----- 8 files changed, 216 insertions(+), 69 deletions(-) diff --git a/pkgs/applications/misc/zathura/cb/default.nix b/pkgs/applications/misc/zathura/cb/default.nix index ea2c74fda370..84ddd0e70ba8 100644 --- a/pkgs/applications/misc/zathura/cb/default.nix +++ b/pkgs/applications/misc/zathura/cb/default.nix @@ -1,5 +1,15 @@ -{ stdenv, lib, fetchurl, meson, ninja, pkg-config, zathura_core -, girara, gettext, libarchive }: +{ + stdenv, + lib, + fetchurl, + meson, + ninja, + pkg-config, + zathura_core, + girara, + gettext, + libarchive, +}: stdenv.mkDerivation rec { pname = "zathura-cb"; @@ -10,8 +20,17 @@ stdenv.mkDerivation rec { sha256 = "1j5v32f9ki35v1jc7a067anhlgqplzrp4fqvznlixfhcm0bwmc49"; }; - nativeBuildInputs = [ meson ninja pkg-config gettext ]; - buildInputs = [ libarchive zathura_core girara ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + ]; + buildInputs = [ + libarchive + zathura_core + girara + ]; PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; @@ -20,7 +39,7 @@ stdenv.mkDerivation rec { 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/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix index 8b452c7f1a40..8dd529c6b6cc 100644 --- a/pkgs/applications/misc/zathura/core/default.nix +++ b/pkgs/applications/misc/zathura/core/default.nix @@ -1,9 +1,29 @@ -{ lib, stdenv, fetchFromGitLab, meson, ninja, wrapGAppsHook3, pkg-config, gitUpdater -, appstream-glib, json-glib, desktop-file-utils, python3 -, gtk, girara, gettext, libxml2, check -, sqlite, glib, texlive, libintl, libseccomp -, file, librsvg -, gtk-mac-integration +{ + lib, + stdenv, + fetchFromGitLab, + meson, + ninja, + wrapGAppsHook3, + pkg-config, + gitUpdater, + appstream-glib, + json-glib, + desktop-file-utils, + python3, + gtk, + girara, + gettext, + libxml2, + check, + sqlite, + glib, + texlive, + libintl, + libseccomp, + file, + librsvg, + gtk-mac-integration, }: stdenv.mkDerivation (finalAttrs: { @@ -18,7 +38,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-mHEYqgBB55p8nykFtvYtP5bWexp/IqFbeLs7gZmXCeE="; }; - outputs = [ "bin" "man" "dev" "out" ]; + outputs = [ + "bin" + "man" + "dev" + "out" + ]; # Flag list: # https://github.com/pwmt/zathura/blob/master/meson_options.txt @@ -33,15 +58,29 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ - meson ninja pkg-config desktop-file-utils python3.pythonOnBuildForHost.pkgs.sphinx - gettext wrapGAppsHook3 libxml2 appstream-glib + meson + ninja + pkg-config + desktop-file-utils + python3.pythonOnBuildForHost.pkgs.sphinx + gettext + wrapGAppsHook3 + libxml2 + appstream-glib ]; buildInputs = [ - gtk girara libintl sqlite glib file librsvg check json-glib + gtk + girara + libintl + sqlite + glib + file + librsvg + check + json-glib texlive.bin.core - ] ++ lib.optional stdenv.isLinux libseccomp - ++ lib.optional stdenv.isDarwin gtk-mac-integration; + ] ++ lib.optional stdenv.isLinux libseccomp ++ lib.optional stdenv.isDarwin gtk-mac-integration; doCheck = !stdenv.isDarwin; diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix index 67fe3032d05c..23b5ce0198e1 100644 --- a/pkgs/applications/misc/zathura/default.nix +++ b/pkgs/applications/misc/zathura/default.nix @@ -1,6 +1,9 @@ -{ 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) }: +{ + 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; @@ -29,5 +32,5 @@ let ]; }; }; - -in self +in +self diff --git a/pkgs/applications/misc/zathura/djvu/default.nix b/pkgs/applications/misc/zathura/djvu/default.nix index f0fe09486324..b4ce653770e3 100644 --- a/pkgs/applications/misc/zathura/djvu/default.nix +++ b/pkgs/applications/misc/zathura/djvu/default.nix @@ -1,4 +1,16 @@ -{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gtk, zathura_core, girara, djvulibre, gettext }: +{ + lib, + stdenv, + fetchurl, + meson, + ninja, + pkg-config, + gtk, + zathura_core, + girara, + djvulibre, + gettext, +}: stdenv.mkDerivation rec { pname = "zathura-djvu"; @@ -9,8 +21,18 @@ stdenv.mkDerivation rec { sha256 = "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"; }; - nativeBuildInputs = [ meson ninja pkg-config ]; - buildInputs = [ djvulibre gettext zathura_core gtk girara ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; + buildInputs = [ + djvulibre + gettext + zathura_core + gtk + girara + ]; PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; @@ -26,4 +48,3 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ ]; }; } - diff --git a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix index f6eb5cfd45e1..f3810c4b7c26 100644 --- a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix +++ b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix @@ -1,17 +1,23 @@ -{ stdenv, lib, meson, ninja, fetchurl, cairo -, girara -, gtk-mac-integration -, gumbo -, jbig2dec -, libjpeg -, mupdf -, openjpeg -, pkg-config -, zathura_core -, tesseract -, leptonica -, mujs -, gitUpdater +{ + 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 { @@ -23,7 +29,11 @@ stdenv.mkDerivation rec { hash = "sha256-+YKgHWUj+iVmk4EYTAamJe2/15YcvbBxHcz9ucQCrC8="; }; - nativeBuildInputs = [ meson ninja pkg-config ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; buildInputs = [ cairo @@ -39,15 +49,13 @@ stdenv.mkDerivation rec { mujs ] ++ lib.optional stdenv.isDarwin gtk-mac-integration; - PKG_CONFIG_ZATHURA_PLUGINDIR= "lib/zathura"; + 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"; - }; + passthru.updateScript = gitUpdater { url = "https://git.pwmt.org/pwmt/zathura-pdf-mupdf.git"; }; meta = with lib; { homepage = "https://pwmt.org/projects/zathura-pdf-mupdf/"; diff --git a/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/pkgs/applications/misc/zathura/pdf-poppler/default.nix index 5246705bbd8b..48be0ed03a72 100644 --- a/pkgs/applications/misc/zathura/pdf-poppler/default.nix +++ b/pkgs/applications/misc/zathura/pdf-poppler/default.nix @@ -1,4 +1,14 @@ -{ stdenv, lib, fetchurl, meson, ninja, pkg-config, zathura_core, girara, poppler }: +{ + stdenv, + lib, + fetchurl, + meson, + ninja, + pkg-config, + zathura_core, + girara, + poppler, +}: stdenv.mkDerivation rec { pname = "zathura-pdf-poppler"; @@ -9,8 +19,16 @@ stdenv.mkDerivation rec { sha256 = "049h8m9swxni7ar6fsbm0hb3fg4ffmjc3m6vyg78ilfi3kayxavi"; }; - nativeBuildInputs = [ meson ninja pkg-config zathura_core ]; - buildInputs = [ poppler girara ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + zathura_core + ]; + buildInputs = [ + poppler + girara + ]; PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; diff --git a/pkgs/applications/misc/zathura/ps/default.nix b/pkgs/applications/misc/zathura/ps/default.nix index 180001b52aeb..437a0eb17c6c 100644 --- a/pkgs/applications/misc/zathura/ps/default.nix +++ b/pkgs/applications/misc/zathura/ps/default.nix @@ -1,4 +1,15 @@ -{ stdenv, lib, fetchurl, meson, ninja, pkg-config, zathura_core, girara, libspectre, gettext }: +{ + stdenv, + lib, + fetchurl, + meson, + ninja, + pkg-config, + zathura_core, + girara, + libspectre, + gettext, +}: stdenv.mkDerivation rec { pname = "zathura-ps"; @@ -9,8 +20,17 @@ stdenv.mkDerivation rec { sha256 = "0ilf63wxn1yzis9m3qs8mxbk316yxdzwxrrv86wpiygm9hhgk5sq"; }; - nativeBuildInputs = [ meson ninja pkg-config gettext ]; - buildInputs = [ libspectre zathura_core girara ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + ]; + buildInputs = [ + libspectre + zathura_core + girara + ]; PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; @@ -20,10 +40,9 @@ stdenv.mkDerivation rec { 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/pkgs/applications/misc/zathura/wrapper.nix b/pkgs/applications/misc/zathura/wrapper.nix index 60ff0bd68854..627ad07ca9a7 100644 --- a/pkgs/applications/misc/zathura/wrapper.nix +++ b/pkgs/applications/misc/zathura/wrapper.nix @@ -1,25 +1,41 @@ -{ symlinkJoin, lib, makeWrapper, zathura_core, file, plugins ? [] }: +{ + symlinkJoin, + lib, + makeWrapper, + zathura_core, + file, + plugins ? [ ], +}: symlinkJoin { name = "zathura-with-plugins-${zathura_core.version}"; - paths = with zathura_core; [ man dev out ] ++ plugins; + 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" + 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" - ''; + # 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/"; @@ -32,7 +48,11 @@ symlinkJoin { ''; license = licenses.zlib; platforms = platforms.unix; - maintainers = with maintainers; [ smironov globin TethysSvensson ]; + maintainers = with maintainers; [ + smironov + globin + TethysSvensson + ]; mainProgram = "zathura"; }; }