diff options
author | B. Watson <yalhcru@gmail.com> | 2018-06-23 16:27:58 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-06-30 07:00:16 +0700 |
commit | cf9c4254ca204146ef0475280bbfe8f977cac592 (patch) | |
tree | 43dba376878f8355f2f469a437c7c9dc199261e8 /office/mupdf/shared_libs.diff | |
parent | 1f1e9ef5160405b5d32e586d98adbc2b4a4da2ba (diff) | |
download | slackbuilds-cf9c4254ca204146ef0475280bbfe8f977cac592.tar.gz |
office/mupdf: Add support for shared libraries.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'office/mupdf/shared_libs.diff')
-rw-r--r-- | office/mupdf/shared_libs.diff | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/office/mupdf/shared_libs.diff b/office/mupdf/shared_libs.diff new file mode 100644 index 0000000000..465028f632 --- /dev/null +++ b/office/mupdf/shared_libs.diff @@ -0,0 +1,76 @@ +diff -Naur mupdf-1.13.0-source/Makefile mupdf-1.13.0-source.patched/Makefile +--- mupdf-1.13.0-source/Makefile 2018-04-12 09:14:06.000000000 -0400 ++++ mupdf-1.13.0-source.patched/Makefile 2018-06-23 15:24:50.242018433 -0400 +@@ -14,7 +14,7 @@ + # Do not specify CFLAGS or LIBS on the make invocation line - specify + # XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that + # set a variable that was set on the command line. +-CFLAGS += $(XCFLAGS) -Iinclude ++CFLAGS += $(XCFLAGS) -Iinclude -fPIC + LIBS += $(XLIBS) -lm + + LIBS += $(FREETYPE_LIBS) +@@ -325,10 +325,10 @@ + + # --- Library --- + +-MUPDF_LIB = $(OUT)/libmupdf.a +-THIRD_LIB = $(OUT)/libmupdfthird.a +-THREAD_LIB = $(OUT)/libmuthreads.a +-PKCS7_LIB = $(OUT)/libmupkcs7.a ++MUPDF_LIB = $(OUT)/libmupdf.so ++THIRD_LIB = $(OUT)/libmupdfthird.so ++THREAD_LIB = $(OUT)/libmuthreads.so ++PKCS7_LIB = $(OUT)/libmupkcs7.so + + MUPDF_OBJ := \ + $(FITZ_OBJ) \ +@@ -355,12 +355,16 @@ + $(ZLIB_OBJ) \ + $(LCMS2_OBJ) + +-$(MUPDF_LIB) : $(MUPDF_OBJ) ++$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB) ++ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf.so.$(SOMAJOR) -Wl,--no-undefined + $(THIRD_LIB) : $(THIRD_OBJ) ++ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdfthird.so.$(SOMAJOR) -Wl,--no-undefined + $(THREAD_LIB) : $(THREAD_OBJ) ++ $(LINK_CMD) -shared -Wl,-soname -Wl,libmuthreads.so.$(SOMAJOR) -Wl,--no-undefined -lpthread + $(PKCS7_LIB) : $(PKCS7_OBJ) ++ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupkcs7.so.$(SOMAJOR) + +-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) ++INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB) + + # --- Tools and Apps --- + +@@ -444,6 +448,14 @@ + + VERSION = $(shell git describe --tags) + ++# 20180623 bkw: major/minor/micro versions for shared library. ++# SOMAJOR is the mupdf major/minor version jammed together (e.g. 113 ++# for 1.13.0). ++# SOMINOR is the mupdf micro version (e.g. 0 for 1.13.0). ++SOMAJOR = $(shell echo $(VERSION) | cut -d. -f1-2 | sed 's,\.,,g' ) ++SOMINOR = $(shell echo $(VERSION) | cut -d. -f3- | sed 's,\.,,g' ) ++SOVER = $(SOMAJOR).$(SOMINOR) ++ + version: + sed -i~ -e '/FZ_VERSION /s/".*"/"'$(VERSION)'"/' include/mupdf/fitz/version.h + +@@ -482,7 +494,13 @@ + install include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf + + install -d $(DESTDIR)$(libdir) +- install $(INSTALL_LIBS) $(DESTDIR)$(libdir) ++ install -s -m0755 $(INSTALL_LIBS) $(DESTDIR)$(libdir) ++ ( cd $(DESTDIR)$(libdir) ; \ ++ for i in $(INSTALL_LIBS); do \ ++ j=$$( basename $$i) ; \ ++ mv $$j $$j.$(SOVER) ; \ ++ ln -s $$j.$(SOVER) $$j ; \ ++ done ) + + install -d $(DESTDIR)$(bindir) + install $(INSTALL_APPS) $(DESTDIR)$(bindir) |