app-text/texlive: x86 stable wrt bug #723404
[gentoo.git] / app-text / llpp / llpp-30.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit toolchain-funcs xdg-utils
7
8 DESCRIPTION="graphical PDF viewer which aims to superficially resemble less(1)"
9 HOMEPAGE="https://github.com/moosotc/llpp"
10 SRC_URI="https://github.com/moosotc/llpp/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="amd64 ~ppc x86"
15 IUSE="+ocamlopt static"
16
17 LIB_DEPEND=">=app-text/mupdf-1.12.0:0=[static-libs]
18         media-libs/openjpeg:2[static-libs]
19         media-libs/fontconfig:1.0[static-libs]
20         media-libs/freetype:2[static-libs]
21         media-libs/jbig2dec:=[static-libs]
22         sys-libs/zlib[static-libs]
23         virtual/jpeg:0[static-libs]
24         x11-libs/libX11[static-libs]"
25 RDEPEND="x11-misc/xsel
26         !static? ( ${LIB_DEPEND//\[static-libs]} )"
27 DEPEND="${RDEPEND}
28         app-text/asciidoc
29         virtual/pkgconfig
30         static? ( ${LIB_DEPEND}
31                 app-arch/bzip2[static-libs]
32                 media-libs/libXcm[static-libs]
33                 x11-libs/libXau[static-libs]
34                 x11-libs/libXdmcp[static-libs]
35                 x11-libs/libXmu[static-libs] )
36         >=dev-lang/ocaml-4.02[ocamlopt?]
37         dev-ml/lablgl[glut,ocamlopt?]"
38
39 RESTRICT="!ocamlopt? ( strip )"
40
41 PATCHES=( "${FILESDIR}"/${P}-keysym.patch )
42
43 src_prepare() {
44         default
45
46         # use custom makefile from archlinux with minor changes
47         cp "${FILESDIR}"/Makefile "${S}" || die
48
49         # re-add desktop file removed upstream
50         cp "${FILESDIR}"/llpp.desktop "${S}"/misc || die
51 }
52
53 src_compile() {
54         emake -j1 VERSION=${PV} CC="$(tc-getCC)" LIBDIR="/usr/$(get_libdir)"
55 }
56
57 src_install() {
58         emake DESTDIR="${D}" PREFIX="/usr" install
59         dodoc README Thanks
60 }
61
62 pkg_postinst() {
63         xdg_desktop_database_update
64         xdg_mimeinfo_database_update
65 }
66
67 pkg_postrm() {
68         xdg_desktop_database_update
69         xdg_mimeinfo_database_update
70 }