app-text/mupdf: bump to 1.15.0
authorVirgil Dupras <vdupras@gentoo.org>
Tue, 7 May 2019 02:37:54 +0000 (22:37 -0400)
committerVirgil Dupras <vdupras@gentoo.org>
Tue, 7 May 2019 02:38:46 +0000 (22:38 -0400)
We remove the "curl" USE flag because upstream stopped depending on it
with its removal of "progressive loading code".

Closes: https://bugs.gentoo.org/653298
Closes: https://bugs.gentoo.org/683490
Closes: https://bugs.gentoo.org/595190
Signed-off-by: Virgil Dupras <vdupras@gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

app-text/mupdf/Manifest
app-text/mupdf/files/mupdf-1.15-CFLAGS.patch [new file with mode: 0644]
app-text/mupdf/files/mupdf-1.15-Makefile.patch [new file with mode: 0644]
app-text/mupdf/files/mupdf-1.15-openssl-x11.patch [new file with mode: 0644]
app-text/mupdf/mupdf-1.15.0.ebuild [new file with mode: 0644]

index 3c5ff516a7ac34197bab7f4b6bc4c6f0c4069218..c8ad1a8bd31f72b6691fa7294395cc89c9f6cccb 100644 (file)
@@ -1 +1,2 @@
 DIST mupdf-1.14.0-source.tar.xz 41602372 BLAKE2B bb680038344af16c7231a18a009c0d04c5f50b3fcbaf061c9f5907f35d79eea93eeced7c2a43a06a963b93b39c74d0246c5fdad35655953d1aa5efb79737265a SHA512 bd41125dac1a81b7dbbfbb5f5e06e70bb601854731e0945983688da5d8d7c0bca9771fff2e4b6d9c36dbead6146f0a866ed7427d58e13d02ed6dfd94dcfe54bf
+DIST mupdf-1.15.0-source.tar.xz 39828864 BLAKE2B 15d0e4244062a91c7055b98fa61f2b02e0e3effbcf5374fe589f5a0d2ba2a2d4a59318ae3c0f28d866c6b07554e4b1e65ee9264c26a5f4524ef34e998d6c3320 SHA512 ef19362e8b6c2843e214fd2fcdcc9ba91017884383f7e1cfe08ef1f528a233820475ddfdd8aef481e6e37ae69e8b64324eb4b30699baa8055e99e47c2fab31dd
diff --git a/app-text/mupdf/files/mupdf-1.15-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.15-CFLAGS.patch
new file mode 100644 (file)
index 0000000..a7de530
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/Makerules b/Makerules
+index 298b5737..71c307e6 100644
+--- a/Makerules
++++ b/Makerules
+@@ -21,8 +21,6 @@ SANITIZE_FLAGS += -fsanitize=address
+ SANITIZE_FLAGS += -fsanitize=leak
+ ifeq ($(build),debug)
+-  CFLAGS += -pipe -g
+-  LDFLAGS += -g
+ else ifeq ($(build),release)
+   CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
+   LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
diff --git a/app-text/mupdf/files/mupdf-1.15-Makefile.patch b/app-text/mupdf/files/mupdf-1.15-Makefile.patch
new file mode 100644 (file)
index 0000000..cff348d
--- /dev/null
@@ -0,0 +1,42 @@
+diff --git a/Makefile b/Makefile
+index a9539342..e76b2c61 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,7 +3,7 @@
+ -include user.make
+ ifndef build
+-  build := release
++  build := debug
+ endif
+ ifndef OUT
+@@ -187,13 +187,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) -o $@ $^ $(THIRD_LIBS) $(LIBS)
++$(MUPDF_STATIC): $(MUPDF_OBJ) $(THIRD_OBJ)
+ $(THREAD_LIB) : $(THREAD_OBJ)
+ $(PKCS7_LIB) : $(PKCS7_OBJ)
+@@ -322,7 +324,7 @@ install: libs apps
+       install -d $(DESTDIR)$(docdir)
+       install -d $(DESTDIR)$(docdir)/examples
+-      install -m 644 README COPYING CHANGES $(DESTDIR)$(docdir)
++      install -m 644 README CHANGES $(DESTDIR)$(docdir)
+       install -m 644 docs/*.html docs/*.css docs/*.png $(DESTDIR)$(docdir)
+       install -m 644 docs/examples/* $(DESTDIR)$(docdir)/examples
diff --git a/app-text/mupdf/files/mupdf-1.15-openssl-x11.patch b/app-text/mupdf/files/mupdf-1.15-openssl-x11.patch
new file mode 100644 (file)
index 0000000..2282927
--- /dev/null
@@ -0,0 +1,20 @@
+diff --git a/Makerules b/Makerules
+index 298b5737..b2079435 100644
+--- a/Makerules
++++ b/Makerules
+@@ -119,13 +119,13 @@ else ifeq ($(OS),Linux)
+       SYS_GLUT_LIBS := -lglut -lGL
+   endif
+-  HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
++  HAVE_X11 := not-unless-portage-tells-me
+   ifeq ($(HAVE_X11),yes)
+       X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
+       X11_LIBS := $(shell pkg-config --libs x11 xext)
+   endif
+-  HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
++  HAVE_LIBCRYPTO := not-unless-portage-tells-me
+   ifeq ($(HAVE_LIBCRYPTO),yes)
+       LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
+       LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
diff --git a/app-text/mupdf/mupdf-1.15.0.ebuild b/app-text/mupdf/mupdf-1.15.0.ebuild
new file mode 100644 (file)
index 0000000..258ffd7
--- /dev/null
@@ -0,0 +1,122 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs xdg desktop
+
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="https://mupdf.com/"
+SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.xz"
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="X +javascript libressl opengl ssl static-libs vanilla"
+
+RDEPEND="
+       >=dev-lang/mujs-1.0.4
+       media-libs/freetype:2=[static-libs?]
+       media-libs/harfbuzz:=[static-libs?,truetype]
+       media-libs/jbig2dec:=[static-libs?]
+       media-libs/libpng:0=[static-libs?]
+       >=media-libs/openjpeg-2.1:2=[static-libs?]
+       virtual/jpeg[static-libs?]
+       ssl? (
+               libressl? ( >=dev-libs/libressl-2.8:0=[static-libs?] )
+               !libressl? ( >=dev-libs/openssl-1.1:0=[static-libs?] )
+       )
+       X? (
+               x11-libs/libX11[static-libs?]
+               x11-libs/libXext[static-libs?]
+       )"
+DEPEND="${RDEPEND}
+       virtual/pkgconfig"
+
+REQUIRED_USE="opengl? ( !static-libs )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.15-CFLAGS.patch
+       "${FILESDIR}"/${PN}-1.15-Makefile.patch
+       "${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+       # See bugs #662352
+       "${FILESDIR}"/${PN}-1.15-openssl-x11.patch
+)
+
+src_prepare() {
+       xdg_src_prepare
+       use hppa && append-cflags -ffunction-sections
+
+       use javascript || \
+               sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
+                       -i include/mupdf/fitz/config.h
+
+       use vanilla || eapply \
+               "${FILESDIR}"/${PN}-1.3-zoom-2.patch
+
+       # See bug #670832
+       use ssl && use libressl && eapply "${FILESDIR}"/${PN}-1.14-libressl.patch
+
+       sed -e "1iOS = Linux" \
+               -e "1iCC = $(tc-getCC)" \
+               -e "1iLD = $(tc-getLD)" \
+               -e "1iAR = $(tc-getAR)" \
+               -e "1iverbose = yes" \
+               -e "1ibuild = debug" \
+               -e "1iprefix = ${ED}/usr" \
+               -e "1ilibdir = ${ED}/usr/$(get_libdir)" \
+               -e "1idocdir = ${ED}/usr/share/doc/${PF}" \
+               -i Makerules || die
+}
+
+_emake() {
+       # When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
+       # We don't use system's freeglut because upstream has a special modified
+       # version of it that gives mupdf clipboard support. See bug #653298
+       emake \
+               GENTOO_PV=${PV} \
+               HAVE_GLUT=$(usex opengl) \
+               HAVE_LIBCRYPTO=$(usex ssl) \
+               HAVE_X11=$(usex X) \
+               USE_SYSTEM_LIBS=yes \
+               USE_SYSTEM_MUJS=yes \
+               USE_SYSTEM_GLUT=no \
+               HAVE_OBJCOPY=no \
+               "$@"
+}
+
+src_compile() {
+       _emake XCFLAGS="-fpic"
+
+       use static-libs && \
+               _emake build/debug/lib${PN}.a
+}
+
+src_install() {
+       if use X || use opengl ; then
+               domenu platform/debian/${PN}.desktop
+               doicon platform/debian/${PN}.xpm
+       else
+               rm docs/man/${PN}.1
+       fi
+
+       _emake install
+
+       dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
+
+       use static-libs && \
+               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}
+       elif use X ; then
+               einfo "mupdf symlink points to mupdf-x11 (bug 616654)"
+               dosym ${PN}-x11 /usr/bin/${PN}
+       fi
+       insinto /usr/$(get_libdir)/pkgconfig
+       doins platform/debian/${PN}.pc
+
+       dodoc README CHANGES CONTRIBUTORS
+}