mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 14:07:01 +01:00
gnu: mupdf: Use only dynamic linking.
* gnu/packages/pdf.scm (mupdf)[source]: Add patch. [arguments]: Build and find the shared library. (zathura-pdf-mupdf)[arguments]: Add a 'remove-libmupdfthird.a-requirement phase to deal with the now-missing static one. * gnu/packages/patches/mupdf-fix-linkage.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it.
This commit is contained in:
parent
43ac6f59c5
commit
8b6ce47ccc
3 changed files with 39 additions and 0 deletions
|
@ -1367,6 +1367,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/mumps-shared-libseq.patch \
|
%D%/packages/patches/mumps-shared-libseq.patch \
|
||||||
%D%/packages/patches/mumps-shared-mumps.patch \
|
%D%/packages/patches/mumps-shared-mumps.patch \
|
||||||
%D%/packages/patches/mumps-shared-pord.patch \
|
%D%/packages/patches/mumps-shared-pord.patch \
|
||||||
|
%D%/packages/patches/mupdf-fix-linkage.patch \
|
||||||
%D%/packages/patches/mupen64plus-ui-console-notice.patch \
|
%D%/packages/patches/mupen64plus-ui-console-notice.patch \
|
||||||
%D%/packages/patches/mupen64plus-video-z64-glew-correct-path.patch \
|
%D%/packages/patches/mupen64plus-video-z64-glew-correct-path.patch \
|
||||||
%D%/packages/patches/musl-cross-locale.patch \
|
%D%/packages/patches/musl-cross-locale.patch \
|
||||||
|
|
27
gnu/packages/patches/mupdf-fix-linkage.patch
Normal file
27
gnu/packages/patches/mupdf-fix-linkage.patch
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
From: Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
|
Date: Tue, 24 Nov 2020 10:29:28 +0000
|
||||||
|
Subject: [PATCH] gnu: mupdf: Fix linkage.
|
||||||
|
|
||||||
|
Replace broken linkage to ‘build/shared-release/libmupdf.so’ with the
|
||||||
|
proper ‘-L$(libdir) -lmupdf’ incantation, and fix libmupdf.so's mode.
|
||||||
|
|
||||||
|
--- mupdf-1.18.0-source.org/Makefile
|
||||||
|
+++ mupdf-1.18.0-source/Makefile
|
||||||
|
@@ -61,7 +61,7 @@
|
||||||
|
ifdef RANLIB
|
||||||
|
RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
|
||||||
|
endif
|
||||||
|
-LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
+LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $(subst $(MUPDF_LIB),-L$(libdir) -L$(OUT) -lmupdf,$^) $(LIBS)
|
||||||
|
TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p
|
||||||
|
WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
|
||||||
|
OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -z noexecstack -o $@ $<
|
||||||
|
@@ -364,7 +364,7 @@ install: libs apps
|
||||||
|
install -m 644 include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
|
||||||
|
|
||||||
|
install -d $(DESTDIR)$(libdir)
|
||||||
|
- install -m 644 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
|
||||||
|
+ install -m 755 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
|
||||||
|
|
||||||
|
install -d $(DESTDIR)$(bindir)
|
||||||
|
install -m 755 $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
|
|
@ -526,6 +526,12 @@ (define-public zathura-pdf-mupdf
|
||||||
"-Dlink-external=true")
|
"-Dlink-external=true")
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
|
(add-after 'unpack 'remove-libmupdfthird.a-requirement
|
||||||
|
(lambda _
|
||||||
|
;; Ignore a missing (apparently superfluous) static library.
|
||||||
|
(substitute* "meson.build"
|
||||||
|
((".*mupdfthird.*") ""))
|
||||||
|
#t))
|
||||||
(add-before 'configure 'add-mujs-to-dependencies
|
(add-before 'configure 'add-mujs-to-dependencies
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Add mujs to the 'build_dependencies'.
|
;; Add mujs to the 'build_dependencies'.
|
||||||
|
@ -692,6 +698,7 @@ (define-public mupdf
|
||||||
"mupdf-" version "-source.tar.xz"))
|
"mupdf-" version "-source.tar.xz"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "16m5sksil22sshxy70xkslsb2qhvcqb1d95i9savnhds1xn4ybar"))
|
(base32 "16m5sksil22sshxy70xkslsb2qhvcqb1d95i9savnhds1xn4ybar"))
|
||||||
|
(patches (search-patches "mupdf-fix-linkage.patch"))
|
||||||
(modules '((guix build utils)))
|
(modules '((guix build utils)))
|
||||||
(snippet
|
(snippet
|
||||||
'(begin
|
'(begin
|
||||||
|
@ -730,6 +737,10 @@ (define-public mupdf
|
||||||
"XCFLAGS=-fpic"
|
"XCFLAGS=-fpic"
|
||||||
"USE_SYSTEM_LIBS=yes"
|
"USE_SYSTEM_LIBS=yes"
|
||||||
"USE_SYSTEM_MUJS=yes"
|
"USE_SYSTEM_MUJS=yes"
|
||||||
|
"shared=yes"
|
||||||
|
;; Even with the linkage patch we must fix RUNPATH.
|
||||||
|
(string-append "LDFLAGS=-Wl,-rpath="
|
||||||
|
(assoc-ref %outputs "out") "/lib")
|
||||||
(string-append "prefix=" (assoc-ref %outputs "out")))
|
(string-append "prefix=" (assoc-ref %outputs "out")))
|
||||||
#:phases (modify-phases %standard-phases
|
#:phases (modify-phases %standard-phases
|
||||||
(delete 'configure)))) ; no configure script
|
(delete 'configure)))) ; no configure script
|
||||||
|
|
Loading…
Reference in a new issue