all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 51803@debbugs.gnu.org
Subject: [bug#51803] [PATCH] gnu: emacs: Make DocView PDF work out of the box.
Date: Sat, 13 Nov 2021 07:44:57 +0100	[thread overview]
Message-ID: <60c9459544fef0b2e19d30396acaf9dac6076e72.camel@gmail.com> (raw)

* gnu/packages/emacs.scm (emacs)[patch-program-file-names]: Add patches for
the programs “gs”, “dvipdf”, “ps2pdf” and “pdftotext”.
[inputs]: Add ghostscript and poppler.
---
This patch might be simplified post core-updates merge by using
search-input-file.

 gnu/packages/emacs.scm | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 22d8db3839..7cc726be6f 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -18,7 +18,7 @@
 ;;; Copyright © 2018, 2019, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Jesse John Gildersleve <jessejohngildersleve@zohomail.eu>
 ;;; Copyright © 2019 Valentin Ignatev <valentignatev@gmail.com>
-;;; Copyright © 2019 Liliana Marie Prikler <liliana.prikler@gmail.com>
+;;; Copyright © 2019, 2021 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2019 Amin Bandali <bandali@gnu.org>
 ;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
@@ -54,6 +54,7 @@ (define-module (gnu packages emacs)
   #:use-module (gnu packages fribidi)
   #:use-module (gnu packages gd)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)     ; for librsvg
   #:use-module (gnu packages gtk)
@@ -63,6 +64,7 @@ (define-module (gnu packages emacs)
   #:use-module (gnu packages mail)      ; for mailutils
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages pdf)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages tls)
@@ -128,7 +130,7 @@ (define-public emacs
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-program-file-names
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
              (substitute* '("src/callproc.c"
                             "lisp/term.el"
                             "lisp/htmlfontify.el"
@@ -136,6 +138,17 @@ (define-public emacs
                             "lisp/progmodes/sh-script.el")
                (("\"/bin/sh\"")
                 (format #f "~s" (which "sh"))))
+             (substitute* "lisp/doc-view.el"
+               (("\"(gs|dvipdf|ps2pdf)\"" all what)
+                (let ((ghostscript (assoc-ref inputs "ghostscript")))
+                  (if ghostscript
+                      (string-append "\"" ghostscript "/bin/" what "\"")
+                      all)))
+               (("\"(pdftotext)\"" all what)
+                (let ((poppler (assoc-ref inputs "poppler")))
+                  (if poppler
+                      (string-append "\"" poppler "/bin/" what "\"")
+                      all))))
              #t))
          (add-before 'configure 'fix-/bin/pwd
            (lambda _
@@ -258,6 +271,8 @@ (define* (emacs-byte-compile-directory dir)
        ("acl" ,acl)
        ("jansson" ,jansson)
        ("gmp" ,gmp)
+       ("ghostscript" ,ghostscript)
+       ("poppler" ,poppler)
 
        ;; When looking for libpng `configure' links with `-lpng -lz', so we
        ;; must also provide zlib as an input.
-- 
2.33.1






             reply	other threads:[~2021-11-13  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13  6:44 Liliana Marie Prikler [this message]
2021-12-03 20:41 ` bug#51803: [PATCH] gnu: emacs: Make DocView PDF work out of the box Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60c9459544fef0b2e19d30396acaf9dac6076e72.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=51803@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.