public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2015-08-10 22:52 Michael Weber
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Weber @ 2015-08-10 22:52 UTC (permalink / raw
  To: gentoo-commits

commit:     1dc8dafb477cabeecc8d46bf6a65bec6e289e4b0
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 10 22:52:28 2015 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Mon Aug 10 22:52:45 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1dc8dafb

app-text/mupdf: fix format-security (bug 556830).

Package-Manager: portage-2.2.20

 .../files/mupdf-1.5-format-security-error.patch    | 22 ++++++++++++++++++++++
 app-text/mupdf/mupdf-1.5-r1.ebuild                 |  3 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/app-text/mupdf/files/mupdf-1.5-format-security-error.patch b/app-text/mupdf/files/mupdf-1.5-format-security-error.patch
new file mode 100644
index 0000000..d0dce97
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.5-format-security-error.patch
@@ -0,0 +1,22 @@
+From: =?utf-8?q?=22Kan-Ru_Chen_=28=E9=99=B3=E4=BE=83=E5=A6=82=29=22?=
+ <koster@debian.org>
+Date: Sat, 20 Sep 2014 13:12:16 +0800
+Subject: Fix -Werror=format-security error
+
+---
+ source/pdf/pdf-op-run.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c
+index 2bea94b..da881b2 100644
+--- a/source/pdf/pdf-op-run.c
++++ b/source/pdf/pdf-op-run.c
+@@ -1729,7 +1729,7 @@ run_xobject(pdf_csi *csi, void *state, pdf_obj *resources, pdf_xobject *xobj, co
+ 
+ 	/* Rethrow postponed errors */
+ 	if (errmess[0])
+-		fz_throw(ctx, FZ_ERROR_GENERIC, errmess);
++		fz_throw(ctx, FZ_ERROR_GENERIC, "%s", errmess);
+ }
+ 
+ static void pdf_run_BDC(pdf_csi *csi, void *state)

diff --git a/app-text/mupdf/mupdf-1.5-r1.ebuild b/app-text/mupdf/mupdf-1.5-r1.ebuild
index 791a17d..b066b49 100644
--- a/app-text/mupdf/mupdf-1.5-r1.ebuild
+++ b/app-text/mupdf/mupdf-1.5-r1.ebuild
@@ -41,7 +41,8 @@ src_prepare() {
 		"${FILESDIR}"/${PN}-1.3-CFLAGS.patch \
 		"${FILESDIR}"/${PN}-1.5-old-debian-files.patch \
 		"${FILESDIR}"/${PN}-1.3-pkg-config.patch \
-		"${FILESDIR}"/${PN}-1.5-Makerules-openssl-curl.patch
+		"${FILESDIR}"/${PN}-1.5-Makerules-openssl-curl.patch \
+		"${FILESDIR}"/${PN}-1.5-format-security-error.patch
 
 	if has_version ">=media-libs/openjpeg-2.1:2" ; then
 		epatch \


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2016-06-04 19:46 Michael Weber
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Weber @ 2016-06-04 19:46 UTC (permalink / raw
  To: gentoo-commits

commit:     9d40bc9df5cd1c5de3bcdd0d6e846ae832ede27b
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 19:45:29 2016 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Sat Jun  4 19:46:09 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d40bc9d

app-text/mupdf: Version bump (thanks johncarmack <AT> cock.li for the hint, bug 584266).

Package-Manager: portage-2.3.0_rc1

 app-text/mupdf/Manifest                            |   1 +
 app-text/mupdf/files/mupdf-1.9a-CFLAGS.patch       |  11 ++
 app-text/mupdf/files/mupdf-1.9a-debug-build.patch  |  10 ++
 app-text/mupdf/files/mupdf-1.9a-no-thirdlibs.patch | 113 ++++++++++++++++
 app-text/mupdf/mupdf-1.9a.ebuild                   | 144 +++++++++++++++++++++
 5 files changed, 279 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 6faa9d9..88b3b21 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,2 +1,3 @@
 DIST mupdf-1.5.tar.gz 7485699 SHA256 946393c7abf78e50fa9815f18a9e91f275a1a96a7ea14ae39b5237944070d1f5 SHA512 bfb79838eba629295ab164cf37e49edc8846689598fbad9312409535022a2e747bd062718b899909564c6cf5826fb46a2b4b579ced8c7a3896d6098e7e5ccf40 WHIRLPOOL ebcaf5f677984a78aecf9eeb72e7a79e6e2a6388db5024427d8bf55f31b3690844dd291ada3cd578a5bb9a370ea21cb2a044656c21a0ef47cdf7bfc42c842beb
 DIST mupdf-1.8.tar.gz 7706473 SHA256 d4e06644caad381d1dc88401dae12ee614809a7b95f6dcbf6fd086d5b594dcc4 SHA512 6adc30330c61d0bb8c9ee09488ef31701e9a7425cbac76e072eae9816c14a1190a1e2bd1e9155b6892d4198f7d8692661582cc1b82c7caab7b3ba4fddfcc7461 WHIRLPOOL 9fceca049cf5eaffd1520a0077c78bd8647d8e5b384eb2c1bc968a16349b46909b592cb8cbd5ee0546e798434afbece39a258e175ba02d0454b8edc35e179dd7
+DIST mupdf-1.9a.tar.gz 13282205 SHA256 2a7d6d73cd1f6de8f70792dff9936b84c54c127feecd485675e0d0c17debc98d SHA512 aa268484371597f2082bff61052b3f80e30b8d41018bf0477b8975e4520849090b75e6c4be6be15d6af9cea6d9315deb28f82c6afc8b6f3c5bfc3498eca91140 WHIRLPOOL b552e68d0412e723e23c645516e87d695e00af0c88b14ab1ebc6b65e374f525fab6df2b5f81fe72fc8a61a8a9f616712ef0d215a07327745d33fb0238509eac9

diff --git a/app-text/mupdf/files/mupdf-1.9a-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.9a-CFLAGS.patch
new file mode 100644
index 0000000..a6caa30
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.9a-CFLAGS.patch
@@ -0,0 +1,11 @@
+--- mupdf-1.9a/Makerules
++++ mupdf-1.9a/Makerules
+@@ -10,7 +10,7 @@
+ CFLAGS += -Wall
+ 
+ ifeq "$(build)" "debug"
+-CFLAGS += -pipe -g -DDEBUG
++CFLAGS += -DDEBUG
+ LDFLAGS += -g
+ else ifeq "$(build)" "release"
+ CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer

diff --git a/app-text/mupdf/files/mupdf-1.9a-debug-build.patch b/app-text/mupdf/files/mupdf-1.9a-debug-build.patch
new file mode 100644
index 0000000..93c52f5
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.9a-debug-build.patch
@@ -0,0 +1,10 @@
+--- mupdf-1.9a/Makefile
++++ mupdf-1.9a/Makefile
+@@ -1,6 +1,6 @@
+ # GNU Makefile
+ 
+-build ?= release
++build ?= debug
+ 
+ OUT := build/$(build)
+ GEN := generated

diff --git a/app-text/mupdf/files/mupdf-1.9a-no-thirdlibs.patch b/app-text/mupdf/files/mupdf-1.9a-no-thirdlibs.patch
new file mode 100644
index 0000000..08d2eca
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.9a-no-thirdlibs.patch
@@ -0,0 +1,113 @@
+--- mupdf-1.9a/Makefile
++++ mupdf-1.9a/Makefile
+@@ -142,15 +141,12 @@
+ # --- Library ---
+ 
+ MUPDF_LIB = $(OUT)/libmupdf.a
+-THIRD_LIB = $(OUT)/libmupdfthird.a
+ 
+ MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ)
+-THIRD_OBJ := $(FREETYPE_OBJ) $(HARFBUZZ_OBJ) $(JBIG2DEC_OBJ) $(JPEG_OBJ) $(MUJS_OBJ) $(OPENJPEG_OBJ) $(ZLIB_OBJ)
+ 
+ $(MUPDF_LIB) : $(MUPDF_OBJ)
+-$(THIRD_LIB) : $(THIRD_OBJ)
+ 
+-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
++INSTALL_LIBS := $(MUPDF_LIB)
+ 
+ # --- Rules ---
+ 
+@@ -251,19 +247,19 @@
+ MUTOOL := $(addprefix $(OUT)/, mutool)
+ MUTOOL_OBJ := $(addprefix $(OUT)/tools/, mutool.o mudraw.o murun.o pdfclean.o pdfcreate.o pdfextract.o pdfinfo.o pdfposter.o pdfshow.o pdfpages.o pdfmerge.o)
+ $(MUTOOL_OBJ): $(FITZ_HDR) $(PDF_HDR)
+-$(MUTOOL) : $(MUPDF_LIB) $(THIRD_LIB)
++$(MUTOOL) : $(MUPDF_LIB)
+ $(MUTOOL) : $(MUTOOL_OBJ)
+ 	$(LINK_CMD)
+ 
+ MJSGEN := $(OUT)/mjsgen
+-$(MJSGEN) : $(MUPDF_LIB) $(THIRD_LIB)
++$(MJSGEN) : $(MUPDF_LIB)
+ $(MJSGEN) : $(addprefix $(OUT)/tools/, mjsgen.o)
+ 	$(LINK_CMD)
+ 
+ MUJSTEST := $(OUT)/mujstest
+ MUJSTEST_OBJ := $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o)
+ $(MUJSTEST_OBJ) : $(FITZ_HDR) $(PDF_HDR)
+-$(MUJSTEST) : $(MUPDF_LIB) $(THIRD_LIB)
++$(MUJSTEST) : $(MUPDF_LIB)
+ $(MUJSTEST) : $(MUJSTEST_OBJ)
+ 	$(LINK_CMD)
+ 
+@@ -271,7 +267,7 @@
+ MUVIEW_X11 := $(OUT)/mupdf-x11
+ MUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
+ $(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR)
+-$(MUVIEW_X11) : $(MUPDF_LIB) $(THIRD_LIB)
++$(MUVIEW_X11) : $(MUPDF_LIB)
+ $(MUVIEW_X11) : $(MUVIEW_X11_OBJ)
+ 	$(LINK_CMD) $(X11_LIBS)
+ 
+@@ -279,7 +275,7 @@
+ MUVIEW_GLFW := $(OUT)/mupdf-gl
+ MUVIEW_GLFW_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.o gl-input.o gl-main.o)
+ $(MUVIEW_GLFW_OBJ) : $(FITZ_HDR) $(PDF_HDR) platform/gl/gl-app.h
+-$(MUVIEW_GLFW) : $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB)
++$(MUVIEW_GLFW) : $(MUPDF_LIB) $(GLFW_LIB)
+ $(MUVIEW_GLFW) : $(MUVIEW_GLFW_OBJ)
+ 	$(LINK_CMD) $(GLFW_LIBS)
+ endif
+@@ -288,7 +284,7 @@
+ MUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl
+ MUVIEW_X11_CURL_OBJ := $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o)
+ $(MUVIEW_X11_CURL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
+-$(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB)
++$(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(CURL_LIB)
+ $(MUVIEW_X11_CURL) : $(MUVIEW_X11_CURL_OBJ)
+ 	$(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
+ endif
+@@ -298,7 +294,7 @@
+ MUVIEW_WIN32 := $(OUT)/mupdf
+ MUVIEW_WIN32_OBJ := $(addprefix $(OUT)/platform/x11/, win_main.o pdfapp.o win_res.o)
+ $(MUVIEW_WIN32_OBJ) : $(FITZ_HDR) $(PDF_HDR)
+-$(MUVIEW_WIN32) : $(MUPDF_LIB) $(THIRD_LIB)
++$(MUVIEW_WIN32) : $(MUPDF_LIB)
+ $(MUVIEW_WIN32) : $(MUVIEW_WIN32_OBJ)
+ 	$(LINK_CMD) $(WIN32_LIBS)
+ endif
+@@ -312,9 +308,9 @@
+ 
+ examples: $(OUT)/example $(OUT)/multi-threaded
+ 
+-$(OUT)/example: docs/example.c $(MUPDF_LIB) $(THIRD_LIB)
++$(OUT)/example: docs/example.c $(MUPDF_LIB)
+ 	$(LINK_CMD) $(CFLAGS)
+-$(OUT)/multi-threaded: docs/multi-threaded.c $(MUPDF_LIB) $(THIRD_LIB)
++$(OUT)/multi-threaded: docs/multi-threaded.c $(MUPDF_LIB)
+ 	$(LINK_CMD) $(CFLAGS) -lpthread
+ 
+ # --- Update version string header ---
+@@ -343,7 +339,6 @@
+ mandir ?= $(prefix)/share/man
+ docdir ?= $(prefix)/share/doc/mupdf
+ 
+-third: $(THIRD_LIB)
+ extra: $(CURL_LIB) $(GLFW_LIB)
+ libs: $(INSTALL_LIBS)
+ apps: $(INSTALL_APPS)
+@@ -376,7 +371,7 @@
+ java:
+ 	$(MAKE) -C platform/java
+ 
+-tags: $(shell find include source platform thirdparty -name '*.[ch]' -or -name '*.cc' -or -name '*.hh')
++tags: $(shell find include source platform -name '*.[ch]' -or -name '*.cc' -or -name '*.hh')
+ 	ctags $^
+ 
+ cscope.files: $(shell find include source platform -name '*.[ch]')
+@@ -397,4 +392,4 @@
+ debug:
+ 	$(MAKE) build=debug
+ 
+-.PHONY: all clean nuke install third libs apps generate
++.PHONY: all clean nuke install libs apps generate

diff --git a/app-text/mupdf/mupdf-1.9a.ebuild b/app-text/mupdf/mupdf-1.9a.ebuild
new file mode 100644
index 0000000..c40e027
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.9a.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib toolchain-funcs vcs-snapshot
+
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="http://mupdf.com/"
+SRC_URI="http://git.ghostscript.com/?p=mupdf.git;a=snapshot;h=027860688eafc89ca3d57937a77a43a9bb96f590;sf=tgz -> ${P}.tar.gz"
+
+LICENSE="AGPL-3"
+MY_SOVER=1.9
+SLOT="0/${MY_SOVER}"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="X vanilla +curl javascript libressl opengl +openssl static static-libs"
+
+LIB_DEPEND="
+	!libressl? ( dev-libs/openssl:0[static-libs?] )
+	libressl? ( dev-libs/libressl[static-libs?] )
+	media-libs/freetype:2[static-libs?]
+	media-libs/harfbuzz[static-libs?]
+	media-libs/jbig2dec[static-libs?]
+	media-libs/libpng:0[static-libs?]
+	media-libs/openjpeg:2[static-libs?]
+	net-misc/curl[static-libs?]
+	virtual/jpeg[static-libs?]
+	X? ( x11-libs/libX11[static-libs?]
+		x11-libs/libXext[static-libs?] )
+	javascript? ( >=dev-lang/mujs-0_p20160504 )
+	opengl? ( >=media-libs/glfw-3 )"
+RDEPEND="${LIB_DEPEND}"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	static-libs? ( ${LIB_DEPEND} )
+	static? ( ${LIB_DEPEND//?}
+		app-arch/bzip2[static-libs]
+		x11-libs/libXau[static-libs]
+		x11-libs/libXdmcp[static-libs]
+		x11-libs/libxcb[static-libs] )"
+
+REQUIRED_USE="opengl? ( X !static !static-libs )"
+
+src_prepare() {
+	use hppa && append-cflags -ffunction-sections
+
+	rm -rf thirdparty || die
+
+	epatch \
+		"${FILESDIR}"/${PN}-1.9a-CFLAGS.patch \
+		"${FILESDIR}"/${PN}-1.9a-debug-build.patch \
+		"${FILESDIR}"/${PN}-1.5-old-debian-files.patch \
+		"${FILESDIR}"/${PN}-1.3-pkg-config.patch \
+		"${FILESDIR}"/${PN}-1.5-Makerules-openssl-curl.patch \
+		"${FILESDIR}"/${PN}-1.9a-no-thirdlibs.patch \
+		"${FILESDIR}"/${PN}-1.8-system-glfw.patch
+
+	if has_version ">=media-libs/openjpeg-2.1:2" ; then
+		epatch \
+			"${FILESDIR}"/${PN}-1.5-openjpeg-2.1.patch
+	fi
+
+	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
+		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
+		-i platform/debian/${PN}.pc || die
+
+	use vanilla || epatch \
+		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
+
+	#http://bugs.ghostscript.com/show_bug.cgi?id=693467
+	sed -e '/^\(Actions\|MimeType\)=/s:\(.*\):\1;:' \
+		-i platform/debian/${PN}.desktop || die
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iLD = $(tc-getCC)" \
+		-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}" \
+		-e "1iHAVE_X11 = $(usex X)" \
+		-e "1iWANT_OPENSSL = $(usex openssl)" \
+		-e "1iWANT_CURL = $(usex curl)" \
+		-e "1iHAVE_MUJS = $(usex javascript)" \
+		-e "1iMUJS_LIBS = -lmujs" \
+		-e "1iMUJS_CFLAGS =" \
+		-e "1iHAVE_GLFW = $(usex opengl yes no)" \
+		-i Makerules || die
+
+	if use static-libs || use static ; then
+		cp -a "${S}" "${S}"-static || die
+		#add missing Libs.private for xcb and freetype
+		sed -e 's:\(pkg-config --libs\):\1 --static:' \
+		    -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
+		    -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
+			-i "${S}"-static/Makerules || die
+	fi
+
+	my_soname=libmupdf.so.${MY_SOVER}
+	my_soname_js_none=libmupdf-js-none.so.${MY_SOVER}
+	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
+		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
+		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
+		-e "/install/s: COPYING : :" \
+		-i Makefile || die
+}
+
+src_compile() {
+	emake XCFLAGS="-fpic"
+	use static-libs && \
+		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
+	use static && \
+		emake -C "${S}"-static XLIBS="-static"
+}
+
+src_install() {
+	if use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon platform/debian/${PN}.xpm
+	else
+		rm docs/man/${PN}.1
+	fi
+
+	emake install
+	dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
+
+	use static-libs && \
+		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
+	if use static ; then
+		dobin "${S}"-static/build/debug/mu{tool,draw}
+		use X && dobin "${S}"-static/build/debug/${PN}-x11
+	fi
+	use X && dosym ${PN}-x11 /usr/bin/${PN}
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README docs/*.{txt,c}
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2017-01-23  0:31 Michael Weber
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Weber @ 2017-01-23  0:31 UTC (permalink / raw
  To: gentoo-commits

commit:     290927105365ff1f2374f383d7135ecf17f41cb1
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 23 00:31:02 2017 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Mon Jan 23 00:31:18 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29092710

app-text/mupdf: Version bump (https://github.com/gentoo/gentoo/pull/3108, thanks charIes17).

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 app-text/mupdf/Manifest                            |   1 +
 .../files/mupdf-1.10a-Makerules-openssl-curl.patch |  32 ++
 .../mupdf-1.10a-add-desktop-pc-xpm-files.patch     | 533 +++++++++++++++++++++
 app-text/mupdf/mupdf-1.10a.ebuild                  | 146 ++++++
 4 files changed, 712 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 88b3b21..43abae7 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,3 +1,4 @@
+DIST mupdf-1.10a-source.tar.gz 42264707 SHA256 aacc1f36b9180f562022ef1ab3439b009369d944364f3cff8a2a898834e3a836 SHA512 8c735963364985e74ceb38242afae555a3d2ee7c69abe3fe5c485e8613a83d996a58f231cb689a156019d431fa67d565503247d010b0a404054850483aed9fec WHIRLPOOL f3dc7fbddd2ee140226f17b444f184138dbff5d626033a295a7b335119fae5eb49eae680fb392068935610cdbed21267016af8afaa080fffba4f320b82209fbb
 DIST mupdf-1.5.tar.gz 7485699 SHA256 946393c7abf78e50fa9815f18a9e91f275a1a96a7ea14ae39b5237944070d1f5 SHA512 bfb79838eba629295ab164cf37e49edc8846689598fbad9312409535022a2e747bd062718b899909564c6cf5826fb46a2b4b579ced8c7a3896d6098e7e5ccf40 WHIRLPOOL ebcaf5f677984a78aecf9eeb72e7a79e6e2a6388db5024427d8bf55f31b3690844dd291ada3cd578a5bb9a370ea21cb2a044656c21a0ef47cdf7bfc42c842beb
 DIST mupdf-1.8.tar.gz 7706473 SHA256 d4e06644caad381d1dc88401dae12ee614809a7b95f6dcbf6fd086d5b594dcc4 SHA512 6adc30330c61d0bb8c9ee09488ef31701e9a7425cbac76e072eae9816c14a1190a1e2bd1e9155b6892d4198f7d8692661582cc1b82c7caab7b3ba4fddfcc7461 WHIRLPOOL 9fceca049cf5eaffd1520a0077c78bd8647d8e5b384eb2c1bc968a16349b46909b592cb8cbd5ee0546e798434afbece39a258e175ba02d0454b8edc35e179dd7
 DIST mupdf-1.9a.tar.gz 13282205 SHA256 2a7d6d73cd1f6de8f70792dff9936b84c54c127feecd485675e0d0c17debc98d SHA512 aa268484371597f2082bff61052b3f80e30b8d41018bf0477b8975e4520849090b75e6c4be6be15d6af9cea6d9315deb28f82c6afc8b6f3c5bfc3498eca91140 WHIRLPOOL b552e68d0412e723e23c645516e87d695e00af0c88b14ab1ebc6b65e374f525fab6df2b5f81fe72fc8a61a8a9f616712ef0d215a07327745d33fb0238509eac9

diff --git a/app-text/mupdf/files/mupdf-1.10a-Makerules-openssl-curl.patch b/app-text/mupdf/files/mupdf-1.10a-Makerules-openssl-curl.patch
new file mode 100644
index 00000000..3fdc204
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.10a-Makerules-openssl-curl.patch
@@ -0,0 +1,32 @@
+--- mupdf-1.10a/Makerules
++++ mupdf-1.10a/Makerules
+@@ -107,12 +107,17 @@
+ 
+ HAVE_PTHREADS ?= yes
+ 
++WANT_OPENSSL ?= yes
++ifeq "$(WANT_OPENSSL)" "yes"
+ ifeq "$(shell pkg-config --exists libcrypto && echo yes)" "yes"
+ HAVE_LIBCRYPTO = yes
+ SYS_LIBCRYPTO_CFLAGS = -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
+ SYS_LIBCRYPTO_LIBS = $(shell pkg-config --libs libcrypto)
+ endif
++endif
+ 
++WANT_CURL ?= yes
++ifeq "$(WANT_CURL)" "yes"
+ ifeq "$(shell pkg-config --exists libcurl && echo yes)" "yes"
+ HAVE_CURL = yes
+ SYS_CURL_CFLAGS = $(shell pkg-config --cflags libcurl)
+@@ -122,8 +127,10 @@
+ SYS_CURL_CFLAGS += $(shell pkg-config --cflags openssl)
+ SYS_CURL_DEPS += $(shell pkg-config --libs openssl)
+ endif
+-endif
+ SYS_CURL_DEPS += -lpthread -lrt
++endif
++endif
++
+ 
+ ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
+ HAVE_X11 = yes

diff --git a/app-text/mupdf/files/mupdf-1.10a-add-desktop-pc-xpm-files.patch b/app-text/mupdf/files/mupdf-1.10a-add-desktop-pc-xpm-files.patch
new file mode 100644
index 00000000..decab50
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.10a-add-desktop-pc-xpm-files.patch
@@ -0,0 +1,533 @@
+--- /dev/null
++++ ./platform/debian/mupdf.desktop
+@@ -0,0 +1,15 @@
++[Desktop Entry]
++Name=MuPDF
++GenericName=PDF file viewer
++Exec=mupdf %f
++TryExec=mupdf
++Icon=mupdf
++Terminal=false
++Type=Application
++MimeType=application/pdf;application/x-pdf;application/x-cbz;application/oxps;application/vnd.ms-xpsdocument;image/jpeg;image/pjpeg;image/png;image/tiff;image/x-tiff;
++Categories=Viewer;Graphics;
++Actions=View;
++
++[Desktop Action View]
++Name=View with mupdf
++Exec=mupdf %f
+--- /dev/null
++++ ./platform/debian/mupdf.pc
+@@ -0,0 +1,12 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: mupdf
++Description: Library for rendering PDF documents
++Requires: freetype2 libopenjp2 libcrypto
++Version: 0.5.0
++Libs: -L${libdir} -lmupdf
++Libs.private: -lmupdf-js-none
++Cflags: -I${includedir}
+--- /dev/null
++++ ./platform/debian/mupdf.xpm
+@@ -0,0 +1,497 @@
++/* XPM */
++static char *mupdf[] = {
++/* width height ncolors chars_per_pixel */
++"48 48 442 2",
++/* colors */
++"   c #000000",
++" . c #2E4558",
++" X c #252121",
++" o c #AFAFAF",
++" O c #28313B",
++" + c #231F1F",
++" @ c #686666",
++" # c #98BDD7",
++" $ c #201B1C",
++" % c #7CABCC",
++" & c #4487B6",
++" * c #DFDEDE",
++" = c #4285B4",
++" - c #615E5F",
++" ; c #605E5E",
++" : c #23262C",
++" > c #D9D8D8",
++" , c #F7FAFC",
++" < c #D7D6D6",
++" 1 c #BFD6E6",
++" 2 c #6BA0C5",
++" 3 c #232122",
++" 4 c #555253",
++" 5 c #CDCCCC",
++" 6 c #E7EFF6",
++" 7 c #4786B2",
++" 8 c #CADDEA",
++" 9 c #4085B5",
++" 0 c #AECBDF",
++" q c #CBCACA",
++" w c #92B9D4",
++" e c #365F7D",
++" r c #5A95BE",
++" t c #3E83B3",
++" y c #304B60",
++" u c #C7C6C6",
++" i c #4D8EBB",
++" p c #F1F6F9",
++" a c #C1C0C0",
++" s c #454243",
++" d c #669CC3",
++" f c #81AECD",
++" g c #7A7777",
++" h c #434041",
++" j c #3E779F",
++" k c #272E36",
++" l c #413E3F",
++" z c #3F3C3D",
++" x c #5895BF",
++" c c #3D3A3B",
++" v c #C6DBE9",
++" b c #B8B6B7",
++" n c #4282B0",
++" m c #FDFDFE",
++" M c #B7B6B6",
++" N c #8DB5D2",
++" B c #242529",
++" V c #B3B2B2",
++" C c #222327",
++" Z c #B0AEAF",
++" A c #EDF4F8",
++" S c #686565",
++" D c #488AB9",
++" F c #9ABED8",
++" G c #7EACCD",
++" H c #ECF2F7",
++" J c #211C1C",
++" K c #666363",
++" L c #F1F1F2",
++" P c #ABAAAA",
++" I c #4588B6",
++" U c #A9A8A8",
++" Y c #2D2A2B",
++" T c #A7A6A6",
++" R c #615D5E",
++" E c #2B2829",
++" W c #8DB7D5",
++" Q c #F9FBFD",
++" ! c #DDE9F2",
++" ~ c #F8FBFC",
++" ^ c #DCE9F1",
++" / c #A5C5DC",
++" ( c #89B3D1",
++" ) c #5C5959",
++" _ c #A4C5DB",
++" ` c #335A76",
++" ' c #518FBB",
++" ] c #E6E7E7",
++" [ c #5A5757",
++" { c #232021",
++" } c #33536C",
++" | c #98BED9",
++".  c #E0E1E1",
++".. c #7CACCE",
++".X c #4488B8",
++".o c #2D3F4F",
++".O c #999898",
++".+ c #4388B7",
++".@ c #5E98C1",
++".# c #CDCDCB",
++".$ c #524F4F",
++".% c #B0CCE0",
++".& c #979696",
++".* c #78A8CA",
++".= c #5C96BF",
++".- c #969495",
++".; c #4084B4",
++".: c #252930",
++".> c #949293",
++"., c #929091",
++".< c #417FAB",
++".1 c #4F8FBC",
++".2 c #F3F7FA",
++".3 c #D3D3D4",
++".4 c #D7E5EF",
++".5 c #222023",
++".6 c #9FC1D9",
++".7 c #679DC3",
++".8 c #37678A",
++".9 c #4B8BB8",
++".0 c #3E769E",
++".q c #3C749C",
++".w c #403D3D",
++".e c #92BAD6",
++".r c #C8DCEA",
++".t c #FEFEFE",
++".y c #3D393A",
++".u c #3B3738",
++".i c #355974",
++".p c #353132",
++".a c #7A7879",
++".s c #498BB9",
++".d c #9BBFD8",
++".f c #4E8AB4",
++".g c #787677",
++".h c #F2F2F2",
++".j c #F0F0F0",
++".k c #2F2B2C",
++".l c #EEEEEE",
++".z c #727071",
++".x c #26282D",
++".c c #ECECEC",
++".v c #2B2728",
++".b c #FAFCFD",
++".n c #EAEAEA",
++".m c #DEEAF2",
++".M c #E9EAE9",
++".N c #C2D8E7",
++".B c #6E6C6D",
++".V c #5390BC",
++".C c #E8E8E8",
++".Z c #6EA2C6",
++".A c #272324",
++".S c #E7E6E7",
++".D c #E6E6E6",
++".F c #252122",
++".G c #29333D",
++".H c #E4E4E4",
++".J c #3F7AA5",
++".K c #231F20",
++".L c #E2E2E2",
++".P c #211D1E",
++".I c #E0E0E0",
++".U c #EAF1F7",
++".Y c #6099C2",
++".T c #1F1B1C",
++".R c #E9F1F6",
++".E c #CDDFEB",
++".W c #4387B6",
++".Q c #96BBD6",
++".! c #B1CDE0",
++".~ c #DEDEDE",
++".^ c #79A9CA",
++"./ c #4285B5",
++".( c #272A31",
++".) c #5D97BF",
++"._ c #4185B4",
++".` c #DCDCDC",
++".' c #959393",
++".] c #DADADA",
++".[ c #314B5F",
++".{ c #D8D8D8",
++".} c #D7D8D7",
++".| c #D6D6D6",
++"X  c #F5F8FB",
++"X. c #D4D4D4",
++"XX c #6AA0C5",
++"Xo c #BDD4E5",
++"XO c #3A6A8C",
++"X+ c #232123",
++"X@ c #D3D4D3",
++"X# c #D2D2D2",
++"X$ c #D0D0D0",
++"X% c #CECECE",
++"X& c #CCCCCC",
++"X* c #CADDEB",
++"X= c #37617F",
++"X- c #242A31",
++"X; c #CACACA",
++"X: c #C8DBE9",
++"X> c #90B7D3",
++"X, c #817F7F",
++"X< c #3F7EAB",
++"X1 c #548FB9",
++"X2 c #355873",
++"X3 c #7D7B7B",
++"X4 c #C2C2C2",
++"X5 c #4B8CBA",
++"X6 c #C0C0C0",
++"X7 c #D4E4EE",
++"X8 c #81AECE",
++"X9 c #659CC3",
++"X0 c #787576",
++"Xq c #4788B6",
++"Xw c #252C35",
++"Xe c #757373",
++"Xr c #BABABA",
++"Xt c #FCFDFE",
++"Xy c #B6B6B6",
++"Xu c #C4D9E8",
++"Xi c #706D6E",
++"Xp c #8CB5D2",
++"Xa c #70A3C7",
++"Xs c #8BB5D1",
++"Xd c #5491BC",
++"Xf c #5391BB",
++"Xg c #282424",
++"Xh c #272223",
++"Xj c #6C696A",
++"Xk c #2F4659",
++"Xl c #6B6969",
++"Xz c #407BA5",
++"Xx c #6A6768",
++"Xc c #E4E3E3",
++"Xv c #3E79A3",
++"Xb c #231E1F",
++"Xn c #221E1E",
++"Xm c #E2E1E1",
++"XM c #211C1D",
++"XN c #EBF2F7",
++"XB c #201C1C",
++"XV c #CFE0EC",
++"XC c #4588B7",
++"XZ c #B3CEE1",
++"XA c #366384",
++"XS c #5F98C0",
++"XD c #4386B5",
++"XF c #DEDDDD",
++"XG c #2B3D4B",
++"XH c #615F5F",
++"XJ c #5F5D5D",
++"XK c #5E5B5C",
++"XL c #DCE9F2",
++"XP c #407DA8",
++"XI c #86B1CF",
++"XU c #D4D3D3",
++"XY c #3A698B",
++"XT c #3E7BA6",
++"XR c #232022",
++"XE c #545152",
++"XW c #999899",
++"XQ c #79AACC",
++"X! c #524F50",
++"X~ c #CCCDCB",
++"X^ c #3D749B",
++"X/ c #93BAD5",
++"X( c #77A8CA",
++"X) c #37607E",
++"X_ c #5B96BF",
++"X` c #3F84B4",
++"X' c #CAC9C9",
++"X] c #C6C5C5",
++"X[ c #3F7DAA",
++"X{ c #F2F7FA",
++"X} c #C2C1C1",
++"X| c #212023",
++"o  c #9EC1D9",
++"o. c #444142",
++"oX c #3F78A0",
++"oo c #90B8D5",
++"oO c #FEFEFF",
++"o+ c #E2ECF4",
++"o@ c #2B3A47",
++"o# c #25262A",
++"o$ c #B1AFB0",
++"o% c #28313A",
++"o& c #221D1D",
++"o* c #262F38",
++"o= c #629BC2",
++"o- c #302D2E",
++"o; c #6199C1",
++"o: c #201B1B",
++"o> c #4587B6",
++"o, c #F0F0F1",
++"o< c #2D3E4C",
++"o1 c #2E2B2C",
++"o2 c #4385B4",
++"o3 c #A8A7A7",
++"o4 c #A7A5A6",
++"o5 c #3D7197",
++"o6 c #4183B2",
++"o7 c #4083B1",
++"o8 c #A5A3A4",
++"o9 c #3B6F95",
++"o0 c #5290BC",
++"oq c #A4C4DB",
++"ow c #E9F1F7",
++"oe c #4387B7",
++"or c #E7EFF5",
++"ot c #CBDDEA",
++"oy c #4185B5",
++"ou c #5B95BE",
++"oi c #3F83B3",
++"op c #939192",
++"oa c #929191",
++"os c #2B3743",
++"od c #4C4849",
++"of c #2A3742",
++"og c #F4F8FB",
++"oh c #D8E6F0",
++"oj c #4C8CB9",
++"ok c #211F22",
++"ol c #CFD0D0",
++"oz c #444041",
++"ox c #262C34",
++"oc c #413E3E",
++"ov c #403C3D",
++"ob c #3B739B",
++"on c #858384",
++"om c #FFFFFF",
++"oM c #E3EDF4",
++"oN c #5995BF",
++"oB c #3E3A3B",
++"oV c #C7DBE9",
++"oC c #2F4B61",
++"oZ c #5793BD",
++"oA c #3C3839",
++"oS c #2A3945",
++"oD c #7E7D7D",
++"oF c #345873",
++"oG c #363233",
++"oH c #7B797A",
++"oJ c #EFF4F9",
++"oK c #EEF4F8",
++"oL c #F3F3F3",
++"oP c #9ABED7",
++"oI c #4788B7",
++"oU c #629AC1",
++"oY c #ACAAAA",
++"oT c #F1F1F1",
++"oR c #EFEFEF",
++"oE c #737172",
++"oW c #EDEDED",
++"oQ c #A9C9DF",
++"o! c #FBFDFE",
++"o~ c #EBEBEB",
++"o^ c #DFEBF3",
++"o/ c #4581AB",
++"o( c #6F6D6E",
++"o) c #EAE9EA",
++"o_ c #E9E9E9",
++"o` c #C1D7E6",
++"o' c #E7E7E7",
++"o] c #E6E7E6",
++"o[ c #E5E5E5",
++"o{ c #3F7BA5",
++"o} c #242021",
++"o| c #E3E3E3",
++"O  c #3E79A4",
++"O. c #221E1F",
++"OX c #26303A",
++"Oo c #9C9A9A",
++"OO c #E1E1E1",
++"O+ c #201C1D",
++"O@ c #4488B7",
++"O# c #DFDFDF",
++"O$ c #7BAACC",
++"O% c #356384",
++"O& c #1E1A1B",
++"O* c #4386B6",
++"O= c #4286B5",
++"O- c #95BAD5",
++"O; c #DDDDDD",
++"O: c #1C1819",
++"O> c #DBDBDB",
++"O, c #D9D9D9",
++"O< c #D7D7D7",
++"O1 c #417FAA",
++"O2 c #DAE7F1",
++"O3 c #F5F9FB",
++"O4 c #D5D5D5",
++"O5 c #242224",
++"O6 c #D4D3D4",
++"O7 c #85B1CF",
++"O8 c #D3D3D3",
++"O9 c #699FC4",
++"O0 c #4D8DB9",
++"Oq c #222022",
++"Ow c #34556F",
++"Oe c #D1D1D1",
++"Or c #D0CFD0",
++"Ot c #8A8888",
++"Oy c #CFCFCF",
++"Ou c #CDCDCD",
++"Oi c #CCCDCC",
++"Op c #CADEEB",
++"Oa c #E5EEF5",
++"Os c #C9DCEA",
++"Od c #ADCADF",
++"Of c #C8DCE9",
++"Og c #91B8D4",
++"Oh c #5994BE",
++"Oj c #3D82B3",
++"Ok c #5894BD",
++"Ol c #3C82B2",
++"Oz c #4181AD",
++"Ox c #3B3737",
++"Oc c #C5C5C5",
++"Ov c #293643",
++"Ob c #3E7DAA",
++"On c #C1C1C1",
++"Om c #353131",
++"OM c #D4E3EE",
++"ON c #B8D1E3",
++"OB c #BFBFBF",
++"OV c #9CBFD8",
++"OC c #80ADCD",
++"OZ c #649BC2",
++"OA c #4889B7",
++"OS c #BDBDBD",
++"OD c #2E292A",
++"OF c #4283B1",
++"OG c #B7B7B7",
++"OH c #4183B0",
++"OJ c #5794BF",
++"OK c #A7C6DC",
++"OL c #365B77",
++"OP c #8BB4D1",
++"OI c #282324",
++"OU c #272323",
++"OY c #6C6A6A",
++"OT c None",
++/* pixels */
++"  oToToToT L.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h LoToToToT  ",
++"o,.joToToToToToToToToToToToToToToToToToToToT.h.h.h.hoToToToToToToToToToToToToToToToToToToToT.j.j",
++".j.j.j.j.j.j.j.j.j.j.j.j.j.j.j.j.joToLoLoR.D.~ > >.~.DoRoLoLoT.j.j.j.j.j.j.j.j.j.j.j.j.j.j.j.j.j",
++"oRoRoRoRoRoRoRoRoRoRoRoRoRoRoRoT.hXcOBoaXjX!oz c cozX!XjoaOBXc.hoToRoRoRoRoRoRoRoRoRoRoRoRoRoRoR",
++".l.l.l.l.l.l.l.l.l.l.l.l.loR.j <.'X! Y.P.To: $ J J $o:.T.P YX!.' <.joR.l.l.l.l.l.l.l.l.l.l.l.l.l",
++".l.l.l.l.l.l.l.l.l.l.l.l.jXm.&oz + $o& 3.x OoSXGXGoS O.x 3o& $ +oz.&Xm.j.l.l.l.l.l.l.l.l.l.l.l.l",
++"oWoWoWoWoWoWoWoWoWoWoWoR uXK X $XRo% yXA.qo/.fX1X1.fo/.qXA yo%XR $ XXK uoRoWoWoWoWoWoWoWoWoWoWoW",
++".c.c.c.c.c.c.c.c.c.coW Z z $ {os eXTo0..oQX*XLoMoMXLOpoQ..o0XT eos { $ z ZoW.c.c.c.c.c.c.c.c.c.c",
++"o~o~o~o~o~o~o~o~o~.co3.p $.(X2X[OJ FOM !Of 0.d wOg.d 0Os.mOM FOJObX2.( $.po3.co~o~o~o~o~o~o~o~o~",
++".n.n.n.n.n.n.n.noW VoGXMoso9XC G.N.!.^XfXD tOjOlOlOj tXDXd.^.% 1O$O@o9osXMoG VoW.n.n.n.n.n.n.n.n",
++".n.n.n.n.n.n.n.c qo.XBo<XvX5 No oUO0 fOPXpXpXpXpXpXpXpXpOP ( NOdo^OV.sXvo<XBo. q.c.n.n.n.n.n.n.n",
++"o_o_o_o_o_o_.M.L @ $o@o{.s.^.Z & t.* ~omomomomomomomomomomomom.toO.b _ D.Jo@ $ @.Lo)o_o_o_o_o_o_",
++".C.C.C.C.C.Co~o8Xg kX^oeoZXf._XDXD 0omomomomomomomomomomomomomomomom.b #XCX^ kXgo8o~.C.C.C.C.C.C",
++"o'o'o'o'o'.CO>.$okX=oeXDo>O=XD./Xd.momomomomomomomomomomomomomom pX7.NOK 'oeX=ok.$O>.Co'o'o'o'o'",
++" ]o'o'o'.So_ TXh.o nXDXDXDXDXD.; %.bomomomomomomomomomomomomoOo`O9ojo>XDXDXD n.oXh To_ ]o'o'o'.S",
++".D.D.D.D.Do| SX|XY.+XDXDXDXDXDXDXZomomomomomomomomomomomomom.4Xd.;O=XDXDXDXD.+XYX| So|.D.D.D.D.D",
++"o[o[o[o[.D 5OxOvOzO*XDXDXDXD =oZo+omomomomomomomomomomomomomoP.;XDXDXDXDXDXDO*OzOvOx 5o]o[o[o[o[",
++".H.H.H.Ho' POU }oeXDXDXDXDXD.;X8o!omomomomomomomomomomomom.bX(.;XDXDXDXDXDXDXDoe }OU Po'.H.H.H.H",
++"o|o|o|o|.DOt.5XO.+XDXDXDXDXD &ONomomomomomomomomomomomomom.2.7._XDXDXDXDXDXDXD.+XO.5Ot.Do|o|o|o|",
++"o|o|o|o|o|Xi : j.WXDXDXDXD = rOaomomomomomomomomomomomomom AXS._XDXDXDXDXDXDXD.W j :Xio|o|o|o|o|",
++".L.L.L.L.I RXwXP.WXDXDXDXD.;XI momomomomomomomomomomomomomXN.=._XDXDXDXDXDXDXD.WXPXw R.I.L.L.L.L",
++"OOOOOOOOO; [OX.<O*XDXDXDXD IXoomomomomomomomomomomomomomom.UX_._XDXDXDXDXDXDXDO*.<OX [O;OOOOOOOO",
++".I.I.I.IO; )o*O1O*XDXDXD._.).Romomomomomog ~omomomomomomom.UX_._XDXDXDXDXDXDXDO*O1o* )O;.I.I.I.I",
++"O#O#O#O#O# KX-Xz.WXDXDXD.;XsoOomomomomom vowomomomomomomom.UX_._XDXDXDXDXDXDXD.WXzX- KO#O#O#O#O#",
++"O#O#O#O#.  g Co5oeXDXDXDXq.Nomomomomom ,X>oromomomomomomom.UX_._XDXDXDXDXDXDXDoeo5 C gOOO#O#O#O#",
++".~.~.~.~OO.- {X).XXDXD._o; HomomomomomohO9.Romomomomomomom.UX_._XDXDXDXDXDXDXD.XX) {.-OO.~.~.~.~",
++"O;O;O;O;O#XyOD .o2XDXD.;Ogomomomomomom / r.Uomomomomomomom.UX_._XDXDXDXDXDXDXDo2 .ODXyO#O;O;O;O;",
++".`.`.`.`O;Oeod.:oX.WXDOAoVomomomomomO3XaOk.Uomomomomomomom.UX_._XDXDXDXDXDXD.WoX.:odOeO;.`.`.`.`",
++"O>O>O>O>O>O;X,.POw.W._ doJomomomomomOMoj r.Uomomomomomomom.UX_._XDXDXDXDXDXD.WOw.PX,O;O>O>O>O>O>",
++"O>O>O>O>O>O;XrOmox.0 9X8Xtomomomomom.6X`ou.Uomomomomomomom.UX_._XDXDXDXDXDoe.0oxOmXrO;O>O>O>O>O>",
++".].].].].].]O,.z JXkOH.VotomomomomX{ 2oiou.Uomomomomomomom.UX_._XDO= &O0 &OFXk J.zO,.].].].].].]",
++"O,O,O,O,O,O,O>OS.yOq.i._OZ ^omomom.E.9._ou.Uomomomomomomom.UX_._._.9.ZXdO=.iOq.yOSO>O,O,O,O,O,O,",
++".{.{.{.{.{.{.{.].,.A BX)oyXXO2omom.Q.;._ou.Uomomomomomomom.UOh._ dO-X9O=X) BOI.,.].{.{.{.{.{.{.{",
++"O<O<O<O<O<O<O<.{O8o(Xno#OLo7.YXuX O7oIoiOk.Romomomomomomom HOCoqOdo=o6OLo#Xno(O8.{O<O<O<O<O<O<O<",
++"O<O<O<O<O<O<O<O<.{X'XJ.PO5.[O  iOgXVX:OVXsoKomomomomomomom.bOMX/.1O .[O5.PXJX'.{O<O<O<O<O<O<O<O<",
++".|.|.|.|.|.|.|.|.|.}X]XH.KXn.G eX<oN.e 8 6 Qomomomom.bXN.roo xX< e.GXn.KXHX].}.|.|.|.|.|.|.|.|.|",
++"O4O4O4O4O4O4O4O4O4O4O<X;Xe.vXBX+ofoFob 7.@XQ W | | WXQ.@ 7oboFofX+XB.vXeX;O<O4O4O4O4O4O4O4O4O4O4",
++"X.X.X.X.X.X.X.X.X.X.X.O4X#XW sO. J.K.xo@oC `O%.8.8O% `oCo@.x.K JO. sXWX#O4X.X.X.X.X.X.X.X.X.X.X.",
++"O8O8O8O6O8XUXUO8O8XUXUO8X..|OnX,oc.F $ Jo&XbXRO5O5XRXbo& J $.FocX,On.|X.O8XUX@X@O8.3O8O8O8O8O8X@",
++"O8O8O8O8O8O8O8O8O8O8O8O8O8O8X.X. aop ; c Eo}.PXMXM.Po} E c ;op aX.X.O8O8O8O8O8O8O8O8O8O8O8O8O8O8",
++"X#X#X#X#X#X#X#X#X#X#X#X#X#X#X#X#O8O4X$X6 P.-onX3X3on.- PX6X$O4O8X#X#X#X#X#X#X#X#X#X#X#X#X#X#X#X#",
++"OeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOeO8X4OGOnOcOcX} MOSX#OeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOeOe",
++"X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$O8ono-oAov.w.u.koEX#X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$X$",
++"X$X$X$X$X$X$X$X$X$olX$X$X$X$X$X$X$X$X$X#oD l.>o1O+.P.T.BOeX$X$X$X$X$X$X$OrOrX$X$X$X$X$X$X$X$X$X$",
++"OyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOyX#oHXEXFoBO&.TO:OYX$OyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOyOy",
++"X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%Oy POo.CX0 -Xx.g TOyX%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%",
++"X%X%OuOuOuOuOuOuOuOuOuOuOuOuOuOuOuOuOuX% oo$.h boYo4.O UX%OuOuOuOuOuOuOuOuOuOuOuOuOuOuOuOuOuX%X%",
++"  Ou.#OuOuOiX&X&X&X&X&X&X&X&X&X&X&X&X&Oy.a 4 * h.K.KO&XlX%X&X&X&X&X&X&X&X&X&X&X&X&X&X&OuOuX~Ou  "
++};

diff --git a/app-text/mupdf/mupdf-1.10a.ebuild b/app-text/mupdf/mupdf-1.10a.ebuild
new file mode 100644
index 00000000..a7f446e
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.10a.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="http://mupdf.com/"
+SRC_URI="http://mupdf.com/downloads/${P}-source.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="X +curl javascript libressl opengl +openssl static static-libs vanilla"
+
+LIB_DEPEND="
+	!libressl? ( dev-libs/openssl:0[static-libs?] )
+	libressl? ( dev-libs/libressl[static-libs?] )
+	javascript? ( >=dev-lang/mujs-0_p20160504 )
+	media-libs/freetype:2[static-libs?]
+	media-libs/harfbuzz[static-libs?]
+	media-libs/jbig2dec[static-libs?]
+	media-libs/libpng:0[static-libs?]
+	media-libs/openjpeg:2[static-libs?]
+	net-misc/curl[static-libs?]
+	virtual/jpeg[static-libs?]
+	X? ( x11-libs/libX11[static-libs?]
+		x11-libs/libXext[static-libs?] )
+	opengl? ( >=media-libs/glfw-3 )"
+RDEPEND="${LIB_DEPEND}"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	static-libs? ( ${LIB_DEPEND} )
+	static? ( ${LIB_DEPEND//?}
+		app-arch/bzip2[static-libs]
+		x11-libs/libXau[static-libs]
+		x11-libs/libXdmcp[static-libs]
+		x11-libs/libxcb[static-libs] )"
+
+REQUIRED_USE="opengl? ( X !static !static-libs )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+		"${FILESDIR}"/${PN}-1.9a-CFLAGS.patch \
+		"${FILESDIR}"/${PN}-1.9a-debug-build.patch \
+		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+		"${FILESDIR}"/${PN}-1.10a-Makerules-openssl-curl.patch \
+		"${FILESDIR}"/${PN}-1.8-system-glfw.patch
+)
+
+src_prepare() {
+	default
+	use hppa && append-cflags -ffunction-sections
+
+	rm -rf thirdparty || die
+
+	if has_version ">=media-libs/openjpeg-2.1:2" ; then
+		# Remove a switch, which prevents using shared libraries for openjpeg2.
+		# See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
+		sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
+	fi
+
+	use javascript || \
+		sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
+			-i include/mupdf/fitz/config.h
+
+	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
+		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
+		-i platform/debian/${PN}.pc || die
+
+	use vanilla || eapply \
+		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iLD = $(tc-getCC)" \
+		-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}" \
+		-e "1iHAVE_X11 = $(usex X)" \
+		-e "1iWANT_OPENSSL = $(usex openssl)" \
+		-e "1iWANT_CURL = $(usex curl)" \
+		-e "1iHAVE_MUJS = $(usex javascript)" \
+		-e "1iMUJS_LIBS = $(usex javascript -lmujs '')" \
+		-e "1iMUJS_CFLAGS =" \
+		-e "1iHAVE_GLFW = $(usex opengl yes no)" \
+		-i Makerules || die
+
+	if use static-libs || use static ; then
+		cp -a "${S}" "${S}"-static || die
+		#add missing Libs.private for xcb and freetype
+		sed -e 's:\(pkg-config --libs\):\1 --static:' \
+		    -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
+		    -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
+			-i "${S}"-static/Makerules || die
+	fi
+
+	my_soname=libmupdf.so.${PV}
+	my_soname_js_none=libmupdf-js-none.so.${PV}
+	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
+		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
+		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
+		-e "/install/s: COPYING : :" \
+		-i Makefile || die
+}
+
+src_compile() {
+	emake XCFLAGS="-fpic"
+	use static-libs && \
+		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
+	use static && \
+		emake -C "${S}"-static XLIBS="-static"
+}
+
+src_install() {
+	if use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon platform/debian/${PN}.xpm
+	else
+		rm docs/man/${PN}.1
+	fi
+
+	emake install
+	dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
+
+	use static-libs && \
+		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
+	if use static ; then
+		dobin "${S}"-static/build/debug/mu{tool,draw}
+		use X && dobin "${S}"-static/build/debug/${PN}-x11
+	fi
+	use X && dosym ${PN}-x11 /usr/bin/${PN}
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README docs/*.{txt,c}
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2017-02-09 21:10 Michael Weber
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Weber @ 2017-02-09 21:10 UTC (permalink / raw
  To: gentoo-commits

commit:     54f3dbbee64dfa9de3193a16daa5ff254d4963b2
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 21:10:20 2017 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 21:10:20 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54f3dbbe

app-text/mupdf: Revbump to fix null pointer dereference (bug 608702) and heap overflow (bug 608712).

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../mupdf/files/mupdf-1.10a-heap-overflow.patch    |  40 ++++++
 .../mupdf/files/mupdf-1.10a-null-pointer.patch     |  21 +++
 app-text/mupdf/mupdf-1.10a-r1.ebuild               | 148 +++++++++++++++++++++
 3 files changed, 209 insertions(+)

diff --git a/app-text/mupdf/files/mupdf-1.10a-heap-overflow.patch b/app-text/mupdf/files/mupdf-1.10a-heap-overflow.patch
new file mode 100644
index 0000000000..8b350ea859
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.10a-heap-overflow.patch
@@ -0,0 +1,40 @@
+X-Git-Url: http://git.ghostscript.com/?p=mupdf.git;a=blobdiff_plain;f=source%2Ffitz%2Fpixmap.c;h=f1291dc29d49ead44c10785fd014a0d995e45a91;hp=a8317127da7af6d39eb86fe3ca02cb4106a9b262;hb=2c4e5867ee699b1081527bc6c6ea0e99a35a5c27;hpb=90fa6203ad032fe161d85a3e580941ce3d1216f0
+
+diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c
+index a831712..f1291dc 100644
+--- a/source/fitz/pixmap.c
++++ b/source/fitz/pixmap.c
+@@ -1104,6 +1104,7 @@ fz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor,
+ 	"@STACK:r1,<9>,factor,n,fwd,back,back2,fwd2,divX,back4,fwd4,fwd3,divY,back5,divXY\n"
+ 	"ldr	r4, [r13,#4*22]		@ r4 = divXY			\n"
+ 	"ldr	r5, [r13,#4*11]		@ for (nn = n; nn > 0; n--) {	\n"
++	"ldr	r8, [r13,#4*17]		@ r8 = back4			\n"
+ 	"18:				@				\n"
+ 	"mov	r14,#0			@ r14= v = 0			\n"
+ 	"sub	r5, r5, r1, LSL #8	@ for (xx = x; xx > 0; x--) {	\n"
+@@ -1120,7 +1121,7 @@ fz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor,
+ 	"mul	r14,r4, r14		@ r14= v *= divX		\n"
+ 	"mov	r14,r14,LSR #16		@ r14= v >>= 16			\n"
+ 	"strb	r14,[r9], #1		@ *d++ = r14			\n"
+-	"sub	r0, r0, r8		@ s -= back2			\n"
++	"sub	r0, r0, r8		@ s -= back4			\n"
+ 	"subs	r5, r5, #1		@ n--				\n"
+ 	"bgt	18b			@ }				\n"
+ 	"21:				@				\n"
+@@ -1249,6 +1250,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor)
+ 		x += f;
+ 		if (x > 0)
+ 		{
++			int back4 = x * n - 1;
+ 			div = x * y;
+ 			for (nn = n; nn > 0; nn--)
+ 			{
+@@ -1263,7 +1265,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor)
+ 					s -= back5;
+ 				}
+ 				*d++ = v / div;
+-				s -= back2;
++				s -= back4;
+ 			}
+ 		}
+ 	}

diff --git a/app-text/mupdf/files/mupdf-1.10a-null-pointer.patch b/app-text/mupdf/files/mupdf-1.10a-null-pointer.patch
new file mode 100644
index 0000000000..9a459b2801
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.10a-null-pointer.patch
@@ -0,0 +1,21 @@
+From: Sebastian Rasmussen <sebras@gmail.com>
+Date: Sat, 4 Feb 2017 05:21:20 +0000 (+0100)
+Subject: Bug 697514: Write SVG output to stdout if no output specified.
+X-Git-Url: http://git.ghostscript.com/?p=mupdf.git;a=commitdiff_plain;h=40ac85bfb676bb4373bda4b18f9fd90268c9f1e9
+
+Bug 697514: Write SVG output to stdout if no output specified.
+---
+
+diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
+index 95b3440..720e7ff 100644
+--- a/source/tools/mudraw.c
++++ b/source/tools/mudraw.c
+@@ -578,7 +578,7 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in
+ 		char buf[512];
+ 		fz_output *out;
+ 
+-		if (!strcmp(output, "-"))
++		if (!output || !strcmp(output, "-"))
+ 			out = fz_stdout(ctx);
+ 		else
+ 		{

diff --git a/app-text/mupdf/mupdf-1.10a-r1.ebuild b/app-text/mupdf/mupdf-1.10a-r1.ebuild
new file mode 100644
index 0000000000..fb40d437d1
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.10a-r1.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="http://mupdf.com/"
+SRC_URI="http://mupdf.com/downloads/${P}-source.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="X +curl javascript libressl opengl +openssl static static-libs vanilla"
+
+LIB_DEPEND="
+	!libressl? ( dev-libs/openssl:0[static-libs?] )
+	libressl? ( dev-libs/libressl[static-libs?] )
+	javascript? ( >=dev-lang/mujs-0_p20160504 )
+	media-libs/freetype:2[static-libs?]
+	media-libs/harfbuzz[static-libs?]
+	media-libs/jbig2dec[static-libs?]
+	media-libs/libpng:0[static-libs?]
+	>=media-libs/openjpeg-2.1:2[static-libs?]
+	net-misc/curl[static-libs?]
+	virtual/jpeg[static-libs?]
+	X? ( x11-libs/libX11[static-libs?]
+		x11-libs/libXext[static-libs?] )
+	opengl? ( >=media-libs/glfw-3 )"
+RDEPEND="${LIB_DEPEND}"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	static-libs? ( ${LIB_DEPEND} )
+	static? ( ${LIB_DEPEND//?}
+		app-arch/bzip2[static-libs]
+		x11-libs/libXau[static-libs]
+		x11-libs/libXdmcp[static-libs]
+		x11-libs/libxcb[static-libs] )"
+
+REQUIRED_USE="opengl? ( X !static !static-libs )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+		"${FILESDIR}"/${PN}-1.9a-CFLAGS.patch
+		"${FILESDIR}"/${PN}-1.9a-debug-build.patch
+		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+		"${FILESDIR}"/${PN}-1.10a-Makerules-openssl-curl.patch
+		"${FILESDIR}"/${PN}-1.8-system-glfw.patch
+		"${FILESDIR}"/${PN}-1.10a-heap-overflow.patch
+		"${FILESDIR}"/${PN}-1.10a-null-pointer.patch
+)
+
+src_prepare() {
+	default
+	use hppa && append-cflags -ffunction-sections
+
+	rm -rf thirdparty || die
+
+	if has_version ">=media-libs/openjpeg-2.1:2" ; then
+		# Remove a switch, which prevents using shared libraries for openjpeg2.
+		# See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
+		sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
+	fi
+
+	use javascript || \
+		sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
+			-i include/mupdf/fitz/config.h
+
+	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
+		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
+		-i platform/debian/${PN}.pc || die
+
+	use vanilla || eapply \
+		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iLD = $(tc-getCC)" \
+		-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}" \
+		-e "1iHAVE_X11 = $(usex X)" \
+		-e "1iWANT_OPENSSL = $(usex openssl)" \
+		-e "1iWANT_CURL = $(usex curl)" \
+		-e "1iHAVE_MUJS = $(usex javascript)" \
+		-e "1iMUJS_LIBS = $(usex javascript -lmujs '')" \
+		-e "1iMUJS_CFLAGS =" \
+		-e "1iHAVE_GLFW = $(usex opengl yes no)" \
+		-i Makerules || die
+
+	if use static-libs || use static ; then
+		cp -a "${S}" "${S}"-static || die
+		#add missing Libs.private for xcb and freetype
+		sed -e 's:\(pkg-config --libs\):\1 --static:' \
+		    -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
+		    -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
+			-i "${S}"-static/Makerules || die
+	fi
+
+	my_soname=libmupdf.so.${PV}
+	my_soname_js_none=libmupdf-js-none.so.${PV}
+	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
+		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
+		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
+		-e "/install/s: COPYING : :" \
+		-i Makefile || die
+}
+
+src_compile() {
+	emake XCFLAGS="-fpic"
+	use static-libs && \
+		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
+	use static && \
+		emake -C "${S}"-static XLIBS="-static"
+}
+
+src_install() {
+	if use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon platform/debian/${PN}.xpm
+	else
+		rm docs/man/${PN}.1
+	fi
+
+	emake install
+	dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
+
+	use static-libs && \
+		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
+	if use static ; then
+		dobin "${S}"-static/build/debug/mu{tool,draw}
+		use X && dobin "${S}"-static/build/debug/${PN}-x11
+	fi
+	use X && dosym ${PN}-x11 /usr/bin/${PN}
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README docs/*.{txt,c}
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2017-03-06 22:12 Michael Weber
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Weber @ 2017-03-06 22:12 UTC (permalink / raw
  To: gentoo-commits

commit:     8231bc27f9ef5caa6f21b3601047797c432adb7c
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  6 22:12:21 2017 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Mon Mar  6 22:12:48 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8231bc27

app-text/mupdf: Revbump with patch for CVE-2017-5991.

Package-Manager: Portage-2.3.4, Repoman-2.3.2

 .../mupdf/files/mupdf-1.10a-null-pointer-2.patch   |  88 ++++++++++++
 app-text/mupdf/mupdf-1.10a-r2.ebuild               | 148 +++++++++++++++++++++
 2 files changed, 236 insertions(+)

diff --git a/app-text/mupdf/files/mupdf-1.10a-null-pointer-2.patch b/app-text/mupdf/files/mupdf-1.10a-null-pointer-2.patch
new file mode 100644
index 00000000000..a4fefb79ca6
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.10a-null-pointer-2.patch
@@ -0,0 +1,88 @@
+From: Robin Watts <robin.watts@artifex.com>
+Date: Thu, 9 Feb 2017 15:49:15 +0000 (+0000)
+Subject: Bug 697500: Fix NULL ptr access.
+X-Git-Url: http://git.ghostscript.com/?p=mupdf.git;a=commitdiff_plain;h=1912de5f08e90af1d9d0a9791f58ba3afdb9d465;hp=2c4e5867ee699b1081527bc6c6ea0e99a35a5c27
+
+Bug 697500: Fix NULL ptr access.
+
+Cope better with errors during rendering - avoid letting the
+gstate stack get out of sync.
+
+This avoids us ever getting into the situation of popping
+a clip when we should be popping a mask or a group. This was
+causing an unexpected case in the painting.
+---
+
+diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c
+index a3ea895..f1eac8d 100644
+--- a/source/pdf/pdf-op-run.c
++++ b/source/pdf/pdf-op-run.c
+@@ -1213,6 +1213,7 @@ pdf_run_xobject(fz_context *ctx, pdf_run_processor *proc, pdf_xobject *xobj, pdf
+ 	pdf_run_processor *pr = (pdf_run_processor *)proc;
+ 	pdf_gstate *gstate = NULL;
+ 	int oldtop = 0;
++	int oldbot = -1;
+ 	fz_matrix local_transform = *transform;
+ 	softmask_save softmask = { NULL };
+ 	int gparent_save;
+@@ -1232,16 +1233,17 @@ pdf_run_xobject(fz_context *ctx, pdf_run_processor *proc, pdf_xobject *xobj, pdf
+ 	fz_var(cleanup_state);
+ 	fz_var(gstate);
+ 	fz_var(oldtop);
++	fz_var(oldbot);
+ 
+ 	gparent_save = pr->gparent;
+ 	pr->gparent = pr->gtop;
++	oldtop = pr->gtop;
+ 
+ 	fz_try(ctx)
+ 	{
+ 		pdf_gsave(ctx, pr);
+ 
+ 		gstate = pr->gstate + pr->gtop;
+-		oldtop = pr->gtop;
+ 
+ 		pdf_xobject_bbox(ctx, xobj, &xobj_bbox);
+ 		pdf_xobject_matrix(ctx, xobj, &xobj_matrix);
+@@ -1302,12 +1304,25 @@ pdf_run_xobject(fz_context *ctx, pdf_run_processor *proc, pdf_xobject *xobj, pdf
+ 
+ 		doc = pdf_get_bound_document(ctx, xobj->obj);
+ 
++		oldbot = pr->gbot;
++		pr->gbot = pr->gtop;
++
+ 		pdf_process_contents(ctx, (pdf_processor*)pr, doc, resources, xobj->obj, NULL);
+ 	}
+ 	fz_always(ctx)
+ 	{
++		/* Undo any gstate mismatches due to the pdf_process_contents call */
++		if (oldbot != -1)
++		{
++			while (pr->gtop > pr->gbot)
++			{
++				pdf_grestore(ctx, pr);
++			}
++			pr->gbot = oldbot;
++		}
++
+ 		if (cleanup_state >= 3)
+-			pdf_grestore(ctx, pr); /* Remove the clippath */
++			pdf_grestore(ctx, pr); /* Remove the state we pushed for the clippath */
+ 
+ 		/* wrap up transparency stacks */
+ 		if (transparency)
+@@ -1341,13 +1356,8 @@ pdf_run_xobject(fz_context *ctx, pdf_run_processor *proc, pdf_xobject *xobj, pdf
+ 		pr->gstate[pr->gparent].ctm = gparent_save_ctm;
+ 		pr->gparent = gparent_save;
+ 
+-		if (gstate)
+-		{
+-			while (oldtop < pr->gtop)
+-				pdf_grestore(ctx, pr);
+-
++		while (oldtop < pr->gtop)
+ 			pdf_grestore(ctx, pr);
+-		}
+ 
+ 		pdf_unmark_obj(ctx, xobj->obj);
+ 	}

diff --git a/app-text/mupdf/mupdf-1.10a-r2.ebuild b/app-text/mupdf/mupdf-1.10a-r2.ebuild
new file mode 100644
index 00000000000..6fb8e5ac911
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.10a-r2.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="http://mupdf.com/"
+SRC_URI="http://mupdf.com/downloads/${P}-source.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="X +curl javascript libressl opengl +openssl static static-libs vanilla"
+
+LIB_DEPEND="
+	!libressl? ( dev-libs/openssl:0[static-libs?] )
+	libressl? ( dev-libs/libressl[static-libs?] )
+	javascript? ( >=dev-lang/mujs-0_p20160504 )
+	media-libs/freetype:2[static-libs?]
+	media-libs/harfbuzz[static-libs?]
+	media-libs/jbig2dec[static-libs?]
+	media-libs/libpng:0[static-libs?]
+	>=media-libs/openjpeg-2.1:2[static-libs?]
+	net-misc/curl[static-libs?]
+	virtual/jpeg[static-libs?]
+	X? ( x11-libs/libX11[static-libs?]
+		x11-libs/libXext[static-libs?] )
+	opengl? ( >=media-libs/glfw-3 )"
+RDEPEND="${LIB_DEPEND}"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	static-libs? ( ${LIB_DEPEND} )
+	static? ( ${LIB_DEPEND//?}
+		app-arch/bzip2[static-libs]
+		x11-libs/libXau[static-libs]
+		x11-libs/libXdmcp[static-libs]
+		x11-libs/libxcb[static-libs] )"
+
+REQUIRED_USE="opengl? ( X !static !static-libs )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+		"${FILESDIR}"/${PN}-1.9a-CFLAGS.patch
+		"${FILESDIR}"/${PN}-1.9a-debug-build.patch
+		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+		"${FILESDIR}"/${PN}-1.10a-Makerules-openssl-curl.patch
+		"${FILESDIR}"/${PN}-1.8-system-glfw.patch
+		"${FILESDIR}"/${PN}-1.10a-heap-overflow.patch
+		"${FILESDIR}"/${PN}-1.10a-null-pointer.patch
+		"${FILESDIR}"/${PN}-1.10a-null-pointer-2.patch
+)
+
+src_prepare() {
+	default
+	use hppa && append-cflags -ffunction-sections
+
+	rm -rf thirdparty || die
+
+	if has_version ">=media-libs/openjpeg-2.1:2" ; then
+		# Remove a switch, which prevents using shared libraries for openjpeg2.
+		# See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
+		sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
+	fi
+
+	use javascript || \
+		sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
+			-i include/mupdf/fitz/config.h
+
+	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
+		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
+		-i platform/debian/${PN}.pc || die
+
+	use vanilla || eapply \
+		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iLD = $(tc-getCC)" \
+		-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}" \
+		-e "1iHAVE_X11 = $(usex X)" \
+		-e "1iWANT_OPENSSL = $(usex openssl)" \
+		-e "1iWANT_CURL = $(usex curl)" \
+		-e "1iHAVE_MUJS = $(usex javascript)" \
+		-e "1iMUJS_LIBS = $(usex javascript -lmujs '')" \
+		-e "1iMUJS_CFLAGS =" \
+		-e "1iHAVE_GLFW = $(usex opengl yes no)" \
+		-i Makerules || die
+
+	if use static-libs || use static ; then
+		cp -a "${S}" "${S}"-static || die
+		#add missing Libs.private for xcb and freetype
+		sed -e 's:\(pkg-config --libs\):\1 --static:' \
+		    -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
+		    -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
+			-i "${S}"-static/Makerules || die
+	fi
+
+	my_soname=libmupdf.so.${PV}
+	my_soname_js_none=libmupdf-js-none.so.${PV}
+	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
+		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
+		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
+		-e "/install/s: COPYING : :" \
+		-i Makefile || die
+}
+
+src_compile() {
+	emake XCFLAGS="-fpic"
+	use static-libs && \
+		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
+	use static && \
+		emake -C "${S}"-static XLIBS="-static"
+}
+
+src_install() {
+	if use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon platform/debian/${PN}.xpm
+	else
+		rm docs/man/${PN}.1
+	fi
+
+	emake install
+	dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
+
+	use static-libs && \
+		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
+	if use static ; then
+		dobin "${S}"-static/build/debug/mu{tool,draw}
+		use X && dobin "${S}"-static/build/debug/${PN}-x11
+	fi
+	use X && dosym ${PN}-x11 /usr/bin/${PN}
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README docs/*.{txt,c}
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2018-01-28  9:53 Michael Weber
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Weber @ 2018-01-28  9:53 UTC (permalink / raw
  To: gentoo-commits

commit:     a4a4dfe71cde92b2eaa38c774d19eeb002d00236
Author:     Michael Weber <xmw <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 28 09:52:34 2018 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Sun Jan 28 09:52:49 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4a4dfe7

app-text/mupdf: Version bump (thanks Hadrien Lacour), add USE=lcms for bundled/modified lcms2.

Closes: https://bugs.gentoo.org/641862
Package-Manager: Portage-2.3.20, Repoman-2.3.6

 app-text/mupdf/Manifest                            |   1 +
 .../files/mupdf-1.11-drop-libmupdfthird.patch      |  11 ++
 app-text/mupdf/files/mupdf-1.12-CFLAGS.patch       |  11 ++
 app-text/mupdf/mupdf-1.12.0.ebuild                 | 160 +++++++++++++++++++++
 4 files changed, 183 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index a0a8c315fa4..1367f972efc 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1 +1,2 @@
 DIST mupdf-1.11-source.tar.gz 40156070 BLAKE2B 2a9991a11355a449b91955bd897b5da175d3a89943277345779ea52c74f57c58226ee4087b23e3f434c0a45ae7a39df95c81c26c55d959f362bd1a0d0216716d SHA512 501670f540e298a8126806ebbd9db8b29866f663b7bbf26c9ade1933e42f0c00ad410b9d93f3ddbfb3e45c38722869095de28d832fe3fb3703c55cc9a01dbf63
+DIST mupdf-1.12.0-source.tar.gz 51508917 BLAKE2B c34df17f0df7a200897d678514ff4012e02b1cef71189fe48740948c88cb544c6ce80f52a5dc335d70002806a7b413e5f79a1edee88865e42daf76e49416d9bf SHA512 11ae620e55e9ebd5844abd7decacc0dafc90dd1f4907ba6ed12f5c725d3920187fc730a7fc33979bf3ff9451da7dbb51f34480a878083e2064f3455555f47d96

diff --git a/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch b/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
index eaf11678868..e5600c00cd8 100644
--- a/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
+++ b/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
@@ -9,3 +9,14 @@
  THREAD_LIB = $(OUT)/libmuthreads.a
  
  MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(SVG_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ)
+--- mupdf-1.12.0-source/Makefile
++++ mupdf-1.12.0-source/Makefile
+@@ -343,7 +343,7 @@
+ 
+ THREAD_OBJ := $(THREAD_OBJ)
+ 
+-$(MUPDF_LIB) : $(MUPDF_OBJ)
++$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_OBJ)
+ $(THIRD_LIB) : $(THIRD_OBJ)
+ $(THREAD_LIB) : $(THREAD_OBJ)
+ 

diff --git a/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch
new file mode 100644
index 00000000000..796d127263a
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch
@@ -0,0 +1,11 @@
+--- mupdf-1.12.0-source/Makerules
++++ mupdf-1.12.0-source/Makerules
+@@ -22,8 +22,6 @@
+ endif
+ 
+ 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/mupdf-1.12.0.ebuild b/app-text/mupdf/mupdf-1.12.0.ebuild
new file mode 100644
index 00000000000..bb542060cd7
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.12.0.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs xdg
+
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="http://mupdf.com/"
+SRC_URI="http://mupdf.com/downloads/${P}-source.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="X +curl javascript lcms libressl opengl +openssl static static-libs vanilla"
+
+LIB_DEPEND="
+	!libressl? ( dev-libs/openssl:0[static-libs?] )
+	libressl? ( dev-libs/libressl[static-libs?] )
+	javascript? ( >=dev-lang/mujs-0_p20160504 )
+	media-libs/freetype:2[static-libs?]
+	media-libs/harfbuzz[static-libs?]
+	media-libs/jbig2dec[static-libs?]
+	media-libs/libpng:0[static-libs?]
+	>=media-libs/openjpeg-2.1:2[static-libs?]
+	net-misc/curl[static-libs?]
+	virtual/jpeg[static-libs?]
+	X? ( x11-libs/libX11[static-libs?]
+		x11-libs/libXext[static-libs?] )
+	opengl? ( >=media-libs/glfw-3.2 )"
+RDEPEND="${LIB_DEPEND}"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	static-libs? ( ${LIB_DEPEND} )
+	static? ( ${LIB_DEPEND//?}
+		app-arch/bzip2[static-libs]
+		x11-libs/libXau[static-libs]
+		x11-libs/libXdmcp[static-libs]
+		x11-libs/libxcb[static-libs] )"
+
+REQUIRED_USE="opengl? ( !static !static-libs )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+		"${FILESDIR}"/${PN}-1.12-CFLAGS.patch
+		"${FILESDIR}"/${PN}-1.9a-debug-build.patch
+		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+		"${FILESDIR}"/${PN}-1.11-openssl-curl-x11.patch
+		"${FILESDIR}"/${PN}-1.11-system-glfw.patch
+		"${FILESDIR}"/${PN}-1.11-drop-libmupdfthird.patch
+)
+
+src_prepare() {
+	xdg_src_prepare
+	use hppa && append-cflags -ffunction-sections
+
+	# specialized lcms2, keep it if wanted inside lubmupdfthird
+	if ! use lcms ; then
+		rm -rf thirdparty/lcms2
+	fi
+
+	rm -rf thirdparty/{README,curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,mujs,openjpeg,zlib} || die
+	for my_third in thirdparty/* ; do
+		ewarn "Bundled thirdparty lib: ${my_third}"
+	done
+
+	if has_version ">=media-libs/openjpeg-2.1:2" ; then
+		# Remove a switch, which prevents using shared libraries for openjpeg2.
+		# See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
+		sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
+	fi
+
+	use javascript || \
+		sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
+			-i include/mupdf/fitz/config.h
+
+	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
+		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
+		-i platform/debian/${PN}.pc || die
+
+	use vanilla || eapply \
+		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iLD = $(tc-getCC)" \
+		-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}" \
+		-e "1iWANT_X11 = $(usex X)" \
+		-e "1iWANT_OPENSSL = $(usex openssl)" \
+		-e "1iWANT_CURL = $(usex curl)" \
+		-e "1iHAVE_MUJS = $(usex javascript)" \
+		-e "1iMUJS_LIBS = $(usex javascript -lmujs '')" \
+		-e "1iMUJS_CFLAGS =" \
+		-e "1iHAVE_GLFW = $(usex opengl yes no)" \
+		-i Makerules || die
+
+	if use static-libs || use static ; then
+		cp -a "${S}" "${S}"-static || die
+		#add missing Libs.private for xcb and freetype
+		sed -e 's:\(pkg-config --libs\):\1 --static:' \
+		    -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
+		    -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
+			-i "${S}"-static/Makerules || die
+	fi
+
+	my_soname=libmupdf.so.${PV}
+	my_soname_js_none=libmupdf-js-none.so.${PV}
+	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
+		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
+		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
+		-e "/install/s: COPYING : :" \
+		-i Makefile || die
+}
+
+src_compile() {
+	use lcms && emake XCFLAGS="-fpic" third
+	emake XCFLAGS="-fpic"
+	use static-libs && \
+		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
+	use static && \
+		emake -C "${S}"-static XLIBS="-static"
+}
+
+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 ${my_soname} /usr/$(get_libdir)/lib${PN}.so
+
+	use static-libs && \
+		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
+	if use static ; then
+		dobin "${S}"-static/build/debug/mu{tool,draw}
+		use X && dobin "${S}"-static/build/debug/${PN}-x11
+	fi
+	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
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2018-04-12  1:03 Thomas Deutschmann
  0 siblings, 0 replies; 27+ messages in thread
From: Thomas Deutschmann @ 2018-04-12  1:03 UTC (permalink / raw
  To: gentoo-commits

commit:     705f826fcfadb81b301ad61589ea585bc58c8849
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 12 01:03:40 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Apr 12 01:03:40 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=705f826f

app-text/mupdf: Fix typo in mupdf-1.11-openssl-curl-x11.patch

Reported-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Package-Manager: Portage-2.3.28, Repoman-2.3.9
RepoMan-Options: --force

 .../files/mupdf-1.11-openssl-curl-x11-r1.patch     | 37 ++++++++++++++++++++++
 ...pdf-1.12.0-r1.ebuild => mupdf-1.12.0-r2.ebuild} |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/app-text/mupdf/files/mupdf-1.11-openssl-curl-x11-r1.patch b/app-text/mupdf/files/mupdf-1.11-openssl-curl-x11-r1.patch
new file mode 100644
index 00000000000..92845a0eef2
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.11-openssl-curl-x11-r1.patch
@@ -0,0 +1,37 @@
+--- mupdf-1.11-source/Makerules
++++ mupdf-1.11-source/Makerules
+@@ -116,12 +116,17 @@
+ SYS_PTHREAD_CFLAGS :=
+ SYS_PTHREAD_LIBS := -lpthread
+ 
++WANT_OPENSSL ?= yes
++ifeq "$(WANT_OPENSSL)" "yes"
+ ifeq "$(shell pkg-config --exists 'libcrypto <= 1.0.1t' && echo yes)" "yes"
+ HAVE_LIBCRYPTO := yes
+ SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
+ SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
+ endif
++endif
+ 
++WANT_CURL ?= yes
++ifeq "$(WANT_CURL)" "yes"
+ ifeq "$(shell pkg-config --exists libcurl && echo yes)" "yes"
+ HAVE_CURL := yes
+ SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+@@ -133,12 +138,16 @@
+ endif
+ endif
+ SYS_CURL_DEPS += -lpthread -lrt
++endif
+ 
++WANT_X11 ?= yes
++ifeq "$(WANT_X11)" "yes"
+ ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
+ HAVE_X11 := yes
+ SYS_X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
+ SYS_X11_LIBS := $(shell pkg-config --libs x11 xext)
+ endif
++endif
+ 
+ ifeq "$(shell pkg-config --exists harfbuzz && echo yes)" "yes"
+ SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)

diff --git a/app-text/mupdf/mupdf-1.12.0-r1.ebuild b/app-text/mupdf/mupdf-1.12.0-r2.ebuild
similarity index 98%
rename from app-text/mupdf/mupdf-1.12.0-r1.ebuild
rename to app-text/mupdf/mupdf-1.12.0-r2.ebuild
index 0511828741f..24fbe8ee0af 100644
--- a/app-text/mupdf/mupdf-1.12.0-r1.ebuild
+++ b/app-text/mupdf/mupdf-1.12.0-r2.ebuild
@@ -46,7 +46,7 @@ PATCHES=(
 		"${FILESDIR}"/${PN}-1.12-CFLAGS.patch
 		"${FILESDIR}"/${PN}-1.9a-debug-build.patch
 		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
-		"${FILESDIR}"/${PN}-1.11-openssl-curl-x11.patch
+		"${FILESDIR}"/${PN}-1.11-openssl-curl-x11-r1.patch
 		"${FILESDIR}"/${PN}-1.11-drop-libmupdfthird.patch
 )
 


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2018-08-27 19:53 Virgil Dupras
  0 siblings, 0 replies; 27+ messages in thread
From: Virgil Dupras @ 2018-08-27 19:53 UTC (permalink / raw
  To: gentoo-commits

commit:     faf6b578bd55a8010c3957e03901cc1dab35a328
Author:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 27 19:50:49 2018 +0000
Commit:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
CommitDate: Mon Aug 27 19:53:30 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=faf6b578

app-text/mupdf: fix compilation with libressl

Patch from Jouni Kosonen

Closes: https://bugs.gentoo.org/662352
Package-Manager: Portage-2.3.48, Repoman-2.3.10

 app-text/mupdf/files/mupdf-1.13-libressl.patch |  23 ++++
 app-text/mupdf/mupdf-1.13.0-r1.ebuild          | 168 +++++++++++++++++++++++++
 2 files changed, 191 insertions(+)

diff --git a/app-text/mupdf/files/mupdf-1.13-libressl.patch b/app-text/mupdf/files/mupdf-1.13-libressl.patch
new file mode 100644
index 00000000000..396a0e5b5db
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.13-libressl.patch
@@ -0,0 +1,23 @@
+diff --git a/Makerules b/Makerules
+index f9b25d6..6c91c6c 100644
+--- a/Makerules
++++ b/Makerules
+@@ -106,11 +106,17 @@ SYS_GLUT_LIBS := -lglut -lGL
+ 
+ WANT_OPENSSL ?= yes
+ ifeq "$(WANT_OPENSSL)" "yes"
+-ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
++ifeq "$(shell pkg-config --exists 'libcrypto >= 2.0.0' && echo libre)" "libre"
++ifeq "$(shell pkg-config --exists 'libcrypto >= 2.7.0' && echo yes)" "yes"
+ HAVE_LIBCRYPTO := yes
+ SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
+ SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
+ endif
++else ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
++HAVE_LIBCRYPTO := yes
++SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
++SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
++endif
+ endif
+ 
+ WANT_CURL ?= yes

diff --git a/app-text/mupdf/mupdf-1.13.0-r1.ebuild b/app-text/mupdf/mupdf-1.13.0-r1.ebuild
new file mode 100644
index 00000000000..3f522e8dc86
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.13.0-r1.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs xdg
+
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="https://mupdf.com/"
+SRC_URI="https://mupdf.com/downloads/${P}-source.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="X +curl javascript lcms libressl opengl +openssl static static-libs vanilla"
+
+LIB_DEPEND="
+	!libressl? ( dev-libs/openssl:0=[static-libs?] )
+	libressl? ( dev-libs/libressl:0=[static-libs?] )
+	javascript? ( >=dev-lang/mujs-0_p20160504 )
+	media-libs/freetype:2=[static-libs?]
+	media-libs/harfbuzz:=[static-libs?]
+	media-libs/jbig2dec:=[static-libs?]
+	media-libs/libpng:0=[static-libs?]
+	>=media-libs/openjpeg-2.1:2=[static-libs?]
+	net-misc/curl[static-libs?]
+	virtual/jpeg[static-libs?]
+	X? ( x11-libs/libX11[static-libs?]
+		x11-libs/libXext[static-libs?] )
+	opengl? ( >=media-libs/freeglut-3.0.0:= )"
+RDEPEND="${LIB_DEPEND}"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	static-libs? ( ${LIB_DEPEND} )
+	static? ( ${LIB_DEPEND//?}
+		app-arch/bzip2[static-libs]
+		x11-libs/libXau[static-libs]
+		x11-libs/libXdmcp[static-libs]
+		x11-libs/libxcb[static-libs] )"
+
+REQUIRED_USE="opengl? ( !static !static-libs )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+		"${FILESDIR}"/${PN}-1.12-CFLAGS.patch
+		"${FILESDIR}"/${PN}-1.9a-debug-build.patch
+		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+		"${FILESDIR}"/${PN}-1.13-openssl-curl-x11.patch
+		"${FILESDIR}"/${PN}-1.11-drop-libmupdfthird.patch
+		# See bug #662352
+		"${FILESDIR}"/${PN}-1.13-libressl.patch
+)
+
+src_prepare() {
+	xdg_src_prepare
+	use hppa && append-cflags -ffunction-sections
+
+	# specialized lcms2, keep it if wanted inside lubmupdfthird
+	if ! use lcms ; then
+		rm -rf thirdparty/lcms2
+	fi
+
+	rm -rf thirdparty/{README,curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,mujs,openjpeg,zlib} || die
+	for my_third in thirdparty/* ; do
+		ewarn "Bundled thirdparty lib: ${my_third}"
+	done
+
+	if has_version ">=media-libs/openjpeg-2.1:2" ; then
+		# Remove a switch, which prevents using shared libraries for openjpeg2.
+		# See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
+		sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
+	fi
+
+	use javascript || \
+		sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
+			-i include/mupdf/fitz/config.h
+
+	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
+		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
+		-i platform/debian/${PN}.pc || die
+
+	use vanilla || eapply \
+		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iLD = $(tc-getCC)" \
+		-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
+
+	if use static-libs || use static ; then
+		cp -a "${S}" "${S}"-static || die
+		#add missing Libs.private for xcb and freetype
+		sed -e 's:\(pkg-config --libs\):\1 --static:' \
+			-e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
+			-e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
+			-i "${S}"-static/Makerules || die
+	fi
+
+	my_soname=libmupdf.so.${PV}
+	my_soname_js_none=libmupdf-js-none.so.${PV}
+	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
+		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
+		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
+		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
+		-e "/install/s: COPYING : :" \
+		-i Makefile || die
+}
+
+src_compile() {
+	use lcms && emake XCFLAGS="-fpic" third
+	emake XCFLAGS="-fpic" \
+		HAVE_GLUT=$(usex opengl yes no) \
+		HAVE_MUJS=$(usex javascript) \
+		MUJS_LIBS=$(usex javascript -lmujs '') \
+		WANT_CURL=$(usex curl) \
+		WANT_OPENSSL=$(usex openssl) \
+		WANT_X11=$(usex X)
+
+	use static-libs && \
+		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
+	use static && \
+		emake -C "${S}"-static XLIBS="-static"
+}
+
+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 \
+		HAVE_GLUT=$(usex opengl yes no) \
+		HAVE_MUJS=$(usex javascript) \
+		MUJS_LIBS=$(usex javascript -lmujs '') \
+		WANT_CURL=$(usex curl) \
+		WANT_OPENSSL=$(usex openssl) \
+		WANT_X11=$(usex X)
+
+	dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
+
+	use static-libs && \
+		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
+	if use static ; then
+		dobin "${S}"-static/build/debug/mu{tool,draw}
+		use X && dobin "${S}"-static/build/debug/${PN}-x11
+	fi
+	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
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2018-12-16 20:24 Virgil Dupras
  0 siblings, 0 replies; 27+ messages in thread
From: Virgil Dupras @ 2018-12-16 20:24 UTC (permalink / raw
  To: gentoo-commits

commit:     fad8415f7c9b2f9d626ac6b2b23d1a238def1763
Author:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 16 20:24:24 2018 +0000
Commit:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
CommitDate: Sun Dec 16 20:24:24 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fad8415f

app-text/mupdf: remove old

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

 app-text/mupdf/Manifest                            |   1 -
 .../files/mupdf-1.11-drop-libmupdfthird.patch      |  22 ---
 app-text/mupdf/files/mupdf-1.12-CFLAGS.patch       |  11 --
 app-text/mupdf/files/mupdf-1.13-libressl.patch     |  23 ---
 .../mupdf/files/mupdf-1.13-openssl-curl-x11.patch  |  39 -----
 app-text/mupdf/files/mupdf-1.9a-debug-build.patch  |  10 --
 app-text/mupdf/mupdf-1.13.0-r1.ebuild              | 168 ---------------------
 app-text/mupdf/mupdf-1.13.0.ebuild                 | 166 --------------------
 8 files changed, 440 deletions(-)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index f5f8f290123..3c5ff516a7a 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,2 +1 @@
-DIST mupdf-1.13.0-source.tar.gz 51425034 BLAKE2B 7f4a1c84b5840991cc7879f3617165579f4db1f7a010a8313b0eaf94ad59af60bb3d0e4a0f2acc14d2c7511dd0f8b96c89c51e360ab379ba32590b887dd3be6a SHA512 d7fca7292e612959893a728d35964cf7b4e607385bdd72e81b8ca1de6ab642f999b734afbbf32d75400cd29b7e178ec360e65c91d7b1e1a53c2a04ff0adbd707
 DIST mupdf-1.14.0-source.tar.xz 41602372 BLAKE2B bb680038344af16c7231a18a009c0d04c5f50b3fcbaf061c9f5907f35d79eea93eeced7c2a43a06a963b93b39c74d0246c5fdad35655953d1aa5efb79737265a SHA512 bd41125dac1a81b7dbbfbb5f5e06e70bb601854731e0945983688da5d8d7c0bca9771fff2e4b6d9c36dbead6146f0a866ed7427d58e13d02ed6dfd94dcfe54bf

diff --git a/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch b/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
deleted file mode 100644
index e5600c00cd8..00000000000
--- a/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- mupdf-1.11-source/Makefile
-+++ mupdf-1.11-source/Makefile
-@@ -301,7 +301,7 @@
- # --- Library ---
- 
- MUPDF_LIB = $(OUT)/libmupdf.a
--THIRD_LIB = $(OUT)/libmupdfthird.a
-+THIRD_LIB =
- THREAD_LIB = $(OUT)/libmuthreads.a
- 
- MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(SVG_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ)
---- mupdf-1.12.0-source/Makefile
-+++ mupdf-1.12.0-source/Makefile
-@@ -343,7 +343,7 @@
- 
- THREAD_OBJ := $(THREAD_OBJ)
- 
--$(MUPDF_LIB) : $(MUPDF_OBJ)
-+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_OBJ)
- $(THIRD_LIB) : $(THIRD_OBJ)
- $(THREAD_LIB) : $(THREAD_OBJ)
- 

diff --git a/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch
deleted file mode 100644
index 796d127263a..00000000000
--- a/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- mupdf-1.12.0-source/Makerules
-+++ mupdf-1.12.0-source/Makerules
-@@ -22,8 +22,6 @@
- endif
- 
- 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.13-libressl.patch b/app-text/mupdf/files/mupdf-1.13-libressl.patch
deleted file mode 100644
index 396a0e5b5db..00000000000
--- a/app-text/mupdf/files/mupdf-1.13-libressl.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/Makerules b/Makerules
-index f9b25d6..6c91c6c 100644
---- a/Makerules
-+++ b/Makerules
-@@ -106,11 +106,17 @@ SYS_GLUT_LIBS := -lglut -lGL
- 
- WANT_OPENSSL ?= yes
- ifeq "$(WANT_OPENSSL)" "yes"
--ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
-+ifeq "$(shell pkg-config --exists 'libcrypto >= 2.0.0' && echo libre)" "libre"
-+ifeq "$(shell pkg-config --exists 'libcrypto >= 2.7.0' && echo yes)" "yes"
- HAVE_LIBCRYPTO := yes
- SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
- SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
- endif
-+else ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
-+HAVE_LIBCRYPTO := yes
-+SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
-+SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
-+endif
- endif
- 
- WANT_CURL ?= yes

diff --git a/app-text/mupdf/files/mupdf-1.13-openssl-curl-x11.patch b/app-text/mupdf/files/mupdf-1.13-openssl-curl-x11.patch
deleted file mode 100644
index 6db51a083ed..00000000000
--- a/app-text/mupdf/files/mupdf-1.13-openssl-curl-x11.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/Makerules b/Makerules
-index ef2b6b0..f9b25d6 100644
---- a/Makerules
-+++ b/Makerules
-@@ -104,12 +104,17 @@ HAVE_GLUT := yes
- SYS_GLUT_CFLAGS :=
- SYS_GLUT_LIBS := -lglut -lGL
- 
-+WANT_OPENSSL ?= yes
-+ifeq "$(WANT_OPENSSL)" "yes"
- ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
- HAVE_LIBCRYPTO := yes
- SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
- SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
- endif
-+endif
- 
-+WANT_CURL ?= yes
-+ifeq "$(WANT_CURL)" "yes"
- ifeq "$(shell pkg-config --exists libcurl && echo yes)" "yes"
- HAVE_CURL := yes
- SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
-@@ -121,12 +126,16 @@ SYS_CURL_DEPS += $(shell pkg-config --libs openssl)
- endif
- endif
- SYS_CURL_DEPS += -lpthread -lrt
-+endif
- 
-+WANT_X11 ?= yes
-+ifeq "$(WANT_X11)" "yes"
- ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
- HAVE_X11 := yes
- SYS_X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
- SYS_X11_LIBS := $(shell pkg-config --libs x11 xext)
- endif
-+endif
- 
- ifeq "$(shell pkg-config --exists harfbuzz && echo yes)" "yes"
- SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)

diff --git a/app-text/mupdf/files/mupdf-1.9a-debug-build.patch b/app-text/mupdf/files/mupdf-1.9a-debug-build.patch
deleted file mode 100644
index 93c52f5c5f8..00000000000
--- a/app-text/mupdf/files/mupdf-1.9a-debug-build.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- mupdf-1.9a/Makefile
-+++ mupdf-1.9a/Makefile
-@@ -1,6 +1,6 @@
- # GNU Makefile
- 
--build ?= release
-+build ?= debug
- 
- OUT := build/$(build)
- GEN := generated

diff --git a/app-text/mupdf/mupdf-1.13.0-r1.ebuild b/app-text/mupdf/mupdf-1.13.0-r1.ebuild
deleted file mode 100644
index 938dffbbb78..00000000000
--- a/app-text/mupdf/mupdf-1.13.0-r1.ebuild
+++ /dev/null
@@ -1,168 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic toolchain-funcs xdg
-
-DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
-HOMEPAGE="https://mupdf.com/"
-SRC_URI="https://mupdf.com/downloads/${P}-source.tar.gz"
-
-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 +curl javascript lcms libressl opengl +openssl static static-libs vanilla"
-
-LIB_DEPEND="
-	!libressl? ( dev-libs/openssl:0=[static-libs?] )
-	libressl? ( dev-libs/libressl:0=[static-libs?] )
-	javascript? ( >=dev-lang/mujs-0_p20160504 )
-	media-libs/freetype:2=[static-libs?]
-	media-libs/harfbuzz:=[static-libs?]
-	media-libs/jbig2dec:=[static-libs?]
-	media-libs/libpng:0=[static-libs?]
-	>=media-libs/openjpeg-2.1:2=[static-libs?]
-	net-misc/curl[static-libs?]
-	virtual/jpeg[static-libs?]
-	X? ( x11-libs/libX11[static-libs?]
-		x11-libs/libXext[static-libs?] )
-	opengl? ( >=media-libs/freeglut-3.0.0:= )"
-RDEPEND="${LIB_DEPEND}"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig
-	static-libs? ( ${LIB_DEPEND} )
-	static? ( ${LIB_DEPEND//?}
-		app-arch/bzip2[static-libs]
-		x11-libs/libXau[static-libs]
-		x11-libs/libXdmcp[static-libs]
-		x11-libs/libxcb[static-libs] )"
-
-REQUIRED_USE="opengl? ( !static !static-libs )"
-
-S=${WORKDIR}/${P}-source
-
-PATCHES=(
-		"${FILESDIR}"/${PN}-1.12-CFLAGS.patch
-		"${FILESDIR}"/${PN}-1.9a-debug-build.patch
-		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
-		"${FILESDIR}"/${PN}-1.13-openssl-curl-x11.patch
-		"${FILESDIR}"/${PN}-1.11-drop-libmupdfthird.patch
-		# See bug #662352
-		"${FILESDIR}"/${PN}-1.13-libressl.patch
-)
-
-src_prepare() {
-	xdg_src_prepare
-	use hppa && append-cflags -ffunction-sections
-
-	# specialized lcms2, keep it if wanted inside lubmupdfthird
-	if ! use lcms ; then
-		rm -rf thirdparty/lcms2
-	fi
-
-	rm -rf thirdparty/{README,curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,mujs,openjpeg,zlib} || die
-	for my_third in thirdparty/* ; do
-		ewarn "Bundled thirdparty lib: ${my_third}"
-	done
-
-	if has_version ">=media-libs/openjpeg-2.1:2" ; then
-		# Remove a switch, which prevents using shared libraries for openjpeg2.
-		# See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
-		sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
-	fi
-
-	use javascript || \
-		sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
-			-i include/mupdf/fitz/config.h
-
-	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
-		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
-		-i platform/debian/${PN}.pc || die
-
-	use vanilla || eapply \
-		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
-
-	sed -e "1iOS = Linux" \
-		-e "1iCC = $(tc-getCC)" \
-		-e "1iLD = $(tc-getCC)" \
-		-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
-
-	if use static-libs || use static ; then
-		cp -a "${S}" "${S}"-static || die
-		#add missing Libs.private for xcb and freetype
-		sed -e 's:\(pkg-config --libs\):\1 --static:' \
-			-e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
-			-e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
-			-i "${S}"-static/Makerules || die
-	fi
-
-	my_soname=libmupdf.so.${PV}
-	my_soname_js_none=libmupdf-js-none.so.${PV}
-	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
-		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
-		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
-		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
-		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
-		-e "/install/s: COPYING : :" \
-		-i Makefile || die
-}
-
-src_compile() {
-	use lcms && emake XCFLAGS="-fpic" third
-	emake XCFLAGS="-fpic" \
-		HAVE_GLUT=$(usex opengl yes no) \
-		HAVE_MUJS=$(usex javascript) \
-		MUJS_LIBS=$(usex javascript -lmujs '') \
-		WANT_CURL=$(usex curl) \
-		WANT_OPENSSL=$(usex openssl) \
-		WANT_X11=$(usex X)
-
-	use static-libs && \
-		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
-	use static && \
-		emake -C "${S}"-static XLIBS="-static"
-}
-
-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 \
-		HAVE_GLUT=$(usex opengl yes no) \
-		HAVE_MUJS=$(usex javascript) \
-		MUJS_LIBS=$(usex javascript -lmujs '') \
-		WANT_CURL=$(usex curl) \
-		WANT_OPENSSL=$(usex openssl) \
-		WANT_X11=$(usex X)
-
-	dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
-
-	use static-libs && \
-		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
-	if use static ; then
-		dobin "${S}"-static/build/debug/mu{tool,draw}
-		use X && dobin "${S}"-static/build/debug/${PN}-x11
-	fi
-	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
-}

diff --git a/app-text/mupdf/mupdf-1.13.0.ebuild b/app-text/mupdf/mupdf-1.13.0.ebuild
deleted file mode 100644
index bd884bbe03c..00000000000
--- a/app-text/mupdf/mupdf-1.13.0.ebuild
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic toolchain-funcs xdg
-
-DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
-HOMEPAGE="https://mupdf.com/"
-SRC_URI="https://mupdf.com/downloads/${P}-source.tar.gz"
-
-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 +curl javascript lcms libressl opengl +openssl static static-libs vanilla"
-
-LIB_DEPEND="
-	!libressl? ( dev-libs/openssl:0=[static-libs?] )
-	libressl? ( dev-libs/libressl:0=[static-libs?] )
-	javascript? ( >=dev-lang/mujs-0_p20160504 )
-	media-libs/freetype:2=[static-libs?]
-	media-libs/harfbuzz:=[static-libs?]
-	media-libs/jbig2dec:=[static-libs?]
-	media-libs/libpng:0=[static-libs?]
-	>=media-libs/openjpeg-2.1:2=[static-libs?]
-	net-misc/curl[static-libs?]
-	virtual/jpeg[static-libs?]
-	X? ( x11-libs/libX11[static-libs?]
-		x11-libs/libXext[static-libs?] )
-	opengl? ( >=media-libs/freeglut-3.0.0:= )"
-RDEPEND="${LIB_DEPEND}"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig
-	static-libs? ( ${LIB_DEPEND} )
-	static? ( ${LIB_DEPEND//?}
-		app-arch/bzip2[static-libs]
-		x11-libs/libXau[static-libs]
-		x11-libs/libXdmcp[static-libs]
-		x11-libs/libxcb[static-libs] )"
-
-REQUIRED_USE="opengl? ( !static !static-libs )"
-
-S=${WORKDIR}/${P}-source
-
-PATCHES=(
-		"${FILESDIR}"/${PN}-1.12-CFLAGS.patch
-		"${FILESDIR}"/${PN}-1.9a-debug-build.patch
-		"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
-		"${FILESDIR}"/${PN}-1.13-openssl-curl-x11.patch
-		"${FILESDIR}"/${PN}-1.11-drop-libmupdfthird.patch
-)
-
-src_prepare() {
-	xdg_src_prepare
-	use hppa && append-cflags -ffunction-sections
-
-	# specialized lcms2, keep it if wanted inside lubmupdfthird
-	if ! use lcms ; then
-		rm -rf thirdparty/lcms2
-	fi
-
-	rm -rf thirdparty/{README,curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,mujs,openjpeg,zlib} || die
-	for my_third in thirdparty/* ; do
-		ewarn "Bundled thirdparty lib: ${my_third}"
-	done
-
-	if has_version ">=media-libs/openjpeg-2.1:2" ; then
-		# Remove a switch, which prevents using shared libraries for openjpeg2.
-		# See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
-		sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
-	fi
-
-	use javascript || \
-		sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
-			-i include/mupdf/fitz/config.h
-
-	sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
-		-e "/^prefix=/s:=.*:=${EROOT}/usr:" \
-		-i platform/debian/${PN}.pc || die
-
-	use vanilla || eapply \
-		"${FILESDIR}"/${PN}-1.3-zoom-2.patch
-
-	sed -e "1iOS = Linux" \
-		-e "1iCC = $(tc-getCC)" \
-		-e "1iLD = $(tc-getCC)" \
-		-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
-
-	if use static-libs || use static ; then
-		cp -a "${S}" "${S}"-static || die
-		#add missing Libs.private for xcb and freetype
-		sed -e 's:\(pkg-config --libs\):\1 --static:' \
-			-e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
-			-e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
-			-i "${S}"-static/Makerules || die
-	fi
-
-	my_soname=libmupdf.so.${PV}
-	my_soname_js_none=libmupdf-js-none.so.${PV}
-	sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
-		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
-		-e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
-		-e "\$a\$(MUPDF_JS_NONE_LIB):" \
-		-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
-		-e "/install/s: COPYING : :" \
-		-i Makefile || die
-}
-
-src_compile() {
-	use lcms && emake XCFLAGS="-fpic" third
-	emake XCFLAGS="-fpic" \
-		HAVE_GLUT=$(usex opengl yes no) \
-		HAVE_MUJS=$(usex javascript) \
-		MUJS_LIBS=$(usex javascript -lmujs '') \
-		WANT_CURL=$(usex curl) \
-		WANT_OPENSSL=$(usex openssl) \
-		WANT_X11=$(usex X)
-
-	use static-libs && \
-		emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
-	use static && \
-		emake -C "${S}"-static XLIBS="-static"
-}
-
-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 \
-		HAVE_GLUT=$(usex opengl yes no) \
-		HAVE_MUJS=$(usex javascript) \
-		MUJS_LIBS=$(usex javascript -lmujs '') \
-		WANT_CURL=$(usex curl) \
-		WANT_OPENSSL=$(usex openssl) \
-		WANT_X11=$(usex X)
-
-	dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
-
-	use static-libs && \
-		dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
-	if use static ; then
-		dobin "${S}"-static/build/debug/mu{tool,draw}
-		use X && dobin "${S}"-static/build/debug/${PN}-x11
-	fi
-	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
-}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2019-02-19 21:02 Virgil Dupras
  0 siblings, 0 replies; 27+ messages in thread
From: Virgil Dupras @ 2019-02-19 21:02 UTC (permalink / raw
  To: gentoo-commits

commit:     a5247eb5569e7573eba63db4cf5e6012607e1a6d
Author:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 19 20:22:34 2019 +0000
Commit:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
CommitDate: Tue Feb 19 21:01:02 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5247eb5

app-text/mupdf: fix libressl and openssl

openssl's requirements is actually 1.1+. prior to this change, mupdf
compiled with openssl support unless openssl 1.1+ was installed.

libressl support requires a patch to work properly.

Also, other minor fixes. See closed bugs.

Closes: https://bugs.gentoo.org/671062
Closes: https://bugs.gentoo.org/623732
Closes: https://bugs.gentoo.org/669698
Closes: https://bugs.gentoo.org/670832
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-libressl.patch     |  45 +++++++
 .../files/mupdf-1.14-r3-openssl-curl-x11.patch     |  35 ++++++
 app-text/mupdf/mupdf-1.14.0-r3.ebuild              | 132 +++++++++++++++++++++
 3 files changed, 212 insertions(+)

diff --git a/app-text/mupdf/files/mupdf-1.14-libressl.patch b/app-text/mupdf/files/mupdf-1.14-libressl.patch
new file mode 100644
index 00000000000..fcc0a7205c1
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.14-libressl.patch
@@ -0,0 +1,45 @@
+From 8561b744ac95ab6145a1163fa1d7c490a3329465 Mon Sep 17 00:00:00 2001
+From: William <wonko@undefined.re>
+Date: Mon, 12 Nov 2018 16:50:07 +0100
+Subject: [PATCH] hardcode missing ssl functions
+
+---
+ source/helpers/pkcs7/pkcs7-openssl.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/source/helpers/pkcs7/pkcs7-openssl.c b/source/helpers/pkcs7/pkcs7-openssl.c
+index 58dbf65..2b1f9e9 100644
+--- a/source/helpers/pkcs7/pkcs7-openssl.c
++++ b/source/helpers/pkcs7/pkcs7-openssl.c
+@@ -511,6 +511,28 @@ static void signer_drop_designated_name(pdf_pkcs7_signer *signer, pdf_pkcs7_desi
+ 	fz_free(osigner->ctx, dn);
+ }
+ 
++int
++PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag)
++{
++    return OBJ_obj2nid(bag->type);
++}
++
++const STACK_OF(PKCS12_SAFEBAG) *
++PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag)
++{
++    if (OBJ_obj2nid(bag->type) != NID_safeContentsBag)
++        return NULL;
++    return bag->value.safes;
++}
++
++const PKCS8_PRIV_KEY_INFO *
++PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag)
++{
++    if (PKCS12_SAFEBAG_get_nid(bag) != NID_keyBag)
++        return NULL;
++    return bag->value.keybag;
++}
++
+ static void add_from_bags(X509 **pX509, EVP_PKEY **pPkey, const STACK_OF(PKCS12_SAFEBAG) *bags, const char *pw);
+ 
+ static void add_from_bag(X509 **pX509, EVP_PKEY **pPkey, PKCS12_SAFEBAG *bag, const char *pw)
+-- 
+2.19.1
+

diff --git a/app-text/mupdf/files/mupdf-1.14-r3-openssl-curl-x11.patch b/app-text/mupdf/files/mupdf-1.14-r3-openssl-curl-x11.patch
new file mode 100644
index 00000000000..79efe32c0e4
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.14-r3-openssl-curl-x11.patch
@@ -0,0 +1,35 @@
+diff --git a/Makerules b/Makerules
+index fc9bf998..f1fd93cb 100644
+--- a/Makerules
++++ b/Makerules
+@@ -113,10 +113,11 @@ else ifeq ($(OS),Linux)
+ 	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
+   endif
+ 
+-  HAVE_CURL := $(shell pkg-config --exists libcurl && echo yes)
++  HAVE_CURL ?= not-unless-portage-tells-me
+   ifeq ($(HAVE_CURL),yes)
+ 	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+-	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
++    # We have to forcibly add -lpthread to avoid linking errors.
++	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl) -lpthread
+   endif
+ 
+   HAVE_GLUT := yes
+@@ -125,13 +126,14 @@ 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.14.0-r3.ebuild b/app-text/mupdf/mupdf-1.14.0-r3.ebuild
new file mode 100644
index 00000000000..1b153620923
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.14.0-r3.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs xdg
+
+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 curl +javascript libressl opengl openssl 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?]
+	curl? ( net-misc/curl[static-libs?] )
+	libressl? ( >=dev-libs/libressl-2.8:0=[static-libs?] )
+	opengl? ( >=media-libs/freeglut-3.0.0:= )
+	openssl? ( >=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="
+	libressl? ( !openssl )
+	opengl? ( !static-libs )
+	curl? ( X )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.14-CFLAGS.patch
+	"${FILESDIR}"/${PN}-1.14-Makefile.patch
+	"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+	# See bugs #662352
+	"${FILESDIR}"/${PN}-1.14-r3-openssl-curl-x11.patch
+	# bug #672998
+	"${FILESDIR}"/${PN}-1.14-fix-big-endian.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 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.
+	local have_libcrypto=no
+	if use openssl || use libressl ; then
+		have_libcrypto=yes
+	fi
+	emake \
+		GENTOO_PV=${PV} \
+		HAVE_GLUT=$(usex opengl) \
+		HAVE_CURL=$(usex curl) \
+		HAVE_LIBCRYPTO=$have_libcrypto \
+		HAVE_X11=$(usex X) \
+		USE_SYSTEM_LIBS=yes \
+		USE_SYSTEM_MUJS=yes \
+		HAVE_OBJCOPY=no \
+		"$@"
+}
+
+src_compile() {
+	_emake XCFLAGS="-fpic"
+
+	use curl && _emake extra-apps
+
+	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
+	use curl && dobin build/debug/${PN}-x11-curl
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2019-05-07  2:39 Virgil Dupras
  0 siblings, 0 replies; 27+ messages in thread
From: Virgil Dupras @ 2019-05-07  2:39 UTC (permalink / raw
  To: gentoo-commits

commit:     6e0b3e7722417649362c3909fbf1fc0b5c80eb93
Author:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
AuthorDate: Tue May  7 02:37:54 2019 +0000
Commit:     Virgil Dupras <vdupras <AT> gentoo <DOT> org>
CommitDate: Tue May  7 02:38:46 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e0b3e77

app-text/mupdf: bump to 1.15.0

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 <AT> gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

 app-text/mupdf/Manifest                           |   1 +
 app-text/mupdf/files/mupdf-1.15-CFLAGS.patch      |  13 +++
 app-text/mupdf/files/mupdf-1.15-Makefile.patch    |  42 ++++++++
 app-text/mupdf/files/mupdf-1.15-openssl-x11.patch |  20 ++++
 app-text/mupdf/mupdf-1.15.0.ebuild                | 122 ++++++++++++++++++++++
 5 files changed, 198 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 3c5ff516a7a..c8ad1a8bd31 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -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
index 00000000000..a7de530909b
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.15-CFLAGS.patch
@@ -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
index 00000000000..cff348d95e4
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.15-Makefile.patch
@@ -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
index 00000000000..22829279e14
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.15-openssl-x11.patch
@@ -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
index 00000000000..258ffd76802
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.15.0.ebuild
@@ -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
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2019-11-26 14:25 Jory Pratt
  0 siblings, 0 replies; 27+ messages in thread
From: Jory Pratt @ 2019-11-26 14:25 UTC (permalink / raw
  To: gentoo-commits

commit:     b451e991a41390d90b59e558ba77ce0efc0e1950
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 26 14:24:28 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Tue Nov 26 14:24:41 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b451e991

Revert "app-text/mupdf: cleanup"

This reverts commit a89743c14b67fa2507926ad8d0aea43b5b8712b0.

Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   2 +
 app-text/mupdf/files/mupdf-1.14-CFLAGS.patch       |  13 +++
 app-text/mupdf/files/mupdf-1.14-Makefile.patch     |  46 ++++++++
 .../mupdf/files/mupdf-1.14-fix-big-endian.patch    | 125 ++++++++++++++++++++
 app-text/mupdf/files/mupdf-1.14-libressl.patch     |  45 +++++++
 .../files/mupdf-1.14-r3-openssl-curl-x11.patch     |  35 ++++++
 app-text/mupdf/files/mupdf-1.3-zoom-2.patch        |  10 ++
 app-text/mupdf/mupdf-1.14.0-r3.ebuild              | 129 ++++++++++++++++++++
 app-text/mupdf/mupdf-1.15.0.ebuild                 | 130 +++++++++++++++++++++
 9 files changed, 535 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 964f9c13501..9142b4ccaf0 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1 +1,3 @@
+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
 DIST mupdf-1.16.1-source.tar.xz 45800404 BLAKE2B bc4158a457056c55db52a518efc13c289cca537c29a6b563046297dc225f3ce0add781adb8520c4d0829d653ed0539042597e341cb21c4fb4c462ed422bf735b SHA512 fa657e6b9251aff91c25e91b335ea829b797dd91a759505bfd7259f8236613f590a044bc741e9b0587da55817a1ab8c1499c067d65d683d099259d06d91a8f50

diff --git a/app-text/mupdf/files/mupdf-1.14-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.14-CFLAGS.patch
new file mode 100644
index 00000000000..90972e8c53e
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.14-CFLAGS.patch
@@ -0,0 +1,13 @@
+diff --git a/Makerules b/Makerules
+index fc9bf998..82f10b28 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 $(LDREMOVEUNREACH)
+ else ifeq ($(build),release)
+   CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
+   LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s

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-fix-big-endian.patch b/app-text/mupdf/files/mupdf-1.14-fix-big-endian.patch
new file mode 100644
index 00000000000..dc472153ca6
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.14-fix-big-endian.patch
@@ -0,0 +1,125 @@
+vdupras note: exact same patch as in
+https://bugs.ghostscript.com/show_bug.cgi?id=699395 except for tweaked
+diff paths.
+From 5fb79e6ccb805b3d94c8bb8eb0990d9944ae7602 Mon Sep 17 00:00:00 2001
+Message-Id: <5fb79e6ccb805b3d94c8bb8eb0990d9944ae7602.1528041417.git.mjg@fedoraproject.org>
+From: Michael J Gruber <mjg@fedoraproject.org>
+Date: Sun, 3 Jun 2018 17:55:46 +0200
+Subject: [PATCH] fix build on big endian
+
+0dc1153 ("Spread of context into all procedures and removal from
+structures", 2017-04-26) missed a few spots that are relevant on big
+endian only.
+
+Add the missing ContextIDs in the call chain so that the build succeeds
+again.
+
+Signed-off-by: Michael J Gruber <mjg@fedoraproject.org>
+---
+ src/cmsmd5.c | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/src/cmsmd5.c b/src/cmsmd5.c
+index 4b8f7f9..dd0925a 100644
+--- a/thirdparty/lcms2/src/cmsmd5.c
++++ b/thirdparty/lcms2/src/cmsmd5.c
+@@ -29,7 +29,7 @@
+ #ifdef CMS_USE_BIG_ENDIAN
+ 
+ static
+-void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
++void byteReverse(cmsContext ContextID, cmsUInt8Number * buf, cmsUInt32Number longs)
+ {
+     do {
+ 
+@@ -42,7 +42,7 @@ void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
+ }
+ 
+ #else
+-#define byteReverse(buf, len)
++#define byteReverse(ContextID, buf, len)
+ #endif
+ 
+ 
+@@ -172,7 +172,7 @@ cmsHANDLE  MD5alloc(cmsContext ContextID)
+ 
+ 
+ static
+-void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
++void MD5add(cmsContext ContextID, cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
+ {
+     _cmsMD5* ctx = (_cmsMD5*) Handle;
+     cmsUInt32Number t;
+@@ -196,7 +196,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
+         }
+ 
+         memmove(p, buf, t);
+-        byteReverse(ctx->in, 16);
++        byteReverse(ContextID, ctx->in, 16);
+ 
+         MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
+         buf += t;
+@@ -205,7 +205,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
+ 
+     while (len >= 64) {
+         memmove(ctx->in, buf, 64);
+-        byteReverse(ctx->in, 16);
++        byteReverse(ContextID, ctx->in, 16);
+         MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
+         buf += 64;
+         len -= 64;
+@@ -216,7 +216,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
+ 
+ // Destroy the object and return the checksum
+ static
+-void MD5finish(cmsProfileID* ProfileID,  cmsHANDLE Handle)
++void MD5finish(cmsContext ContextID, cmsProfileID* ProfileID,  cmsHANDLE Handle)
+ {
+     _cmsMD5* ctx = (_cmsMD5*) Handle;
+     cmsUInt32Number count;
+@@ -232,21 +232,21 @@ void MD5finish(cmsProfileID* ProfileID,  cmsHANDLE Handle)
+     if (count < 8) {
+ 
+         memset(p, 0, count);
+-        byteReverse(ctx->in, 16);
++        byteReverse(ContextID, ctx->in, 16);
+         MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
+ 
+         memset(ctx->in, 0, 56);
+     } else {
+         memset(p, 0, count - 8);
+     }
+-    byteReverse(ctx->in, 14);
++    byteReverse(ContextID, ctx->in, 14);
+ 
+     ((cmsUInt32Number *) ctx->in)[14] = ctx->bits[0];
+     ((cmsUInt32Number *) ctx->in)[15] = ctx->bits[1];
+ 
+     MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
+ 
+-    byteReverse((cmsUInt8Number *) ctx->buf, 4);
++    byteReverse(ContextID, (cmsUInt8Number *) ctx->buf, 4);
+     memmove(ProfileID ->ID8, ctx->buf, 16);
+ 
+     _cmsFree(ctx ->ContextID, ctx);
+@@ -291,7 +291,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile)
+     if (MD5 == NULL) goto Error;
+ 
+     // Add all bytes
+-    MD5add(MD5, Mem, BytesNeeded);
++    MD5add(ContextID,MD5, Mem, BytesNeeded);
+ 
+     // Temp storage is no longer needed
+     _cmsFree(ContextID, Mem);
+@@ -300,7 +300,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile)
+     memmove(Icc, &Keep, sizeof(_cmsICCPROFILE));
+ 
+     // And store the ID
+-    MD5finish(&Icc ->ProfileID,  MD5);
++    MD5finish(ContextID, &Icc ->ProfileID,  MD5);
+     return TRUE;
+ 
+ Error:
+-- 
+2.18.0.rc0.294.g786209a621
+

diff --git a/app-text/mupdf/files/mupdf-1.14-libressl.patch b/app-text/mupdf/files/mupdf-1.14-libressl.patch
new file mode 100644
index 00000000000..fcc0a7205c1
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.14-libressl.patch
@@ -0,0 +1,45 @@
+From 8561b744ac95ab6145a1163fa1d7c490a3329465 Mon Sep 17 00:00:00 2001
+From: William <wonko@undefined.re>
+Date: Mon, 12 Nov 2018 16:50:07 +0100
+Subject: [PATCH] hardcode missing ssl functions
+
+---
+ source/helpers/pkcs7/pkcs7-openssl.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/source/helpers/pkcs7/pkcs7-openssl.c b/source/helpers/pkcs7/pkcs7-openssl.c
+index 58dbf65..2b1f9e9 100644
+--- a/source/helpers/pkcs7/pkcs7-openssl.c
++++ b/source/helpers/pkcs7/pkcs7-openssl.c
+@@ -511,6 +511,28 @@ static void signer_drop_designated_name(pdf_pkcs7_signer *signer, pdf_pkcs7_desi
+ 	fz_free(osigner->ctx, dn);
+ }
+ 
++int
++PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag)
++{
++    return OBJ_obj2nid(bag->type);
++}
++
++const STACK_OF(PKCS12_SAFEBAG) *
++PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag)
++{
++    if (OBJ_obj2nid(bag->type) != NID_safeContentsBag)
++        return NULL;
++    return bag->value.safes;
++}
++
++const PKCS8_PRIV_KEY_INFO *
++PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag)
++{
++    if (PKCS12_SAFEBAG_get_nid(bag) != NID_keyBag)
++        return NULL;
++    return bag->value.keybag;
++}
++
+ static void add_from_bags(X509 **pX509, EVP_PKEY **pPkey, const STACK_OF(PKCS12_SAFEBAG) *bags, const char *pw);
+ 
+ static void add_from_bag(X509 **pX509, EVP_PKEY **pPkey, PKCS12_SAFEBAG *bag, const char *pw)
+-- 
+2.19.1
+

diff --git a/app-text/mupdf/files/mupdf-1.14-r3-openssl-curl-x11.patch b/app-text/mupdf/files/mupdf-1.14-r3-openssl-curl-x11.patch
new file mode 100644
index 00000000000..79efe32c0e4
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.14-r3-openssl-curl-x11.patch
@@ -0,0 +1,35 @@
+diff --git a/Makerules b/Makerules
+index fc9bf998..f1fd93cb 100644
+--- a/Makerules
++++ b/Makerules
+@@ -113,10 +113,11 @@ else ifeq ($(OS),Linux)
+ 	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
+   endif
+ 
+-  HAVE_CURL := $(shell pkg-config --exists libcurl && echo yes)
++  HAVE_CURL ?= not-unless-portage-tells-me
+   ifeq ($(HAVE_CURL),yes)
+ 	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+-	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
++    # We have to forcibly add -lpthread to avoid linking errors.
++	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl) -lpthread
+   endif
+ 
+   HAVE_GLUT := yes
+@@ -125,13 +126,14 @@ 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/files/mupdf-1.3-zoom-2.patch b/app-text/mupdf/files/mupdf-1.3-zoom-2.patch
new file mode 100644
index 00000000000..35391245023
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.3-zoom-2.patch
@@ -0,0 +1,10 @@
+--- mupdf-1.3/platform/x11/pdfapp.c
++++ mupdf-1.3/platform/x11/pdfapp.c
+@@ -866,6 +867,7 @@
+ 		break;
+ 
+ 	case ' ':
++	case 'F':
+ 		panto = DONT_PAN;
+ 		if (app->numberlen > 0)
+ 			app->pageno += atoi(app->number);

diff --git a/app-text/mupdf/mupdf-1.14.0-r3.ebuild b/app-text/mupdf/mupdf-1.14.0-r3.ebuild
new file mode 100644
index 00000000000..fca81cfa02f
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.14.0-r3.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs xdg
+
+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 curl +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?]
+	curl? ( net-misc/curl[static-libs?] )
+	opengl? ( >=media-libs/freeglut-3.0.0:= )
+	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 )
+	curl? ( X )"
+
+S=${WORKDIR}/${P}-source
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.14-CFLAGS.patch
+	"${FILESDIR}"/${PN}-1.14-Makefile.patch
+	"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+	# See bugs #662352
+	"${FILESDIR}"/${PN}-1.14-r3-openssl-curl-x11.patch
+	# bug #672998
+	"${FILESDIR}"/${PN}-1.14-fix-big-endian.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.
+	emake \
+		GENTOO_PV=${PV} \
+		HAVE_GLUT=$(usex opengl) \
+		HAVE_CURL=$(usex curl) \
+		HAVE_LIBCRYPTO=$(usex ssl) \
+		HAVE_X11=$(usex X) \
+		USE_SYSTEM_LIBS=yes \
+		USE_SYSTEM_MUJS=yes \
+		HAVE_OBJCOPY=no \
+		"$@"
+}
+
+src_compile() {
+	_emake XCFLAGS="-fpic"
+
+	use curl && _emake extra-apps
+
+	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
+	use curl && dobin build/debug/${PN}-x11-curl
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}

diff --git a/app-text/mupdf/mupdf-1.15.0.ebuild b/app-text/mupdf/mupdf-1.15.0.ebuild
new file mode 100644
index 00000000000..7d1f75d3ee1
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.15.0.ebuild
@@ -0,0 +1,130 @@
+# 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"
+
+# Although we use the bundled, patched version of freeglut in mupdf (because of
+# bug #653298), the best way to ensure that its dependencies are present is to
+# install system's freeglut.
+RDEPEND="
+	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?]
+	opengl? ( >=media-libs/freeglut-3.0.0:= )
+	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
+
+	# As of v1.15.0, mupdf started using symbols in mujs that were not part
+	# of any release. We thus go back to using the bundled version of it.
+	# Bug #685244
+	emake \
+		GENTOO_PV=${PV} \
+		HAVE_GLUT=$(usex opengl) \
+		HAVE_LIBCRYPTO=$(usex ssl) \
+		HAVE_X11=$(usex X) \
+		USE_SYSTEM_LIBS=yes \
+		USE_SYSTEM_MUJS=no \
+		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
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2020-01-21 23:04 Sergei Trofimovich
  0 siblings, 0 replies; 27+ messages in thread
From: Sergei Trofimovich @ 2020-01-21 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     b65f37dd215869eae0bc6fd367a515281e301f6a
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 21 23:04:19 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Jan 21 23:04:29 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b65f37dd

app-text/mupdf: tweak for gcc-10

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch      | 80 ++++++++++++++++++++++
 app-text/mupdf/mupdf-1.16.1.ebuild                 |  3 +-
 2 files changed, 82 insertions(+), 1 deletion(-)

diff --git a/app-text/mupdf/files/mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch b/app-text/mupdf/files/mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch
new file mode 100644
index 00000000000..c9c37e2efac
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch
@@ -0,0 +1,80 @@
+From 5791564dd934d193df771a0a7c52013e9f456aa1 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Tue, 21 Jan 2020 22:33:49 +0000
+Subject: [PATCH] fg_gl2: fix build failure against gcc-10
+
+On gcc-10 (and gcc-9 -fno-common) build fails as:
+
+```
+[ 31%] Linking C executable bin/Lorenz_static
+/usr/bin/cmake -E cmake_link_script CMakeFiles/Lorenz_static.dir/link.txt --verbose=1
+/usr/lib/ccache/bin/cc  -Wall -pedantic  -rdynamic CMakeFiles/Lorenz_static.dir/progs/demos/Lorenz/lorenz.c.o \
+   -o bin/Lorenz_static  -lGLU -lGL -lm -lX11 -lXrandr -lXxf86vm -lXi -lm lib/libglut.a -lGL -lm -lX11 -lXrandr -lXxf86vm -lXi
+ld: lib/libglut.a(fg_gl2.c.o):(.bss+0x0):
+  multiple definition of `fghGenBuffers'; lib/libglut.a(fg_window.c.o):(.bss+0x0): first defined here
+ld: lib/libglut.a(fg_gl2.c.o):(.bss+0x8):
+  multiple definition of `fghDeleteBuffers'; lib/libglut.a(fg_window.c.o):(.bss+0x8): first defined here
+```
+
+Note: duplicate definition comes here from 'fg_gl2.h'.
+The fix is to move declaration to a 'fg_gl2.c' file.
+
+gcc-10 will change the default from -fcommon to fno-common:
+https://gcc.gnu.org/PR85678.
+
+The error also happens if CFLAGS=-fno-common passed explicitly.
+
+Bug: https://bugs.gentoo.org/705840
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ freeglut/freeglut/src/fg_gl2.c | 12 ++++++++++++
+ freeglut/freeglut/src/fg_gl2.h | 14 +++++++-------
+ 2 files changed, 19 insertions(+), 7 deletions(-)
+
+--- a/thirdparty/freeglut/src/fg_gl2.c
++++ b/thirdparty/freeglut/src/fg_gl2.c
+@@ -27,6 +27,18 @@
+ #include "fg_internal.h"
+ #include "fg_gl2.h"
+ 
++#ifdef GL_ES_VERSION_2_0
++/* Use existing functions on GLES 2.0 */
++#else
++FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++FGH_PFNGLBUFFERDATAPROC fghBufferData;
++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++#endif
++
+ void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
+   if (fgStructure.CurrentWindow != NULL)
+     fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
+--- a/thirdparty/freeglut/src/fg_gl2.h
++++ b/thirdparty/freeglut/src/fg_gl2.h
+@@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+ typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
+ typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+ 
+-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+-FGH_PFNGLBUFFERDATAPROC fghBufferData;
+-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+ 
+ #    endif
+ 
+-- 
+2.25.0
+

diff --git a/app-text/mupdf/mupdf-1.16.1.ebuild b/app-text/mupdf/mupdf-1.16.1.ebuild
index 117de7bc199..a7b99956515 100644
--- a/app-text/mupdf/mupdf-1.16.1.ebuild
+++ b/app-text/mupdf/mupdf-1.16.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -46,6 +46,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
 	# See bugs #662352
 	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
+	"${FILESDIR}"/${PN}-1.16.1-freeglut-fg_gl2-gcc-10.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2020-08-14  4:21 Sam James
  0 siblings, 0 replies; 27+ messages in thread
From: Sam James @ 2020-08-14  4:21 UTC (permalink / raw
  To: gentoo-commits

commit:     0985c4811a165c289d7cde5a81ea960077d7a235
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 14 04:09:42 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 14 04:21:22 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0985c481

app-text/mupdf: security bump to 1.17.0

* Debundle dev-lang/mujs again for the
  security bug (bundled copy is probably OK
  in terms of release mujs, but not a new bug
  (CVE-2020-24343).

* Document bundled libs with references
  to check when bumping. Useful for both
  security@ and the maintainer.

* Include extra Debian patches for improved
  cross-compilation support (mostly pkg-config).

* Fix existing patch to respect libdir in pkgconfig
  file.

* Fix missing || dies.

Bug: https://bugs.gentoo.org/737034
Bug: https://bugs.gentoo.org/737020
Closes: https://bugs.gentoo.org/725672
Closes: https://bugs.gentoo.org/734898
Package-Manager: Portage-3.0.2, Repoman-2.3.23
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   1 +
 .../mupdf/files/mupdf-1.17.0-cross-fixes.patch     | 103 ++++++++++++++
 app-text/mupdf/mupdf-1.17.0.ebuild                 | 153 +++++++++++++++++++++
 3 files changed, 257 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 964f9c13501..7d709695072 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1 +1,2 @@
 DIST mupdf-1.16.1-source.tar.xz 45800404 BLAKE2B bc4158a457056c55db52a518efc13c289cca537c29a6b563046297dc225f3ce0add781adb8520c4d0829d653ed0539042597e341cb21c4fb4c462ed422bf735b SHA512 fa657e6b9251aff91c25e91b335ea829b797dd91a759505bfd7259f8236613f590a044bc741e9b0587da55817a1ab8c1499c067d65d683d099259d06d91a8f50
+DIST mupdf-1.17.0-source.tar.xz 48559964 BLAKE2B f46b09a6d288054da79bea356df4d7d98fe2759cf82bea1f0df2e961b94acebbab58826f7a731c4c68e8b086fd9367fddcabea6c7d2838f25ed84ddc1a0c2bd9 SHA512 39188e6ce3eaefb525b2c32767c4bf52ed881b41889edef086aa64bfe1c38e6f3cb853450c8284d175ef8854f32e9bc67415a692048ead26cf31c35645f9e0e5

diff --git a/app-text/mupdf/files/mupdf-1.17.0-cross-fixes.patch b/app-text/mupdf/files/mupdf-1.17.0-cross-fixes.patch
new file mode 100644
index 00000000000..ae14f9bb5e4
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.17.0-cross-fixes.patch
@@ -0,0 +1,103 @@
+Refreshed patches based on:
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0004-MuPDF-crossbuild-use-target-arch-pkg-config.patch/
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0005-MuPDF-crossbuild-use-host-cc-for-utils.patch/
+--- a/Makefile
++++ b/Makefile
+@@ -134,6 +134,9 @@ PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.o)
+ 
+ HEXDUMP_EXE := $(OUT)/scripts/hexdump.exe
+ 
++$(HEXDUMP_EXE): scripts/hexdump.c
++	$(QUIET_CC) $(MKTGTDIR) ; $(CC_FOR_BUILD) $(CFLAGS) -o $@ $<
++
+ FONT_BIN := $(sort $(wildcard resources/fonts/urw/*.cff))
+ FONT_BIN += $(sort $(wildcard resources/fonts/han/*.ttc))
+ FONT_BIN += $(sort $(wildcard resources/fonts/droid/*.ttf))
+--- a/Makerules
++++ b/Makerules
+@@ -15,6 +15,9 @@ OS := $(OS:MSYS%=MINGW)
+ OS := $(OS:Windows_NT=MINGW)
+ OS := $(OS:Darwin=MACOS)
+ 
++PKG_CONFIG ?= pkg-config
++CC_FOR_BUILD ?= $(CC)
++
+ ifeq ($(findstring -fembed-bitcode,$(XCFLAGS)),)
+   # clang does not support these in combination with -fembed-bitcode
+   CFLAGS += -ffunction-sections -fdata-sections
+@@ -101,35 +104,35 @@ else ifeq ($(OS),MACOS)
+ else ifeq ($(OS),Linux)
+   HAVE_OBJCOPY := yes
+ 
+-  ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+-	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+-	SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
++  ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes)
++	SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
++	SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
+   endif
+-  ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
+-	SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
+-	SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
++  ifeq ($(shell $(PKG_CONFIG) --exists harfbuzz && echo yes),yes)
++	SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz)
++	SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz)
+   endif
+-  ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes)
+-	SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2)
+-	SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2)
++  ifeq ($(shell $(PKG_CONFIG) --exists lcms2 && echo yes),yes)
++	SYS_LCMS2_CFLAGS := $(shell $(PKG_CONFIG) --cflags lcms2)
++	SYS_LCMS2_LIBS := $(shell $(PKG_CONFIG) --libs lcms2)
+   endif
+-  ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
+-	SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
+-	SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
++  ifeq ($(shell $(PKG_CONFIG) --exists libjpeg && echo yes),yes)
++	SYS_LIBJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libjpeg)
++	SYS_LIBJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libjpeg)
+   endif
+-  ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
+-	SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
+-	SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
++  ifeq ($(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes),yes)
++	SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2)
++	SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2)
+   endif
+-  ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
+-	SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
+-	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
++  ifeq ($(shell $(PKG_CONFIG) --exists zlib && echo yes),yes)
++	SYS_ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
++	SYS_ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
+   endif
+ 
+-  HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes)
++  HAVE_SYS_CURL := $(shell $(PKG_CONFIG) --exists libcurl && echo yes)
+   ifeq ($(HAVE_SYS_CURL),yes)
+-	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+-	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
++	SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl)
++	SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl)
+   endif
+ 
+   HAVE_GLUT := yes
+@@ -140,14 +143,14 @@ else ifeq ($(OS),Linux)
+ 
+   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)
++	X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext)
++	X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext)
+   endif
+ 
+   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)
++	LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO
++	LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
+   endif
+ 
+   HAVE_PTHREAD := yes

diff --git a/app-text/mupdf/mupdf-1.17.0.ebuild b/app-text/mupdf/mupdf-1.17.0.ebuild
new file mode 100644
index 00000000000..61f7125c382
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.17.0.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit desktop flag-o-matic toolchain-funcs xdg
+
+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"
+S="${WORKDIR}/${P}-source"
+
+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"
+
+# Although we use the bundled, patched version of freeglut in mupdf (because of
+# bug #653298), the best way to ensure that its dependencies are present is to
+# install system's freeglut.
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+	>=dev-lang/mujs-1.0.7:=[static-libs?]
+	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?]
+	opengl? ( >=media-libs/freeglut-3.0.0:= )
+	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}"
+
+REQUIRED_USE="opengl? ( !static-libs )"
+
+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
+	"${FILESDIR}"/${PN}-1.16.1-freeglut-fg_gl2-gcc-10.patch
+	# General cross fixes from Debian (refreshed)
+	"${FILESDIR}"/${PN}-1.17.0-cross-fixes.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 || die
+
+	# 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.
+
+	# Bundled libs
+	# * General
+	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
+	# recommendations. It does not mean "always use system libs".
+	# See [0] below for what it means in a specific version.
+	#
+	# * freeglut
+	# We don't use system's freeglut because upstream has a special modified
+	# version of it that gives mupdf clipboard support. See bug #653298
+	#
+	# * mujs
+	# As of v1.15.0, mupdf started using symbols in mujs that were not part
+	# of any release. We then went back to using the bundled version of it.
+	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
+	# when bumping and check!
+	# See bug #685244
+	#
+	# * lmms2
+	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
+	# It is therefore not appropriate for us to unbundle it at this time.
+	#
+	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
+	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
+
+	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 || die
+	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
+
+	# Respect libdir (bug #734898)
+	sed -i -e "s:/lib:/$(get_libdir):" platform/debian/${PN}.pc || die
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2020-10-13 23:21 Sam James
  0 siblings, 0 replies; 27+ messages in thread
From: Sam James @ 2020-10-13 23:21 UTC (permalink / raw
  To: gentoo-commits

commit:     a986634efb6c5c0842444e989d86e10472412699
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Mon Oct 12 10:51:19 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 13 23:21:38 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a986634e

app-text/mupdf: bump to 1.18.0 (CVE-2020-26519)

Bug: https://bugs.gentoo.org/747151
Removing some keywords (RDEPEND dev-libs/gumbo)

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/17898
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   1 +
 app-text/mupdf/files/mupdf-1.18-Makefile.patch     |  42 ++++++
 .../mupdf/files/mupdf-1.18.0-cross-fixes.patch     | 128 ++++++++++++++++++
 app-text/mupdf/mupdf-1.18.0.ebuild                 | 150 +++++++++++++++++++++
 4 files changed, 321 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 7d709695072..7c07b736ec9 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,2 +1,3 @@
 DIST mupdf-1.16.1-source.tar.xz 45800404 BLAKE2B bc4158a457056c55db52a518efc13c289cca537c29a6b563046297dc225f3ce0add781adb8520c4d0829d653ed0539042597e341cb21c4fb4c462ed422bf735b SHA512 fa657e6b9251aff91c25e91b335ea829b797dd91a759505bfd7259f8236613f590a044bc741e9b0587da55817a1ab8c1499c067d65d683d099259d06d91a8f50
 DIST mupdf-1.17.0-source.tar.xz 48559964 BLAKE2B f46b09a6d288054da79bea356df4d7d98fe2759cf82bea1f0df2e961b94acebbab58826f7a731c4c68e8b086fd9367fddcabea6c7d2838f25ed84ddc1a0c2bd9 SHA512 39188e6ce3eaefb525b2c32767c4bf52ed881b41889edef086aa64bfe1c38e6f3cb853450c8284d175ef8854f32e9bc67415a692048ead26cf31c35645f9e0e5
+DIST mupdf-1.18.0-source.tar.xz 53621544 BLAKE2B d0057f4240bd4f6b4b6d9381ae1c3871c56b97604d5c6ea6438a8bde72d4696c10a9f0e8e2ed8f43d63a04bb1d973bade8a708327c00b0d0c6802b28af697a55 SHA512 7551f18b9bac6e2dc1cf073741cbc975ce3a16dc7e37c9d5a58254c67bf2c07bb36185d6585e435d4126f3ae351f67d7432d19a986c9b47b15105ca43db0edb8

diff --git a/app-text/mupdf/files/mupdf-1.18-Makefile.patch b/app-text/mupdf/files/mupdf-1.18-Makefile.patch
new file mode 100644
index 00000000000..32ee7e57c49
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.18-Makefile.patch
@@ -0,0 +1,42 @@
+diff --git a/Makefile b/Makefile
+index b0fb617..528e117 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,7 +3,7 @@
+ -include user.make
+ 
+ ifndef build
+-  build := release
++  build := debug
+ endif
+ 
+ ifndef OUT
+@@ -214,13 +214,15 @@ MUPDF_LIB = $(OUT)/libmupdf.$(SO)
+ 
+ $(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_OBJ) $(THREAD_OBJ) $(PKCS7_OBJ)
+ else
+-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)
+ endif
+@@ -374,7 +376,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.18.0-cross-fixes.patch b/app-text/mupdf/files/mupdf-1.18.0-cross-fixes.patch
new file mode 100644
index 00000000000..0576033a03a
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.18.0-cross-fixes.patch
@@ -0,0 +1,128 @@
+Refreshed patches based on:
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0004-MuPDF-crossbuild-use-target-arch-pkg-config.patch/
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0005-MuPDF-crossbuild-use-host-cc-for-utils.patch/
+--- a/Makefile
++++ b/Makefile
+@@ -147,6 +147,9 @@ PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.o)
+ 
+ HEXDUMP_EXE := $(OUT)/scripts/hexdump.exe
+ 
++$(HEXDUMP_EXE): scripts/hexdump.c
++	$(QUIET_CC) $(MKTGTDIR) ; $(CC_FOR_BUILD) $(CFLAGS) -o $@ $<
++
+ FONT_BIN := $(sort $(wildcard resources/fonts/urw/*.cff))
+ FONT_BIN += $(sort $(wildcard resources/fonts/han/*.ttc))
+ FONT_BIN += $(sort $(wildcard resources/fonts/droid/*.ttf))
+--- a/Makerules
++++ b/Makerules
+@@ -6,6 +6,9 @@ OS := $(OS:MSYS%=MINGW)
+ OS := $(OS:Windows_NT=MINGW)
+ OS := $(OS:Darwin=MACOS)
+ 
++PKG_CONFIG ?= pkg-config
++CC_FOR_BUILD ?= $(CC)
++
+ ifeq ($(findstring -fembed-bitcode,$(XCFLAGS)),)
+   # clang does not support these in combination with -fembed-bitcode
+   CFLAGS += -ffunction-sections -fdata-sections
+@@ -128,51 +128,51 @@ else ifeq ($(OS),MACOS)
+ else ifeq ($(OS),Linux)
+   HAVE_OBJCOPY := yes
+ 
+-  ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+-	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+-	SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
++  ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes)
++	SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
++	SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
+   endif
+-  ifeq ($(shell pkg-config --exists gumbo && echo yes),yes)
+-	SYS_GUMBO_CFLAGS := $(shell pkg-config --cflags gumbo)
+-	SYS_GUMBO_LIBS := $(shell pkg-config --libs gumbo)
++  ifeq ($(shell $(PKG_CONFIG) --exists gumbo && echo yes),yes)
++	SYS_GUMBO_CFLAGS := $(shell $(PKG_CONFIG) --cflags gumbo)
++	SYS_GUMBO_LIBS := $(shell $(PKG_CONFIG) --libs gumbo)
+   endif
+-  ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
+-	SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
+-	SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
++  ifeq ($(shell $(PKG_CONFIG) --exists harfbuzz && echo yes),yes)
++	SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz)
++	SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz)
+   endif
+-  ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes)
+-	SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2)
+-	SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2)
++  ifeq ($(shell $(PKG_CONFIG) --exists lcms2 && echo yes),yes)
++	SYS_LCMS2_CFLAGS := $(shell $(PKG_CONFIG) --cflags lcms2)
++	SYS_LCMS2_LIBS := $(shell $(PKG_CONFIG) --libs lcms2)
+   endif
+-  ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
+-	SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
+-	SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
++  ifeq ($(shell $(PKG_CONFIG) --exists libjpeg && echo yes),yes)
++	SYS_LIBJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libjpeg)
++	SYS_LIBJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libjpeg)
+   endif
+-  ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
+-	SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
+-	SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
++  ifeq ($(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes),yes)
++	SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2)
++	SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2)
+   endif
+-  ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
+-	SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
+-	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
++  ifeq ($(shell $(PKG_CONFIG) --exists zlib && echo yes),yes)
++	SYS_ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
++	SYS_ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
+   endif
+ 
+-  HAVE_LEPTONICA := $(shell pkg-config --exists 'lept >= 1.7.4' && echo yes)
++  HAVE_LEPTONICA := $(shell $(PKG_CONFIG) --exists 'lept >= 1.7.4' && echo yes)
+   ifeq ($(HAVE_LEPTONICA),yes)
+-	SYS_LEPTONICA_CFLAGS := $(shell pkg-config --cflags lept)
+-	SYS_LEPTONICA_LIBS := $(shell pkg-config --libs lept)
++	SYS_LEPTONICA_CFLAGS := $(shell $(PKG_CONFIG) --cflags lept)
++	SYS_LEPTONICA_LIBS := $(shell $(PKG_CONFIG) --libs lept)
+   endif
+ 
+-  HAVE_TESSERACT := $(shell pkg-config --exists 'tesseract-ocr >= 4.0.0' && echo yes)
++  HAVE_TESSERACT := $(shell $(PKG_CONFIG) --exists 'tesseract-ocr >= 4.0.0' && echo yes)
+   ifeq ($(HAVE_TESSERACT),yes)
+-	SYS_TESSERACT_CFLAGS := $(shell pkg-config --cflags tesseract)
+-	SYS_TESSERACT_LIBS := $(shell pkg-config --libs tesseract)
++	SYS_TESSERACT_CFLAGS := $(shell $(PKG_CONFIG) --cflags tesseract)
++	SYS_TESSERACT_LIBS := $(shell $(PKG_CONFIG) --libs tesseract)
+   endif
+ 
+-  HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes)
++  HAVE_SYS_CURL := $(shell $(PKG_CONFIG) --exists libcurl && echo yes)
+   ifeq ($(HAVE_SYS_CURL),yes)
+-	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+-	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
++	SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl)
++	SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl)
+   endif
+ 
+   HAVE_GLUT := yes
+@@ -183,14 +183,14 @@ else ifeq ($(OS),Linux)
+ 
+   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)
++	X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext)
++	X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext)
+   endif
+ 
+   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)
++	LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO
++	LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
+   endif
+ 
+   HAVE_PTHREAD := yes

diff --git a/app-text/mupdf/mupdf-1.18.0.ebuild b/app-text/mupdf/mupdf-1.18.0.ebuild
new file mode 100644
index 00000000000..2a7b35539b9
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.18.0.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit desktop flag-o-matic toolchain-funcs xdg
+
+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"
+S="${WORKDIR}/${P}-source"
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="X +javascript libressl opengl ssl static-libs"
+
+# Although we use the bundled, patched version of freeglut in mupdf (because of
+# bug #653298), the best way to ensure that its dependencies are present is to
+# install system's freeglut.
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+	>=dev-lang/mujs-1.0.7:=[static-libs?]
+	dev-libs/gumbo
+	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?]
+	opengl? ( >=media-libs/freeglut-3.0.0:= )
+	ssl? (
+		libressl? ( >=dev-libs/libressl-3.2.0: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}"
+
+REQUIRED_USE="opengl? ( !static-libs )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
+	"${FILESDIR}"/${PN}-1.18-Makefile.patch
+	"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+	# See bugs #662352
+	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
+	# General cross fixes from Debian (refreshed)
+	"${FILESDIR}"/${PN}-1.18.0-cross-fixes.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 || die
+
+	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.
+
+	# Bundled libs
+	# * General
+	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
+	# recommendations. It does not mean "always use system libs".
+	# See [0] below for what it means in a specific version.
+	#
+	# * freeglut
+	# We don't use system's freeglut because upstream has a special modified
+	# version of it that gives mupdf clipboard support. See bug #653298
+	#
+	# * mujs
+	# As of v1.15.0, mupdf started using symbols in mujs that were not part
+	# of any release. We then went back to using the bundled version of it.
+	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
+	# when bumping and check!
+	# See bug #685244
+	#
+	# * lmms2
+	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
+	# It is therefore not appropriate for us to unbundle it at this time.
+	#
+	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
+	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
+
+	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 || die
+	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
+
+	# Respect libdir (bug #734898)
+	sed -i -e "s:/lib:/$(get_libdir):" platform/debian/${PN}.pc || die
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2021-04-14 22:03 Sam James
  0 siblings, 0 replies; 27+ messages in thread
From: Sam James @ 2021-04-14 22:03 UTC (permalink / raw
  To: gentoo-commits

commit:     179ae2aff7affd4cc9e273ae1c7ec4ef3b443578
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 14 21:37:36 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 14 22:00:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=179ae2af

app-text/mupdf: improve build on Darwin, ${ED} usage, libressl--

Not quite there on Darwin, need to fix -soname usage, but
a lot further than before.

We also fix incorrect ${ED} usage, export ${PKG_CONFIG}, and
drop USE=libressl.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-text/mupdf/files/mupdf-1.18.0-darwin.patch | 41 +++++++++++++++++++++++
 app-text/mupdf/mupdf-1.18.0-r3.ebuild          | 45 +++++++++++++++-----------
 2 files changed, 67 insertions(+), 19 deletions(-)

diff --git a/app-text/mupdf/files/mupdf-1.18.0-darwin.patch b/app-text/mupdf/files/mupdf-1.18.0-darwin.patch
new file mode 100644
index 00000000000..cdd8ccf0f40
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.18.0-darwin.patch
@@ -0,0 +1,41 @@
+--- a/Makerules
++++ b/Makerules
+@@ -117,11 +117,11 @@ ifeq ($(OS),MINGW)
+ else ifeq ($(OS),MACOS)
+   HAVE_GLUT := yes
+   SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
+-  SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
+-  CC = xcrun cc
+-  AR = xcrun ar
+-  LD = xcrun ld
+-  RANLIB = xcrun ranlib
++  SYS_GLUT_LIBS ?= -framework GLUT -framework OpenGL
++  CC ?= xcrun cc
++  AR ?= xcrun ar
++  LD ?= xcrun ld
++  RANLIB ?= xcrun ranlib
+ 
+ else ifeq ($(OS),Linux)
+   HAVE_OBJCOPY := yes
+--- a/Makerules
++++ b/Makerules
+@@ -122,9 +122,7 @@ else ifeq ($(OS),MACOS)
+   AR ?= xcrun ar
+   LD ?= xcrun ld
+   RANLIB ?= xcrun ranlib
+-
+-else ifeq ($(OS),Linux)
+-  HAVE_OBJCOPY := yes
++endif
+ 
+   ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes)
+ 	SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
+@@ -197,8 +195,6 @@ else ifeq ($(OS),Linux)
+ 	PTHREAD_LIBS := -lpthread
+   endif
+ 
+-endif
+-
+ # The following section has various cross compilation configurations.
+ #
+ # Invoke these as:

diff --git a/app-text/mupdf/mupdf-1.18.0-r3.ebuild b/app-text/mupdf/mupdf-1.18.0-r3.ebuild
index 8c96cdb6255..60145d9c3d3 100644
--- a/app-text/mupdf/mupdf-1.18.0-r3.ebuild
+++ b/app-text/mupdf/mupdf-1.18.0-r3.ebuild
@@ -8,18 +8,17 @@ inherit desktop flag-o-matic toolchain-funcs xdg
 DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
 HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
 SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.xz"
-S="${WORKDIR}/${P}-source"
+S="${WORKDIR}"/${P}-source
 
 LICENSE="AGPL-3"
 SLOT="0/${PV}"
 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~s390 x86"
-IUSE="+javascript libressl opengl ssl X"
+IUSE="+javascript opengl ssl X"
 REQUIRED_USE="opengl? ( javascript )"
 
 # Although we use the bundled, patched version of freeglut in mupdf (because of
 # bug #653298), the best way to ensure that its dependencies are present is to
 # install system's freeglut.
-BDEPEND="virtual/pkgconfig"
 RDEPEND="
 	dev-libs/gumbo
 	media-libs/freetype:2=
@@ -30,21 +29,20 @@ RDEPEND="
 	virtual/jpeg
 	javascript? ( >=dev-lang/mujs-1.0.7:= )
 	opengl? ( >=media-libs/freeglut-3.0.0 )
-	ssl? (
-		libressl? ( >=dev-libs/libressl-3.1.4:0= )
-		!libressl? ( >=dev-libs/openssl-1.1:0= )
-	)
+	ssl? ( >=dev-libs/openssl-1.1:0= )
 	X? (
 		x11-libs/libX11
 		x11-libs/libXext
 	)
 "
 DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
 	"${FILESDIR}"/${PN}-1.18-Makefile.patch
 	"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+	"${FILESDIR}"/${PN}-1.18.0-darwin.patch
 	# See bugs #662352
 	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
 	# General cross fixes from Debian (refreshed)
@@ -69,14 +67,12 @@ src_prepare() {
 		-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.
+	#
 	# Bundled libs
 	# * General
 	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
@@ -100,19 +96,24 @@ _emake() {
 	#
 	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
 	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
-	emake \
-		GENTOO_PV=${PF} \
-		HAVE_GLUT=$(usex opengl) \
-		HAVE_LIBCRYPTO=$(usex ssl) \
-		HAVE_X11=$(usex X) \
-		USE_SYSTEM_LIBS=yes \
-		USE_SYSTEM_MUJS=$(usex javascript) \
-		USE_SYSTEM_GLUT=no \
-		HAVE_OBJCOPY=no \
+	local myemakeargs=(
+		GENTOO_PV=${PF}
+		HAVE_GLUT=$(usex opengl)
+		HAVE_LIBCRYPTO=$(usex ssl)
+		HAVE_X11=$(usex X)
+		USE_SYSTEM_LIBS=yes
+		USE_SYSTEM_MUJS=$(usex javascript)
+		USE_SYSTEM_GLUT=no
+		HAVE_OBJCOPY=no
 		"$@"
+	)
+
+	emake "${myemakeargs[@]}"
 }
 
 src_compile() {
+	tc-export PKG_CONFIG
+
 	_emake XCFLAGS="-fPIC"
 }
 
@@ -124,6 +125,12 @@ src_install() {
 		rm docs/man/${PN}.1 || die
 	fi
 
+	sed -i \
+		-e "1iprefix = ${ED}/usr" \
+		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
+		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
+		-i Makerules || die
+
 	_emake install
 
 	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2021-12-04  8:20 Joonas Niilola
  0 siblings, 0 replies; 27+ messages in thread
From: Joonas Niilola @ 2021-12-04  8:20 UTC (permalink / raw
  To: gentoo-commits

commit:     59271a38de883bea2a0ebdc0f42dd1ca458b11f0
Author:     Philipp Roesner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Fri Dec  3 23:59:47 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Dec  4 08:18:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59271a38

app-text/mupdf: bump to 1.19.0

We version bumped the package to mupdf-1.19.0.
Several patches were removed because they were fixed upstream.

Closes: https://bugs.gentoo.org/827957
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Philipp Roesner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/23174
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   1 +
 app-text/mupdf/files/mupdf-1.19.0-Makefile.patch   |  37 +++++
 .../mupdf/files/mupdf-1.19.0-cross-fixes.patch     | 130 ++++++++++++++++++
 app-text/mupdf/files/mupdf-1.19.0-darwin.patch     |  39 ++++++
 app-text/mupdf/mupdf-1.19.0.ebuild                 | 152 +++++++++++++++++++++
 5 files changed, 359 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index acda2b0eb4e3..c901a64470da 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1 +1,2 @@
 DIST mupdf-1.18.0-source.tar.xz 53621544 BLAKE2B d0057f4240bd4f6b4b6d9381ae1c3871c56b97604d5c6ea6438a8bde72d4696c10a9f0e8e2ed8f43d63a04bb1d973bade8a708327c00b0d0c6802b28af697a55 SHA512 7551f18b9bac6e2dc1cf073741cbc975ce3a16dc7e37c9d5a58254c67bf2c07bb36185d6585e435d4126f3ae351f67d7432d19a986c9b47b15105ca43db0edb8
+DIST mupdf-1.19.0-source.tar.xz 64077324 BLAKE2B 4c30cfc004b4f354ae349e5460327775a4dbdd689e561888c156e9e69e22b45ea1f260dfed8d2d8c017fe65a1e83cabc8ff29dad8de47a2c541f9e335bf11285 SHA512 421e8e49f83cf00bfb2c86b5425939056fe866a048cf18e4c8f5764cdee9829974eea655c944d0f3f5a9407347cceaef34030f4079aa399e798da3ff849230e7

diff --git a/app-text/mupdf/files/mupdf-1.19.0-Makefile.patch b/app-text/mupdf/files/mupdf-1.19.0-Makefile.patch
new file mode 100644
index 000000000000..b266655aaeca
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.19.0-Makefile.patch
@@ -0,0 +1,37 @@
+diff --git a/Makefile b/Makefile
+index 7fa74b3..e842374 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,7 +3,7 @@
+ -include user.make
+ 
+ ifndef build
+-  build := release
++  build := debug
+ endif
+ 
+ default: all
+@@ -252,17 +252,19 @@ $(THIRD_GLUT_LIB) : $(THIRD_GLUT_OBJ)
+ $(THREAD_LIB) : $(THREAD_OBJ)
+ $(PKCS7_LIB) : $(PKCS7_OBJ)
+ else
+-MUPDF_LIB = $(OUT)/libmupdf.a
++MUPDF_LIB = libmupdf.so.$(GENTOO_PV) 
+ LIBS_TO_INSTALL_IN_LIB = $(MUPDF_LIB) $(THIRD_LIB)
+-THIRD_LIB = $(OUT)/libmupdf-third.a
++THIRD_LIB = 
++MUPDF_STATIC = $(OUT)/libmupdf.a
+ ifneq ($(USE_SYSTEM_GLUT),yes)
+ THIRD_GLUT_LIB = $(OUT)/libmupdf-glut.a
+ endif
+ 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)
+ $(THIRD_GLUT_LIB) : $(THIRD_GLUT_OBJ)
+ $(THREAD_LIB) : $(THREAD_OBJ)
+ $(PKCS7_LIB) : $(PKCS7_OBJ)

diff --git a/app-text/mupdf/files/mupdf-1.19.0-cross-fixes.patch b/app-text/mupdf/files/mupdf-1.19.0-cross-fixes.patch
new file mode 100644
index 000000000000..643b6d2c8b1e
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.19.0-cross-fixes.patch
@@ -0,0 +1,130 @@
+Refreshed patches based on:
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0004-MuPDF-crossbuild-use-target-arch-pkg-config.patch/
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0005-MuPDF-crossbuild-use-host-cc-for-utils.patch/
+--- a/Makefile
++++ b/Makefile
+@@ -147,6 +147,9 @@ PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.o)
+
+ HEXDUMP_EXE := $(OUT)/scripts/hexdump.exe
+
++$(HEXDUMP_EXE): scripts/hexdump.c
++	$(QUIET_CC) $(MKTGTDIR) ; $(CC_FOR_BUILD) $(CFLAGS) -o $@ $<
++
+ FONT_BIN := $(sort $(wildcard resources/fonts/urw/*.cff))
+ FONT_BIN += $(sort $(wildcard resources/fonts/han/*.ttc))
+ FONT_BIN += $(sort $(wildcard resources/fonts/droid/*.ttf))
+--- a/Makerules
++++ b/Makerules
+@@ -6,6 +6,9 @@ OS := $(OS:MSYS%=MINGW)
+ OS := $(OS:Windows_NT=MINGW)
+ OS := $(OS:Darwin=MACOS)
+ 
++PKG_CONFIG ?= pkg-config
++CC_FOR_BUILD ?= $(CC)
++
+ WARNING_CFLAGS := -Wall -Wsign-compare
+ 
+ # Feature configuration options
+@@ -156,51 +159,51 @@ else ifeq ($(OS),MACOS)
+   endif
+ endif
+ 
+-  ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+-	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+-	SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
++  ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes)
++	SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
++	SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
+   endif
+-  ifeq ($(shell pkg-config --exists gumbo && echo yes),yes)
+-	SYS_GUMBO_CFLAGS := $(shell pkg-config --cflags gumbo)
+-	SYS_GUMBO_LIBS := $(shell pkg-config --libs gumbo)
++  ifeq ($(shell $(PKG_CONFIG) --exists gumbo && echo yes),yes)
++	SYS_GUMBO_CFLAGS := $(shell $(PKG_CONFIG) --cflags gumbo)
++	SYS_GUMBO_LIBS := $(shell $(PKG_CONFIG) --libs gumbo)
+   endif
+-  ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
+-	SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
+-	SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
++  ifeq ($(shell $(PKG_CONFIG) --exists harfbuzz && echo yes),yes)
++	SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz)
++	SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz)
+   endif
+-  ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes)
+-	SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2)
+-	SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2)
++  ifeq ($(shell $(PKG_CONFIG) --exists lcms2 && echo yes),yes)
++	SYS_LCMS2_CFLAGS := $(shell $(PKG_CONFIG) --cflags lcms2)
++	SYS_LCMS2_LIBS := $(shell $(PKG_CONFIG) --libs lcms2)
+   endif
+-  ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
+-	SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
+-	SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
++  ifeq ($(shell $(PKG_CONFIG) --exists libjpeg && echo yes),yes)
++	SYS_LIBJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libjpeg)
++	SYS_LIBJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libjpeg)
+   endif
+-  ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
+-	SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
+-	SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
++  ifeq ($(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes),yes)
++	SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2)
++	SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2)
+   endif
+-  ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
+-	SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
+-	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
++  ifeq ($(shell $(PKG_CONFIG) --exists zlib && echo yes),yes)
++	SYS_ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
++	SYS_ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
+   endif
+ 
+-  HAVE_SYS_LEPTONICA := $(shell pkg-config --exists 'lept >= 1.7.4' && echo yes)
++  HAVE_SYS_LEPTONICA := $(shell $(PKG_CONFIG) --exists 'lept >= 1.7.4' && echo yes)
+   ifeq ($(HAVE_SYS_LEPTONICA),yes)
+-	SYS_LEPTONICA_CFLAGS := $(shell pkg-config --cflags lept)
+-	SYS_LEPTONICA_LIBS := $(shell pkg-config --libs lept)
++	SYS_LEPTONICA_CFLAGS := $(shell $(PKG_CONFIG) --cflags lept)
++	SYS_LEPTONICA_LIBS := $(shell $(PKG_CONFIG) --libs lept)
+   endif
+ 
+-  HAVE_SYS_TESSERACT := $(shell pkg-config --exists 'tesseract >= 4.0.0' && echo yes)
++  HAVE_SYS_TESSERACT := $(shell $(PKG_CONFIG) --exists 'tesseract >= 4.0.0' && echo yes)
+   ifeq ($(HAVE_SYS_TESSERACT),yes)
+-	SYS_TESSERACT_CFLAGS := $(shell pkg-config --cflags tesseract)
+-	SYS_TESSERACT_LIBS := $(shell pkg-config --libs tesseract)
++	SYS_TESSERACT_CFLAGS := $(shell $(PKG_CONFIG) --cflags tesseract)
++	SYS_TESSERACT_LIBS := $(shell $(PKG_CONFIG) --libs tesseract)
+   endif
+ 
+-  HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes)
++  HAVE_SYS_CURL := $(shell $(PKG_CONFIG) --exists libcurl && echo yes)
+   ifeq ($(HAVE_SYS_CURL),yes)
+-	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+-	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
++	SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl)
++	SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl)
+   endif
+ 
+   HAVE_GLUT := yes
+@@ -209,16 +212,16 @@ endif
+ 	SYS_GLUT_LIBS := -lglut -lGL
+   endif
+ 
+   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)
++	X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext)
++	X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext)
+   endif
+ 
+   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)
++	LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO
++	LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
+   endif
+ 
+   HAVE_PTHREAD := yes

diff --git a/app-text/mupdf/files/mupdf-1.19.0-darwin.patch b/app-text/mupdf/files/mupdf-1.19.0-darwin.patch
new file mode 100644
index 000000000000..a81c7a008e44
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.19.0-darwin.patch
@@ -0,0 +1,39 @@
+--- a/Makerules
++++ b/Makerules
+@@ -139,11 +139,11 @@ ifeq ($(OS),MINGW)
+ else ifeq ($(OS),MACOS)
+   HAVE_GLUT := yes
+   SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
+-  SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
+-  CC = xcrun cc
+-  AR = xcrun ar
+-  LD = xcrun ld
+-  RANLIB = xcrun ranlib
++  SYS_GLUT_LIBS ?= -framework GLUT -framework OpenGL
++  CC ?= xcrun cc
++  AR ?= xcrun ar
++  LD ?= xcrun ld
++  RANLIB ?= xcrun ranlib
+ 
+   ifeq (, $(shell which pkg-config))
+     $(warning "No pkg-config found, install it for proper integration of libcrypto")
+@@ -154,9 +154,7 @@ else ifeq ($(OS),MACOS)
+ 	  LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
+     endif
+   endif
+-
+-else ifeq ($(OS),Linux)
+-  HAVE_OBJCOPY := yes
++endif
+ 
+   ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+ 	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+@@ -229,8 +227,6 @@ else ifeq ($(OS),Linux)
+ 	PTHREAD_LIBS := -lpthread
+   endif
+ 
+-endif
+-
+ # The following section has various cross compilation configurations.
+ #
+ # Invoke these as:

diff --git a/app-text/mupdf/mupdf-1.19.0.ebuild b/app-text/mupdf/mupdf-1.19.0.ebuild
new file mode 100644
index 000000000000..e98b869cc5e1
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.19.0.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# Please check upstream git regularly for relevant security-related commits
+# to backport.
+
+inherit desktop flag-o-matic toolchain-funcs xdg
+
+DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
+SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.xz"
+S="${WORKDIR}"/${P}-source
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~x86"
+IUSE="+javascript opengl ssl X"
+REQUIRED_USE="opengl? ( javascript )"
+
+# Although we use the bundled, patched version of freeglut in mupdf (because of
+# bug #653298), the best way to ensure that its dependencies are present is to
+# install system's freeglut.
+RDEPEND="
+	dev-libs/gumbo
+	media-libs/freetype:2=
+	media-libs/harfbuzz:=[truetype]
+	media-libs/jbig2dec:=
+	media-libs/libpng:0=
+	>=media-libs/openjpeg-2.1:2=
+	virtual/jpeg
+	javascript? ( >=dev-lang/mujs-1.0.7:= )
+	opengl? ( >=media-libs/freeglut-3.0.0 )
+	ssl? ( >=dev-libs/openssl-1.1:0= )
+	X? (
+		x11-libs/libX11
+		x11-libs/libXext
+	)
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
+	"${FILESDIR}"/${PN}-1.19.0-Makefile.patch
+	"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
+	"${FILESDIR}"/${PN}-1.19.0-darwin.patch
+	# See bugs #662352
+	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
+	# General cross fixes from Debian (refreshed)
+	"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
+)
+
+src_prepare() {
+	xdg_src_prepare
+
+	use hppa && append-cflags -ffunction-sections
+
+	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iCXX = $(tc-getCXX)" \
+		-e "1iLD = $(tc-getLD)" \
+		-e "1iAR = $(tc-getAR)" \
+		-e "1iverbose = yes" \
+		-e "1ibuild = debug" \
+		-i Makerules || die
+}
+
+_emake() {
+	# When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
+	#
+	# Bundled libs
+	# * General
+	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
+	# recommendations. It does not mean "always use system libs".
+	# See [0] below for what it means in a specific version.
+	#
+	# * freeglut
+	# We don't use system's freeglut because upstream has a special modified
+	# version of it that gives mupdf clipboard support. See bug #653298
+	#
+	# * mujs
+	# As of v1.15.0, mupdf started using symbols in mujs that were not part
+	# of any release. We then went back to using the bundled version of it.
+	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
+	# when bumping and check!
+	# See bug #685244
+	#
+	# * lmms2
+	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
+	# It is therefore not appropriate for us to unbundle it at this time.
+	#
+	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
+	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
+	local myemakeargs=(
+		GENTOO_PV=${PV}
+		HAVE_GLUT=$(usex opengl)
+		HAVE_LIBCRYPTO=$(usex ssl)
+		HAVE_X11=$(usex X)
+		USE_SYSTEM_LIBS=yes
+		USE_SYSTEM_MUJS=$(usex javascript)
+		USE_SYSTEM_GLUT=no
+		HAVE_OBJCOPY=no
+		"$@"
+	)
+
+	emake "${myemakeargs[@]}"
+}
+
+src_compile() {
+	tc-export PKG_CONFIG
+
+	_emake XCFLAGS="-fPIC"
+}
+
+src_install() {
+	if use opengl || use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon platform/debian/${PN}.xpm
+	else
+		rm docs/man/${PN}.1 || die
+	fi
+
+	sed -i \
+		-e "1iprefix = ${ED}/usr" \
+		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
+		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
+		-i Makerules || die
+
+	_emake install
+
+	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
+
+	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
+
+	# Respect libdir (bug #734898)
+	sed -i -e "s:/lib:/$(get_libdir):" platform/debian/${PN}.pc || die
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2022-06-30 13:33 Florian Schmaus
  0 siblings, 0 replies; 27+ messages in thread
From: Florian Schmaus @ 2022-06-30 13:33 UTC (permalink / raw
  To: gentoo-commits

commit:     3b49a6d09605a565ec329c53ee4e5adcc8c9c2b0
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 30 13:30:19 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Jun 30 13:33:09 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b49a6d0

app-text/mupdf: Revert "fix strict-aliasing violations"

Sam pointed out that the patch my be wrong (although correct from a
strict aliasing view).

This reverts commit e69ffe486e072430217eb921a1886f93d8d74534.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Suggested-by: Sam James <sam <AT> gentoo.org>

 app-text/mupdf/files/mupdf-1.20.0-lcms2.patch | 20 --------------------
 app-text/mupdf/mupdf-1.20.0.ebuild            |  1 -
 2 files changed, 21 deletions(-)

diff --git a/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch b/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch
deleted file mode 100644
index a975d42d15e9..000000000000
--- a/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/thirdparty/lcms2/src/cmsplugin.c
-+++ b/thirdparty/lcms2/src/cmsplugin.c
-@@ -177,7 +177,7 @@ cmsBool CMSEXPORT  _cmsReadFloat32Number(cmsContext ContextID, cmsIOHANDLER* io,
-     if (n != NULL) {
- 
-         tmp = _cmsAdjustEndianess32(tmp);
--        *n = *(cmsFloat32Number*)(void*)&tmp;
-+        *n = (cmsFloat32Number)tmp;
- 
-         // Safeguard which covers against absurd values
-         if (*n > 1E+20 || *n < -1E+20) return FALSE;
-@@ -308,7 +308,7 @@ cmsBool CMSEXPORT  _cmsWriteFloat32Number(cmsContext ContextID, cmsIOHANDLER* io
- 
-     _cmsAssert(io != NULL);
- 
--    tmp = *(cmsUInt32Number*) (void*) &n;
-+    tmp = (cmsUInt32Number)n;
-     tmp = _cmsAdjustEndianess32(tmp);
-     if (io -> Write(ContextID, io, sizeof(cmsUInt32Number), &tmp) != 1)
-             return FALSE;

diff --git a/app-text/mupdf/mupdf-1.20.0.ebuild b/app-text/mupdf/mupdf-1.20.0.ebuild
index 216bbfaa79e7..3d7f8f3e2946 100644
--- a/app-text/mupdf/mupdf-1.20.0.ebuild
+++ b/app-text/mupdf/mupdf-1.20.0.ebuild
@@ -51,7 +51,6 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
 	# General cross fixes from Debian (refreshed)
 	"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
-	"${FILESDIR}"/${P}-lcms2.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2022-07-19  7:41 Florian Schmaus
  0 siblings, 0 replies; 27+ messages in thread
From: Florian Schmaus @ 2022-07-19  7:41 UTC (permalink / raw
  To: gentoo-commits

commit:     a8ca257f22f4ca2eddaec6b04906d2a805c86134
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Wed Jun 29 19:36:48 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue Jul 19 07:35:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8ca257f

app-text/mupdf: fix strict-aliasing violations

Fix two issues in thirdparty/lcms2/src/cmsplugin.c regarding
strinct-aliasing rule violations.

Issue: https://github.com/mm2/Little-CMS/issues/303
PR: https://github.com/mm2/Little-CMS/pull/323

Closes: https://bugs.gentoo.org/855020
Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/26152
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 app-text/mupdf/files/mupdf-1.20.0-lcms2.patch | 69 +++++++++++++++++++++++++++
 app-text/mupdf/mupdf-1.20.0.ebuild            |  1 +
 2 files changed, 70 insertions(+)

diff --git a/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch b/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch
new file mode 100644
index 000000000000..a5cb30e3b74c
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.20.0-lcms2.patch
@@ -0,0 +1,69 @@
+From d98de0bb0b627772625c1acf050ba0dd4b5ac9df Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Tue, 5 Jul 2022 11:35:28 +0200
+Subject: [PATCH] Perform type punning via union without undefined behavior
+
+* The previous code from c3d7f491e2daebda2413fb3d2935c51df1c50ac7
+  still contains undefined behavior, since it just creates
+  temporary pointer variables.
+---
+ src/cmsplugin.c | 31 +++++++++++++++----------------
+ 1 file changed, 15 insertions(+), 16 deletions(-)
+
+This patch slightly differs from the upstream commit, because
+the lcms2 version used in mupdf is slightly behind the upstream
+version.
+
+See: https://github.com/mm2/Little-CMS/commit/d98de0bb0b627772625c1acf050ba0dd4b5ac9df.patch
+
+diff --git a/src/cmsplugin.c b/src/cmsplugin.c
+index 556fbc28..b34e3aab 100644
+--- a/thirdparty/lcms2/src/cmsplugin.c
++++ b/thirdparty/lcms2/src/cmsplugin.c
+@@ -167,17 +167,20 @@ cmsBool CMSEXPORT  _cmsReadUInt32Number(cmsContext ContextID, cmsIOHANDLER* io,
+ 
+ cmsBool CMSEXPORT  _cmsReadFloat32Number(cmsContext ContextID, cmsIOHANDLER* io, cmsFloat32Number* n)
+ {
+-    cmsUInt32Number tmp;
++    union typeConverter {
++        cmsUInt32Number integer;
++        cmsFloat32Number floating_point;
++    } tmp;
+ 
+     _cmsAssert(io != NULL);
+ 
+-    if (io->Read(ContextID, io, &tmp, sizeof(cmsUInt32Number), 1) != 1)
++    if (io->Read(ContextID, io, &tmp.integer, sizeof(cmsUInt32Number), 1) != 1)
+         return FALSE;
+ 
+     if (n != NULL) {
+ 
+-        tmp = _cmsAdjustEndianess32(tmp);
+-        *n = *(cmsFloat32Number*)(void*)&tmp;
++        tmp.integer = _cmsAdjustEndianess32(tmp.integer);
++        *n = tmp.floating_point;
+ 
+         // Safeguard which covers against absurd values
+         if (*n > 1E+20 || *n < -1E+20) return FALSE;
+@@ -304,13 +307,14 @@ cmsBool CMSEXPORT  _cmsWriteUInt32Number(cmsContext ContextID, cmsIOHANDLER* io,
+ 
+ cmsBool CMSEXPORT  _cmsWriteFloat32Number(cmsContext ContextID, cmsIOHANDLER* io, cmsFloat32Number n)
+ {
+-    cmsUInt32Number tmp;
+-
+-    _cmsAssert(io != NULL);
+-
+-    tmp = *(cmsUInt32Number*) (void*) &n;
+-    tmp = _cmsAdjustEndianess32(tmp);
+-    if (io -> Write(ContextID, io, sizeof(cmsUInt32Number), &tmp) != 1)
++    union typeConverter {
++        cmsUInt32Number integer;
++        cmsFloat32Number floating_point;
++    } tmp;
++
++    tmp.floating_point = n;
++    tmp.integer = _cmsAdjustEndianess32(tmp.integer);
++    if (io -> Write(ContextID, io, sizeof(cmsUInt32Number), &tmp.integer) != 1)
+             return FALSE;
+ 
+     return TRUE;

diff --git a/app-text/mupdf/mupdf-1.20.0.ebuild b/app-text/mupdf/mupdf-1.20.0.ebuild
index 3d7f8f3e2946..216bbfaa79e7 100644
--- a/app-text/mupdf/mupdf-1.20.0.ebuild
+++ b/app-text/mupdf/mupdf-1.20.0.ebuild
@@ -51,6 +51,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
 	# General cross fixes from Debian (refreshed)
 	"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
+	"${FILESDIR}"/${P}-lcms2.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2022-12-29 20:50 Florian Schmaus
  0 siblings, 0 replies; 27+ messages in thread
From: Florian Schmaus @ 2022-12-29 20:50 UTC (permalink / raw
  To: gentoo-commits

commit:     4a46119e0149990be553c6ee7723cdeb16410c7f
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 20:48:22 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 20:48:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a46119e

app-text/mupdf: rename drm macro to GENTOO_MUPDF_DRM

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 app-text/mupdf/files/mupdf-1.21.1-no-drm.patch | 2 +-
 app-text/mupdf/mupdf-1.21.1.ebuild             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch b/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch
index 356ee4b852dd..9f2b9d692f4e 100644
--- a/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch
+++ b/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch
@@ -6,7 +6,7 @@ index f764242..83888dc 100644
  	epub_chapter **tailp;
  	int i;
  
-+	#ifdef drm
++	#ifdef GENTOO_MUPDF_DRM
 	if (fz_has_archive_entry(ctx, zip, "META-INF/rights.xml"))
  		fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM");
  	if (fz_has_archive_entry(ctx, zip, "META-INF/encryption.xml"))

diff --git a/app-text/mupdf/mupdf-1.21.1.ebuild b/app-text/mupdf/mupdf-1.21.1.ebuild
index 5b4674fadf25..ac2702bc5da4 100644
--- a/app-text/mupdf/mupdf-1.21.1.ebuild
+++ b/app-text/mupdf/mupdf-1.21.1.ebuild
@@ -60,7 +60,7 @@ src_prepare() {
 
 	use hppa && append-cflags -ffunction-sections
 
-	use drm && append-cflags -Ddrm
+	use drm && append-cflags -DGENTOO_MUPDF_DRM
 
 	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
 


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2022-12-29 20:50 Florian Schmaus
  0 siblings, 0 replies; 27+ messages in thread
From: Florian Schmaus @ 2022-12-29 20:50 UTC (permalink / raw
  To: gentoo-commits

commit:     9581bec40fed2aaf7cce58fa0f4d64ce9db887aa
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Fri Dec 23 15:51:49 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 20:48:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9581bec4

app-text/mupdf-1.21.1: allow disabling DRM checking

MuPDF by default blocks DRM content, see:
https://github.com/ArtifexSoftware/mupdf/commit/2b3bd1b7dbbf13f82b70587676809f189354c77a

Add patch and local use flag `drm` for allowing/disallowing DRM content
in PDF files.

Suggested-by: William Rabbermann <willrabbermann <AT> gmail.com>
Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/28772
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 app-text/mupdf/files/mupdf-1.21.1-no-drm.patch | 18 ++++++++++++++++++
 app-text/mupdf/metadata.xml                    |  3 +++
 app-text/mupdf/mupdf-1.21.1.ebuild             |  5 ++++-
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch b/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch
new file mode 100644
index 000000000000..356ee4b852dd
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch
@@ -0,0 +1,18 @@
+diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c
+index f764242..83888dc 100644
+--- a/source/html/epub-doc.c
++++ b/source/html/epub-doc.c
+@@ -692,10 +692,12 @@ epub_parse_header(fz_context *ctx, epub_document *doc)
+ 	epub_chapter **tailp;
+ 	int i;
+ 
++	#ifdef drm
+	if (fz_has_archive_entry(ctx, zip, "META-INF/rights.xml"))
+ 		fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM");
+ 	if (fz_has_archive_entry(ctx, zip, "META-INF/encryption.xml"))
+ 		fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM");
++	#endif
+ 
+ 	fz_var(buf);
+ 	fz_var(container_xml);
+

diff --git a/app-text/mupdf/metadata.xml b/app-text/mupdf/metadata.xml
index 5d2f87cc3174..c0d61774dbcf 100644
--- a/app-text/mupdf/metadata.xml
+++ b/app-text/mupdf/metadata.xml
@@ -9,4 +9,7 @@
 		<email>proxy-maint@gentoo.org</email>
 		<name>Proxy Maintainers</name>
 	</maintainer>
+	<use>
+		<flag name="drm">Enable support for Digital rights management (DRM)</flag>
+	</use>
 </pkgmetadata>

diff --git a/app-text/mupdf/mupdf-1.21.1.ebuild b/app-text/mupdf/mupdf-1.21.1.ebuild
index 87efa898ece6..5b4674fadf25 100644
--- a/app-text/mupdf/mupdf-1.21.1.ebuild
+++ b/app-text/mupdf/mupdf-1.21.1.ebuild
@@ -16,7 +16,7 @@ S="${WORKDIR}"/${P}-source
 LICENSE="AGPL-3"
 SLOT="0/${PV}"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86"
-IUSE="+javascript opengl ssl X"
+IUSE="+drm +javascript opengl ssl X"
 REQUIRED_USE="opengl? ( javascript )"
 
 # Although we use the bundled, patched version of freeglut in mupdf (because of
@@ -52,6 +52,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
 	# General cross fixes from Debian (refreshed)
 	"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
+	"${FILESDIR}"/$P-no-drm.patch
 )
 
 src_prepare() {
@@ -59,6 +60,8 @@ src_prepare() {
 
 	use hppa && append-cflags -ffunction-sections
 
+	use drm && append-cflags -Ddrm
+
 	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
 
 	sed -e "1iOS = Linux" \


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2023-01-04  5:50 Sam James
  0 siblings, 0 replies; 27+ messages in thread
From: Sam James @ 2023-01-04  5:50 UTC (permalink / raw
  To: gentoo-commits

commit:     6208b6698adad4d24c7cad780efb95349fb5e2da
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Fri Dec 30 22:22:33 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan  4 05:48:12 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6208b669

app-text/mupdf-1.21.1: patch aliasing violation

Add patch fixing an aliasing violation build error
in the thirdparty freeglut module.

See: https://bugs.gentoo.org/859847
See: https://github.com/FreeGLUTProject/freeglut/pull/112/commits/8c6f6bf3ad2fd33d15de6ee96175cd29bf804d9f

Closes: https://bugs.gentoo.org/888998
Suggested-by: Matt Turner <mattst88 <AT> gentoo.org>
Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/28903
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../mupdf-1.21.1-fix-aliasing-violation.patch      | 63 ++++++++++++++++++++++
 app-text/mupdf/mupdf-1.21.1.ebuild                 |  1 +
 2 files changed, 64 insertions(+)

diff --git a/app-text/mupdf/files/mupdf-1.21.1-fix-aliasing-violation.patch b/app-text/mupdf/files/mupdf-1.21.1-fix-aliasing-violation.patch
new file mode 100644
index 000000000000..4f51f72deb1e
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.21.1-fix-aliasing-violation.patch
@@ -0,0 +1,63 @@
+https://bugs.gentoo.org/859847
+
+From 8c6f6bf3ad2fd33d15de6ee96175cd29bf804d9f Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Tue, 26 Jul 2022 15:47:02 -0400
+Subject: [PATCH] Fix aliasing violation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Noticed when compiling with link-time optimizations.
+
+include/GL/freeglut_std.h:240:18: error: type of `glutBitmapHelvetica18` does not match original declaration [-Werror=lto-type-mismatch]
+  240 |     extern void* glutBitmapHelvetica18;
+      |                  ^
+src/x11/fg_glutfont_definitions_x11.c:103:27: note: `glutBitmapHelvetica18` was previously declared here
+  103 | struct freeglutBitmapFont glutBitmapHelvetica18 ;
+      |                           ^
+src/x11/fg_glutfont_definitions_x11.c:103:27: note: code may be misoptimized unless `-fno-strict-aliasing` is used
+---
+ src/x11/fg_glutfont_definitions_x11.c | 29 ++++++++++++++++++---------
+ 1 file changed, 20 insertions(+), 9 deletions(-)
+
+--- a/thirdparty/freeglut/src/x11/fg_glutfont_definitions_x11.c
++++ b/thirdparty/freeglut/src/x11/fg_glutfont_definitions_x11.c
+@@ -91,14 +91,25 @@ struct freeglutBitmapFont
+ };
+ 
+ 
+-struct freeglutStrokeFont glutStrokeRoman ;
+-struct freeglutStrokeFont glutStrokeMonoRoman ;
++static struct freeglutStrokeFont glutStrokeRoman_ ;
++static struct freeglutStrokeFont glutStrokeMonoRoman_ ;
+ 
+-struct freeglutBitmapFont glutBitmap9By15 ;
+-struct freeglutBitmapFont glutBitmap8By13 ;
+-struct freeglutBitmapFont glutBitmapTimesRoman10 ;
+-struct freeglutBitmapFont glutBitmapTimesRoman24 ;
+-struct freeglutBitmapFont glutBitmapHelvetica10 ;
+-struct freeglutBitmapFont glutBitmapHelvetica12 ;
+-struct freeglutBitmapFont glutBitmapHelvetica18 ;
++static struct freeglutBitmapFont glutBitmap9By15_ ;
++static struct freeglutBitmapFont glutBitmap8By13_ ;
++static struct freeglutBitmapFont glutBitmapTimesRoman10_ ;
++static struct freeglutBitmapFont glutBitmapTimesRoman24_ ;
++static struct freeglutBitmapFont glutBitmapHelvetica10_ ;
++static struct freeglutBitmapFont glutBitmapHelvetica12_ ;
++static struct freeglutBitmapFont glutBitmapHelvetica18_ ;
+ 
++
++void *glutStrokeRoman = &glutStrokeRoman_ ;
++void *glutStrokeMonoRoman = &glutStrokeMonoRoman_ ;
++
++void *glutBitmap9By15 = &glutBitmap9By15_ ;
++void *glutBitmap8By13 = &glutBitmap8By13_ ;
++void *glutBitmapTimesRoman10 = &glutBitmapTimesRoman10_ ;
++void *glutBitmapTimesRoman24 = &glutBitmapTimesRoman24_ ;
++void *glutBitmapHelvetica10 = &glutBitmapHelvetica10_ ;
++void *glutBitmapHelvetica12 = &glutBitmapHelvetica12_ ;
++void *glutBitmapHelvetica18 = &glutBitmapHelvetica18_ ;
+-- 
+2.35.1
+

diff --git a/app-text/mupdf/mupdf-1.21.1.ebuild b/app-text/mupdf/mupdf-1.21.1.ebuild
index ac2702bc5da4..718ebd6ed15a 100644
--- a/app-text/mupdf/mupdf-1.21.1.ebuild
+++ b/app-text/mupdf/mupdf-1.21.1.ebuild
@@ -53,6 +53,7 @@ PATCHES=(
 	# General cross fixes from Debian (refreshed)
 	"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
 	"${FILESDIR}"/$P-no-drm.patch
+	"${FILESDIR}"/$P-fix-aliasing-violation.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2023-02-26  7:02 Joonas Niilola
  0 siblings, 0 replies; 27+ messages in thread
From: Joonas Niilola @ 2023-02-26  7:02 UTC (permalink / raw
  To: gentoo-commits

commit:     2d0b50425eb4184f10e275934e8c6939c9bffea8
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Mon Feb 13 21:42:05 2023 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 06:59:58 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d0b5042

app-text/mupdf: fix url processing in 1.21.1

In <=app-text/mupdf-1.21.1 built with USE=opengl trying to open
an URL in a PDF file results in "warning: cannot spawn browser
'xdg-open': No such file or directory".
Apply fix from upstream to resolve the issue until the next
release of MuPDF.

Closes: https://bugs.gentoo.org/893604
Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../files/mupdf-1.21.1-fix-url-processing.patch    |  25 ++++
 app-text/mupdf/mupdf-1.21.1-r1.ebuild              | 166 +++++++++++++++++++++
 2 files changed, 191 insertions(+)

diff --git a/app-text/mupdf/files/mupdf-1.21.1-fix-url-processing.patch b/app-text/mupdf/files/mupdf-1.21.1-fix-url-processing.patch
new file mode 100644
index 000000000000..bebdf3909e81
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.21.1-fix-url-processing.patch
@@ -0,0 +1,25 @@
+From 37757db262425d793b17b63821d9014d3655e50a Mon Sep 17 00:00:00 2001
+From: Sebastian Rasmussen <sebras@gmail.com>
+Date: Thu, 1 Dec 2022 00:04:40 +0100
+Subject: [PATCH] gl: Use posix_spawnp() in order to search PATH for binaries.
+
+---
+ platform/gl/gl-main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
+index d5ae69c95..271ac43a6 100644
+--- a/platform/gl/gl-main.c
++++ b/platform/gl/gl-main.c
+@@ -122,7 +122,7 @@ static void open_browser(const char *uri)
+ 	argv[0] = (char*) browser;
+ 	argv[1] = (char*) uri;
+ 	argv[2] = NULL;
+-	err = posix_spawn(&pid, browser, NULL, NULL, argv, environ);
++	err = posix_spawnp(&pid, browser, NULL, NULL, argv, environ);
+ 	if (err)
+ 		fz_warn(ctx, "cannot spawn browser '%s': %s", browser, strerror(err));
+ 
+-- 
+2.39.1
+

diff --git a/app-text/mupdf/mupdf-1.21.1-r1.ebuild b/app-text/mupdf/mupdf-1.21.1-r1.ebuild
new file mode 100644
index 000000000000..e8c3ad893fa4
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.21.1-r1.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Please check upstream git regularly for relevant security-related commits
+# to backport.
+
+inherit desktop flag-o-matic toolchain-funcs xdg
+
+DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
+SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.gz"
+S="${WORKDIR}"/${P}-source
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86"
+IUSE="+drm +javascript opengl ssl X"
+REQUIRED_USE="opengl? ( javascript )"
+
+# Although we use the bundled, patched version of freeglut in mupdf (because of
+# bug #653298), the best way to ensure that its dependencies are present is to
+# install system's freeglut.
+RDEPEND="
+	dev-libs/gumbo
+	media-libs/freetype:2
+	media-libs/harfbuzz:=[truetype]
+	media-libs/jbig2dec:=
+	media-libs/libpng:0=
+	>=media-libs/openjpeg-2.1:2=
+	>=media-libs/libjpeg-turbo-1.5.3-r2:0=
+	javascript? ( >=dev-lang/mujs-1.2.0:= )
+	opengl? ( >=media-libs/freeglut-3.0.0 )
+	ssl? ( >=dev-libs/openssl-1.1:0= )
+	sys-libs/zlib
+	X? (
+		x11-libs/libX11
+		x11-libs/libXext
+	)
+"
+DEPEND="${RDEPEND}"
+BDEPEND="X? ( x11-base/xorg-proto )
+	virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
+	"${FILESDIR}"/${PN}-1.19.0-Makefile.patch
+	"${FILESDIR}"/${PN}-1.21.0-add-desktop-pc-files.patch
+	"${FILESDIR}"/${PN}-1.19.0-darwin.patch
+	# See bugs #662352
+	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
+	# General cross fixes from Debian (refreshed)
+	"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
+	"${FILESDIR}"/${P}-no-drm.patch
+	"${FILESDIR}"/${P}-fix-aliasing-violation.patch
+	# See bug 893604
+	# Fixed in upcoming release
+	"${FILESDIR}"/${P}-fix-url-processing.patch
+)
+
+src_prepare() {
+	default
+
+	use hppa && append-cflags -ffunction-sections
+
+	use drm && append-cflags -DGENTOO_MUPDF_DRM
+
+	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iCXX = $(tc-getCXX)" \
+		-e "1iLD = $(tc-getLD)" \
+		-e "1iAR = $(tc-getAR)" \
+		-e "1iverbose = yes" \
+		-e "1ibuild = debug" \
+		-i Makerules || die "Failed adding build variables to Makerules in src_prepare()"
+
+	# Adjust MuPDF version in .pc file created by the
+	# mupdf-1.10a-add-desktop-pc-xpm-files.patch file
+	sed -e "s/Version: \(.*\)/Version: ${PV}/" \
+		-i platform/debian/${PN}.pc || die "Failed substituting version in ${PN}.pc"
+}
+
+_emake() {
+	# When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
+	#
+	# Bundled libs
+	# * General
+	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
+	# recommendations. It does not mean "always use system libs".
+	# See [0] below for what it means in a specific version.
+	#
+	# * freeglut
+	# We don't use system's freeglut because upstream has a special modified
+	# version of it that gives mupdf clipboard support. See bug #653298
+	#
+	# * mujs
+	# As of v1.15.0, mupdf started using symbols in mujs that were not part
+	# of any release. We then went back to using the bundled version of it.
+	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
+	# when bumping and check!
+	# See bug #685244
+	#
+	# * lmms2
+	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
+	# It is therefore not appropriate for us to unbundle it at this time.
+	#
+	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
+	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
+	local myemakeargs=(
+		GENTOO_PV=${PV}
+		HAVE_GLUT=$(usex opengl)
+		HAVE_LIBCRYPTO=$(usex ssl)
+		HAVE_X11=$(usex X)
+		USE_SYSTEM_LIBS=yes
+		USE_SYSTEM_MUJS=$(usex javascript)
+		USE_SYSTEM_GLUT=no
+		HAVE_OBJCOPY=no
+		"$@"
+	)
+
+	emake "${myemakeargs[@]}"
+}
+
+src_compile() {
+	tc-export PKG_CONFIG
+
+	_emake XCFLAGS="-fPIC"
+}
+
+src_install() {
+	if use opengl || use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon -s scalable docs/logo/new-${PN}-icon.svg
+	else
+		rm docs/man/${PN}.1 || die "Failed to remove man page in src_install()"
+	fi
+
+	sed -i \
+		-e "1iprefix = ${ED}/usr" \
+		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
+		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
+		-i Makerules || die "Failed adding liprefix, lilibdir and lidocdir to Makerules in src_install()"
+
+	_emake install
+
+	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
+
+	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
+
+	# Respect libdir (bug #734898)
+	sed -i -e "s:/lib:/$(get_libdir):" platform/debian/${PN}.pc || die "Failed to sed pkgconfig file to respect libdir in src_install()"
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2024-05-25  7:06 Arthur Zamarin
  0 siblings, 0 replies; 27+ messages in thread
From: Arthur Zamarin @ 2024-05-25  7:06 UTC (permalink / raw
  To: gentoo-commits

commit:     dc4b87e7add0dcdc791e922d28de8b3e36ac80e0
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Sat May  4 18:42:51 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat May 25 07:04:08 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc4b87e7

app-text/mupdf: add 1.24.1

Add local use flag 'archive' for enabling support
for various archive format using libarchive.

Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   1 +
 .../mupdf/files/mupdf-1.24.1-cross-fixes.patch     | 154 +++++++++++++++++++
 app-text/mupdf/files/mupdf-1.24.1-darwin.patch     |  20 +++
 .../mupdf/files/mupdf-1.24.1-openssl-x11.patch     |  19 +++
 app-text/mupdf/metadata.xml                        |   1 +
 app-text/mupdf/mupdf-1.24.1.ebuild                 | 166 +++++++++++++++++++++
 6 files changed, 361 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index a835f7c90abd..e50372953f7c 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,3 +1,4 @@
 DIST mupdf-1.22.0-source.tar.gz 55043552 BLAKE2B 745a2fd1d0406acf4fa696585bcd21a4ff36e7539c1d45f886dfe5c9bbf966169e5183e89940d81e88db3014f1ebb0446ae1732b6c2fa25a135251853b71f1f7 SHA512 ba073b977306420343c969e6fec37cca4559031ad06cfdee2356edfdfa013ebe7654175aff931684fa48a935bf87f68537754b5e83f767517bc428ac07709a59
 DIST mupdf-1.23.3-source.tar.gz 55144800 BLAKE2B 816e2bf46c2431df9726976efeaa0d7ebd8809cbdd9331a747cca32088aaf21b70e9522614d1dc20c856cc597003be6285f866eae8bbde3098e702acfdea8465 SHA512 37fbebd07680d79a38d289264a4028396ee58fad52c541efa37463e63a45ed8bab71188d6c05eb15e602964d89ee6633575dceb972f7bd8b0b5efdde5af9b737
 DIST mupdf-1.23.7-source.tar.gz 55312697 BLAKE2B 7ceb7c1871d33b77d4a3d52ed2d1af514c09349df019a189fa7df8ad09648fae313d63de4c1ce6b0666d17f9a897d5ac788d0be2d8896d9b7e4e6ecf679bad7c SHA512 581a4a5a16041bb405fbd7c1b9fba47da5745f00cbdf30e0e0468bfe67ac542884193b5957b293a4cdfc52f043b4f19612086f294b93dbd242d34735a1088777
+DIST mupdf-1.24.1-source.tar.gz 55310618 BLAKE2B 33396b0cca6e2beb1b2bc70c606917c8d9b30b6a277645849ef7ba1e7efbf909c21196acdd5d94d964dd20d3ba746c45cab3c899dfbee1b2138de12e32375a4e SHA512 9d6fbd3388173f06c5db4a27753e69afd21ed32d93f263d4448c3be60a3be747b61102edd5430459f0dbe7ae4df2019689a2f3a582acec77ff322b6d41066fba

diff --git a/app-text/mupdf/files/mupdf-1.24.1-cross-fixes.patch b/app-text/mupdf/files/mupdf-1.24.1-cross-fixes.patch
new file mode 100644
index 000000000000..6d87798c2e66
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.24.1-cross-fixes.patch
@@ -0,0 +1,154 @@
+# Fix cross compilation issue with pkg-config
+--- a/Makerules
++++ b/Makerules
+@@ -9,6 +9,8 @@ ifeq ($(OS),)
+   OS := $(OS:Darwin=MACOS)
+ endif
+ 
++PKG_CONFIG ?= pkg-config
++CC_FOR_BUILD ?= $(CC)
+ WARNING_CFLAGS := -Wall -Wsign-compare
+ 
+ # Feature configuration options
+@@ -194,13 +196,13 @@ else ifeq ($(OS),MACOS)
+   ifneq ($(ARCHFLAGS),)
+     $(warning "MacOS with ARCHFLAGS set. Assuming we are building for arm64, and setting HAVE_LIBCRYPTO to no.")
+     HAVE_LIBCRYPTO := no
+-  else ifeq (, $(shell command -v pkg-config))
++  else ifeq (, $(shell command -v $(PKG_CONFIG)))
+     $(warning "No pkg-config found, install it for proper integration of libcrypto")
+   else
+-    HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
++    HAVE_LIBCRYPTO := $(shell $(PKG_CONFIG) --exists 'libcrypto >= 1.1.0' && echo yes)
+     ifeq ($(HAVE_LIBCRYPTO),yes)
+-	  LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
+-	  LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
++	  LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO
++	  LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
+     endif
+   endif
+ 
+@@ -210,82 +212,82 @@ else ifeq ($(LINUX_OR_OPENBSD),yes)
+     HAVE_OBJCOPY := yes
+   endif
+ 
+-  ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+-	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+-	SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
++  ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes)
++	SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
++	SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
+   endif
+-  ifeq ($(shell pkg-config --exists gumbo && echo yes),yes)
+-	SYS_GUMBO_CFLAGS := $(shell pkg-config --cflags gumbo)
+-	SYS_GUMBO_LIBS := $(shell pkg-config --libs gumbo)
++  ifeq ($(shell $(PKG_CONFIG) --exists gumbo && echo yes),yes)
++	SYS_GUMBO_CFLAGS := $(shell $(PKG_CONFIG) --cflags gumbo)
++	SYS_GUMBO_LIBS := $(shell $(PKG_CONFIG) --libs gumbo)
+   endif
+-  ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
+-	SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
+-	SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
++  ifeq ($(shell $(PKG_CONFIG) --exists harfbuzz && echo yes),yes)
++	SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz)
++	SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz)
+   endif
+-  ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes)
+-	SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2)
+-	SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2)
++  ifeq ($(shell $(PKG_CONFIG) --exists lcms2 && echo yes),yes)
++	SYS_LCMS2_CFLAGS := $(shell $(PKG_CONFIG) --cflags lcms2)
++	SYS_LCMS2_LIBS := $(shell $(PKG_CONFIG) --libs lcms2)
+   endif
+-  ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
+-	SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
+-	SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
++  ifeq ($(shell $(PKG_CONFIG) --exists libjpeg && echo yes),yes)
++	SYS_LIBJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libjpeg)
++	SYS_LIBJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libjpeg)
+   endif
+-  ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
+-	SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
+-	SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
++  ifeq ($(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes),yes)
++	SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2)
++	SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2)
+   endif
+-  ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
+-	SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
+-	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
++  ifeq ($(shell $(PKG_CONFIG) --exists zlib && echo yes),yes)
++	SYS_ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
++	SYS_ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
+   endif
+ 
+-  HAVE_SYS_LEPTONICA := $(shell pkg-config --exists 'lept >= 1.7.4' && echo yes)
++  HAVE_SYS_LEPTONICA := $(shell $(PKG_CONFIG) --exists 'lept >= 1.7.4' && echo yes)
+   ifeq ($(HAVE_SYS_LEPTONICA),yes)
+-	SYS_LEPTONICA_CFLAGS := $(shell pkg-config --cflags lept)
+-	SYS_LEPTONICA_LIBS := $(shell pkg-config --libs lept)
++	SYS_LEPTONICA_CFLAGS := $(shell $(PKG_CONFIG) --cflags lept)
++	SYS_LEPTONICA_LIBS := $(shell $(PKG_CONFIG) --libs lept)
+   endif
+ 
+-  HAVE_SYS_TESSERACT := $(shell pkg-config --exists 'tesseract >= 4.0.0' && echo yes)
++  HAVE_SYS_TESSERACT := $(shell $(PKG_CONFIG) --exists 'tesseract >= 4.0.0' && echo yes)
+   ifeq ($(HAVE_SYS_TESSERACT),yes)
+-	SYS_TESSERACT_CFLAGS := $(shell pkg-config --cflags tesseract)
+-	SYS_TESSERACT_LIBS := $(shell pkg-config --libs tesseract)
++	SYS_TESSERACT_CFLAGS := $(shell $(PKG_CONFIG) --cflags tesseract)
++	SYS_TESSERACT_LIBS := $(shell $(PKG_CONFIG) --libs tesseract)
+   endif
+ 
+-  HAVE_SYS_LIBARCHIVE := $(shell pkg-config --exists 'libarchive' && echo yes)
++  HAVE_SYS_LIBARCHIVE := $(shell $(PKG_CONFIG) --exists 'libarchive' && echo yes)
+   ifeq ($(HAVE_SYS_LIBARCHIVE),yes)
+-	SYS_LIBARCHIVE_CFLAGS := $(shell pkg-config --cflags libarchive)
+-	SYS_LIBARCHIVE_LIBS := $(shell pkg-config --libs libarchive)
++	SYS_LIBARCHIVE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libarchive)
++	SYS_LIBARCHIVE_LIBS := $(shell $(PKG_CONFIG) --libs libarchive)
+   endif
+ 
+-  HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes)
++  HAVE_SYS_CURL := $(shell $(PKG_CONFIG) --exists libcurl && echo yes)
+   ifeq ($(HAVE_SYS_CURL),yes)
+-	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+-	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
++	SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl)
++	SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl)
+   endif
+ 
+   HAVE_GLUT := yes
+   ifeq ($(HAVE_GLUT),yes)
+     ifeq ($(OS),OpenBSD)
+-      SYS_GLUT_CFLAGS := $(shell pkg-config --cflags glut gl)
+-      SYS_GLUT_LIBS := $(shell pkg-config --libs glut gl)
++      SYS_GLUT_CFLAGS := $(shell $(PKG_CONFIG) --cflags glut gl)
++      SYS_GLUT_LIBS := $(shell $(PKG_CONFIG) --libs glut gl)
+     else
+       SYS_GLUT_CFLAGS :=
+       SYS_GLUT_LIBS := -lglut -lGL
+     endif
+   endif
+ 
+-  HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
++  HAVE_X11 := $(shell $(PKG_CONFIG) --exists x11 xext && echo yes)
+   ifeq ($(HAVE_X11),yes)
+-	X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
+-	X11_LIBS := $(shell pkg-config --libs x11 xext)
++	X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext)
++	X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext)
+   endif
+ 
+   ifeq ($(HAVE_LIBCRYPTO),)
+-    HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
++    HAVE_LIBCRYPTO := $(shell $(PKG_CONFIG) --exists 'libcrypto >= 1.1.0' && echo yes)
+   endif
+   ifeq ($(HAVE_LIBCRYPTO),yes)
+-	LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
+-	LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
++	LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO
++	LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
+   endif
+ 
+   HAVE_PTHREAD := yes

diff --git a/app-text/mupdf/files/mupdf-1.24.1-darwin.patch b/app-text/mupdf/files/mupdf-1.24.1-darwin.patch
new file mode 100644
index 000000000000..9a699fc98209
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.24.1-darwin.patch
@@ -0,0 +1,20 @@
+# Fix configuration on darwin
+--- a/Makerules
++++ b/Makerules
+@@ -185,11 +185,11 @@ ifeq ($(OS),MINGW)
+ else ifeq ($(OS),MACOS)
+   HAVE_GLUT := yes
+   SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
+-  SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
+-  CC = xcrun cc
+-  AR = xcrun ar
+-  LD = xcrun ld
+-  RANLIB = xcrun ranlib
++  SYS_GLUT_LIBS ?= -framework GLUT -framework OpenGL
++  CC ?= xcrun cc
++  AR ?= xcrun ar
++  LD ?= xcrun ld
++  RANLIB ?= xcrun ranlib
+ 
+   ifneq ($(ARCHFLAGS),)
+     $(warning "MacOS with ARCHFLAGS set. Assuming we are building for arm64, and setting HAVE_LIBCRYPTO to no.")

diff --git a/app-text/mupdf/files/mupdf-1.24.1-openssl-x11.patch b/app-text/mupdf/files/mupdf-1.24.1-openssl-x11.patch
new file mode 100644
index 000000000000..77710a6d51a4
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.24.1-openssl-x11.patch
@@ -0,0 +1,19 @@
+--- a/Makerules
++++ b/Makerules
+@@ -274,14 +274,14 @@ else ifeq ($(LINUX_OR_OPENBSD),yes)
+     endif
+   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
+ 
+   ifeq ($(HAVE_LIBCRYPTO),)
+-    HAVE_LIBCRYPTO := $(shell $(PKG_CONFIG) --exists 'libcrypto >= 1.1.0' && echo yes)
++    HAVE_LIBCRYPTO := not-unless-portage-tells-me
+   endif
+   ifeq ($(HAVE_LIBCRYPTO),yes)
+ 	LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO

diff --git a/app-text/mupdf/metadata.xml b/app-text/mupdf/metadata.xml
index c0d61774dbcf..0e5cd3a8d8d5 100644
--- a/app-text/mupdf/metadata.xml
+++ b/app-text/mupdf/metadata.xml
@@ -10,6 +10,7 @@
 		<name>Proxy Maintainers</name>
 	</maintainer>
 	<use>
+		<flag name="archive">Enable support for CBR and other archive formats using libarchive</flag>
 		<flag name="drm">Enable support for Digital rights management (DRM)</flag>
 	</use>
 </pkgmetadata>

diff --git a/app-text/mupdf/mupdf-1.24.1.ebuild b/app-text/mupdf/mupdf-1.24.1.ebuild
new file mode 100644
index 000000000000..25256507c5bc
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.24.1.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Please check upstream git regularly for relevant security-related commits
+# to backport.
+
+inherit desktop flag-o-matic toolchain-funcs xdg
+
+DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
+SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.gz"
+S="${WORKDIR}"/${P}-source
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="archive +javascript opengl ssl X"
+REQUIRED_USE="opengl? ( javascript )"
+
+# Although we use the bundled, patched version of freeglut in mupdf (because of
+# bug #653298), the best way to ensure that its dependencies are present is to
+# install system's freeglut.
+RDEPEND="
+	archive? ( app-arch/libarchive )
+	dev-libs/gumbo:=
+	media-libs/freetype:2
+	media-libs/harfbuzz:=[truetype]
+	media-libs/jbig2dec:=
+	media-libs/libpng:0=
+	>=media-libs/openjpeg-2.1:2=
+	>=media-libs/libjpeg-turbo-1.5.3-r2:0=
+	net-misc/curl
+	javascript? ( >=dev-lang/mujs-1.2.0:= )
+	opengl? ( >=media-libs/freeglut-3.0.0 )
+	ssl? ( >=dev-libs/openssl-1.1:0= )
+	sys-libs/zlib
+	X? (
+		media-libs/libglvnd[X]
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+	)
+"
+DEPEND="${RDEPEND}
+	X? ( x11-base/xorg-proto )"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
+	"${FILESDIR}"/${PN}-1.19.0-Makefile.patch
+	"${FILESDIR}"/${PN}-1.21.0-add-desktop-pc-files.patch
+	"${FILESDIR}"/${P}-cross-fixes.patch
+	"${FILESDIR}"/${P}-darwin.patch
+	# See bugs #662352
+	"${FILESDIR}"/${P}-openssl-x11.patch
+	# General cross fixes from Debian (refreshed)
+	"${FILESDIR}"/${PN}-1.21.1-fix-aliasing-violation.patch
+)
+
+src_prepare() {
+	default
+
+	use hppa && append-cflags -ffunction-sections
+
+	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iCXX = $(tc-getCXX)" \
+		-e "1iLD = $(tc-getLD)" \
+		-e "1iAR = $(tc-getAR)" \
+		-e "1iverbose = yes" \
+		-e "1ibuild = debug" \
+		-i Makerules || die "Failed adding build variables to Makerules in src_prepare()"
+
+	# Adjust MuPDF version in .pc file created by the
+	# mupdf-1.21.0-add-desktop-pc-files.patch file
+	sed -e "s/Version: \(.*\)/Version: ${PV}/" \
+		-i platform/debian/${PN}.pc || die "Failed substituting version in ${PN}.pc"
+}
+
+_emake() {
+	# When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
+	#
+	# Bundled libs
+	# * General
+	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
+	# recommendations. It does not mean "always use system libs".
+	# See [0] below for what it means in a specific version.
+	#
+	# * freeglut
+	# We don't use system's freeglut because upstream has a special modified
+	# version of it that gives mupdf clipboard support. See bug #653298
+	#
+	# * mujs
+	# As of v1.15.0, mupdf started using symbols in mujs that were not part
+	# of any release. We then went back to using the bundled version of it.
+	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
+	# when bumping and check!
+	# See bug #685244
+	#
+	# * lmms2
+	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
+	# It is therefore not appropriate for us to unbundle it at this time.
+	#
+	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
+	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
+	local myemakeargs=(
+		GENTOO_PV=${PV}
+		HAVE_GLUT=$(usex opengl)
+		HAVE_LIBCRYPTO=$(usex ssl)
+		HAVE_X11=$(usex X)
+		USE_SYSTEM_LIBS=yes
+		USE_SYSTEM_MUJS=$(usex javascript)
+		USE_SYSTEM_GLUT=no
+		HAVE_OBJCOPY=no
+		"$@"
+	)
+
+	emake "${myemakeargs[@]}"
+}
+
+src_compile() {
+	tc-export PKG_CONFIG
+
+	_emake XCFLAGS="-fPIC"
+}
+
+src_install() {
+	if use opengl || use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon -s scalable docs/logo/new-${PN}-icon.svg
+	else
+		rm docs/man/${PN}.1 || die "Failed to remove man page in src_install()"
+	fi
+
+	sed -i \
+		-e "1iprefix = ${ED}/usr" \
+		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
+		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
+		-i Makerules || die "Failed adding liprefix, lilibdir and lidocdir to Makerules in src_install()"
+
+	_emake install
+
+	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
+
+	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
+
+	# Respect libdir and EPREFIX (bugs #734898, #911965)
+	sed -i -e "s:/lib:/$(get_libdir):" \
+		-e "s:/usr:${EPREFIX}/usr:" platform/debian/${PN}.pc \
+		|| die "Failed to sed pkgconfig file to respect libdir and EPREFIX in src_install()"
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2024-05-25  7:06 Arthur Zamarin
  0 siblings, 0 replies; 27+ messages in thread
From: Arthur Zamarin @ 2024-05-25  7:06 UTC (permalink / raw
  To: gentoo-commits

commit:     2c435680ca5545dfcf3215d7a9d2d646c9209e48
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Sat May  4 18:47:19 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat May 25 07:04:08 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c435680

app-text/mupdf: drop 1.22.0-r1, 1.23.3-r1

Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   2 -
 app-text/mupdf/files/mupdf-1.15-openssl-x11.patch  |  18 ---
 .../mupdf/files/mupdf-1.19.0-cross-fixes.patch     | 130 ----------------
 app-text/mupdf/files/mupdf-1.19.0-darwin.patch     |  39 -----
 app-text/mupdf/files/mupdf-1.21.1-no-drm.patch     |  18 ---
 app-text/mupdf/mupdf-1.22.0-r1.ebuild              | 164 ---------------------
 app-text/mupdf/mupdf-1.23.3-r1.ebuild              | 164 ---------------------
 7 files changed, 535 deletions(-)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index e50372953f7c..2d8887e05469 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,4 +1,2 @@
-DIST mupdf-1.22.0-source.tar.gz 55043552 BLAKE2B 745a2fd1d0406acf4fa696585bcd21a4ff36e7539c1d45f886dfe5c9bbf966169e5183e89940d81e88db3014f1ebb0446ae1732b6c2fa25a135251853b71f1f7 SHA512 ba073b977306420343c969e6fec37cca4559031ad06cfdee2356edfdfa013ebe7654175aff931684fa48a935bf87f68537754b5e83f767517bc428ac07709a59
-DIST mupdf-1.23.3-source.tar.gz 55144800 BLAKE2B 816e2bf46c2431df9726976efeaa0d7ebd8809cbdd9331a747cca32088aaf21b70e9522614d1dc20c856cc597003be6285f866eae8bbde3098e702acfdea8465 SHA512 37fbebd07680d79a38d289264a4028396ee58fad52c541efa37463e63a45ed8bab71188d6c05eb15e602964d89ee6633575dceb972f7bd8b0b5efdde5af9b737
 DIST mupdf-1.23.7-source.tar.gz 55312697 BLAKE2B 7ceb7c1871d33b77d4a3d52ed2d1af514c09349df019a189fa7df8ad09648fae313d63de4c1ce6b0666d17f9a897d5ac788d0be2d8896d9b7e4e6ecf679bad7c SHA512 581a4a5a16041bb405fbd7c1b9fba47da5745f00cbdf30e0e0468bfe67ac542884193b5957b293a4cdfc52f043b4f19612086f294b93dbd242d34735a1088777
 DIST mupdf-1.24.1-source.tar.gz 55310618 BLAKE2B 33396b0cca6e2beb1b2bc70c606917c8d9b30b6a277645849ef7ba1e7efbf909c21196acdd5d94d964dd20d3ba746c45cab3c899dfbee1b2138de12e32375a4e SHA512 9d6fbd3388173f06c5db4a27753e69afd21ed32d93f263d4448c3be60a3be747b61102edd5430459f0dbe7ae4df2019689a2f3a582acec77ff322b6d41066fba

diff --git a/app-text/mupdf/files/mupdf-1.15-openssl-x11.patch b/app-text/mupdf/files/mupdf-1.15-openssl-x11.patch
deleted file mode 100644
index 3f3aac4c933a..000000000000
--- a/app-text/mupdf/files/mupdf-1.15-openssl-x11.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- 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/files/mupdf-1.19.0-cross-fixes.patch b/app-text/mupdf/files/mupdf-1.19.0-cross-fixes.patch
deleted file mode 100644
index 643b6d2c8b1e..000000000000
--- a/app-text/mupdf/files/mupdf-1.19.0-cross-fixes.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-Refreshed patches based on:
-https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0004-MuPDF-crossbuild-use-target-arch-pkg-config.patch/
-https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0005-MuPDF-crossbuild-use-host-cc-for-utils.patch/
---- a/Makefile
-+++ b/Makefile
-@@ -147,6 +147,9 @@ PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.o)
-
- HEXDUMP_EXE := $(OUT)/scripts/hexdump.exe
-
-+$(HEXDUMP_EXE): scripts/hexdump.c
-+	$(QUIET_CC) $(MKTGTDIR) ; $(CC_FOR_BUILD) $(CFLAGS) -o $@ $<
-+
- FONT_BIN := $(sort $(wildcard resources/fonts/urw/*.cff))
- FONT_BIN += $(sort $(wildcard resources/fonts/han/*.ttc))
- FONT_BIN += $(sort $(wildcard resources/fonts/droid/*.ttf))
---- a/Makerules
-+++ b/Makerules
-@@ -6,6 +6,9 @@ OS := $(OS:MSYS%=MINGW)
- OS := $(OS:Windows_NT=MINGW)
- OS := $(OS:Darwin=MACOS)
- 
-+PKG_CONFIG ?= pkg-config
-+CC_FOR_BUILD ?= $(CC)
-+
- WARNING_CFLAGS := -Wall -Wsign-compare
- 
- # Feature configuration options
-@@ -156,51 +159,51 @@ else ifeq ($(OS),MACOS)
-   endif
- endif
- 
--  ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
--	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
--	SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
-+  ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes)
-+	SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
-+	SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
-   endif
--  ifeq ($(shell pkg-config --exists gumbo && echo yes),yes)
--	SYS_GUMBO_CFLAGS := $(shell pkg-config --cflags gumbo)
--	SYS_GUMBO_LIBS := $(shell pkg-config --libs gumbo)
-+  ifeq ($(shell $(PKG_CONFIG) --exists gumbo && echo yes),yes)
-+	SYS_GUMBO_CFLAGS := $(shell $(PKG_CONFIG) --cflags gumbo)
-+	SYS_GUMBO_LIBS := $(shell $(PKG_CONFIG) --libs gumbo)
-   endif
--  ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
--	SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
--	SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
-+  ifeq ($(shell $(PKG_CONFIG) --exists harfbuzz && echo yes),yes)
-+	SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz)
-+	SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz)
-   endif
--  ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes)
--	SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2)
--	SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2)
-+  ifeq ($(shell $(PKG_CONFIG) --exists lcms2 && echo yes),yes)
-+	SYS_LCMS2_CFLAGS := $(shell $(PKG_CONFIG) --cflags lcms2)
-+	SYS_LCMS2_LIBS := $(shell $(PKG_CONFIG) --libs lcms2)
-   endif
--  ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
--	SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
--	SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
-+  ifeq ($(shell $(PKG_CONFIG) --exists libjpeg && echo yes),yes)
-+	SYS_LIBJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libjpeg)
-+	SYS_LIBJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libjpeg)
-   endif
--  ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
--	SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
--	SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
-+  ifeq ($(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes),yes)
-+	SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2)
-+	SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2)
-   endif
--  ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
--	SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
--	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
-+  ifeq ($(shell $(PKG_CONFIG) --exists zlib && echo yes),yes)
-+	SYS_ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
-+	SYS_ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
-   endif
- 
--  HAVE_SYS_LEPTONICA := $(shell pkg-config --exists 'lept >= 1.7.4' && echo yes)
-+  HAVE_SYS_LEPTONICA := $(shell $(PKG_CONFIG) --exists 'lept >= 1.7.4' && echo yes)
-   ifeq ($(HAVE_SYS_LEPTONICA),yes)
--	SYS_LEPTONICA_CFLAGS := $(shell pkg-config --cflags lept)
--	SYS_LEPTONICA_LIBS := $(shell pkg-config --libs lept)
-+	SYS_LEPTONICA_CFLAGS := $(shell $(PKG_CONFIG) --cflags lept)
-+	SYS_LEPTONICA_LIBS := $(shell $(PKG_CONFIG) --libs lept)
-   endif
- 
--  HAVE_SYS_TESSERACT := $(shell pkg-config --exists 'tesseract >= 4.0.0' && echo yes)
-+  HAVE_SYS_TESSERACT := $(shell $(PKG_CONFIG) --exists 'tesseract >= 4.0.0' && echo yes)
-   ifeq ($(HAVE_SYS_TESSERACT),yes)
--	SYS_TESSERACT_CFLAGS := $(shell pkg-config --cflags tesseract)
--	SYS_TESSERACT_LIBS := $(shell pkg-config --libs tesseract)
-+	SYS_TESSERACT_CFLAGS := $(shell $(PKG_CONFIG) --cflags tesseract)
-+	SYS_TESSERACT_LIBS := $(shell $(PKG_CONFIG) --libs tesseract)
-   endif
- 
--  HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes)
-+  HAVE_SYS_CURL := $(shell $(PKG_CONFIG) --exists libcurl && echo yes)
-   ifeq ($(HAVE_SYS_CURL),yes)
--	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
--	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
-+	SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl)
-+	SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl)
-   endif
- 
-   HAVE_GLUT := yes
-@@ -209,16 +212,16 @@ endif
- 	SYS_GLUT_LIBS := -lglut -lGL
-   endif
- 
-   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)
-+	X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext)
-+	X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext)
-   endif
- 
-   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)
-+	LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO
-+	LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
-   endif
- 
-   HAVE_PTHREAD := yes

diff --git a/app-text/mupdf/files/mupdf-1.19.0-darwin.patch b/app-text/mupdf/files/mupdf-1.19.0-darwin.patch
deleted file mode 100644
index a81c7a008e44..000000000000
--- a/app-text/mupdf/files/mupdf-1.19.0-darwin.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- a/Makerules
-+++ b/Makerules
-@@ -139,11 +139,11 @@ ifeq ($(OS),MINGW)
- else ifeq ($(OS),MACOS)
-   HAVE_GLUT := yes
-   SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
--  SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
--  CC = xcrun cc
--  AR = xcrun ar
--  LD = xcrun ld
--  RANLIB = xcrun ranlib
-+  SYS_GLUT_LIBS ?= -framework GLUT -framework OpenGL
-+  CC ?= xcrun cc
-+  AR ?= xcrun ar
-+  LD ?= xcrun ld
-+  RANLIB ?= xcrun ranlib
- 
-   ifeq (, $(shell which pkg-config))
-     $(warning "No pkg-config found, install it for proper integration of libcrypto")
-@@ -154,9 +154,7 @@ else ifeq ($(OS),MACOS)
- 	  LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
-     endif
-   endif
--
--else ifeq ($(OS),Linux)
--  HAVE_OBJCOPY := yes
-+endif
- 
-   ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
- 	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
-@@ -229,8 +227,6 @@ else ifeq ($(OS),Linux)
- 	PTHREAD_LIBS := -lpthread
-   endif
- 
--endif
--
- # The following section has various cross compilation configurations.
- #
- # Invoke these as:

diff --git a/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch b/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch
deleted file mode 100644
index 9f2b9d692f4e..000000000000
--- a/app-text/mupdf/files/mupdf-1.21.1-no-drm.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/source/html/epub-doc.c b/source/html/epub-doc.c
-index f764242..83888dc 100644
---- a/source/html/epub-doc.c
-+++ b/source/html/epub-doc.c
-@@ -692,10 +692,12 @@ epub_parse_header(fz_context *ctx, epub_document *doc)
- 	epub_chapter **tailp;
- 	int i;
- 
-+	#ifdef GENTOO_MUPDF_DRM
-	if (fz_has_archive_entry(ctx, zip, "META-INF/rights.xml"))
- 		fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM");
- 	if (fz_has_archive_entry(ctx, zip, "META-INF/encryption.xml"))
- 		fz_throw(ctx, FZ_ERROR_GENERIC, "EPUB is locked by DRM");
-+	#endif
- 
- 	fz_var(buf);
- 	fz_var(container_xml);
-

diff --git a/app-text/mupdf/mupdf-1.22.0-r1.ebuild b/app-text/mupdf/mupdf-1.22.0-r1.ebuild
deleted file mode 100644
index fc8bbe571872..000000000000
--- a/app-text/mupdf/mupdf-1.22.0-r1.ebuild
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# Please check upstream git regularly for relevant security-related commits
-# to backport.
-
-inherit desktop flag-o-matic toolchain-funcs xdg
-
-DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
-HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
-SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.gz"
-S="${WORKDIR}"/${P}-source
-
-LICENSE="AGPL-3"
-SLOT="0/${PV}"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
-IUSE="+drm +javascript opengl ssl X"
-REQUIRED_USE="opengl? ( javascript )"
-
-# Although we use the bundled, patched version of freeglut in mupdf (because of
-# bug #653298), the best way to ensure that its dependencies are present is to
-# install system's freeglut.
-RDEPEND="
-	dev-libs/gumbo:=
-	media-libs/freetype:2
-	media-libs/harfbuzz:=[truetype]
-	media-libs/jbig2dec:=
-	media-libs/libpng:0=
-	>=media-libs/openjpeg-2.1:2=
-	>=media-libs/libjpeg-turbo-1.5.3-r2:0=
-	javascript? ( >=dev-lang/mujs-1.2.0:= )
-	opengl? ( >=media-libs/freeglut-3.0.0 )
-	ssl? ( >=dev-libs/openssl-1.1:0= )
-	sys-libs/zlib
-	X? (
-		x11-libs/libX11
-		x11-libs/libXext
-	)
-"
-DEPEND="${RDEPEND}"
-BDEPEND="X? ( x11-base/xorg-proto )
-	virtual/pkgconfig"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
-	"${FILESDIR}"/${PN}-1.19.0-Makefile.patch
-	"${FILESDIR}"/${PN}-1.21.0-add-desktop-pc-files.patch
-	"${FILESDIR}"/${PN}-1.19.0-darwin.patch
-	# See bugs #662352
-	"${FILESDIR}"/${PN}-1.15-openssl-x11.patch
-	# General cross fixes from Debian (refreshed)
-	"${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch
-	"${FILESDIR}"/${PN}-1.21.1-no-drm.patch
-	"${FILESDIR}"/${PN}-1.21.1-fix-aliasing-violation.patch
-)
-
-src_prepare() {
-	default
-
-	use hppa && append-cflags -ffunction-sections
-
-	use drm && append-cflags -DGENTOO_MUPDF_DRM
-
-	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
-
-	sed -e "1iOS = Linux" \
-		-e "1iCC = $(tc-getCC)" \
-		-e "1iCXX = $(tc-getCXX)" \
-		-e "1iLD = $(tc-getLD)" \
-		-e "1iAR = $(tc-getAR)" \
-		-e "1iverbose = yes" \
-		-e "1ibuild = debug" \
-		-i Makerules || die "Failed adding build variables to Makerules in src_prepare()"
-
-	# Adjust MuPDF version in .pc file created by the
-	# mupdf-1.10a-add-desktop-pc-xpm-files.patch file
-	sed -e "s/Version: \(.*\)/Version: ${PV}/" \
-		-i platform/debian/${PN}.pc || die "Failed substituting version in ${PN}.pc"
-}
-
-_emake() {
-	# When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
-	#
-	# Bundled libs
-	# * General
-	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
-	# recommendations. It does not mean "always use system libs".
-	# See [0] below for what it means in a specific version.
-	#
-	# * freeglut
-	# We don't use system's freeglut because upstream has a special modified
-	# version of it that gives mupdf clipboard support. See bug #653298
-	#
-	# * mujs
-	# As of v1.15.0, mupdf started using symbols in mujs that were not part
-	# of any release. We then went back to using the bundled version of it.
-	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
-	# when bumping and check!
-	# See bug #685244
-	#
-	# * lmms2
-	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
-	# It is therefore not appropriate for us to unbundle it at this time.
-	#
-	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
-	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
-	local myemakeargs=(
-		GENTOO_PV=${PV}
-		HAVE_GLUT=$(usex opengl)
-		HAVE_LIBCRYPTO=$(usex ssl)
-		HAVE_X11=$(usex X)
-		USE_SYSTEM_LIBS=yes
-		USE_SYSTEM_MUJS=$(usex javascript)
-		USE_SYSTEM_GLUT=no
-		HAVE_OBJCOPY=no
-		"$@"
-	)
-
-	emake "${myemakeargs[@]}"
-}
-
-src_compile() {
-	tc-export PKG_CONFIG
-
-	_emake XCFLAGS="-fPIC"
-}
-
-src_install() {
-	if use opengl || use X ; then
-		domenu platform/debian/${PN}.desktop
-		doicon -s scalable docs/logo/new-${PN}-icon.svg
-	else
-		rm docs/man/${PN}.1 || die "Failed to remove man page in src_install()"
-	fi
-
-	sed -i \
-		-e "1iprefix = ${ED}/usr" \
-		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
-		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
-		-i Makerules || die "Failed adding liprefix, lilibdir and lidocdir to Makerules in src_install()"
-
-	_emake install
-
-	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
-
-	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
-
-	# Respect libdir (bug #734898)
-	sed -i -e "s:/lib:/$(get_libdir):" platform/debian/${PN}.pc \
-		|| die "Failed to sed pkgconfig file to respect libdir in src_install()"
-
-	insinto /usr/$(get_libdir)/pkgconfig
-	doins platform/debian/${PN}.pc
-
-	dodoc README CHANGES CONTRIBUTORS
-}

diff --git a/app-text/mupdf/mupdf-1.23.3-r1.ebuild b/app-text/mupdf/mupdf-1.23.3-r1.ebuild
deleted file mode 100644
index 7c7e19d9e75c..000000000000
--- a/app-text/mupdf/mupdf-1.23.3-r1.ebuild
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# Please check upstream git regularly for relevant security-related commits
-# to backport.
-
-inherit desktop flag-o-matic toolchain-funcs xdg
-
-DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
-HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
-SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.gz"
-S="${WORKDIR}"/${P}-source
-
-LICENSE="AGPL-3"
-SLOT="0/${PV}"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
-IUSE="+javascript opengl ssl X"
-REQUIRED_USE="opengl? ( javascript )"
-
-# Although we use the bundled, patched version of freeglut in mupdf (because of
-# bug #653298), the best way to ensure that its dependencies are present is to
-# install system's freeglut.
-RDEPEND="
-	dev-libs/gumbo:=
-	media-libs/freetype:2
-	media-libs/harfbuzz:=[truetype]
-	media-libs/jbig2dec:=
-	media-libs/libpng:0=
-	>=media-libs/openjpeg-2.1:2=
-	>=media-libs/libjpeg-turbo-1.5.3-r2:0=
-	net-misc/curl
-	javascript? ( >=dev-lang/mujs-1.2.0:= )
-	opengl? ( >=media-libs/freeglut-3.0.0 )
-	ssl? ( >=dev-libs/openssl-1.1:0= )
-	sys-libs/zlib
-	X? (
-		media-libs/libglvnd[X]
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-	)
-"
-DEPEND="${RDEPEND}
-	X? ( x11-base/xorg-proto )"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
-	"${FILESDIR}"/${PN}-1.19.0-Makefile.patch
-	"${FILESDIR}"/${PN}-1.21.0-add-desktop-pc-files.patch
-	"${FILESDIR}"/${P}-darwin.patch
-	# See bugs #662352
-	"${FILESDIR}"/${P}-openssl-x11.patch
-	# General cross fixes from Debian (refreshed)
-	"${FILESDIR}"/${P}-cross-fixes.patch
-	"${FILESDIR}"/${PN}-1.21.1-fix-aliasing-violation.patch
-)
-
-src_prepare() {
-	default
-
-	use hppa && append-cflags -ffunction-sections
-
-	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
-
-	sed -e "1iOS = Linux" \
-		-e "1iCC = $(tc-getCC)" \
-		-e "1iCXX = $(tc-getCXX)" \
-		-e "1iLD = $(tc-getLD)" \
-		-e "1iAR = $(tc-getAR)" \
-		-e "1iverbose = yes" \
-		-e "1ibuild = debug" \
-		-i Makerules || die "Failed adding build variables to Makerules in src_prepare()"
-
-	# Adjust MuPDF version in .pc file created by the
-	# mupdf-1.10a-add-desktop-pc-xpm-files.patch file
-	sed -e "s/Version: \(.*\)/Version: ${PV}/" \
-		-i platform/debian/${PN}.pc || die "Failed substituting version in ${PN}.pc"
-}
-
-_emake() {
-	# When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
-	#
-	# Bundled libs
-	# * General
-	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
-	# recommendations. It does not mean "always use system libs".
-	# See [0] below for what it means in a specific version.
-	#
-	# * freeglut
-	# We don't use system's freeglut because upstream has a special modified
-	# version of it that gives mupdf clipboard support. See bug #653298
-	#
-	# * mujs
-	# As of v1.15.0, mupdf started using symbols in mujs that were not part
-	# of any release. We then went back to using the bundled version of it.
-	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
-	# when bumping and check!
-	# See bug #685244
-	#
-	# * lmms2
-	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
-	# It is therefore not appropriate for us to unbundle it at this time.
-	#
-	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
-	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
-	local myemakeargs=(
-		GENTOO_PV=${PV}
-		HAVE_GLUT=$(usex opengl)
-		HAVE_LIBCRYPTO=$(usex ssl)
-		HAVE_X11=$(usex X)
-		USE_SYSTEM_LIBS=yes
-		USE_SYSTEM_MUJS=$(usex javascript)
-		USE_SYSTEM_GLUT=no
-		HAVE_OBJCOPY=no
-		"$@"
-	)
-
-	emake "${myemakeargs[@]}"
-}
-
-src_compile() {
-	tc-export PKG_CONFIG
-
-	_emake XCFLAGS="-fPIC"
-}
-
-src_install() {
-	if use opengl || use X ; then
-		domenu platform/debian/${PN}.desktop
-		doicon -s scalable docs/logo/new-${PN}-icon.svg
-	else
-		rm docs/man/${PN}.1 || die "Failed to remove man page in src_install()"
-	fi
-
-	sed -i \
-		-e "1iprefix = ${ED}/usr" \
-		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
-		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
-		-i Makerules || die "Failed adding liprefix, lilibdir and lidocdir to Makerules in src_install()"
-
-	_emake install
-
-	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
-
-	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
-
-	# Respect libdir (bug #734898)
-	sed -i -e "s:/lib:/$(get_libdir):" platform/debian/${PN}.pc \
-		|| die "Failed to sed pkgconfig file to respect libdir in src_install()"
-
-	insinto /usr/$(get_libdir)/pkgconfig
-	doins platform/debian/${PN}.pc
-
-	dodoc README CHANGES CONTRIBUTORS
-}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2024-08-28  6:11 Joonas Niilola
  0 siblings, 0 replies; 27+ messages in thread
From: Joonas Niilola @ 2024-08-28  6:11 UTC (permalink / raw
  To: gentoo-commits

commit:     5674d646d7c612b6a5c7f3801c42a38ed2772c89
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Mon Aug 19 17:41:53 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Aug 28 06:07:34 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5674d646

app-text/mupdf: add 1.24.8

Add ebuild for 1.24.8.
Update icon path and desktop entry.
Upstream changelog doesn't state other changes
relevant to the ebuild.

Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   1 +
 .../files/mupdf-1.24.8-add-desktop-pc-files.patch  |  33 ++++
 app-text/mupdf/mupdf-1.24.8.ebuild                 | 166 +++++++++++++++++++++
 3 files changed, 200 insertions(+)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 2d8887e05469..0b182ac1ae41 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,2 +1,3 @@
 DIST mupdf-1.23.7-source.tar.gz 55312697 BLAKE2B 7ceb7c1871d33b77d4a3d52ed2d1af514c09349df019a189fa7df8ad09648fae313d63de4c1ce6b0666d17f9a897d5ac788d0be2d8896d9b7e4e6ecf679bad7c SHA512 581a4a5a16041bb405fbd7c1b9fba47da5745f00cbdf30e0e0468bfe67ac542884193b5957b293a4cdfc52f043b4f19612086f294b93dbd242d34735a1088777
 DIST mupdf-1.24.1-source.tar.gz 55310618 BLAKE2B 33396b0cca6e2beb1b2bc70c606917c8d9b30b6a277645849ef7ba1e7efbf909c21196acdd5d94d964dd20d3ba746c45cab3c899dfbee1b2138de12e32375a4e SHA512 9d6fbd3388173f06c5db4a27753e69afd21ed32d93f263d4448c3be60a3be747b61102edd5430459f0dbe7ae4df2019689a2f3a582acec77ff322b6d41066fba
+DIST mupdf-1.24.8-source.tar.gz 54039703 BLAKE2B 0fe25d9f0f01a1e387da590c28abac66309247c46c05c7c9b36c4bc911fc16adab681243c2c1d2c50ec91bb76b737022bd3faf06b0b3a803e9120829d9cae5b4 SHA512 17d8fd9fd0e176c8abd1ebc594259a0f7cf822338085ea4574451ba8ec1ac72ba8bd2d5388a1421bbfd4e91257a48d0e0766213ace0933c39d3cb8d774a3860e

diff --git a/app-text/mupdf/files/mupdf-1.24.8-add-desktop-pc-files.patch b/app-text/mupdf/files/mupdf-1.24.8-add-desktop-pc-files.patch
new file mode 100644
index 000000000000..03d5a014fe48
--- /dev/null
+++ b/app-text/mupdf/files/mupdf-1.24.8-add-desktop-pc-files.patch
@@ -0,0 +1,33 @@
+--- /dev/null
++++ ./platform/debian/mupdf.desktop
+@@ -0,0 +1,15 @@
++[Desktop Entry]
++Name=MuPDF
++GenericName=PDF file viewer
++Exec=mupdf %f
++TryExec=mupdf
++Icon=mupdf-icon
++Terminal=false
++Type=Application
++MimeType=application/pdf;application/x-pdf;application/x-cbz;application/oxps;application/vnd.ms-xpsdocument;image/jpeg;image/pjpeg;image/png;image/tiff;image/x-tiff;
++Categories=Viewer;Graphics;
++Actions=View;
++
++[Desktop Action View]
++Name=View with mupdf
++Exec=mupdf %f
+--- /dev/null
++++ ./platform/debian/mupdf.pc
+@@ -0,0 +1,12 @@
++prefix=/usr
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: mupdf
++Description: Library for rendering PDF documents
++Requires: freetype2 libopenjp2 libcrypto
++Version: 0.5.0
++Libs: -L${libdir} -lmupdf
++Libs.private: -lmupdf-js-none
++Cflags: -I${includedir}

diff --git a/app-text/mupdf/mupdf-1.24.8.ebuild b/app-text/mupdf/mupdf-1.24.8.ebuild
new file mode 100644
index 000000000000..7773f50f2acd
--- /dev/null
+++ b/app-text/mupdf/mupdf-1.24.8.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Please check upstream git regularly for relevant security-related commits
+# to backport.
+
+inherit desktop flag-o-matic toolchain-funcs xdg
+
+DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
+HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
+SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.gz"
+S="${WORKDIR}"/${P}-source
+
+LICENSE="AGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="archive +javascript opengl ssl X"
+REQUIRED_USE="opengl? ( javascript )"
+
+# Although we use the bundled, patched version of freeglut in mupdf (because of
+# bug #653298), the best way to ensure that its dependencies are present is to
+# install system's freeglut.
+RDEPEND="
+	archive? ( app-arch/libarchive )
+	dev-libs/gumbo:=
+	media-libs/freetype:2
+	media-libs/harfbuzz:=[truetype]
+	media-libs/jbig2dec:=
+	media-libs/libpng:0=
+	>=media-libs/openjpeg-2.1:2=
+	>=media-libs/libjpeg-turbo-1.5.3-r2:0=
+	net-misc/curl
+	javascript? ( >=dev-lang/mujs-1.2.0:= )
+	opengl? ( >=media-libs/freeglut-3.0.0 )
+	ssl? ( >=dev-libs/openssl-1.1:0= )
+	sys-libs/zlib
+	X? (
+		media-libs/libglvnd[X]
+		x11-libs/libX11
+		x11-libs/libXext
+		x11-libs/libXrandr
+	)
+"
+DEPEND="${RDEPEND}
+	X? ( x11-base/xorg-proto )"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
+	"${FILESDIR}"/${PN}-1.19.0-Makefile.patch
+	"${FILESDIR}"/${P}-add-desktop-pc-files.patch
+	"${FILESDIR}"/${PN}-1.24.1-cross-fixes.patch
+	"${FILESDIR}"/${PN}-1.24.1-darwin.patch
+	# See bugs #662352
+	"${FILESDIR}"/${PN}-1.24.1-openssl-x11.patch
+	# General cross fixes from Debian (refreshed)
+	"${FILESDIR}"/${PN}-1.21.1-fix-aliasing-violation.patch
+)
+
+src_prepare() {
+	default
+
+	use hppa && append-cflags -ffunction-sections
+
+	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
+
+	sed -e "1iOS = Linux" \
+		-e "1iCC = $(tc-getCC)" \
+		-e "1iCXX = $(tc-getCXX)" \
+		-e "1iLD = $(tc-getLD)" \
+		-e "1iAR = $(tc-getAR)" \
+		-e "1iverbose = yes" \
+		-e "1ibuild = debug" \
+		-i Makerules || die "Failed adding build variables to Makerules in src_prepare()"
+
+	# Adjust MuPDF version in .pc file created by the
+	# mupdf-1.21.0-add-desktop-pc-files.patch file
+	sed -e "s/Version: \(.*\)/Version: ${PV}/" \
+		-i platform/debian/${PN}.pc || die "Failed substituting version in ${PN}.pc"
+}
+
+_emake() {
+	# When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
+	#
+	# Bundled libs
+	# * General
+	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
+	# recommendations. It does not mean "always use system libs".
+	# See [0] below for what it means in a specific version.
+	#
+	# * freeglut
+	# We don't use system's freeglut because upstream has a special modified
+	# version of it that gives mupdf clipboard support. See bug #653298
+	#
+	# * mujs
+	# As of v1.15.0, mupdf started using symbols in mujs that were not part
+	# of any release. We then went back to using the bundled version of it.
+	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
+	# when bumping and check!
+	# See bug #685244
+	#
+	# * lmms2
+	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
+	# It is therefore not appropriate for us to unbundle it at this time.
+	#
+	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
+	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
+	local myemakeargs=(
+		GENTOO_PV=${PV}
+		HAVE_GLUT=$(usex opengl)
+		HAVE_LIBCRYPTO=$(usex ssl)
+		HAVE_X11=$(usex X)
+		USE_SYSTEM_LIBS=yes
+		USE_SYSTEM_MUJS=$(usex javascript)
+		USE_SYSTEM_GLUT=no
+		HAVE_OBJCOPY=no
+		"$@"
+	)
+
+	emake "${myemakeargs[@]}"
+}
+
+src_compile() {
+	tc-export PKG_CONFIG
+
+	_emake XCFLAGS="-fPIC"
+}
+
+src_install() {
+	if use opengl || use X ; then
+		domenu platform/debian/${PN}.desktop
+		doicon -s scalable docs/logo/${PN}-icon.svg
+	else
+		rm docs/man/${PN}.1 || die "Failed to remove man page in src_install()"
+	fi
+
+	sed -i \
+		-e "1iprefix = ${ED}/usr" \
+		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
+		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
+		-i Makerules || die "Failed adding liprefix, lilibdir and lidocdir to Makerules in src_install()"
+
+	_emake install
+
+	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
+
+	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
+
+	# Respect libdir and EPREFIX (bugs #734898, #911965)
+	sed -i -e "s:/lib:/$(get_libdir):" \
+		-e "s:/usr:${EPREFIX}/usr:" platform/debian/${PN}.pc \
+		|| die "Failed to sed pkgconfig file to respect libdir and EPREFIX in src_install()"
+
+	insinto /usr/$(get_libdir)/pkgconfig
+	doins platform/debian/${PN}.pc
+
+	dodoc README CHANGES CONTRIBUTORS
+}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
@ 2024-08-28  6:11 Joonas Niilola
  0 siblings, 0 replies; 27+ messages in thread
From: Joonas Niilola @ 2024-08-28  6:11 UTC (permalink / raw
  To: gentoo-commits

commit:     1d4920771fbc0ff99ae8bfecfe3704349a567d69
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Mon Aug 19 17:48:38 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Aug 28 06:07:39 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d492077

app-text/mupdf: drop 1.23.7-r1

Drop 1.23.7-r1 as its keywords are overshadowed
by 1.24.1.

Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38209
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 app-text/mupdf/Manifest                            |   1 -
 .../mupdf/files/mupdf-1.23.3-cross-fixes.patch     | 120 ---------------
 app-text/mupdf/files/mupdf-1.23.3-darwin.patch     |  45 ------
 .../mupdf/files/mupdf-1.23.3-openssl-x11.patch     |  19 ---
 app-text/mupdf/mupdf-1.23.7-r1.ebuild              | 165 ---------------------
 5 files changed, 350 deletions(-)

diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
index 0b182ac1ae41..c1805aa70fe3 100644
--- a/app-text/mupdf/Manifest
+++ b/app-text/mupdf/Manifest
@@ -1,3 +1,2 @@
-DIST mupdf-1.23.7-source.tar.gz 55312697 BLAKE2B 7ceb7c1871d33b77d4a3d52ed2d1af514c09349df019a189fa7df8ad09648fae313d63de4c1ce6b0666d17f9a897d5ac788d0be2d8896d9b7e4e6ecf679bad7c SHA512 581a4a5a16041bb405fbd7c1b9fba47da5745f00cbdf30e0e0468bfe67ac542884193b5957b293a4cdfc52f043b4f19612086f294b93dbd242d34735a1088777
 DIST mupdf-1.24.1-source.tar.gz 55310618 BLAKE2B 33396b0cca6e2beb1b2bc70c606917c8d9b30b6a277645849ef7ba1e7efbf909c21196acdd5d94d964dd20d3ba746c45cab3c899dfbee1b2138de12e32375a4e SHA512 9d6fbd3388173f06c5db4a27753e69afd21ed32d93f263d4448c3be60a3be747b61102edd5430459f0dbe7ae4df2019689a2f3a582acec77ff322b6d41066fba
 DIST mupdf-1.24.8-source.tar.gz 54039703 BLAKE2B 0fe25d9f0f01a1e387da590c28abac66309247c46c05c7c9b36c4bc911fc16adab681243c2c1d2c50ec91bb76b737022bd3faf06b0b3a803e9120829d9cae5b4 SHA512 17d8fd9fd0e176c8abd1ebc594259a0f7cf822338085ea4574451ba8ec1ac72ba8bd2d5388a1421bbfd4e91257a48d0e0766213ace0933c39d3cb8d774a3860e

diff --git a/app-text/mupdf/files/mupdf-1.23.3-cross-fixes.patch b/app-text/mupdf/files/mupdf-1.23.3-cross-fixes.patch
deleted file mode 100644
index 02fa3bfdd45c..000000000000
--- a/app-text/mupdf/files/mupdf-1.23.3-cross-fixes.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-Refreshed patches based on:
-https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0004-MuPDF-crossbuild-use-target-arch-pkg-config.patch/
-https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0005-MuPDF-crossbuild-use-host-cc-for-utils.patch/
---- a/Makerules
-+++ b/Makerules
-@@ -9,6 +9,9 @@ ifeq ($(OS),)
-   OS := $(OS:Darwin=MACOS)
- endif
- 
-+PKG_CONFIG ?= pkg-config
-+CC_FOR_BUILD ?= $(CC)
-+
- WARNING_CFLAGS := -Wall -Wsign-compare
- 
- # Feature configuration options
-@@ -190,51 +193,51 @@ else ifeq ($(OS),Linux)
-     LDFLAGS += -sTOTAL_MEMORY=48MB
-   endif
- 
--  ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
--	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
--	SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
-+  ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes)
-+	SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
-+	SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
-   endif
--  ifeq ($(shell pkg-config --exists gumbo && echo yes),yes)
--	SYS_GUMBO_CFLAGS := $(shell pkg-config --cflags gumbo)
--	SYS_GUMBO_LIBS := $(shell pkg-config --libs gumbo)
-+  ifeq ($(shell $(PKG_CONFIG) --exists gumbo && echo yes),yes)
-+	SYS_GUMBO_CFLAGS := $(shell $(PKG_CONFIG) --cflags gumbo)
-+	SYS_GUMBO_LIBS := $(shell $(PKG_CONFIG) --libs gumbo)
-   endif
--  ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
--	SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
--	SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
-+  ifeq ($(shell $(PKG_CONFIG) --exists harfbuzz && echo yes),yes)
-+	SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz)
-+	SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz)
-   endif
--  ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes)
--	SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2)
--	SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2)
-+  ifeq ($(shell $(PKG_CONFIG) --exists lcms2 && echo yes),yes)
-+	SYS_LCMS2_CFLAGS := $(shell $(PKG_CONFIG) --cflags lcms2)
-+	SYS_LCMS2_LIBS := $(shell $(PKG_CONFIG) --libs lcms2)
-   endif
--  ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
--	SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
--	SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
-+  ifeq ($(shell $(PKG_CONFIG) --exists libjpeg && echo yes),yes)
-+	SYS_LIBJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libjpeg)
-+	SYS_LIBJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libjpeg)
-   endif
--  ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
--	SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
--	SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
-+  ifeq ($(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes),yes)
-+	SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2)
-+	SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2)
-   endif
--  ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
--	SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
--	SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
-+  ifeq ($(shell $(PKG_CONFIG) --exists zlib && echo yes),yes)
-+	SYS_ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
-+	SYS_ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
-   endif
- 
--  HAVE_SYS_LEPTONICA := $(shell pkg-config --exists 'lept >= 1.7.4' && echo yes)
-+  HAVE_SYS_LEPTONICA := $(shell $(PKG_CONFIG) --exists 'lept >= 1.7.4' && echo yes)
-   ifeq ($(HAVE_SYS_LEPTONICA),yes)
--	SYS_LEPTONICA_CFLAGS := $(shell pkg-config --cflags lept)
--	SYS_LEPTONICA_LIBS := $(shell pkg-config --libs lept)
-+	SYS_LEPTONICA_CFLAGS := $(shell $(PKG_CONFIG) --cflags lept)
-+	SYS_LEPTONICA_LIBS := $(shell $(PKG_CONFIG) --libs lept)
-   endif
- 
--  HAVE_SYS_TESSERACT := $(shell pkg-config --exists 'tesseract >= 4.0.0' && echo yes)
-+  HAVE_SYS_TESSERACT := $(shell $(PKG_CONFIG) --exists 'tesseract >= 4.0.0' && echo yes)
-   ifeq ($(HAVE_SYS_TESSERACT),yes)
--	SYS_TESSERACT_CFLAGS := $(shell pkg-config --cflags tesseract)
--	SYS_TESSERACT_LIBS := $(shell pkg-config --libs tesseract)
-+	SYS_TESSERACT_CFLAGS := $(shell $(PKG_CONFIG) --cflags tesseract)
-+	SYS_TESSERACT_LIBS := $(shell $(PKG_CONFIG) --libs tesseract)
-   endif
- 
--  HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes)
-+  HAVE_SYS_CURL := $(shell $(PKG_CONFIG) --exists libcurl && echo yes)
-   ifeq ($(HAVE_SYS_CURL),yes)
--	SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
--	SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
-+	SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl)
-+	SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl)
-   endif
- 
-   HAVE_GLUT := yes
-@@ -243,18 +246,18 @@ else ifeq ($(OS),Linux)
- 	SYS_GLUT_LIBS := -lglut -lGL
-   endif
- 
-   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)
-+	X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext)
-+	X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext)
-   endif
- 
-   ifeq ($(HAVE_LIBCRYPTO),)
-     HAVE_LIBCRYPTO := not-unless-portage-tells-me
-   endif
-   ifeq ($(HAVE_LIBCRYPTO),yes)
--	LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
--	LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
-+	LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO
-+	LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
-   endif
- 
-   HAVE_PTHREAD := yes

diff --git a/app-text/mupdf/files/mupdf-1.23.3-darwin.patch b/app-text/mupdf/files/mupdf-1.23.3-darwin.patch
deleted file mode 100644
index c151d81f175d..000000000000
--- a/app-text/mupdf/files/mupdf-1.23.3-darwin.patch
+++ /dev/null
@@ -1,45 +0,0 @@
---- a/Makerules
-+++ b/Makerules
-@@ -161,11 +161,11 @@ ifeq ($(OS),MINGW)
- else ifeq ($(OS),MACOS)
-   HAVE_GLUT := yes
-   SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
--  SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
--  CC = xcrun cc
--  AR = xcrun ar
--  LD = xcrun ld
--  RANLIB = xcrun ranlib
-+  SYS_GLUT_LIBS ?= -framework GLUT -framework OpenGL
-+  CC ?= xcrun cc
-+  AR ?= xcrun ar
-+  LD ?= xcrun ld
-+  RANLIB ?= xcrun ranlib
- 
-   ifneq ($(ARCHFLAGS),)
-     $(warning "MacOS with ARCHFLAGS set. Assuming we are building for arm64, and setting HAVE_LIBCRYPTO to no.")
-@@ -180,15 +180,7 @@ else ifeq ($(OS),MACOS)
-     endif
-   endif
- 
--else ifeq ($(OS),Linux)
--  ifeq ($(PYODIDE_ROOT),)
--    HAVE_OBJCOPY := yes
--  else
--    # Pyodide's ld does not support -b so we cannot use it to create object
--    # files containing font data, so leave HAVE_OBJCOPY unset. And we need
--    # extra memory when linking.
--    LDFLAGS += -sTOTAL_MEMORY=48MB
--  endif
-+endif
- 
-   ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
- 	SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
-@@ -263,8 +255,6 @@ else ifeq ($(OS),Linux)
- 	PTHREAD_LIBS := -lpthread
-   endif
- 
--endif
--
- # The following section has various cross compilation configurations.
- #
- # Invoke these as:

diff --git a/app-text/mupdf/files/mupdf-1.23.3-openssl-x11.patch b/app-text/mupdf/files/mupdf-1.23.3-openssl-x11.patch
deleted file mode 100644
index b91bd9ad12e3..000000000000
--- a/app-text/mupdf/files/mupdf-1.23.3-openssl-x11.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/Makerules
-+++ b/Makerules
-@@ -243,14 +243,14 @@ 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
- 
-   ifeq ($(HAVE_LIBCRYPTO),)
--    HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
-+    HAVE_LIBCRYPTO := not-unless-portage-tells-me
-   endif
-   ifeq ($(HAVE_LIBCRYPTO),yes)
- 	LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO

diff --git a/app-text/mupdf/mupdf-1.23.7-r1.ebuild b/app-text/mupdf/mupdf-1.23.7-r1.ebuild
deleted file mode 100644
index d27ecf8911d4..000000000000
--- a/app-text/mupdf/mupdf-1.23.7-r1.ebuild
+++ /dev/null
@@ -1,165 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-# Please check upstream git regularly for relevant security-related commits
-# to backport.
-
-inherit desktop flag-o-matic toolchain-funcs xdg
-
-DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C"
-HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git"
-SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.gz"
-S="${WORKDIR}"/${P}-source
-
-LICENSE="AGPL-3"
-SLOT="0/${PV}"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
-IUSE="+javascript opengl ssl X"
-REQUIRED_USE="opengl? ( javascript )"
-
-# Although we use the bundled, patched version of freeglut in mupdf (because of
-# bug #653298), the best way to ensure that its dependencies are present is to
-# install system's freeglut.
-RDEPEND="
-	dev-libs/gumbo:=
-	media-libs/freetype:2
-	media-libs/harfbuzz:=[truetype]
-	media-libs/jbig2dec:=
-	media-libs/libpng:0=
-	>=media-libs/openjpeg-2.1:2=
-	>=media-libs/libjpeg-turbo-1.5.3-r2:0=
-	net-misc/curl
-	javascript? ( >=dev-lang/mujs-1.2.0:= )
-	opengl? ( >=media-libs/freeglut-3.0.0 )
-	ssl? ( >=dev-libs/openssl-1.1:0= )
-	sys-libs/zlib
-	X? (
-		media-libs/libglvnd[X]
-		x11-libs/libX11
-		x11-libs/libXext
-		x11-libs/libXrandr
-	)
-"
-DEPEND="${RDEPEND}
-	X? ( x11-base/xorg-proto )"
-BDEPEND="virtual/pkgconfig"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.15-CFLAGS.patch
-	"${FILESDIR}"/${PN}-1.19.0-Makefile.patch
-	"${FILESDIR}"/${PN}-1.21.0-add-desktop-pc-files.patch
-	"${FILESDIR}"/${PN}-1.23.3-darwin.patch
-	# See bugs #662352
-	"${FILESDIR}"/${PN}-1.23.3-openssl-x11.patch
-	# General cross fixes from Debian (refreshed)
-	"${FILESDIR}"/${PN}-1.23.3-cross-fixes.patch
-	"${FILESDIR}"/${PN}-1.21.1-fix-aliasing-violation.patch
-)
-
-src_prepare() {
-	default
-
-	use hppa && append-cflags -ffunction-sections
-
-	append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)"
-
-	sed -e "1iOS = Linux" \
-		-e "1iCC = $(tc-getCC)" \
-		-e "1iCXX = $(tc-getCXX)" \
-		-e "1iLD = $(tc-getLD)" \
-		-e "1iAR = $(tc-getAR)" \
-		-e "1iverbose = yes" \
-		-e "1ibuild = debug" \
-		-i Makerules || die "Failed adding build variables to Makerules in src_prepare()"
-
-	# Adjust MuPDF version in .pc file created by the
-	# mupdf-1.21.0-add-desktop-pc-files.patch file
-	sed -e "s/Version: \(.*\)/Version: ${PV}/" \
-		-i platform/debian/${PN}.pc || die "Failed substituting version in ${PN}.pc"
-}
-
-_emake() {
-	# When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
-	#
-	# Bundled libs
-	# * General
-	# Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's
-	# recommendations. It does not mean "always use system libs".
-	# See [0] below for what it means in a specific version.
-	#
-	# * freeglut
-	# We don't use system's freeglut because upstream has a special modified
-	# version of it that gives mupdf clipboard support. See bug #653298
-	#
-	# * mujs
-	# As of v1.15.0, mupdf started using symbols in mujs that were not part
-	# of any release. We then went back to using the bundled version of it.
-	# But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk
-	# when bumping and check!
-	# See bug #685244
-	#
-	# * lmms2
-	# mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1].
-	# It is therefore not appropriate for us to unbundle it at this time.
-	#
-	# [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9
-	# [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt
-	local myemakeargs=(
-		GENTOO_PV=${PV}
-		HAVE_GLUT=$(usex opengl)
-		HAVE_LIBCRYPTO=$(usex ssl)
-		HAVE_X11=$(usex X)
-		USE_SYSTEM_LIBS=yes
-		USE_SYSTEM_MUJS=$(usex javascript)
-		USE_SYSTEM_GLUT=no
-		HAVE_OBJCOPY=no
-		"$@"
-	)
-
-	emake "${myemakeargs[@]}"
-}
-
-src_compile() {
-	tc-export PKG_CONFIG
-
-	_emake XCFLAGS="-fPIC"
-}
-
-src_install() {
-	if use opengl || use X ; then
-		domenu platform/debian/${PN}.desktop
-		doicon -s scalable docs/logo/new-${PN}-icon.svg
-	else
-		rm docs/man/${PN}.1 || die "Failed to remove man page in src_install()"
-	fi
-
-	sed -i \
-		-e "1iprefix = ${ED}/usr" \
-		-e "1ilibdir = ${ED}/usr/$(get_libdir)" \
-		-e "1idocdir = ${ED}/usr/share/doc/${PF}" \
-		-i Makerules || die "Failed adding liprefix, lilibdir and lidocdir to Makerules in src_install()"
-
-	_emake install
-
-	dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so
-
-	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
-
-	# Respect libdir and EPREFIX (bugs #734898, #911965)
-	sed -i -e "s:/lib:/$(get_libdir):" \
-		-e "s:/usr:${EPREFIX}/usr:" platform/debian/${PN}.pc \
-		|| die "Failed to sed pkgconfig file to respect libdir and EPREFIX in src_install()"
-
-	insinto /usr/$(get_libdir)/pkgconfig
-	doins platform/debian/${PN}.pc
-
-	dodoc README CHANGES CONTRIBUTORS
-}


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2024-08-28  6:11 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10 22:52 [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/ Michael Weber
  -- strict thread matches above, loose matches on Subject: below --
2016-06-04 19:46 Michael Weber
2017-01-23  0:31 Michael Weber
2017-02-09 21:10 Michael Weber
2017-03-06 22:12 Michael Weber
2018-01-28  9:53 Michael Weber
2018-04-12  1:03 Thomas Deutschmann
2018-08-27 19:53 Virgil Dupras
2018-12-16 20:24 Virgil Dupras
2019-02-19 21:02 Virgil Dupras
2019-05-07  2:39 Virgil Dupras
2019-11-26 14:25 Jory Pratt
2020-01-21 23:04 Sergei Trofimovich
2020-08-14  4:21 Sam James
2020-10-13 23:21 Sam James
2021-04-14 22:03 Sam James
2021-12-04  8:20 Joonas Niilola
2022-06-30 13:33 Florian Schmaus
2022-07-19  7:41 Florian Schmaus
2022-12-29 20:50 Florian Schmaus
2022-12-29 20:50 Florian Schmaus
2023-01-04  5:50 Sam James
2023-02-26  7:02 Joonas Niilola
2024-05-25  7:06 Arthur Zamarin
2024-05-25  7:06 Arthur Zamarin
2024-08-28  6:11 Joonas Niilola
2024-08-28  6:11 Joonas Niilola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox