summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2023-05-03 20:59:39 +0200
committerPacho Ramos <pacho@gentoo.org>2023-05-03 21:20:47 +0200
commit5c8f8d5a7d3dfb33040865e75c720707792604b8 (patch)
tree4f3c2cbe6761ddc76bbf59c85e2bd4b572f7e884 /app-text/apvlv
parentapp-metrics/portage-exporter: add 0.1.0, add systemd service (diff)
downloadgentoo-5c8f8d5a7d3dfb33040865e75c720707792604b8.tar.gz
gentoo-5c8f8d5a7d3dfb33040865e75c720707792604b8.tar.bz2
gentoo-5c8f8d5a7d3dfb33040865e75c720707792604b8.zip
app-text/apvlv: Port to webkitgtk-4.1 and use a highres icon
Port to webkitgtk-4.1 applying upstream fix. But the way, provide a better icon definition allowing standard icon packs to provide a nicer icon over current low resolution one provided by upstream. Closes: https://bugs.gentoo.org/893678 Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Diffstat (limited to 'app-text/apvlv')
-rw-r--r--app-text/apvlv/apvlv-0.4.0-r2.ebuild60
-rw-r--r--app-text/apvlv/files/apvlv-0.4.0-icon-r1.patch10
-rw-r--r--app-text/apvlv/files/apvlv-0.4.0-webkitgtk4.1.patch45
3 files changed, 115 insertions, 0 deletions
diff --git a/app-text/apvlv/apvlv-0.4.0-r2.ebuild b/app-text/apvlv/apvlv-0.4.0-r2.ebuild
new file mode 100644
index 000000000000..afd75022a0c5
--- /dev/null
+++ b/app-text/apvlv/apvlv-0.4.0-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xdg cmake desktop
+
+DESCRIPTION="Alf's PDF/DJVU/EPUB Viewer like Vim"
+HOMEPAGE="https://github.com/naihe2010/apvlv/"
+SRC_URI="https://github.com/naihe2010/apvlv/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug djvu"
+
+RDEPEND="
+ app-text/ebook-tools
+ >=app-text/poppler-0.5.0:=[cairo,xpdf-headers(+)]
+ dev-libs/glib:2
+ dev-libs/libxml2
+ net-libs/webkit-gtk:4.1=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3
+ x11-libs/pango
+ djvu? ( app-text/djvu )
+"
+
+DEPEND="${RDEPEND}
+ app-text/ghostscript-gpl
+ media-libs/freetype
+"
+BDEPEND="
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-cmake-cxxflags.patch
+ "${FILESDIR}"/${P}-icon-r1.patch
+ # https://github.com/naihe2010/apvlv/commit/39f783103e99b954991183cea2b5ccbd9add2a1a
+ "${FILESDIR}"/${P}-webkitgtk4.1.patch
+)
+src_prepare() {
+ cmake_src_prepare
+}
+src_configure() {
+ local mycmakeargs=(
+ -DAPVLV_WITH_DJVU=$(usex djvu)
+ -DAPVLV_ENABLE_DEBUG=$(usex debug)
+ -DAPVLV_WITH_TXT=ON
+ -DDOCDIR="/usr/share/doc/${PF}"
+ )
+ cmake_src_configure
+}
+src_install() {
+ cmake_src_install
+ # https://github.com/naihe2010/apvlv/issues/84
+ newicon -s 32 icons/pdf.png x-office-document.png
+}
diff --git a/app-text/apvlv/files/apvlv-0.4.0-icon-r1.patch b/app-text/apvlv/files/apvlv-0.4.0-icon-r1.patch
new file mode 100644
index 000000000000..e5cb3526f318
--- /dev/null
+++ b/app-text/apvlv/files/apvlv-0.4.0-icon-r1.patch
@@ -0,0 +1,10 @@
+--- a/apvlv.desktop
++++ b/apvlv.desktop
+@@ -2,6 +2,7 @@
+ Version=1.0
+ Type=Application
+ Name=apvlv
++Icon=x-office-document
+ Comment=A minimalistic document viewer
+ Comment[de]=Ein minimalistischer Dokumenten-Betrachter
+ Comment[fr]=Un visionneur de document minimaliste
diff --git a/app-text/apvlv/files/apvlv-0.4.0-webkitgtk4.1.patch b/app-text/apvlv/files/apvlv-0.4.0-webkitgtk4.1.patch
new file mode 100644
index 000000000000..4501184d365c
--- /dev/null
+++ b/app-text/apvlv/files/apvlv-0.4.0-webkitgtk4.1.patch
@@ -0,0 +1,45 @@
+From 39f783103e99b954991183cea2b5ccbd9add2a1a Mon Sep 17 00:00:00 2001
+From: Alberto Garcia <berto@igalia.com>
+Date: Wed, 16 Nov 2022 10:05:42 +0100
+Subject: [PATCH] Use the WebKitGTK 4.1 API builds when available
+
+These use soup3 instead of soup2 internally but the API is the same.
+---
+ src/CMakeLists.txt | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 457f576..cd12d9b 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -18,14 +18,20 @@ FIND_PACKAGE(PkgConfig)
+ PKG_CHECK_MODULES(FREETYPE2 freetype2 REQUIRED)
+ PKG_CHECK_MODULES(GTK gtk+-3.0)
+ PKG_CHECK_MODULES(GLIB2 glib-2.0 REQUIRED)
+-PKG_CHECK_MODULES(WEBKIT webkit2gtk-4.0 REQUIRED)
++PKG_CHECK_MODULES(LIBXML libxml-2.0 REQUIRED)
++PKG_CHECK_MODULES(WEBKIT webkit2gtk-4.1)
++if (NOT WEBKIT_FOUND)
++ PKG_CHECK_MODULES(WEBKIT webkit2gtk-4.0 REQUIRED)
++endif()
+ INCLUDE_DIRECTORIES(${FREETYPE2_INCLUDE_DIRS}
+ ${GTK_INCLUDE_DIRS}
+ ${GLIB2_INCLUDE_DIRS}
++ ${LIBXML_INCLUDE_DIRS}
+ ${WEBKIT_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${FREETYPE2_LIBRARY_DIRS}
+ ${GTK_LIBRARY_DIRS}
+ ${GLIB2_LIBRARY_DIRS}
++ ${LIBXML_LIBRARY_DIRS}
+ ${WEBKIT_LIBRARY_DIRS})
+
+ IF (WIN32)
+@@ -116,7 +122,7 @@ TARGET_LINK_LIBRARIES(apvlv
+ ${GTHREAD2_LIBRARIES}
+ ${WEBKIT_LIBRARIES}
+ "-lepub"
+- "-lxml2"
++ ${LIBXML_LIBRARIES}
+ ${APVLV_REQ_LIBRARIES})
+
+ IF (WIN32)