aports/community/mupdf/versioned-soname.patch
Sören Tempel 76dd0d8bb7 community/mupdf: encode full SONAME in shared library
Upstream provides no ABI stability across updates, hence we always
need to rebuild mupdf even for patch version upgrades. Previously
only the major + minor version was encoded in the SONAME (e.g.
mupdf-1.23). This is insufficient as apk's dependency tracker
will then not update dependency on partial upgrades.
2023-09-22 10:52:10 +00:00

45 lines
1.7 KiB
Diff

From: Jakub Jirutka <jakub@jirutka.cz>
Date: Thu, 21 Jul 2022 17:38:00 +0200
Subject: [PATCH] Set SONAME in shared library
With `shared=yes` mupdf builds a shared library for libmupdf. Sadly,
this shared library does not have an SONAME set, because upstream
doesn't provide any ABI compatibility. However, apk uses the provided
soname for dependency tracking and since there is no ABI compatability
other packages need to encode the full mupdf version as a dependency.
Hence, we set the SONAME to the full mupdf package version, e.g.
mupdf-1.23.3 instead of just mupdf-1.23.
diff -upr mupdf-1.23.3.orig/Makefile mupdf-1.23.3/Makefile
--- mupdf-1.23.3.orig/Makefile 2023-09-22 09:58:03.052211188 +0200
+++ mupdf-1.23.3/Makefile 2023-09-22 09:58:08.688893445 +0200
@@ -85,7 +85,7 @@ $(OUT)/%.exe: %.c
$(LINK_CMD)
$(OUT)/%.$(SO):
- $(LINK_CMD) $(LIB_LDFLAGS) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
+ $(LINK_CMD) $(LIB_LDFLAGS) -Wl,-soname,$(notdir $@).$(VERSION) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
$(OUT)/%.def: $(OUT)/%.$(SO)
$(GENDEF_CMD)
@@ -409,7 +409,9 @@ $(OUT)/storytest: docs/examples/storytes
# --- 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)
version:
sed -i~ -e '/FZ_VERSION /s/".*"/"'$(VERSION)'"/' include/mupdf/fitz/version.h
@@ -448,7 +450,7 @@ install-libs: libs
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