Gentoo Archives: gentoo-commits

From: Virgil Dupras <vdupras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/files/, app-text/mupdf/
Date: Sun, 07 Oct 2018 17:43:23
Message-Id: 1538934050.da7c28ccf0ad7b3a35d0adbd0ed2ad50640e718f.vdupras@gentoo
1 commit: da7c28ccf0ad7b3a35d0adbd0ed2ad50640e718f
2 Author: Virgil Dupras <vdupras <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 7 13:39:48 2018 +0000
4 Commit: Virgil Dupras <vdupras <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 7 17:40:50 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da7c28cc
7
8 app-text/mupdf: bump to 1.14.0
9
10 Many things changed upstream in this release, which prompts many changes
11 in the ebuild.
12
13 1. Drop the "static" USE flag. It was already broken in 1.13 because
14 options weren't passed to the static `emake` call like is was in the
15 main `emake` invocation. In addition to that, building a static binary
16 requires "media-gfx/graphite2[+static-libs]" which doesn't exist.
17
18 2. Drop "lcms" USE flag. See bug #667788.
19
20 3. Always link to dev-lang/mujs. mupdf can't build without being linked
21 to mujs now. The best we can do it to disable JS with the "FZ_ENABLE_JS"
22 flag, which is what the "javascript" USE flag does.
23
24 4. Make "javascript" USE flag enabled by default, which is in line with
25 upstream's behavior.
26
27 5. Make "vanilla" USE flag enabled by default. The patch it enables
28 doesn't seem very useful and I couldn't track it's *raison d'ĂȘtre* in
29 git/cvs history: it's been there since the first commit.
30
31 6. Simplify ebuild and remove obsolete seds. The "sed" invocations I've
32 removed have been verified and either point to absent files or replace
33 nothing.
34
35 7. Don't remove third party libs. The new "USE_SYSTEM_LIBS" flag being
36 used is a reliable way to ensure that the correct libraries are used.
37
38 8. Fix "curl" USE flag. See bug #664646
39
40 Closes: https://bugs.gentoo.org/664646
41 Closes: https://bugs.gentoo.org/667788
42
43 Signed-off-by: Virgil Dupras <vdupras <AT> gentoo.org>
44 Package-Manager: Portage-2.3.50, Repoman-2.3.11
45
46 app-text/mupdf/Manifest | 1 +
47 app-text/mupdf/files/mupdf-1.14-CFLAGS.patch | 13 +++
48 app-text/mupdf/files/mupdf-1.14-debug-build.patch | 13 +++
49 .../mupdf/files/mupdf-1.14-openssl-curl-x11.patch | 52 +++++++++
50 app-text/mupdf/mupdf-1.14.0.ebuild | 123 +++++++++++++++++++++
51 5 files changed, 202 insertions(+)
52
53 diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
54 index 6e813b10936..f5f8f290123 100644
55 --- a/app-text/mupdf/Manifest
56 +++ b/app-text/mupdf/Manifest
57 @@ -1 +1,2 @@
58 DIST mupdf-1.13.0-source.tar.gz 51425034 BLAKE2B 7f4a1c84b5840991cc7879f3617165579f4db1f7a010a8313b0eaf94ad59af60bb3d0e4a0f2acc14d2c7511dd0f8b96c89c51e360ab379ba32590b887dd3be6a SHA512 d7fca7292e612959893a728d35964cf7b4e607385bdd72e81b8ca1de6ab642f999b734afbbf32d75400cd29b7e178ec360e65c91d7b1e1a53c2a04ff0adbd707
59 +DIST mupdf-1.14.0-source.tar.xz 41602372 BLAKE2B bb680038344af16c7231a18a009c0d04c5f50b3fcbaf061c9f5907f35d79eea93eeced7c2a43a06a963b93b39c74d0246c5fdad35655953d1aa5efb79737265a SHA512 bd41125dac1a81b7dbbfbb5f5e06e70bb601854731e0945983688da5d8d7c0bca9771fff2e4b6d9c36dbead6146f0a866ed7427d58e13d02ed6dfd94dcfe54bf
60
61 diff --git a/app-text/mupdf/files/mupdf-1.14-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.14-CFLAGS.patch
62 new file mode 100644
63 index 00000000000..90972e8c53e
64 --- /dev/null
65 +++ b/app-text/mupdf/files/mupdf-1.14-CFLAGS.patch
66 @@ -0,0 +1,13 @@
67 +diff --git a/Makerules b/Makerules
68 +index fc9bf998..82f10b28 100644
69 +--- a/Makerules
70 ++++ b/Makerules
71 +@@ -21,8 +21,6 @@ SANITIZE_FLAGS += -fsanitize=address
72 + SANITIZE_FLAGS += -fsanitize=leak
73 +
74 + ifeq ($(build),debug)
75 +- CFLAGS += -pipe -g
76 +- LDFLAGS += -g $(LDREMOVEUNREACH)
77 + else ifeq ($(build),release)
78 + CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
79 + LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
80
81 diff --git a/app-text/mupdf/files/mupdf-1.14-debug-build.patch b/app-text/mupdf/files/mupdf-1.14-debug-build.patch
82 new file mode 100644
83 index 00000000000..6f8b5b96a97
84 --- /dev/null
85 +++ b/app-text/mupdf/files/mupdf-1.14-debug-build.patch
86 @@ -0,0 +1,13 @@
87 +diff --git a/Makefile b/Makefile
88 +index 37fc48e6..bd8c6049 100644
89 +--- a/Makefile
90 ++++ b/Makefile
91 +@@ -3,7 +3,7 @@
92 + -include user.make
93 +
94 + ifndef build
95 +- build := release
96 ++ build := debug
97 + endif
98 +
99 + ifndef OUT
100
101 diff --git a/app-text/mupdf/files/mupdf-1.14-openssl-curl-x11.patch b/app-text/mupdf/files/mupdf-1.14-openssl-curl-x11.patch
102 new file mode 100644
103 index 00000000000..a1284a63d67
104 --- /dev/null
105 +++ b/app-text/mupdf/files/mupdf-1.14-openssl-curl-x11.patch
106 @@ -0,0 +1,52 @@
107 +diff --git a/Makerules b/Makerules
108 +index fc9bf998..5c0fffa4 100644
109 +--- a/Makerules
110 ++++ b/Makerules
111 +@@ -113,10 +113,14 @@ else ifeq ($(OS),Linux)
112 + SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
113 + endif
114 +
115 ++ WANT_CURL ?= yes
116 ++ ifeq "$(WANT_CURL)" "yes"
117 + HAVE_CURL := $(shell pkg-config --exists libcurl && echo yes)
118 + ifeq ($(HAVE_CURL),yes)
119 + SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
120 +- SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
121 ++ # We have to forcibly add -lpthread to avoid linking errors.
122 ++ SYS_CURL_LIBS := $(shell pkg-config --libs libcurl) -lpthread
123 ++ endif
124 + endif
125 +
126 + HAVE_GLUT := yes
127 +@@ -125,17 +129,29 @@ else ifeq ($(OS),Linux)
128 + SYS_GLUT_LIBS := -lglut -lGL
129 + endif
130 +
131 ++ WANT_X11 ?= yes
132 ++ ifeq "$(WANT_X11)" "yes"
133 + HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
134 + ifeq ($(HAVE_X11),yes)
135 + X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
136 + X11_LIBS := $(shell pkg-config --libs x11 xext)
137 + endif
138 ++ endif
139 +
140 +- HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
141 +- ifeq ($(HAVE_LIBCRYPTO),yes)
142 ++ WANT_OPENSSL ?= yes
143 ++ ifeq "$(WANT_OPENSSL)" "yes"
144 ++ ifeq "$(shell pkg-config --exists 'libcrypto >= 2.0.0' && echo libre)" "libre"
145 ++ ifeq "$(shell pkg-config --exists 'libcrypto >= 2.7.0' && echo yes)" "yes"
146 ++ HAVE_LIBCRYPTO := yes
147 ++ LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
148 ++ LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
149 ++ endif
150 ++ else ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
151 ++ HAVE_LIBCRYPTO := yes
152 + LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
153 + LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
154 + endif
155 ++ endif
156 +
157 + HAVE_PTHREAD := yes
158 + ifeq ($(HAVE_PTHREAD),yes)
159
160 diff --git a/app-text/mupdf/mupdf-1.14.0.ebuild b/app-text/mupdf/mupdf-1.14.0.ebuild
161 new file mode 100644
162 index 00000000000..8c23107fc6d
163 --- /dev/null
164 +++ b/app-text/mupdf/mupdf-1.14.0.ebuild
165 @@ -0,0 +1,123 @@
166 +# Copyright 1999-2018 Gentoo Authors
167 +# Distributed under the terms of the GNU General Public License v2
168 +
169 +EAPI=6
170 +
171 +inherit flag-o-matic toolchain-funcs xdg
172 +
173 +DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
174 +HOMEPAGE="https://mupdf.com/"
175 +SRC_URI="https://mupdf.com/downloads/archive/${P}-source.tar.xz"
176 +
177 +LICENSE="AGPL-3"
178 +SLOT="0/${PV}"
179 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
180 +IUSE="X curl +javascript libressl opengl +openssl static-libs +vanilla"
181 +
182 +RDEPEND="
183 + >=dev-lang/mujs-1.0.4
184 + media-libs/freetype:2=[static-libs?]
185 + media-libs/harfbuzz:=[static-libs?]
186 + media-libs/jbig2dec:=[static-libs?]
187 + media-libs/libpng:0=[static-libs?]
188 + >=media-libs/openjpeg-2.1:2=[static-libs?]
189 + virtual/jpeg[static-libs?]
190 + curl? ( net-misc/curl[static-libs?] )
191 + !libressl? ( dev-libs/openssl:0=[static-libs?] )
192 + libressl? ( dev-libs/libressl:0=[static-libs?] )
193 + opengl? ( >=media-libs/freeglut-3.0.0:= )
194 + X? (
195 + x11-libs/libX11[static-libs?]
196 + x11-libs/libXext[static-libs?]
197 + )"
198 +DEPEND="${RDEPEND}
199 + virtual/pkgconfig"
200 +
201 +REQUIRED_USE="
202 + opengl? ( !static-libs )
203 + curl? ( X )"
204 +
205 +S=${WORKDIR}/${P}-source
206 +
207 +PATCHES=(
208 + "${FILESDIR}"/${PN}-1.14-CFLAGS.patch
209 + "${FILESDIR}"/${PN}-1.14-debug-build.patch
210 + "${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
211 + # See bug #662352
212 + "${FILESDIR}"/${PN}-1.14-openssl-curl-x11.patch
213 +)
214 +
215 +src_prepare() {
216 + xdg_src_prepare
217 + use hppa && append-cflags -ffunction-sections
218 +
219 + use javascript || \
220 + sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
221 + -i include/mupdf/fitz/config.h
222 +
223 + use vanilla || eapply \
224 + "${FILESDIR}"/${PN}-1.3-zoom-2.patch
225 +
226 + sed -e "1iOS = Linux" \
227 + -e "1iCC = $(tc-getCC)" \
228 + -e "1iLD = $(tc-getLD)" \
229 + -e "1iAR = $(tc-getAR)" \
230 + -e "1iverbose = yes" \
231 + -e "1ibuild = debug" \
232 + -e "1iprefix = ${ED}usr" \
233 + -e "1ilibdir = ${ED}usr/$(get_libdir)" \
234 + -e "1idocdir = ${ED}usr/share/doc/${PF}" \
235 + -i Makerules || die
236 +
237 + if use static-libs; then
238 + cp -a "${S}" "${S}"-static || die
239 + fi
240 +}
241 +
242 +_emake() {
243 + # When HAVE_OBJCOPY is yes, we end up with a lot of QA warnings.
244 + emake \
245 + HAVE_GLUT=$(usex opengl yes no) \
246 + WANT_CURL=$(usex curl) \
247 + WANT_OPENSSL=$(usex openssl) \
248 + WANT_X11=$(usex X) \
249 + USE_SYSTEM_LIBS=yes \
250 + USE_SYSTEM_MUJS=yes \
251 + HAVE_OBJCOPY=no \
252 + "$@"
253 +}
254 +
255 +src_compile() {
256 + _emake XCFLAGS="-fpic"
257 +
258 + use curl && _emake extra-apps
259 +
260 + use static-libs && \
261 + _emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
262 +}
263 +
264 +src_install() {
265 + if use X || use opengl ; then
266 + domenu platform/debian/${PN}.desktop
267 + doicon platform/debian/${PN}.xpm
268 + else
269 + rm docs/man/${PN}.1
270 + fi
271 +
272 + _emake install
273 +
274 + use static-libs && \
275 + dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
276 + if use opengl ; then
277 + einfo "mupdf symlink points to mupdf-gl (bug 616654)"
278 + dosym ${PN}-gl /usr/bin/${PN}
279 + elif use X ; then
280 + einfo "mupdf symlink points to mupdf-x11 (bug 616654)"
281 + dosym ${PN}-x11 /usr/bin/${PN}
282 + fi
283 + use curl && dobin build/debug/${PN}-x11-curl
284 + insinto /usr/$(get_libdir)/pkgconfig
285 + doins platform/debian/${PN}.pc
286 +
287 + dodoc README CHANGES CONTRIBUTORS
288 +}