about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2024-04-13 11:13:13 -0400
committerGitHub <noreply@github.com>2024-04-13 11:13:13 -0400
commit32ddcd80645396524b24af9108a9a5e88ae0117d (patch)
tree453089a094e5c78d58b156c7676bc92c507f682c /pkgs
parentf805656494a2844f4a3c1270346785e8cc5ae3e3 (diff)
parentbc2e4a537e0160fbf591aefb6c70d363f926147b (diff)
Merge pull request #299239 from anthonyroussel/update/apvlv
apvlv: 0.1.5 -> 0.5.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/misc/apvlv/default.nix75
-rw-r--r--pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch13
-rw-r--r--pkgs/by-name/ap/apvlv/package.nix113
-rw-r--r--pkgs/top-level/all-packages.nix2
4 files changed, 113 insertions, 90 deletions
diff --git a/pkgs/applications/misc/apvlv/default.nix b/pkgs/applications/misc/apvlv/default.nix
deleted file mode 100644
index f45fb95aba59a..0000000000000
--- a/pkgs/applications/misc/apvlv/default.nix
+++ /dev/null
@@ -1,75 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, pcre, libxkbcommon, libepoxy
-, gtk3, poppler, freetype, libpthreadstubs, libXdmcp, libxshmfence, wrapGAppsHook
-}:
-
-stdenv.mkDerivation rec {
-  version = "0.1.5";
-  pname = "apvlv";
-
-  src = fetchFromGitHub {
-    owner = "naihe2010";
-    repo = "apvlv";
-    rev = "v${version}";
-    sha256 = "1n4xiic8lqnv3mqi7wpdv866gyyakax71gffv3n9427rmcld465i";
-  };
-
-  env.NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler";
-
-  nativeBuildInputs = [
-    cmake
-    pkg-config
-    wrapGAppsHook
-  ];
-
-  buildInputs = [
-    poppler pcre libxkbcommon libepoxy
-    freetype gtk3
-    libpthreadstubs libXdmcp libxshmfence # otherwise warnings in compilation
-  ];
-
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/naihe2010/apvlv/commit/d432635b9c5ea6c052a2ae1fb71aedec5c4ad57a.patch";
-      sha256 = "1am8dgv2kkpqmm2vaysa61czx8ppdx94zb3c59sx88np50jpy70w";
-    })
-    (fetchpatch {
-      url = "https://github.com/naihe2010/apvlv/commit/4c7a583e8431964def482e5471f02e6de8e62a7b.patch";
-      sha256 = "1dszm120lwm90hcg5zmd4vr6pjyaxc84qmb7k0fr59mmb3qif62j";
-    })
-    # fix build with gcc7
-    (fetchpatch {
-      url = "https://github.com/naihe2010/apvlv/commit/a3a895772a27d76dab0c37643f0f4c73f9970e62.patch";
-      sha256 = "1fpc7wr1ajilvwi5gjsy5g9jcx4bl03gp5dmajg90ljqbhwz2bfi";
-    })
-    ./fix-build-with-poppler-0.73.0.patch
-  ];
-
-  installPhase = ''
-    # binary
-    mkdir -p $out/bin
-    cp src/apvlv $out/bin/apvlv
-
-    # displays pdfStartup.pdf as default pdf entry
-    mkdir -p $out/share/doc/apvlv/
-    cp ../Startup.pdf $out/share/doc/apvlv/Startup.pdf
-    cp ../main_menubar.glade $out/share/doc/apvlv/main_menubar.glade
-  ''
-  + lib.optionalString (!stdenv.isDarwin) ''
-    install -D ../apvlv.desktop $out/share/applications/apvlv.desktop
-  '';
-
-  meta = with lib; {
-    homepage = "http://naihe2010.github.io/apvlv/";
-    description = "PDF viewer with Vim-like behaviour";
-    mainProgram = "apvlv";
-    longDescription = ''
-      apvlv is a PDF/DJVU/UMD/TXT Viewer Under Linux/WIN32
-      with Vim-like behaviour.
-    '';
-
-    license = licenses.lgpl2;
-    platforms = platforms.linux;
-    maintainers = [ maintainers.ardumont ];
-  };
-
-}
diff --git a/pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch b/pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch
deleted file mode 100644
index d2a7831dca639..0000000000000
--- a/pkgs/applications/misc/apvlv/fix-build-with-poppler-0.73.0.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/ApvlvPdf.cc b/src/ApvlvPdf.cc
-index 765b112..83d133f 100644
---- a/src/ApvlvPdf.cc
-+++ b/src/ApvlvPdf.cc
-@@ -29,7 +29,7 @@
- #include "ApvlvPdf.h"
-
- #ifndef POPPLER_WITH_GDK
--#include <goo/gtypes.h>
-+#include <goo/gfile.h>
-
- static void
- copy_cairo_surface_to_pixbuf (cairo_surface_t *surface,
diff --git a/pkgs/by-name/ap/apvlv/package.nix b/pkgs/by-name/ap/apvlv/package.nix
new file mode 100644
index 0000000000000..5771769323512
--- /dev/null
+++ b/pkgs/by-name/ap/apvlv/package.nix
@@ -0,0 +1,113 @@
+{
+  cmake,
+  copyDesktopItems,
+  ebook_tools,
+  fetchFromGitHub,
+  freetype,
+  ghostscript,
+  gtk3,
+  installShellFiles,
+  lib,
+  libepoxy,
+  libpthreadstubs,
+  libXdmcp,
+  libxkbcommon,
+  libxml2,
+  libxshmfence,
+  man,
+  nix-update-script,
+  pcre,
+  pkg-config,
+  poppler,
+  stdenv,
+  testers,
+  webkitgtk,
+  wrapGAppsHook,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "apvlv";
+
+  # If you change the version, please also update src.rev accordingly
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "naihe2010";
+    repo = "apvlv";
+    rev = "refs/tags/v0.5.0-final";
+    hash = "sha256-5Wbv3dXieymhhPmEKQu8X/38WsDA1T/IBPoMXdpzcaA=";
+  };
+
+  env.NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler";
+
+  nativeBuildInputs = [
+    cmake
+    copyDesktopItems
+    ghostscript
+    installShellFiles
+    man
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    ebook_tools
+    freetype
+    gtk3
+    libepoxy
+    libpthreadstubs
+    libXdmcp
+    libxkbcommon
+    libxml2
+    libxshmfence # otherwise warnings in compilation
+    pcre
+    poppler
+    webkitgtk
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    # binary
+    mkdir -p $out/bin
+    cp src/apvlv $out/bin/apvlv
+
+    # displays pdfStartup.pdf as default pdf entry
+    mkdir -p $out/share/doc/apvlv/
+    cp ../Startup.pdf $out/share/doc/apvlv/Startup.pdf
+    cp ../main_menubar.glade $out/share/doc/apvlv/main_menubar.glade
+
+    mkdir -p $out/etc
+    cp ../apvlvrc.example $out/etc/apvlvrc
+
+    installManPage ../apvlv.1
+
+    runHook postInstall
+  '';
+
+  desktopItems = [
+    "../apvlv.desktop"
+  ];
+
+  passthru = {
+    tests.version = testers.testVersion {
+      command = "${lib.getExe finalAttrs.finalPackage} -v";
+      package = finalAttrs.finalPackage;
+      version = "${finalAttrs.version}-rel";
+    };
+  };
+
+  meta = {
+    changelog = "https://github.com/naihe2010/apvlv/blob/v${finalAttrs.version}/NEWS";
+    description = "PDF viewer with Vim-like behaviour";
+    homepage = "https://naihe2010.github.io/apvlv/";
+    license = lib.licenses.lgpl2;
+    longDescription = ''
+      apvlv is a PDF/DJVU/UMD/TXT Viewer Under Linux/WIN32
+      with Vim-like behaviour.
+    '';
+    mainProgram = "apvlv";
+    maintainers = with lib.maintainers; [ ardumont anthonyroussel ];
+    platforms = lib.platforms.linux;
+  };
+})
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f26c91e77e10c..a6e6d9754569a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -35991,8 +35991,6 @@ with pkgs;
     lua = lua5_3;
   };
 
-  apvlv = callPackage ../applications/misc/apvlv { };
-
   xpdf = libsForQt5.callPackage ../applications/misc/xpdf {
     stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
   };