1 |
commit: 7e51c0aae90d1611ff7674963a0e3989e6124e5d |
2 |
Author: Michael Weber <xmw <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 28 09:33:04 2017 +0000 |
4 |
Commit: Michael Weber <xmw <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 28 09:33:23 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e51c0aa |
7 |
|
8 |
app-text/mupdf: Version bump (bug 616652), make mupdf-gl default if available (bug 616654), thanks Massimo Burcheri. |
9 |
|
10 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
11 |
|
12 |
app-text/mupdf/Manifest | 1 + |
13 |
app-text/mupdf/files/mupdf-1.11-CFLAGS.patch | 10 ++ |
14 |
.../mupdf/files/mupdf-1.11-openssl-curl-x11.patch | 37 +++++ |
15 |
app-text/mupdf/files/mupdf-1.11-system-glfw.patch | 11 ++ |
16 |
app-text/mupdf/mupdf-1.11.ebuild | 151 +++++++++++++++++++++ |
17 |
5 files changed, 210 insertions(+) |
18 |
|
19 |
diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest |
20 |
index 006624c52d7..a18278adef1 100644 |
21 |
--- a/app-text/mupdf/Manifest |
22 |
+++ b/app-text/mupdf/Manifest |
23 |
@@ -1 +1,2 @@ |
24 |
DIST mupdf-1.10a-source.tar.gz 42264707 SHA256 aacc1f36b9180f562022ef1ab3439b009369d944364f3cff8a2a898834e3a836 SHA512 8c735963364985e74ceb38242afae555a3d2ee7c69abe3fe5c485e8613a83d996a58f231cb689a156019d431fa67d565503247d010b0a404054850483aed9fec WHIRLPOOL f3dc7fbddd2ee140226f17b444f184138dbff5d626033a295a7b335119fae5eb49eae680fb392068935610cdbed21267016af8afaa080fffba4f320b82209fbb |
25 |
+DIST mupdf-1.11-source.tar.gz 40156070 SHA256 209474a80c56a035ce3f4958a63373a96fad75c927c7b1acdc553fc85855f00a SHA512 501670f540e298a8126806ebbd9db8b29866f663b7bbf26c9ade1933e42f0c00ad410b9d93f3ddbfb3e45c38722869095de28d832fe3fb3703c55cc9a01dbf63 WHIRLPOOL 91ee829b7b39b31c21cda324925e70a52139515c9cd2ef6fb3d903493c96af22d2c2bf19017dfc6d58842c8ebd7896faef34b73d94822977f10300c916fe1352 |
26 |
|
27 |
diff --git a/app-text/mupdf/files/mupdf-1.11-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.11-CFLAGS.patch |
28 |
new file mode 100644 |
29 |
index 00000000000..2ffd326e5e4 |
30 |
--- /dev/null |
31 |
+++ b/app-text/mupdf/files/mupdf-1.11-CFLAGS.patch |
32 |
@@ -0,0 +1,10 @@ |
33 |
+--- mupdf-1.11-source/Makerules |
34 |
++++ mupdf-1.11-source/Makerules |
35 |
+@@ -23,7 +23,6 @@ |
36 |
+ endif |
37 |
+ |
38 |
+ ifeq "$(build)" "debug" |
39 |
+-CFLAGS += -pipe -g |
40 |
+ LDFLAGS += -g |
41 |
+ else ifeq "$(build)" "release" |
42 |
+ CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer |
43 |
|
44 |
diff --git a/app-text/mupdf/files/mupdf-1.11-openssl-curl-x11.patch b/app-text/mupdf/files/mupdf-1.11-openssl-curl-x11.patch |
45 |
new file mode 100644 |
46 |
index 00000000000..91fd9f6485d |
47 |
--- /dev/null |
48 |
+++ b/app-text/mupdf/files/mupdf-1.11-openssl-curl-x11.patch |
49 |
@@ -0,0 +1,37 @@ |
50 |
+--- mupdf-1.11-source/Makerules |
51 |
++++ mupdf-1.11-source/Makerules |
52 |
+@@ -116,12 +116,17 @@ |
53 |
+ SYS_PTHREAD_CFLAGS := |
54 |
+ SYS_PTHREAD_LIBS := -lpthread |
55 |
+ |
56 |
++WANT_OPENSSL ?= yes |
57 |
++ifeq "$(WANT_OPENSSL)" "yes" |
58 |
+ ifeq "$(shell pkg-config --exists 'libcrypto <= 1.0.1t' && echo yes)" "yes" |
59 |
+ HAVE_LIBCRYPTO := yes |
60 |
+ SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto) |
61 |
+ SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto) |
62 |
+ endif |
63 |
++endif |
64 |
+ |
65 |
++WANT_CURL ?= yes |
66 |
++ifeq "$(WANT_CURL)" "yes" |
67 |
+ ifeq "$(shell pkg-config --exists libcurl && echo yes)" "yes" |
68 |
+ HAVE_CURL := yes |
69 |
+ SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl) |
70 |
+@@ -133,12 +138,16 @@ |
71 |
+ endif |
72 |
+ endif |
73 |
+ SYS_CURL_DEPS += -lpthread -lrt |
74 |
++endif |
75 |
+ |
76 |
++WANT_X!! ?= yes |
77 |
++ifeq "$(WANT_X11)" "yes" |
78 |
+ ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes" |
79 |
+ HAVE_X11 := yes |
80 |
+ SYS_X11_CFLAGS := $(shell pkg-config --cflags x11 xext) |
81 |
+ SYS_X11_LIBS := $(shell pkg-config --libs x11 xext) |
82 |
+ endif |
83 |
++endif |
84 |
+ |
85 |
+ ifeq "$(shell pkg-config --exists harfbuzz && echo yes)" "yes" |
86 |
+ SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz) |
87 |
|
88 |
diff --git a/app-text/mupdf/files/mupdf-1.11-system-glfw.patch b/app-text/mupdf/files/mupdf-1.11-system-glfw.patch |
89 |
new file mode 100644 |
90 |
index 00000000000..90189f9400b |
91 |
--- /dev/null |
92 |
+++ b/app-text/mupdf/files/mupdf-1.11-system-glfw.patch |
93 |
@@ -0,0 +1,11 @@ |
94 |
+--- mupdf-1.11-source/Makerules |
95 |
++++ mupdf-1.11-source/Makerules |
96 |
+@@ -158,6 +158,8 @@ |
97 |
+ SYS_JBIG2DEC_LIBS := -ljbig2dec |
98 |
+ SYS_LIBJPEG_LIBS := -ljpeg |
99 |
+ SYS_ZLIB_LIBS := -lz |
100 |
++SYS_GLFW_CFLAGS = $(shell pkg-config --cflags glfw3 gl) |
101 |
++SYS_GLFW_LIBS = $(shell pkg-config --libs glfw3 gl) |
102 |
+ |
103 |
+ endif |
104 |
+ |
105 |
|
106 |
diff --git a/app-text/mupdf/mupdf-1.11.ebuild b/app-text/mupdf/mupdf-1.11.ebuild |
107 |
new file mode 100644 |
108 |
index 00000000000..0369b675c19 |
109 |
--- /dev/null |
110 |
+++ b/app-text/mupdf/mupdf-1.11.ebuild |
111 |
@@ -0,0 +1,151 @@ |
112 |
+# Copyright 1999-2017 Gentoo Foundation |
113 |
+# Distributed under the terms of the GNU General Public License v2 |
114 |
+ |
115 |
+EAPI=6 |
116 |
+ |
117 |
+inherit flag-o-matic toolchain-funcs |
118 |
+ |
119 |
+DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C" |
120 |
+HOMEPAGE="http://mupdf.com/" |
121 |
+SRC_URI="http://mupdf.com/downloads/${P}-source.tar.gz" |
122 |
+ |
123 |
+LICENSE="AGPL-3" |
124 |
+SLOT="0/${PV}" |
125 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos" |
126 |
+IUSE="X +curl javascript libressl opengl +openssl static static-libs vanilla" |
127 |
+ |
128 |
+LIB_DEPEND=" |
129 |
+ !libressl? ( dev-libs/openssl:0[static-libs?] ) |
130 |
+ libressl? ( dev-libs/libressl[static-libs?] ) |
131 |
+ javascript? ( >=dev-lang/mujs-0_p20160504 ) |
132 |
+ media-libs/freetype:2[static-libs?] |
133 |
+ media-libs/harfbuzz[static-libs?] |
134 |
+ media-libs/jbig2dec[static-libs?] |
135 |
+ media-libs/libpng:0[static-libs?] |
136 |
+ >=media-libs/openjpeg-2.1:2[static-libs?] |
137 |
+ net-misc/curl[static-libs?] |
138 |
+ virtual/jpeg[static-libs?] |
139 |
+ X? ( x11-libs/libX11[static-libs?] |
140 |
+ x11-libs/libXext[static-libs?] ) |
141 |
+ opengl? ( >=media-libs/glfw-3 )" |
142 |
+RDEPEND="${LIB_DEPEND}" |
143 |
+DEPEND="${RDEPEND} |
144 |
+ virtual/pkgconfig |
145 |
+ static-libs? ( ${LIB_DEPEND} ) |
146 |
+ static? ( ${LIB_DEPEND//?} |
147 |
+ app-arch/bzip2[static-libs] |
148 |
+ x11-libs/libXau[static-libs] |
149 |
+ x11-libs/libXdmcp[static-libs] |
150 |
+ x11-libs/libxcb[static-libs] )" |
151 |
+ |
152 |
+REQUIRED_USE="opengl? ( X !static !static-libs )" |
153 |
+ |
154 |
+S=${WORKDIR}/${P}-source |
155 |
+ |
156 |
+PATCHES=( |
157 |
+ "${FILESDIR}"/${PN}-1.11-CFLAGS.patch |
158 |
+ "${FILESDIR}"/${PN}-1.9a-debug-build.patch |
159 |
+ "${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch |
160 |
+ "${FILESDIR}"/${PN}-1.11-openssl-curl-x11.patch |
161 |
+ "${FILESDIR}"/${PN}-1.11-system-glfw.patch |
162 |
+) |
163 |
+ |
164 |
+src_prepare() { |
165 |
+ default |
166 |
+ use hppa && append-cflags -ffunction-sections |
167 |
+ |
168 |
+ rm -rf thirdparty || die |
169 |
+ |
170 |
+ if has_version ">=media-libs/openjpeg-2.1:2" ; then |
171 |
+ # Remove a switch, which prevents using shared libraries for openjpeg2. |
172 |
+ # See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html |
173 |
+ sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c |
174 |
+ fi |
175 |
+ |
176 |
+ use javascript || \ |
177 |
+ sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \ |
178 |
+ -i include/mupdf/fitz/config.h |
179 |
+ |
180 |
+ sed -e "/^libdir=/s:/lib:/$(get_libdir):" \ |
181 |
+ -e "/^prefix=/s:=.*:=${EROOT}/usr:" \ |
182 |
+ -i platform/debian/${PN}.pc || die |
183 |
+ |
184 |
+ use vanilla || eapply \ |
185 |
+ "${FILESDIR}"/${PN}-1.3-zoom-2.patch |
186 |
+ |
187 |
+ sed -e "1iOS = Linux" \ |
188 |
+ -e "1iCC = $(tc-getCC)" \ |
189 |
+ -e "1iLD = $(tc-getCC)" \ |
190 |
+ -e "1iAR = $(tc-getAR)" \ |
191 |
+ -e "1iverbose = yes" \ |
192 |
+ -e "1ibuild = debug" \ |
193 |
+ -e "1iprefix = ${ED}usr" \ |
194 |
+ -e "1ilibdir = ${ED}usr/$(get_libdir)" \ |
195 |
+ -e "1idocdir = ${ED}usr/share/doc/${PF}" \ |
196 |
+ -e "1iWANT_X11 = $(usex X)" \ |
197 |
+ -e "1iWANT_OPENSSL = $(usex openssl)" \ |
198 |
+ -e "1iWANT_CURL = $(usex curl)" \ |
199 |
+ -e "1iHAVE_MUJS = $(usex javascript)" \ |
200 |
+ -e "1iMUJS_LIBS = $(usex javascript -lmujs '')" \ |
201 |
+ -e "1iMUJS_CFLAGS =" \ |
202 |
+ -e "1iHAVE_GLFW = $(usex opengl yes no)" \ |
203 |
+ -i Makerules || die |
204 |
+ |
205 |
+ if use static-libs || use static ; then |
206 |
+ cp -a "${S}" "${S}"-static || die |
207 |
+ #add missing Libs.private for xcb and freetype |
208 |
+ sed -e 's:\(pkg-config --libs\):\1 --static:' \ |
209 |
+ -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \ |
210 |
+ -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \ |
211 |
+ -i "${S}"-static/Makerules || die |
212 |
+ fi |
213 |
+ |
214 |
+ my_soname=libmupdf.so.${PV} |
215 |
+ my_soname_js_none=libmupdf-js-none.so.${PV} |
216 |
+ sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \ |
217 |
+ -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \ |
218 |
+ -e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \ |
219 |
+ -e "\$a\$(MUPDF_JS_NONE_LIB):" \ |
220 |
+ -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \ |
221 |
+ -e "/install/s: COPYING : :" \ |
222 |
+ -i Makefile || die |
223 |
+} |
224 |
+ |
225 |
+src_compile() { |
226 |
+ emake XCFLAGS="-fpic" |
227 |
+ use static-libs && \ |
228 |
+ emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a |
229 |
+ use static && \ |
230 |
+ emake -C "${S}"-static XLIBS="-static" |
231 |
+} |
232 |
+ |
233 |
+src_install() { |
234 |
+ if use X ; then |
235 |
+ domenu platform/debian/${PN}.desktop |
236 |
+ doicon platform/debian/${PN}.xpm |
237 |
+ else |
238 |
+ rm docs/man/${PN}.1 |
239 |
+ fi |
240 |
+ |
241 |
+ emake install |
242 |
+ dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so |
243 |
+ |
244 |
+ use static-libs && \ |
245 |
+ dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a |
246 |
+ if use static ; then |
247 |
+ dobin "${S}"-static/build/debug/mu{tool,draw} |
248 |
+ use X && dobin "${S}"-static/build/debug/${PN}-x11 |
249 |
+ fi |
250 |
+ if use X ; then |
251 |
+ if use opengl ; then |
252 |
+ dosym ${PN}-gl /usr/bin/${PN} |
253 |
+ einfo "mupdf symlink points to mupdf-gl (bug 616654)" |
254 |
+ else |
255 |
+ dosym ${PN}-x11 /usr/bin/${PN} |
256 |
+ fi |
257 |
+ fi |
258 |
+ insinto /usr/$(get_libdir)/pkgconfig |
259 |
+ doins platform/debian/${PN}.pc |
260 |
+ |
261 |
+ dodoc README docs/*.{txt,c} |
262 |
+} |