1 |
commit: 59271a38de883bea2a0ebdc0f42dd1ca458b11f0 |
2 |
Author: Philipp Roesner <rndxelement <AT> protonmail <DOT> com> |
3 |
AuthorDate: Fri Dec 3 23:59:47 2021 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 4 08:18:21 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59271a38 |
7 |
|
8 |
app-text/mupdf: bump to 1.19.0 |
9 |
|
10 |
We version bumped the package to mupdf-1.19.0. |
11 |
Several patches were removed because they were fixed upstream. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/827957 |
14 |
Package-Manager: Portage-3.0.28, Repoman-3.0.3 |
15 |
Signed-off-by: Philipp Roesner <rndxelement <AT> protonmail.com> |
16 |
Closes: https://github.com/gentoo/gentoo/pull/23174 |
17 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
18 |
|
19 |
app-text/mupdf/Manifest | 1 + |
20 |
app-text/mupdf/files/mupdf-1.19.0-Makefile.patch | 37 +++++ |
21 |
.../mupdf/files/mupdf-1.19.0-cross-fixes.patch | 130 ++++++++++++++++++ |
22 |
app-text/mupdf/files/mupdf-1.19.0-darwin.patch | 39 ++++++ |
23 |
app-text/mupdf/mupdf-1.19.0.ebuild | 152 +++++++++++++++++++++ |
24 |
5 files changed, 359 insertions(+) |
25 |
|
26 |
diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest |
27 |
index acda2b0eb4e3..c901a64470da 100644 |
28 |
--- a/app-text/mupdf/Manifest |
29 |
+++ b/app-text/mupdf/Manifest |
30 |
@@ -1 +1,2 @@ |
31 |
DIST mupdf-1.18.0-source.tar.xz 53621544 BLAKE2B d0057f4240bd4f6b4b6d9381ae1c3871c56b97604d5c6ea6438a8bde72d4696c10a9f0e8e2ed8f43d63a04bb1d973bade8a708327c00b0d0c6802b28af697a55 SHA512 7551f18b9bac6e2dc1cf073741cbc975ce3a16dc7e37c9d5a58254c67bf2c07bb36185d6585e435d4126f3ae351f67d7432d19a986c9b47b15105ca43db0edb8 |
32 |
+DIST mupdf-1.19.0-source.tar.xz 64077324 BLAKE2B 4c30cfc004b4f354ae349e5460327775a4dbdd689e561888c156e9e69e22b45ea1f260dfed8d2d8c017fe65a1e83cabc8ff29dad8de47a2c541f9e335bf11285 SHA512 421e8e49f83cf00bfb2c86b5425939056fe866a048cf18e4c8f5764cdee9829974eea655c944d0f3f5a9407347cceaef34030f4079aa399e798da3ff849230e7 |
33 |
|
34 |
diff --git a/app-text/mupdf/files/mupdf-1.19.0-Makefile.patch b/app-text/mupdf/files/mupdf-1.19.0-Makefile.patch |
35 |
new file mode 100644 |
36 |
index 000000000000..b266655aaeca |
37 |
--- /dev/null |
38 |
+++ b/app-text/mupdf/files/mupdf-1.19.0-Makefile.patch |
39 |
@@ -0,0 +1,37 @@ |
40 |
+diff --git a/Makefile b/Makefile |
41 |
+index 7fa74b3..e842374 100644 |
42 |
+--- a/Makefile |
43 |
++++ b/Makefile |
44 |
+@@ -3,7 +3,7 @@ |
45 |
+ -include user.make |
46 |
+ |
47 |
+ ifndef build |
48 |
+- build := release |
49 |
++ build := debug |
50 |
+ endif |
51 |
+ |
52 |
+ default: all |
53 |
+@@ -252,17 +252,19 @@ $(THIRD_GLUT_LIB) : $(THIRD_GLUT_OBJ) |
54 |
+ $(THREAD_LIB) : $(THREAD_OBJ) |
55 |
+ $(PKCS7_LIB) : $(PKCS7_OBJ) |
56 |
+ else |
57 |
+-MUPDF_LIB = $(OUT)/libmupdf.a |
58 |
++MUPDF_LIB = libmupdf.so.$(GENTOO_PV) |
59 |
+ LIBS_TO_INSTALL_IN_LIB = $(MUPDF_LIB) $(THIRD_LIB) |
60 |
+-THIRD_LIB = $(OUT)/libmupdf-third.a |
61 |
++THIRD_LIB = |
62 |
++MUPDF_STATIC = $(OUT)/libmupdf.a |
63 |
+ ifneq ($(USE_SYSTEM_GLUT),yes) |
64 |
+ THIRD_GLUT_LIB = $(OUT)/libmupdf-glut.a |
65 |
+ endif |
66 |
+ THREAD_LIB = $(OUT)/libmupdf-threads.a |
67 |
+ PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a |
68 |
+ |
69 |
+-$(MUPDF_LIB) : $(MUPDF_OBJ) |
70 |
+-$(THIRD_LIB) : $(THIRD_OBJ) |
71 |
++$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_OBJ) |
72 |
++ $(QUIET_LINK) $(CC) $(LDFLAGS) --shared -Wl,-soname -Wl,$(MUPDF_LIB) -o $@ $^ $(THIRD_LIBS) $(LIBS) |
73 |
++$(MUPDF_STATIC): $(MUPDF_OBJ) $(THIRD_OBJ) |
74 |
+ $(THIRD_GLUT_LIB) : $(THIRD_GLUT_OBJ) |
75 |
+ $(THREAD_LIB) : $(THREAD_OBJ) |
76 |
+ $(PKCS7_LIB) : $(PKCS7_OBJ) |
77 |
|
78 |
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 |
79 |
new file mode 100644 |
80 |
index 000000000000..643b6d2c8b1e |
81 |
--- /dev/null |
82 |
+++ b/app-text/mupdf/files/mupdf-1.19.0-cross-fixes.patch |
83 |
@@ -0,0 +1,130 @@ |
84 |
+Refreshed patches based on: |
85 |
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0004-MuPDF-crossbuild-use-target-arch-pkg-config.patch/ |
86 |
+https://sources.debian.org/patches/mupdf/1.17.0+ds1-1/0005-MuPDF-crossbuild-use-host-cc-for-utils.patch/ |
87 |
+--- a/Makefile |
88 |
++++ b/Makefile |
89 |
+@@ -147,6 +147,9 @@ PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.o) |
90 |
+ |
91 |
+ HEXDUMP_EXE := $(OUT)/scripts/hexdump.exe |
92 |
+ |
93 |
++$(HEXDUMP_EXE): scripts/hexdump.c |
94 |
++ $(QUIET_CC) $(MKTGTDIR) ; $(CC_FOR_BUILD) $(CFLAGS) -o $@ $< |
95 |
++ |
96 |
+ FONT_BIN := $(sort $(wildcard resources/fonts/urw/*.cff)) |
97 |
+ FONT_BIN += $(sort $(wildcard resources/fonts/han/*.ttc)) |
98 |
+ FONT_BIN += $(sort $(wildcard resources/fonts/droid/*.ttf)) |
99 |
+--- a/Makerules |
100 |
++++ b/Makerules |
101 |
+@@ -6,6 +6,9 @@ OS := $(OS:MSYS%=MINGW) |
102 |
+ OS := $(OS:Windows_NT=MINGW) |
103 |
+ OS := $(OS:Darwin=MACOS) |
104 |
+ |
105 |
++PKG_CONFIG ?= pkg-config |
106 |
++CC_FOR_BUILD ?= $(CC) |
107 |
++ |
108 |
+ WARNING_CFLAGS := -Wall -Wsign-compare |
109 |
+ |
110 |
+ # Feature configuration options |
111 |
+@@ -156,51 +159,51 @@ else ifeq ($(OS),MACOS) |
112 |
+ endif |
113 |
+ endif |
114 |
+ |
115 |
+- ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes) |
116 |
+- SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2) |
117 |
+- SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2) |
118 |
++ ifeq ($(shell $(PKG_CONFIG) --exists freetype2 && echo yes),yes) |
119 |
++ SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2) |
120 |
++ SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2) |
121 |
+ endif |
122 |
+- ifeq ($(shell pkg-config --exists gumbo && echo yes),yes) |
123 |
+- SYS_GUMBO_CFLAGS := $(shell pkg-config --cflags gumbo) |
124 |
+- SYS_GUMBO_LIBS := $(shell pkg-config --libs gumbo) |
125 |
++ ifeq ($(shell $(PKG_CONFIG) --exists gumbo && echo yes),yes) |
126 |
++ SYS_GUMBO_CFLAGS := $(shell $(PKG_CONFIG) --cflags gumbo) |
127 |
++ SYS_GUMBO_LIBS := $(shell $(PKG_CONFIG) --libs gumbo) |
128 |
+ endif |
129 |
+- ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes) |
130 |
+- SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz) |
131 |
+- SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz) |
132 |
++ ifeq ($(shell $(PKG_CONFIG) --exists harfbuzz && echo yes),yes) |
133 |
++ SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz) |
134 |
++ SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz) |
135 |
+ endif |
136 |
+- ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes) |
137 |
+- SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2) |
138 |
+- SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2) |
139 |
++ ifeq ($(shell $(PKG_CONFIG) --exists lcms2 && echo yes),yes) |
140 |
++ SYS_LCMS2_CFLAGS := $(shell $(PKG_CONFIG) --cflags lcms2) |
141 |
++ SYS_LCMS2_LIBS := $(shell $(PKG_CONFIG) --libs lcms2) |
142 |
+ endif |
143 |
+- ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes) |
144 |
+- SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg) |
145 |
+- SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg) |
146 |
++ ifeq ($(shell $(PKG_CONFIG) --exists libjpeg && echo yes),yes) |
147 |
++ SYS_LIBJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libjpeg) |
148 |
++ SYS_LIBJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libjpeg) |
149 |
+ endif |
150 |
+- ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes) |
151 |
+- SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2) |
152 |
+- SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2) |
153 |
++ ifeq ($(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes),yes) |
154 |
++ SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2) |
155 |
++ SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2) |
156 |
+ endif |
157 |
+- ifeq ($(shell pkg-config --exists zlib && echo yes),yes) |
158 |
+- SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib) |
159 |
+- SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib) |
160 |
++ ifeq ($(shell $(PKG_CONFIG) --exists zlib && echo yes),yes) |
161 |
++ SYS_ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib) |
162 |
++ SYS_ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib) |
163 |
+ endif |
164 |
+ |
165 |
+- HAVE_SYS_LEPTONICA := $(shell pkg-config --exists 'lept >= 1.7.4' && echo yes) |
166 |
++ HAVE_SYS_LEPTONICA := $(shell $(PKG_CONFIG) --exists 'lept >= 1.7.4' && echo yes) |
167 |
+ ifeq ($(HAVE_SYS_LEPTONICA),yes) |
168 |
+- SYS_LEPTONICA_CFLAGS := $(shell pkg-config --cflags lept) |
169 |
+- SYS_LEPTONICA_LIBS := $(shell pkg-config --libs lept) |
170 |
++ SYS_LEPTONICA_CFLAGS := $(shell $(PKG_CONFIG) --cflags lept) |
171 |
++ SYS_LEPTONICA_LIBS := $(shell $(PKG_CONFIG) --libs lept) |
172 |
+ endif |
173 |
+ |
174 |
+- HAVE_SYS_TESSERACT := $(shell pkg-config --exists 'tesseract >= 4.0.0' && echo yes) |
175 |
++ HAVE_SYS_TESSERACT := $(shell $(PKG_CONFIG) --exists 'tesseract >= 4.0.0' && echo yes) |
176 |
+ ifeq ($(HAVE_SYS_TESSERACT),yes) |
177 |
+- SYS_TESSERACT_CFLAGS := $(shell pkg-config --cflags tesseract) |
178 |
+- SYS_TESSERACT_LIBS := $(shell pkg-config --libs tesseract) |
179 |
++ SYS_TESSERACT_CFLAGS := $(shell $(PKG_CONFIG) --cflags tesseract) |
180 |
++ SYS_TESSERACT_LIBS := $(shell $(PKG_CONFIG) --libs tesseract) |
181 |
+ endif |
182 |
+ |
183 |
+- HAVE_SYS_CURL := $(shell pkg-config --exists libcurl && echo yes) |
184 |
++ HAVE_SYS_CURL := $(shell $(PKG_CONFIG) --exists libcurl && echo yes) |
185 |
+ ifeq ($(HAVE_SYS_CURL),yes) |
186 |
+- SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl) |
187 |
+- SYS_CURL_LIBS := $(shell pkg-config --libs libcurl) |
188 |
++ SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl) |
189 |
++ SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl) |
190 |
+ endif |
191 |
+ |
192 |
+ HAVE_GLUT := yes |
193 |
+@@ -209,16 +212,16 @@ endif |
194 |
+ SYS_GLUT_LIBS := -lglut -lGL |
195 |
+ endif |
196 |
+ |
197 |
+ HAVE_X11 := not-unless-portage-tells-me |
198 |
+ ifeq ($(HAVE_X11),yes) |
199 |
+- X11_CFLAGS := $(shell pkg-config --cflags x11 xext) |
200 |
+- X11_LIBS := $(shell pkg-config --libs x11 xext) |
201 |
++ X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext) |
202 |
++ X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext) |
203 |
+ endif |
204 |
+ |
205 |
+ HAVE_LIBCRYPTO := not-unless-portage-tells-me |
206 |
+ ifeq ($(HAVE_LIBCRYPTO),yes) |
207 |
+- LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO |
208 |
+- LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto) |
209 |
++ LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcrypto) -DHAVE_LIBCRYPTO |
210 |
++ LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto) |
211 |
+ endif |
212 |
+ |
213 |
+ HAVE_PTHREAD := yes |
214 |
|
215 |
diff --git a/app-text/mupdf/files/mupdf-1.19.0-darwin.patch b/app-text/mupdf/files/mupdf-1.19.0-darwin.patch |
216 |
new file mode 100644 |
217 |
index 000000000000..a81c7a008e44 |
218 |
--- /dev/null |
219 |
+++ b/app-text/mupdf/files/mupdf-1.19.0-darwin.patch |
220 |
@@ -0,0 +1,39 @@ |
221 |
+--- a/Makerules |
222 |
++++ b/Makerules |
223 |
+@@ -139,11 +139,11 @@ ifeq ($(OS),MINGW) |
224 |
+ else ifeq ($(OS),MACOS) |
225 |
+ HAVE_GLUT := yes |
226 |
+ SYS_GLUT_CFLAGS := -Wno-deprecated-declarations |
227 |
+- SYS_GLUT_LIBS := -framework GLUT -framework OpenGL |
228 |
+- CC = xcrun cc |
229 |
+- AR = xcrun ar |
230 |
+- LD = xcrun ld |
231 |
+- RANLIB = xcrun ranlib |
232 |
++ SYS_GLUT_LIBS ?= -framework GLUT -framework OpenGL |
233 |
++ CC ?= xcrun cc |
234 |
++ AR ?= xcrun ar |
235 |
++ LD ?= xcrun ld |
236 |
++ RANLIB ?= xcrun ranlib |
237 |
+ |
238 |
+ ifeq (, $(shell which pkg-config)) |
239 |
+ $(warning "No pkg-config found, install it for proper integration of libcrypto") |
240 |
+@@ -154,9 +154,7 @@ else ifeq ($(OS),MACOS) |
241 |
+ LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto) |
242 |
+ endif |
243 |
+ endif |
244 |
+- |
245 |
+-else ifeq ($(OS),Linux) |
246 |
+- HAVE_OBJCOPY := yes |
247 |
++endif |
248 |
+ |
249 |
+ ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes) |
250 |
+ SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2) |
251 |
+@@ -229,8 +227,6 @@ else ifeq ($(OS),Linux) |
252 |
+ PTHREAD_LIBS := -lpthread |
253 |
+ endif |
254 |
+ |
255 |
+-endif |
256 |
+- |
257 |
+ # The following section has various cross compilation configurations. |
258 |
+ # |
259 |
+ # Invoke these as: |
260 |
|
261 |
diff --git a/app-text/mupdf/mupdf-1.19.0.ebuild b/app-text/mupdf/mupdf-1.19.0.ebuild |
262 |
new file mode 100644 |
263 |
index 000000000000..e98b869cc5e1 |
264 |
--- /dev/null |
265 |
+++ b/app-text/mupdf/mupdf-1.19.0.ebuild |
266 |
@@ -0,0 +1,152 @@ |
267 |
+# Copyright 1999-2021 Gentoo Authors |
268 |
+# Distributed under the terms of the GNU General Public License v2 |
269 |
+ |
270 |
+EAPI=7 |
271 |
+ |
272 |
+# Please check upstream git regularly for relevant security-related commits |
273 |
+# to backport. |
274 |
+ |
275 |
+inherit desktop flag-o-matic toolchain-funcs xdg |
276 |
+ |
277 |
+DESCRIPTION="A lightweight PDF viewer and toolkit written in portable C" |
278 |
+HOMEPAGE="https://mupdf.com/ https://git.ghostscript.com/?p=mupdf.git" |
279 |
+SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.xz" |
280 |
+S="${WORKDIR}"/${P}-source |
281 |
+ |
282 |
+LICENSE="AGPL-3" |
283 |
+SLOT="0/${PV}" |
284 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~x86" |
285 |
+IUSE="+javascript opengl ssl X" |
286 |
+REQUIRED_USE="opengl? ( javascript )" |
287 |
+ |
288 |
+# Although we use the bundled, patched version of freeglut in mupdf (because of |
289 |
+# bug #653298), the best way to ensure that its dependencies are present is to |
290 |
+# install system's freeglut. |
291 |
+RDEPEND=" |
292 |
+ dev-libs/gumbo |
293 |
+ media-libs/freetype:2= |
294 |
+ media-libs/harfbuzz:=[truetype] |
295 |
+ media-libs/jbig2dec:= |
296 |
+ media-libs/libpng:0= |
297 |
+ >=media-libs/openjpeg-2.1:2= |
298 |
+ virtual/jpeg |
299 |
+ javascript? ( >=dev-lang/mujs-1.0.7:= ) |
300 |
+ opengl? ( >=media-libs/freeglut-3.0.0 ) |
301 |
+ ssl? ( >=dev-libs/openssl-1.1:0= ) |
302 |
+ X? ( |
303 |
+ x11-libs/libX11 |
304 |
+ x11-libs/libXext |
305 |
+ ) |
306 |
+" |
307 |
+DEPEND="${RDEPEND}" |
308 |
+BDEPEND="virtual/pkgconfig" |
309 |
+ |
310 |
+PATCHES=( |
311 |
+ "${FILESDIR}"/${PN}-1.15-CFLAGS.patch |
312 |
+ "${FILESDIR}"/${PN}-1.19.0-Makefile.patch |
313 |
+ "${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch |
314 |
+ "${FILESDIR}"/${PN}-1.19.0-darwin.patch |
315 |
+ # See bugs #662352 |
316 |
+ "${FILESDIR}"/${PN}-1.15-openssl-x11.patch |
317 |
+ # General cross fixes from Debian (refreshed) |
318 |
+ "${FILESDIR}"/${PN}-1.19.0-cross-fixes.patch |
319 |
+) |
320 |
+ |
321 |
+src_prepare() { |
322 |
+ xdg_src_prepare |
323 |
+ |
324 |
+ use hppa && append-cflags -ffunction-sections |
325 |
+ |
326 |
+ append-cflags "-DFZ_ENABLE_JS=$(usex javascript 1 0)" |
327 |
+ |
328 |
+ sed -e "1iOS = Linux" \ |
329 |
+ -e "1iCC = $(tc-getCC)" \ |
330 |
+ -e "1iCXX = $(tc-getCXX)" \ |
331 |
+ -e "1iLD = $(tc-getLD)" \ |
332 |
+ -e "1iAR = $(tc-getAR)" \ |
333 |
+ -e "1iverbose = yes" \ |
334 |
+ -e "1ibuild = debug" \ |
335 |
+ -i Makerules || die |
336 |
+} |
337 |
+ |
338 |
+_emake() { |
339 |
+ # When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings. |
340 |
+ # |
341 |
+ # Bundled libs |
342 |
+ # * General |
343 |
+ # Note that USE_SYSTEM_LIBS=yes is a metaoption which will set to upstream's |
344 |
+ # recommendations. It does not mean "always use system libs". |
345 |
+ # See [0] below for what it means in a specific version. |
346 |
+ # |
347 |
+ # * freeglut |
348 |
+ # We don't use system's freeglut because upstream has a special modified |
349 |
+ # version of it that gives mupdf clipboard support. See bug #653298 |
350 |
+ # |
351 |
+ # * mujs |
352 |
+ # As of v1.15.0, mupdf started using symbols in mujs that were not part |
353 |
+ # of any release. We then went back to using the bundled version of it. |
354 |
+ # But v1.17.0 looks ok, so we'll go unbundled again. Be aware of this risk |
355 |
+ # when bumping and check! |
356 |
+ # See bug #685244 |
357 |
+ # |
358 |
+ # * lmms2 |
359 |
+ # mupdf uses a bundled version of lcms2 [0] because Artifex have forked it [1]. |
360 |
+ # It is therefore not appropriate for us to unbundle it at this time. |
361 |
+ # |
362 |
+ # [0] https://git.ghostscript.com/?p=mupdf.git;a=blob;f=Makethird;h=c4c540fa4a075df0db85e6fdaab809099881f35a;hb=HEAD#l9 |
363 |
+ # [1] https://www.ghostscript.com/doc/lcms2mt/doc/WhyThisFork.txt |
364 |
+ local myemakeargs=( |
365 |
+ GENTOO_PV=${PV} |
366 |
+ HAVE_GLUT=$(usex opengl) |
367 |
+ HAVE_LIBCRYPTO=$(usex ssl) |
368 |
+ HAVE_X11=$(usex X) |
369 |
+ USE_SYSTEM_LIBS=yes |
370 |
+ USE_SYSTEM_MUJS=$(usex javascript) |
371 |
+ USE_SYSTEM_GLUT=no |
372 |
+ HAVE_OBJCOPY=no |
373 |
+ "$@" |
374 |
+ ) |
375 |
+ |
376 |
+ emake "${myemakeargs[@]}" |
377 |
+} |
378 |
+ |
379 |
+src_compile() { |
380 |
+ tc-export PKG_CONFIG |
381 |
+ |
382 |
+ _emake XCFLAGS="-fPIC" |
383 |
+} |
384 |
+ |
385 |
+src_install() { |
386 |
+ if use opengl || use X ; then |
387 |
+ domenu platform/debian/${PN}.desktop |
388 |
+ doicon platform/debian/${PN}.xpm |
389 |
+ else |
390 |
+ rm docs/man/${PN}.1 || die |
391 |
+ fi |
392 |
+ |
393 |
+ sed -i \ |
394 |
+ -e "1iprefix = ${ED}/usr" \ |
395 |
+ -e "1ilibdir = ${ED}/usr/$(get_libdir)" \ |
396 |
+ -e "1idocdir = ${ED}/usr/share/doc/${PF}" \ |
397 |
+ -i Makerules || die |
398 |
+ |
399 |
+ _emake install |
400 |
+ |
401 |
+ dosym libmupdf.so.${PV} /usr/$(get_libdir)/lib${PN}.so |
402 |
+ |
403 |
+ if use opengl ; then |
404 |
+ einfo "mupdf symlink points to mupdf-gl (bug 616654)" |
405 |
+ dosym ${PN}-gl /usr/bin/${PN} |
406 |
+ elif use X ; then |
407 |
+ einfo "mupdf symlink points to mupdf-x11 (bug 616654)" |
408 |
+ dosym ${PN}-x11 /usr/bin/${PN} |
409 |
+ fi |
410 |
+ |
411 |
+ # Respect libdir (bug #734898) |
412 |
+ sed -i -e "s:/lib:/$(get_libdir):" platform/debian/${PN}.pc || die |
413 |
+ |
414 |
+ insinto /usr/$(get_libdir)/pkgconfig |
415 |
+ doins platform/debian/${PN}.pc |
416 |
+ |
417 |
+ dodoc README CHANGES CONTRIBUTORS |
418 |
+} |