Gentoo Archives: gentoo-commits

From: Michael Weber <xmw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/mupdf/, app-text/mupdf/files/
Date: Sun, 28 Jan 2018 09:53:05
Message-Id: 1517133169.a4a4dfe71cde92b2eaa38c774d19eeb002d00236.xmw@gentoo
1 commit: a4a4dfe71cde92b2eaa38c774d19eeb002d00236
2 Author: Michael Weber <xmw <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 28 09:52:34 2018 +0000
4 Commit: Michael Weber <xmw <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 28 09:52:49 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4a4dfe7
7
8 app-text/mupdf: Version bump (thanks Hadrien Lacour), add USE=lcms for bundled/modified lcms2.
9
10 Closes: https://bugs.gentoo.org/641862
11 Package-Manager: Portage-2.3.20, Repoman-2.3.6
12
13 app-text/mupdf/Manifest | 1 +
14 .../files/mupdf-1.11-drop-libmupdfthird.patch | 11 ++
15 app-text/mupdf/files/mupdf-1.12-CFLAGS.patch | 11 ++
16 app-text/mupdf/mupdf-1.12.0.ebuild | 160 +++++++++++++++++++++
17 4 files changed, 183 insertions(+)
18
19 diff --git a/app-text/mupdf/Manifest b/app-text/mupdf/Manifest
20 index a0a8c315fa4..1367f972efc 100644
21 --- a/app-text/mupdf/Manifest
22 +++ b/app-text/mupdf/Manifest
23 @@ -1 +1,2 @@
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
27 diff --git a/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch b/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
28 index eaf11678868..e5600c00cd8 100644
29 --- a/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
30 +++ b/app-text/mupdf/files/mupdf-1.11-drop-libmupdfthird.patch
31 @@ -9,3 +9,14 @@
32 THREAD_LIB = $(OUT)/libmuthreads.a
33
34 MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(SVG_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ)
35 +--- mupdf-1.12.0-source/Makefile
36 ++++ mupdf-1.12.0-source/Makefile
37 +@@ -343,7 +343,7 @@
38 +
39 + THREAD_OBJ := $(THREAD_OBJ)
40 +
41 +-$(MUPDF_LIB) : $(MUPDF_OBJ)
42 ++$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_OBJ)
43 + $(THIRD_LIB) : $(THIRD_OBJ)
44 + $(THREAD_LIB) : $(THREAD_OBJ)
45 +
46
47 diff --git a/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch b/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch
48 new file mode 100644
49 index 00000000000..796d127263a
50 --- /dev/null
51 +++ b/app-text/mupdf/files/mupdf-1.12-CFLAGS.patch
52 @@ -0,0 +1,11 @@
53 +--- mupdf-1.12.0-source/Makerules
54 ++++ mupdf-1.12.0-source/Makerules
55 +@@ -22,8 +22,6 @@
56 + endif
57 +
58 + ifeq "$(build)" "debug"
59 +-CFLAGS += -pipe -g
60 +-LDFLAGS += -g
61 + else ifeq "$(build)" "release"
62 + CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
63 + LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
64
65 diff --git a/app-text/mupdf/mupdf-1.12.0.ebuild b/app-text/mupdf/mupdf-1.12.0.ebuild
66 new file mode 100644
67 index 00000000000..bb542060cd7
68 --- /dev/null
69 +++ b/app-text/mupdf/mupdf-1.12.0.ebuild
70 @@ -0,0 +1,160 @@
71 +# Copyright 1999-2018 Gentoo Foundation
72 +# Distributed under the terms of the GNU General Public License v2
73 +
74 +EAPI=6
75 +
76 +inherit flag-o-matic toolchain-funcs xdg
77 +
78 +DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
79 +HOMEPAGE="http://mupdf.com/"
80 +SRC_URI="http://mupdf.com/downloads/${P}-source.tar.gz"
81 +
82 +LICENSE="AGPL-3"
83 +SLOT="0/${PV}"
84 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
85 +IUSE="X +curl javascript lcms libressl opengl +openssl static static-libs vanilla"
86 +
87 +LIB_DEPEND="
88 + !libressl? ( dev-libs/openssl:0[static-libs?] )
89 + libressl? ( dev-libs/libressl[static-libs?] )
90 + javascript? ( >=dev-lang/mujs-0_p20160504 )
91 + media-libs/freetype:2[static-libs?]
92 + media-libs/harfbuzz[static-libs?]
93 + media-libs/jbig2dec[static-libs?]
94 + media-libs/libpng:0[static-libs?]
95 + >=media-libs/openjpeg-2.1:2[static-libs?]
96 + net-misc/curl[static-libs?]
97 + virtual/jpeg[static-libs?]
98 + X? ( x11-libs/libX11[static-libs?]
99 + x11-libs/libXext[static-libs?] )
100 + opengl? ( >=media-libs/glfw-3.2 )"
101 +RDEPEND="${LIB_DEPEND}"
102 +DEPEND="${RDEPEND}
103 + virtual/pkgconfig
104 + static-libs? ( ${LIB_DEPEND} )
105 + static? ( ${LIB_DEPEND//?}
106 + app-arch/bzip2[static-libs]
107 + x11-libs/libXau[static-libs]
108 + x11-libs/libXdmcp[static-libs]
109 + x11-libs/libxcb[static-libs] )"
110 +
111 +REQUIRED_USE="opengl? ( !static !static-libs )"
112 +
113 +S=${WORKDIR}/${P}-source
114 +
115 +PATCHES=(
116 + "${FILESDIR}"/${PN}-1.12-CFLAGS.patch
117 + "${FILESDIR}"/${PN}-1.9a-debug-build.patch
118 + "${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch
119 + "${FILESDIR}"/${PN}-1.11-openssl-curl-x11.patch
120 + "${FILESDIR}"/${PN}-1.11-system-glfw.patch
121 + "${FILESDIR}"/${PN}-1.11-drop-libmupdfthird.patch
122 +)
123 +
124 +src_prepare() {
125 + xdg_src_prepare
126 + use hppa && append-cflags -ffunction-sections
127 +
128 + # specialized lcms2, keep it if wanted inside lubmupdfthird
129 + if ! use lcms ; then
130 + rm -rf thirdparty/lcms2
131 + fi
132 +
133 + rm -rf thirdparty/{README,curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,mujs,openjpeg,zlib} || die
134 + for my_third in thirdparty/* ; do
135 + ewarn "Bundled thirdparty lib: ${my_third}"
136 + done
137 +
138 + if has_version ">=media-libs/openjpeg-2.1:2" ; then
139 + # Remove a switch, which prevents using shared libraries for openjpeg2.
140 + # See http://www.linuxfromscratch.org/blfs/view/cvs/pst/mupdf.html
141 + sed '/OPJ_STATIC$/d' -i source/fitz/load-jpx.c
142 + fi
143 +
144 + use javascript || \
145 + sed -e '/* #define FZ_ENABLE_JS/ a\#define FZ_ENABLE_JS 0' \
146 + -i include/mupdf/fitz/config.h
147 +
148 + sed -e "/^libdir=/s:/lib:/$(get_libdir):" \
149 + -e "/^prefix=/s:=.*:=${EROOT}/usr:" \
150 + -i platform/debian/${PN}.pc || die
151 +
152 + use vanilla || eapply \
153 + "${FILESDIR}"/${PN}-1.3-zoom-2.patch
154 +
155 + sed -e "1iOS = Linux" \
156 + -e "1iCC = $(tc-getCC)" \
157 + -e "1iLD = $(tc-getCC)" \
158 + -e "1iAR = $(tc-getAR)" \
159 + -e "1iverbose = yes" \
160 + -e "1ibuild = debug" \
161 + -e "1iprefix = ${ED}usr" \
162 + -e "1ilibdir = ${ED}usr/$(get_libdir)" \
163 + -e "1idocdir = ${ED}usr/share/doc/${PF}" \
164 + -e "1iWANT_X11 = $(usex X)" \
165 + -e "1iWANT_OPENSSL = $(usex openssl)" \
166 + -e "1iWANT_CURL = $(usex curl)" \
167 + -e "1iHAVE_MUJS = $(usex javascript)" \
168 + -e "1iMUJS_LIBS = $(usex javascript -lmujs '')" \
169 + -e "1iMUJS_CFLAGS =" \
170 + -e "1iHAVE_GLFW = $(usex opengl yes no)" \
171 + -i Makerules || die
172 +
173 + if use static-libs || use static ; then
174 + cp -a "${S}" "${S}"-static || die
175 + #add missing Libs.private for xcb and freetype
176 + sed -e 's:\(pkg-config --libs\):\1 --static:' \
177 + -e '/^SYS_X11_LIBS = /s:\(.*\):\1 -lpthread:' \
178 + -e '/^SYS_FREETYPE_LIBS = /s:\(.*\):\1 -lbz2:' \
179 + -i "${S}"-static/Makerules || die
180 + fi
181 +
182 + my_soname=libmupdf.so.${PV}
183 + my_soname_js_none=libmupdf-js-none.so.${PV}
184 + sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
185 + -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
186 + -e "/^MUPDF_LIB =/s:=.*:= \$(OUT)/${my_soname}:" \
187 + -e "\$a\$(MUPDF_JS_NONE_LIB):" \
188 + -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
189 + -e "/install/s: COPYING : :" \
190 + -i Makefile || die
191 +}
192 +
193 +src_compile() {
194 + use lcms && emake XCFLAGS="-fpic" third
195 + emake XCFLAGS="-fpic"
196 + use static-libs && \
197 + emake -C "${S}"-static build/debug/lib${PN}{,-js-none}.a
198 + use static && \
199 + emake -C "${S}"-static XLIBS="-static"
200 +}
201 +
202 +src_install() {
203 + if use X || use opengl ; then
204 + domenu platform/debian/${PN}.desktop
205 + doicon platform/debian/${PN}.xpm
206 + else
207 + rm docs/man/${PN}.1
208 + fi
209 +
210 + emake install
211 + dosym ${my_soname} /usr/$(get_libdir)/lib${PN}.so
212 +
213 + use static-libs && \
214 + dolib.a "${S}"-static/build/debug/lib${PN}{,-js-none}.a
215 + if use static ; then
216 + dobin "${S}"-static/build/debug/mu{tool,draw}
217 + use X && dobin "${S}"-static/build/debug/${PN}-x11
218 + fi
219 + if use opengl ; then
220 + einfo "mupdf symlink points to mupdf-gl (bug 616654)"
221 + dosym ${PN}-gl /usr/bin/${PN}
222 + elif use X ; then
223 + einfo "mupdf symlink points to mupdf-x11 (bug 616654)"
224 + dosym ${PN}-x11 /usr/bin/${PN}
225 + fi
226 + insinto /usr/$(get_libdir)/pkgconfig
227 + doins platform/debian/${PN}.pc
228 +
229 + dodoc README CHANGES CONTRIBUTORS
230 +}