gnu: mupdf: Simplify package.

* gnu/packages/pdf.scm (mupdf)[source]: Drop patch and part of snippet
  modifying permissions of files added by the patch.
  [arguments]: Use #:make-flags instead of modified build and install phases.
  Drop superfluous module inclusion. Use modify-phases syntax.
* gnu/packages/patches/mupdf-buildsystem-fix.patch: Remove patch.
* gnu-system.am (dist_patch_DATA): Unregister patch.
This commit is contained in:
Andreas Enge 2016-03-12 09:56:27 +01:00
parent 0ede252b66
commit 8e755b1bcd
3 changed files with 8 additions and 96 deletions

View File

@ -636,7 +636,6 @@ dist_patch_DATA = \
gnu/packages/patches/module-init-tools-moduledir.patch \ gnu/packages/patches/module-init-tools-moduledir.patch \
gnu/packages/patches/mumps-build-parallelism.patch \ gnu/packages/patches/mumps-build-parallelism.patch \
gnu/packages/patches/mupen64plus-ui-console-notice.patch \ gnu/packages/patches/mupen64plus-ui-console-notice.patch \
gnu/packages/patches/mupdf-buildsystem-fix.patch \
gnu/packages/patches/mutt-store-references.patch \ gnu/packages/patches/mutt-store-references.patch \
gnu/packages/patches/net-tools-bitrot.patch \ gnu/packages/patches/net-tools-bitrot.patch \
gnu/packages/patches/ngircd-handle-zombies.patch \ gnu/packages/patches/ngircd-handle-zombies.patch \

View File

@ -1,69 +0,0 @@
Since openjpeg doesn't seem to ship with a .pc file, provide an alternative.
--- a/ojp2_cppflags.sh 1970-01-01 01:00:00.000000000 +0100
+++ b/ojp2_cppflags.sh 2014-09-13 22:56:38.842418777 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Return the preprocessor flags to link against openjpeg.
+
+cpppath=$(echo ${NIX_STORE}/*-openjpeg-*/include/openjpeg-*)
+
+echo -I$cpppath
--- a/ojp2_ldflags.sh 1970-01-01 01:00:00.000000000 +0100
+++ b/ojp2_ldflags.sh 2014-09-13 22:56:38.842418777 +0200
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Return the linker flags to link against openjpeg.
+
+ldpath=$(echo ${NIX_STORE}/*-openjpeg-*/lib)
+
+echo -L$ldpath -lopenjp2
Make use of the above alternatives, compile with gcc.
--- a/Makerules 2014-09-14 09:13:40.729149860 +0200
+++ b/Makerules 2014-09-14 09:17:06.425156595 +0200
@@ -75,12 +75,14 @@
SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2)
SYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype2)
-SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjp2)
-SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjp2)
+SYS_OPENJPEG_CFLAGS = $(shell ./ojp2_cppflags.sh)
+SYS_OPENJPEG_LIBS = $(shell ./ojp2_ldflags.sh)
SYS_JBIG2DEC_LIBS = -ljbig2dec
SYS_JPEG_LIBS = -ljpeg
SYS_ZLIB_LIBS = -lz
+CC = gcc
+
endif
# The following section is an example of how to simply do cross-compilation
Remove the -x11 from the built binaries, since X11 is implied on GNU. (This
might change when Wayland gets more popular)
--- a/Makefile 2014-06-10 17:09:28.000000000 +0200
+++ b/Makefile 2014-09-14 09:57:10.381235299 +0200
@@ -255,7 +255,7 @@
$(LINK_CMD)
ifeq "$(HAVE_X11)" "yes"
-MUVIEW_X11 := $(OUT)/mupdf-x11
+MUVIEW_X11 := $(OUT)/mupdf
MUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
$(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR)
$(MUVIEW_X11) : $(MUPDF_LIB) $(THIRD_LIBS)
@@ -263,7 +263,7 @@
$(LINK_CMD) $(X11_LIBS)
ifeq "$(HAVE_CURL)" "yes"
-MUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl
+MUVIEW_X11_CURL := $(OUT)/mupdf-curl
MUVIEW_X11_CURL_OBJ := $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o)
$(MUVIEW_X11_CURL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
$(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(THIRD_LIBS) $(CURL_LIB)

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014, 2015 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2014, 2015 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
@ -418,18 +418,10 @@ extracting content or merging files.")
name "-" version "-source.tar.gz")) name "-" version "-source.tar.gz"))
(sha256 (sha256
(base32 "0qx51rj6alzcagcixm59rvdpm54w6syrwr4184v439jh14ryw4wq")) (base32 "0qx51rj6alzcagcixm59rvdpm54w6syrwr4184v439jh14ryw4wq"))
(patches
(list (search-patch "mupdf-buildsystem-fix.patch")))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin
;; Don't build the bundled-in third party libraries. ;; Don't build the bundled-in third party libraries.
(delete-file-recursively "thirdparty") '(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) (build-system gnu-build-system)
(inputs (inputs
`(("curl" ,curl) `(("curl" ,curl)
@ -444,22 +436,12 @@ extracting content or merging files.")
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config))) `(("pkg-config" ,pkg-config)))
(arguments (arguments
;; Trying to run `$ make check' results in a no rule fault. '(#:tests? #f ; no check target
'(#:tests? #f #:make-flags (list "CC=gcc"
"XCFLAGS=-fpic"
#:modules ((guix build gnu-build-system) (string-append "prefix=" (assoc-ref %outputs "out")))
(guix build utils) #:phases (modify-phases %standard-phases
(srfi srfi-1)) (delete 'configure))))
#: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") (home-page "http://mupdf.com")
(synopsis "Lightweight PDF viewer and toolkit") (synopsis "Lightweight PDF viewer and toolkit")
(description (description