commit:     84450c429203901c5de4e786b4413fbb5f25d731
Author:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 15 14:41:38 2018 +0000
Commit:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
CommitDate: Mon Oct 15 14:41:38 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84450c42

app-text/mupdf: fix shared library build

Closes: https://bugs.gentoo.org/668684
Signed-off-by: Virgil Dupras <vdupras <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 app-text/mupdf/files/mupdf-1.14-Makefile.patch     | 46 ++++++++++++++++++++++
 app-text/mupdf/files/mupdf-1.14-debug-build.patch  | 13 ------
 ...{mupdf-1.14.0.ebuild => mupdf-1.14.0-r1.ebuild} | 11 ++----
 3 files changed, 50 insertions(+), 20 deletions(-)

diff --git a/app-text/mupdf/files/mupdf-1.14-Makefile.patch 
b/app-text/mupdf/files/mupdf-1.14-Makefile.patch
new file mode 100644
index 00000000000..a8c4ef770dc
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.14-Makefile.patch
@@ -0,0 +1,46 @@
+1. debug build (not sure why...)
+2. build shared library
+3. add optional static lib target
+4. Don't install COPYING
+diff --git a/Makefile b/Makefile
+index 37fc48e6..4303e9fa 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,7 +3,7 @@
+ -include user.make
+ 
+ ifndef build
+-  build := release
++  build := debug
+ endif
+ 
+ ifndef OUT
+@@ -190,13 +190,15 @@ generate: source/pdf/js/util.js.h
+ 
+ # --- Library ---
+ 
+-MUPDF_LIB = $(OUT)/libmupdf.a
+-THIRD_LIB = $(OUT)/libmupdf-third.a
++MUPDF_LIB = libmupdf.so.$(GENTOO_PV)
++MUPDF_STATIC = $(OUT)/libmupdf.a
++THIRD_LIB =
+ THREAD_LIB = $(OUT)/libmupdf-threads.a
+ PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
+ 
+-$(MUPDF_LIB) : $(MUPDF_OBJ)
+-$(THIRD_LIB) : $(THIRD_OBJ)
++$(MUPDF_LIB): $(MUPDF_OBJ) $(THIRD_OBJ)
++      $(QUIET_LINK) $(CC) $(LDFLAGS) --shared -Wl,-soname -Wl,$(MUPDF_LIB) 
-Wl,--no-undefined -o $@ $^ $(THIRD_LIBS) $(LIBS)
++$(MUPDF_STATIC): $(MUPDF_OBJ) $(THIRD_OBJ)
+ $(THREAD_LIB) : $(THREAD_OBJ)
+ $(PKCS7_LIB) : $(PKCS7_OBJ)
+ 
+@@ -355,7 +357,7 @@ install: libs apps
+ 
+       install -d $(DESTDIR)$(docdir)
+       install -d $(DESTDIR)$(docdir)/examples
+-      install README COPYING CHANGES $(DESTDIR)$(docdir)
++      install README CHANGES $(DESTDIR)$(docdir)
+       install docs/*.html docs/*.css docs/*.png $(DESTDIR)$(docdir)
+       install docs/examples/* $(DESTDIR)$(docdir)/examples
+ 

diff --git a/app-text/mupdf/files/mupdf-1.14-debug-build.patch 
b/app-text/mupdf/files/mupdf-1.14-debug-build.patch
deleted file mode 100644
index 6f8b5b96a97..00000000000
--- a/app-text/mupdf/files/mupdf-1.14-debug-build.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 37fc48e6..bd8c6049 100644
---- a/Makefile
-+++ b/Makefile
-@@ -3,7 +3,7 @@
- -include user.make
- 
- ifndef build
--  build := release
-+  build := debug
- endif
- 
- ifndef OUT

diff --git a/app-text/mupdf/mupdf-1.14.0.ebuild 
b/app-text/mupdf/mupdf-1.14.0-r1.ebuild
similarity index 92%
rename from app-text/mupdf/mupdf-1.14.0.ebuild
rename to app-text/mupdf/mupdf-1.14.0-r1.ebuild
index 3bafaab5d0b..f12cf699e38 100644
--- a/app-text/mupdf/mupdf-1.14.0.ebuild
+++ b/app-text/mupdf/mupdf-1.14.0-r1.ebuild
@@ -41,7 +41,7 @@ S=${WORKDIR}/${P}-source
 
 PATCHES=(
        "${FILESDIR}"/${PN}-1.14-CFLAGS.patch
-       "${FILESDIR}"/${PN}-1.14-debug-build.patch
+       "${FILESDIR}"/${PN}-1.14-Makefile.patch
        "${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
        # See bug #662352
        "${FILESDIR}"/${PN}-1.14-openssl-curl-x11.patch
@@ -68,15 +68,12 @@ src_prepare() {
                -e "1ilibdir = ${ED}usr/$(get_libdir)" \
                -e "1idocdir = ${ED}usr/share/doc/${PF}" \
                -i Makerules || die
-
-       if use static-libs; then
-               cp -a "${S}" "${S}"-static || die
-       fi
 }
 
 _emake() {
        # When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
        emake \
+               GENTOO_PV=${PV} \
                HAVE_GLUT=$(usex opengl yes no) \
                WANT_CURL=$(usex curl) \
                WANT_OPENSSL=$(usex openssl) \
@@ -93,7 +90,7 @@ src_compile() {
        use curl && _emake extra-apps
 
        use static-libs && \
-               _emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
+               _emake build/debug/lib${PN}.a
 }
 
 src_install() {
@@ -107,7 +104,7 @@ src_install() {
        _emake install
 
        use static-libs && \
-               dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
+               dolib.a build/debug/lib${PN}.a
        if use opengl ; then
                einfo "mupdf symlink points to mupdf-gl (bug 616654)"
                dosym ${PN}-gl /usr/bin/${PN}

Reply via email to