From c0b390ed72425bb0856b00b6826f89dc2978a525 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Mon, 15 Sep 2014 08:03:03 +0200 Subject: gnu: Add mupdf. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/pdf.scm (mupdf): New variable. * gnu/packages/patches/mupdf-buildsystem-fix.patch: New file. * gnu-system.am (dist_patch_DATA): Added the above patch. Signed-off-by: Ludovic Courtès --- gnu/packages/pdf.scm | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'gnu/packages/pdf.scm') diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index 82331a1d0a..a547530148 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -35,6 +35,7 @@ (define-module (gnu packages pdf) #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages lua) + #:use-module (gnu packages curl) #:use-module (srfi srfi-1)) (define-public poppler @@ -159,3 +160,69 @@ (define-public podofo for applications that wish to do lower level manipulation of PDF, such as extracting content or merging files.") (license license:lgpl2.0+))) + +(define-public mupdf + (package + (name "mupdf") + (version "1.5") + (source + (origin + (method url-fetch) + (uri (string-append "http://mupdf.com/downloads/" name "-" version + "-source.tar.gz")) + (sha256 + (base32 "0sl47zqf4c9fhs4h5zg046vixjmwgy4vhljhr5g4md733nash7z4")) + (patches + (list (search-patch "mupdf-buildsystem-fix.patch"))) + (modules '((guix build utils))) + (snippet + '(begin + ;; Don't build the bundled-in third party libraries. + (delete-file-recursively "thirdparty") + + ;; Make the scripts for finding openjpeg build details executable. + (chmod "ojp2_cppflags.sh" #o0755) + (chmod "ojp2_ldflags.sh" #o0755))))) + + (build-system gnu-build-system) + (inputs + `(("curl" ,curl) + ("freetype" ,freetype) + ("jbig2dec" ,jbig2dec) + ("libjpeg" ,libjpeg) + ("libx11" ,libx11) + ("libxext" ,libxext) + ("openjpeg" ,openjpeg) + ("openssl" ,openssl) + ("zlib" ,zlib))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (arguments + ;; Trying to run `$ make check' results in a no rule fault. + '(#:tests? #f + + #:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases (alist-replace + 'build + (lambda _ (zero? (system* "make" "XCFLAGS=-fpic"))) + (alist-replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (zero? (system* "make" (string-append "prefix=" out) + "install")))) + (alist-delete 'configure %standard-phases))))) + (home-page "http://mupdf.com") + (synopsis "A lightweight PDF viewer and toolkit") + (description + "MuPDF is a C library that implements a PDF and XPS parsing and +rendering engine. It is used primarily to render pages into bitmaps, +but also provides support for other operations such as searching and +listing the table of contents and hyperlinks. + +The library ships with a rudimentary X11 viewer, and a set of command +line tools for batch rendering (pdfdraw), examining the file structure +(pdfshow), and rewriting files (pdfclean).") + (license license:agpl3+))) -- cgit v1.2.3