From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] Add Emacs PDF tools Date: Sun, 05 Jul 2015 19:59:37 +0200 Message-ID: <878uaujxiu.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/x-patch; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBoCn-0006GH-L7 for guix-devel@gnu.org; Sun, 05 Jul 2015 13:59:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBoCj-0002qa-1i for guix-devel@gnu.org; Sun, 05 Jul 2015 13:59:53 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:25293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBoCi-0002p1-PO for guix-devel@gnu.org; Sun, 05 Jul 2015 13:59:48 -0400 Content-Disposition: inline; filename=0001-gnu-Add-emacs-pdf-tools.patch List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Guix-devel >From 1f5f4de3da2f8158884116746ed00435a317b6c6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 5 Jul 2015 19:58:38 +0200 Subject: [PATCH] gnu: Add emacs-pdf-tools. * gnu/packages/emacs.scm (emacs-pdf-tools): New variable. --- gnu/packages/emacs.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 2502f29..b052a63 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Alex Kost +;;; Copyright © 2015 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +51,7 @@ #:use-module (gnu packages glib) #:use-module (gnu packages acl) #:use-module (gnu packages perl) + #:use-module (gnu packages pdf) #:use-module (gnu packages linux) ;alsa #:use-module (gnu packages xiph) #:use-module (gnu packages mp3) @@ -776,3 +778,62 @@ an address book for email and snail mail addresses, phone numbers and the like. It can be linked with various Emacs mail clients (Message and Mail mode, Rmail, Gnus, MH-E, and VM). BBDB is fully customizable.") (license license:gpl3+))) + +(define-public emacs-pdf-tools + (package + (name "emacs-pdf-tools") + (version "0.60") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/politza/pdf-tools/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1y8k5n2jbyaxby0j6f4m9xbm0ddpmbkrfj6rp6ll5sb97lcg3vrx")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; there are no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-dir (lambda _ (chdir "server") #t)) + (add-before + 'configure 'autogen + (lambda _ + (zero? (system* "bash" "autogen.sh")))) + (add-after + 'install 'install-lisp + (lambda* (#:key outputs #:allow-other-keys) + (let ((target (string-append (assoc-ref outputs "out") + "/share/emacs/site-lisp/"))) + (mkdir-p target) + (for-each + (lambda (file) + (copy-file file (string-append target (basename file)))) + (find-files "../lisp" "^(pdf|tab).*\\.elc?")) + + ;; Set path to epdfinfo program + (substitute* (string-append target "pdf-info.el") + (("or load-file-name") + (string-append "or \"" + (string-append (assoc-ref outputs "out") + "/bin/") + "\" load-file-name")))) + #t))))) + (native-inputs `(("autoconf" ,autoconf) + ("automake" ,automake) + ("pkg-config" ,pkg-config))) + (inputs `(("poppler" ,poppler) + ("cairo" ,cairo) + ("glib" ,glib) + ("libpng" ,libpng) + ("zlib" ,zlib))) + (synopsis "Emacs support library for PDF files") + (description + "PDF Tools is, among other things, a replacement of DocView for PDF +files. The key difference is that pages are not pre-rendered by +e.g. ghostscript and stored in the file-system, but rather created on-demand +and stored in memory.") + (home-page "https://github.com/politza/pdf-tools") + (license license:gpl3+))) -- 2.4.3