[PATCH] gnu: Add qpdfview.

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Famulari
  • Timotej Lazar
Owner
unassigned
Submitted by
Timotej Lazar
Severity
normal
T
T
Timotej Lazar wrote on 24 Nov 2020 19:58
(address . guix-patches@gnu.org)(name . Timotej Lazar)(address . timotej.lazar@araneo.si)
20201124185845.31317-1-timotej.lazar@araneo.si
* gnu/packages/pdf.scm (qpdfview): New variable.
---
gnu/packages/pdf.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 1899501122..1861851b72 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -54,6 +54,7 @@
#:use-module (gnu packages bash)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages cups)
#:use-module (gnu packages curl)
#:use-module (gnu packages djvu)
#:use-module (gnu packages fontutils)
@@ -806,6 +807,44 @@ program capable of converting PDF into other formats.")
(license (list license:asl2.0 license:clarified-artistic))
(home-page "http://qpdf.sourceforge.net/")))
+(define-public qpdfview
+ (package
+ (name "qpdfview")
+ (version "0.4.18")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://launchpad.net/qpdfview/"
+ "trunk/" version "/+download/"
+ "qpdfview-" version ".tar.gz"))
+ (sha256
+ (base32 "0v1rl126hvblajnph2hkansgi0s8vjdc5yxrm4y3faa0lxzjwr6c"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("cups" ,cups)
+ ("djvulibre" ,djvulibre)
+ ("libspectre" ,libspectre)
+ ("poppler-qt5" ,poppler-qt5)
+ ("qtbase" ,qtbase)
+ ("qtsvg" ,qtsvg)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda _
+ (substitute* "qpdfview.pri"
+ (("/usr") (assoc-ref %outputs "out")))
+ (invoke "qmake" "qpdfview.pro"))))))
+ (home-page "https://launchpad.net/qpdfview")
+ (synopsis "Tabbed document viewer")
+ (description "@command{qpdfview} is a document viewer for PDF, PS and DJVU
+files. It uses the Qt toolkit and features persistent per-file settings,
+configurable toolbars and shortcuts, continuous and multi?page layouts,
+SyncTeX support, and rudimentary support for annotations and forms.")
+ (license license:gpl2+)))
+
(define-public xournal
(package
(name "xournal")
--
2.28.0
L
L
Leo Famulari wrote on 25 Nov 2020 04:13
(name . Timotej Lazar)(address . timotej.lazar@araneo.si)(address . 44853@debbugs.gnu.org)
20201125031309.GA10305@jasmine.lan
On Tue, Nov 24, 2020 at 07:58:45PM +0100, Timotej Lazar wrote:
Toggle quote (2 lines)
> * gnu/packages/pdf.scm (qpdfview): New variable.

Thanks!

I noticed that, on my Debian system, the user interface was not
displaying any icons.

I fixed it for myself by making the package use the 'qt-wrap' phase from
the Qt build system fixed this, which adds a wrapper for the
XDG_DATA_DIRS, XDG_CONFIG_DIRS, QT_PLUGIN_PATH, and QML2_IMPORT_PATH
environment variables.

I've attached a patch that does this. Can you check that it still works
for you?
From 33e6e67975d63a27319f7df6e34741e97b83f5db Mon Sep 17 00:00:00 2001
From: Timotej Lazar <timotej.lazar@araneo.si>
Date: Tue, 24 Nov 2020 19:58:45 +0100
Subject: [PATCH] gnu: Add qpdfview.

* gnu/packages/pdf.scm (qpdfview): New variable.

Signed-off-by: Leo Famulari <leo@famulari.name>
---
gnu/packages/pdf.scm | 49 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 1899501122..9e4341afb9 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2019,2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -45,6 +46,7 @@
#:use-module (guix build-system cmake)
#:use-module (guix build-system meson)
#:use-module (guix build-system python)
+ #:use-module (guix build-system qt)
#:use-module (guix build-system trivial)
#:use-module (gnu packages)
#:use-module (gnu packages audio)
@@ -54,6 +56,7 @@
#:use-module (gnu packages bash)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages cups)
#:use-module (gnu packages curl)
#:use-module (gnu packages djvu)
#:use-module (gnu packages fontutils)
@@ -806,6 +809,52 @@ program capable of converting PDF into other formats.")
(license (list license:asl2.0 license:clarified-artistic))
(home-page "http://qpdf.sourceforge.net/")))
+(define-public qpdfview
+ (package
+ (name "qpdfview")
+ (version "0.4.18")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://launchpad.net/qpdfview/"
+ "trunk/" version "/+download/"
+ "qpdfview-" version ".tar.gz"))
+ (sha256
+ (base32 "0v1rl126hvblajnph2hkansgi0s8vjdc5yxrm4y3faa0lxzjwr6c"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("cups" ,cups)
+ ("djvulibre" ,djvulibre)
+ ("libspectre" ,libspectre)
+ ("poppler-qt5" ,poppler-qt5)
+ ("qtbase" ,qtbase)
+ ("qtsvg" ,qtsvg)))
+ (arguments
+ `(#:imported-modules ((guix build qt-build-system)
+ (guix build cmake-build-system)
+ ,@%gnu-build-system-modules)
+ #:modules ((guix build utils)
+ (guix build gnu-build-system)
+ ((guix build qt-build-system) #:prefix qt:))
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda _
+ (substitute* "qpdfview.pri"
+ (("/usr") (assoc-ref %outputs "out")))
+ (invoke "qmake" "qpdfview.pro")))
+ (add-after 'install 'qt-wrap
+ (assoc-ref qt:%standard-phases 'qt-wrap)))))
+ (home-page "https://launchpad.net/qpdfview")
+ (synopsis "Tabbed document viewer")
+ (description "@command{qpdfview} is a document viewer for PDF, PS and DJVU
+files. It uses the Qt toolkit and features persistent per-file settings,
+configurable toolbars and shortcuts, continuous and multi?page layouts,
+SyncTeX support, and rudimentary support for annotations and forms.")
+ (license license:gpl2+)))
+
(define-public xournal
(package
(name "xournal")
--
2.29.2
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAl+9y8EACgkQJkb6MLrK
fwjkkRAAzx2GIaNN+7XhglRXgHfM8lHG4VsBKp1Cx/i1+76MGKfcKj/eswnUeZdb
sJ6bGwfjgxa9Yi0uwN2e8+bbnZNTRhbyO4daxC0ybOaRdrbi4DCZfbFr4U986C0n
aykPF7cO4dsxYNg1w47Pr95E15SCNkk6Dyk0YkgrrJGLVIluEZh9rLbBMdgRYu0/
tHY541HLBTw/PHsmmej+fIy/UGzefUXY7z1kxt+/Sgw7BnuCVHYrmlSsax45xHH5
VKaBLd6FP94trUbaK3KgbSVp2pBQT2d8cYvxyOSWS8ArQdoJLhwXVuZIIH2taU/F
+xXt9EoT7v7B6hSbMb+/1oHPcBZqERs3rasxYTMGQxj8gr0wIXRTNJ1JO6WOPTql
hEkaZsfJ1JVwwBS5SQ+CfkNftqgednPJ6NrYHoowXa+O3xCRmiMK1X+i75pXZMlA
6A40V/Oq34xSwSOTncEKLSgHg5NxWPnXzobZibxLq6t5aTqPCrPqDpJ0ij4sPxWa
/CmEE2Jd0mDKXIvo+Zdb+HGJ746amoT8fb4sJJ6UbXf85ib0EV56uB8leVzH/WTQ
PEFh+cLBNpEv9MYFvRpiEjh1GshYpGJPO2h5sW6M+yyl7X14jQN5hkyaC9VKUyzM
xH/3u2QOsAA+v5oXn6FucNHkTgI7AcPNPtMdmRcKCzsv7xUNHD0=
=3hDv
-----END PGP SIGNATURE-----


T
T
Timotej Lazar wrote on 25 Nov 2020 19:35
(name . Leo Famulari)(address . leo@famulari.name)(address . 44853@debbugs.gnu.org)
87ft4xuvw8.fsf@araneo.si
Leo Famulari <leo@famulari.name> [2020-11-24 22:13:09-0500]:
Toggle quote (3 lines)
> I noticed that, on my Debian system, the user interface was not
> displaying any icons.

Turns out it happens for me too, but I didn’t notice because I have
qtsvg installed in my profile.

Toggle quote (2 lines)
> I fixed it for myself by making the package use the 'qt-wrap' phase

This makes sense. I suppose we should wrap all Qt programs like this. I
tried your patch and it works, but the same icon theme is used
regardless of what I choose in LXQt appearance settings.

I think the problem is with the 'qt-wrap phase, which uses "=" instead
of "suffix" for wrapping variables. Changing this in qt-build-sytem.scm
gives me correct icons. Now that I think about it, "prefix" might be
better to ensure the correct versions of plugins are used at runtime;
both options work for me.

Thanks!
Timotej
L
L
Leo Famulari wrote on 25 Nov 2020 21:33
(name . Timotej Lazar)(address . timotej.lazar@araneo.si)(address . 44853@debbugs.gnu.org)
X76/git/aac+WWYb@jasmine.lan
On Wed, Nov 25, 2020 at 07:35:51PM +0100, Timotej Lazar wrote:
Toggle quote (4 lines)
> This makes sense. I suppose we should wrap all Qt programs like this. I
> tried your patch and it works, but the same icon theme is used
> regardless of what I choose in LXQt appearance settings.

Hm, that's not ideal.

Toggle quote (6 lines)
> I think the problem is with the 'qt-wrap phase, which uses "=" instead
> of "suffix" for wrapping variables. Changing this in qt-build-sytem.scm
> gives me correct icons. Now that I think about it, "prefix" might be
> better to ensure the correct versions of plugins are used at runtime;
> both options work for me.

Can you send the patch for qt-build-system? There are only 166 users of
it currently, so we can update it on the master branch. I don't really
know much about it, so I can't judge which is the best way to change it.
L
L
Leo Famulari wrote on 25 Nov 2020 21:38
(name . Timotej Lazar)(address . timotej.lazar@araneo.si)(address . 44853-done@debbugs.gnu.org)
X77AwKv8SX2WRvxw@jasmine.lan
On Wed, Nov 25, 2020 at 07:35:51PM +0100, Timotej Lazar wrote:
Toggle quote (7 lines)
> Leo Famulari <leo@famulari.name> [2020-11-24 22:13:09-0500]:
> > I noticed that, on my Debian system, the user interface was not
> > displaying any icons.
>
> Turns out it happens for me too, but I didn’t notice because I have
> qtsvg installed in my profile.

I pushed my version of your patch as cbcd520e1a71d75513a1c47d046142b2ff33ad56
Closed
?