1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 02:05:16 +03:00
aports/community/mupdf/shared-lib.patch
2022-07-21 18:43:11 +02:00

47 lines
1.4 KiB
Diff

From: Jakub Jirutka <jakub@jirutka.cz>
Date: Thu, 21 Jul 2022 17:38:00 +0200
Subject: [PATCH] Set SONAME and build with -fPIC
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,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
ifneq ($(threading),no)
@@ -85,7 +85,7 @@
$(LINK_CMD)
$(OUT)/%.$(SO):
- $(LINK_CMD) $(LIB_LDFLAGS) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
+ $(LINK_CMD) $(LIB_LDFLAGS) -Wl,-soname,$(notdir $@).$(SOVERSION) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
$(OUT)/%.def: $(OUT)/%.$(SO)
$(GENDEF_CMD)
@@ -371,8 +371,12 @@
# --- Update version string header ---
-VERSION = $(shell git describe --tags)
+VERSION = $(shell test -d .git \
+ && git describe --tags 2>/dev/null \
+ || sed -n 's/.* FZ_VERSION "\([^"]\+\)"/\1/p' include/mupdf/fitz/version.h)
+SOVERSION = $(basename $(VERSION))
+
version:
sed -i~ -e '/FZ_VERSION /s/".*"/"'$(VERSION)'"/' include/mupdf/fitz/version.h
@@ -410,7 +414,7 @@
install -m 644 include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
ifneq ($(LIBS_TO_INSTALL_IN_LIB),)
install -d $(DESTDIR)$(libdir)
- install -m 644 $(LIBS_TO_INSTALL_IN_LIB) $(DESTDIR)$(libdir)
+ install -m 755 $(LIBS_TO_INSTALL_IN_LIB) $(DESTDIR)$(libdir)
endif
install-apps: apps