blob: a2b0354b57ec6752e95738ea2f876b02fbda0e8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
inherit eutils flag-o-matic git-2 java-pkg-2 java-ant-2 multilib
EANT_BUILD_TARGET=${PN}
DESCRIPTION="Java library for rendering PDF, XPS and CBZ (Comic Book) documents"
HOMEPAGE="https://code.google.com/p/jmupdf/"
EGIT_REPO_URI="https://code.google.com/p/${PN}/"
LICENSE="GPL-1"
SLOT="0"
KEYWORDS=""
IUSE="system-mupdf"
REQUIRED_USE="!system-mupdf"
RDEPEND="system-mupdf? ( >=app-text/mupdf-1.2 )
virtual/jdk:1.7"
DEPEND="${RDEPEND}
app-arch/p7zip
media-libs/libbmp"
src_prepare() {
if ! grep javac ${PN}/build.xml >/dev/null ; then
epatch \
"${FILESDIR}"/${PN}-0.4.1-build-xml.patch
fi
edos2unix $(find mupdf/jni -type f)
sed -e "/^JVM_INCLUDES/s:=.*:= $(java-pkg_get-jni-cflags):" \
-i mupdf/MakeJNI2 || die
sed -e "s:-pipe -O2::" \
-i mupdf/Makerules || die
rm -r mupdf/thirdparty || die
if use system-mupdf ; then
for i in android apps cbz cmaps debian draw fitz fonts ios pdf scripts viewer win32 xps ; do
einfo remove mupdf/${i}
rm -r mupdf/${i} || die
done
fi
}
src_compile() {
#append-cflags -Ijni/includes
emake -C mupdf \
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
SYS_FREETYPE_INC="$($(tc-getPKG_CONFIG) --cflags freetype2)" \
JNI_DLL=build/libjmupdf.so \
JNI_CMD="-shared -Wl,-soname -Wl,lib${PN}.so" \
build/libjmupdf.so
cd ${PN}
java-pkg-2_src_compile
}
src_install() {
dolib.so mupdf/build/lib${PN}.so
cd ${PN}
java-pkg_dojar build/${PN}{,-viewer}.jar
dodoc Readme
}
|