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: Wed, 25 Jul 2018 01:33:41
Message-Id: 1532482274.856a6ad1fd3dfe1ab67a2976edc3f5dedd694fa3.vdupras@gentoo
1 commit: 856a6ad1fd3dfe1ab67a2976edc3f5dedd694fa3
2 Author: Jouni Kosonen <jouni.kosonen <AT> tukesoft <DOT> com>
3 AuthorDate: Wed Jun 27 07:03:42 2018 +0000
4 Commit: Virgil Dupras <vdupras <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 25 01:31:14 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=856a6ad1
7
8 app-text/mupdf: version bump to 1.13.0
9
10 Bug: https://bugs.gentoo.org/646010
11 Bug: https://bugs.gentoo.org/651828
12 Bug: https://bugs.gentoo.org/658618
13
14 app-text/mupdf/Manifest | 1 +
15 .../mupdf/files/mupdf-1.13-openssl-curl-x11.patch | 39 +++++
16 app-text/mupdf/mupdf-1.13.0.ebuild | 166 +++++++++++++++++++++
17 3 files changed, 206 insertions(+)
18
19 diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
20 index 1367f972efc..a37226db36a 100644
21 --- a/app-text/mupdf/Manifest
22 +++ b/app-text/mupdf/Manifest
23 @@ -1,2 +1,3 @@
24 DIST mupdf-1.11-source.tar.gz 40156070 BLAKE2B 2a9991a11355a449b91955bd897b5da175d3a89943277345779ea52c74f57c58226ee4087b23e3f434c0a45ae7a39df95c81c26c55d959f362bd1a0d0216716d SHA512 501670f540e298a8126806ebbd9db8b29866f663b7bbf26c9ade1933e42f0c00ad410b9d93f3ddbfb3e45c38722869095de28d832fe3fb3703c55cc9a01dbf63
25 DIST mupdf-1.12.0-source.tar.gz 51508917 BLAKE2B c34df17f0df7a200897d678514ff4012e02b1cef71189fe48740948c88cb544c6ce80f52a5dc335d70002806a7b413e5f79a1edee88865e42daf76e49416d9bf SHA512 11ae620e55e9ebd5844abd7decacc0dafc90dd1f4907ba6ed12f5c725d3920187fc730a7fc33979bf3ff9451da7dbb51f34480a878083e2064f3455555f47d96
26 +DIST mupdf-1.13.0-source.tar.gz 51425034 BLAKE2B 7f4a1c84b5840991cc7879f3617165579f4db1f7a010a8313b0eaf94ad59af60bb3d0e4a0f2acc14d2c7511dd0f8b96c89c51e360ab379ba32590b887dd3be6a SHA512 d7fca7292e612959893a728d35964cf7b4e607385bdd72e81b8ca1de6ab642f999b734afbbf32d75400cd29b7e178ec360e65c91d7b1e1a53c2a04ff0adbd707
27
28 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
29 new file mode 100644
30 index 00000000000..6db51a083ed
31 --- /dev/null
32 +++ b/app-text/mupdf/files/mupdf-1.13-openssl-curl-x11.patch
33 @@ -0,0 +1,39 @@
34 +diff --git a/Makerules b/Makerules
35 +index ef2b6b0..f9b25d6 100644
36 +--- a/Makerules
37 ++++ b/Makerules
38 +@@ -104,12 +104,17 @@ HAVE_GLUT := yes
39 + SYS_GLUT_CFLAGS :=
40 + SYS_GLUT_LIBS := -lglut -lGL
41 +
42 ++WANT_OPENSSL ?= yes
43 ++ifeq "$(WANT_OPENSSL)" "yes"
44 + ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
45 + HAVE_LIBCRYPTO := yes
46 + SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
47 + SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
48 + endif
49 ++endif
50 +
51 ++WANT_CURL ?= yes
52 ++ifeq "$(WANT_CURL)" "yes"
53 + ifeq "$(shell pkg-config --exists libcurl && echo yes)" "yes"
54 + HAVE_CURL := yes
55 + SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
56 +@@ -121,12 +126,16 @@ SYS_CURL_DEPS += $(shell pkg-config --libs openssl)
57 + endif
58 + endif
59 + SYS_CURL_DEPS += -lpthread -lrt
60 ++endif
61 +
62 ++WANT_X11 ?= yes
63 ++ifeq "$(WANT_X11)" "yes"
64 + ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
65 + HAVE_X11 := yes
66 + SYS_X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
67 + SYS_X11_LIBS := $(shell pkg-config --libs x11 xext)
68 + endif
69 ++endif
70 +
71 + ifeq "$(shell pkg-config --exists harfbuzz && echo yes)" "yes"
72 + SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
73
74 diff --git a/app-text/mupdf/mupdf-1.13.0.ebuild b/app-text/mupdf/mupdf-1.13.0.ebuild
75 new file mode 100644
76 index 00000000000..413d97b408e
77 --- /dev/null
78 +++ b/app-text/mupdf/mupdf-1.13.0.ebuild
79 @@ -0,0 +1,166 @@
80 +# Copyright 1999-2018 Gentoo Foundation
81 +# Distributed under the terms of the GNU General Public License v2
82 +
83 +EAPI=6
84 +
85 +inherit flag-o-matic toolchain-funcs xdg
86 +
87 +DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
88 +HOMEPAGE="https://mupdf.com/"
89 +SRC_URI="https://mupdf.com/downloads/${P}-source.tar.gz"
90 +
91 +LICENSE="AGPL-3"
92 +SLOT="0/${PV}"
93 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
94 +IUSE="X +curl javascript lcms libressl opengl +openssl static static-libs vanilla"
95 +
96 +LIB_DEPEND="
97 + !libressl? ( dev-libs/openssl:0=[static-libs?] )
98 + libressl? ( dev-libs/libressl:0=[static-libs?] )
99 + javascript? ( >=dev-lang/mujs-0_p20160504 )
100 + media-libs/freetype:2=[static-libs?]
101 + media-libs/harfbuzz:=[static-libs?]
102 + media-libs/jbig2dec:=[static-libs?]
103 + media-libs/libpng:0=[static-libs?]
104 + >=media-libs/openjpeg-2.1:2=[static-libs?]
105 + net-misc/curl[static-libs?]
106 + virtual/jpeg[static-libs?]
107 + X? ( x11-libs/libX11[static-libs?]
108 + x11-libs/libXext[static-libs?] )
109 + opengl? ( >=media-libs/freeglut-3.0.0:= )"
110 +RDEPEND="${LIB_DEPEND}"
111 +DEPEND="${RDEPEND}
112 + virtual/pkgconfig
113 + static-libs? ( ${LIB_DEPEND} )
114 + static? ( ${LIB_DEPEND//?}
115 + app-arch/bzip2[static-libs]
116 + x11-libs/libXau[static-libs]
117 + x11-libs/libXdmcp[static-libs]
118 + x11-libs/libxcb[static-libs] )"
119 +
120 +REQUIRED_USE="opengl? ( !static !static-libs )"
121 +
122 +S=${WORKDIR}/${P}-source
123 +
124 +PATCHES=(
125 + "${FILESDIR}"/${PN}-1.12-CFLAGS.patch
126 + "${FILESDIR}"/${PN}-1.9a-debug-build.patch
127 + "${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
128 + "${FILESDIR}"/${PN}-1.13-openssl-curl-x11.patch
129 + "${FILESDIR}"/${PN}-1.11-drop-libmupdfthird.patch
130 +)
131 +
132 +src_prepare() {
133 + xdg_src_prepare
134 + use hppa && append-cflags -ffunction-sections
135 +
136 + # specialized lcms2, keep it if wanted inside lubmupdfthird
137 + if ! use lcms ; then
138 + rm -rf thirdparty/lcms2
139 + fi
140 +
141 + rm -rf thirdparty/{README,curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,mujs,openjpeg,zlib} || die
142 + for my_third in thirdparty/* ; do
143 + ewarn "Bundled thirdparty lib: ${my_third}"
144 + done
145 +
146 + if has_version ">=media-libs/openjpeg-2.1:2" ; then
147 + # Remove a switch, which prevents using shared libraries for openjpeg2.
148 + # See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
149 + sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
150 + fi
151 +
152 + use javascript || \
153 + sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
154 + -i include/mupdf/fitz/config.h
155 +
156 + sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
157 + -e "/^prefix=/s:=.*:=${EROOT}/usr:" \
158 + -i platform/debian/${PN}.pc || die
159 +
160 + use vanilla || eapply \
161 + "${FILESDIR}"/${PN}-1.3-zoom-2.patch
162 +
163 + sed -e "1iOS = Linux" \
164 + -e "1iCC = $(tc-getCC)" \
165 + -e "1iLD = $(tc-getCC)" \
166 + -e "1iAR = $(tc-getAR)" \
167 + -e "1iverbose = yes" \
168 + -e "1ibuild = debug" \
169 + -e "1iprefix = ${ED}usr" \
170 + -e "1ilibdir = ${ED}usr/$(get_libdir)" \
171 + -e "1idocdir = ${ED}usr/share/doc/${PF}" \
172 + -i Makerules || die
173 +
174 + if use static-libs || use static ; then
175 + cp -a "${S}" "${S}"-static || die
176 + #add missing Libs.private for xcb and freetype
177 + sed -e 's:\(pkg-config --libs\):\1 --static:' \
178 + -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
179 + -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
180 + -i "${S}"-static/Makerules || die
181 + fi
182 +
183 + my_soname=libmupdf.so.${PV}
184 + my_soname_js_none=libmupdf-js-none.so.${PV}
185 + sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
186 + -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
187 + -e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
188 + -e "\$a\$(MUPDF_JS_NONE_LIB):" \
189 + -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
190 + -e "/install/s: COPYING : :" \
191 + -i Makefile || die
192 +}
193 +
194 +src_compile() {
195 + use lcms && emake XCFLAGS="-fpic" third
196 + emake XCFLAGS="-fpic" \
197 + HAVE_GLUT=$(usex opengl yes no) \
198 + HAVE_MUJS=$(usex javascript) \
199 + MUJS_LIBS=$(usex javascript -lmujs '') \
200 + WANT_CURL=$(usex curl) \
201 + WANT_OPENSSL=$(usex openssl) \
202 + WANT_X11=$(usex X)
203 +
204 + use static-libs && \
205 + emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
206 + use static && \
207 + emake -C "${S}"-static XLIBS="-static"
208 +}
209 +
210 +src_install() {
211 + if use X || use opengl ; then
212 + domenu platform/debian/${PN}.desktop
213 + doicon platform/debian/${PN}.xpm
214 + else
215 + rm docs/man/${PN}.1
216 + fi
217 +
218 + emake install \
219 + HAVE_GLUT=$(usex opengl yes no) \
220 + HAVE_MUJS=$(usex javascript) \
221 + MUJS_LIBS=$(usex javascript -lmujs '') \
222 + WANT_CURL=$(usex curl) \
223 + WANT_OPENSSL=$(usex openssl) \
224 + WANT_X11=$(usex X)
225 +
226 + dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
227 +
228 + use static-libs && \
229 + dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
230 + if use static ; then
231 + dobin "${S}"-static/build/debug/mu{tool,draw}
232 + use X && dobin "${S}"-static/build/debug/${PN}-x11
233 + fi
234 + if use opengl ; then
235 + einfo "mupdf symlink points to mupdf-gl (bug 616654)"
236 + dosym ${PN}-gl /usr/bin/${PN}
237 + elif use X ; then
238 + einfo "mupdf symlink points to mupdf-x11 (bug 616654)"
239 + dosym ${PN}-x11 /usr/bin/${PN}
240 + fi
241 + insinto /usr/$(get_libdir)/pkgconfig
242 + doins platform/debian/${PN}.pc
243 +
244 + dodoc README CHANGES CONTRIBUTORS
245 +}