summaryrefslogtreecommitdiff
blob: 3bd790d94a7df962fbba40d2f4944e2a74423905 (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
70
71
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

NEED_EMACS=26.3

inherit autotools elisp

DESCRIPTION="Emacs Lisp support library for PDF documents"
HOMEPAGE="https://github.com/vedang/pdf-tools/"

if [[ ${PV} == *9999* ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/vedang/${PN}.git"
else
	SRC_URI="https://github.com/vedang/${PN}/archive/v${PV}.tar.gz
		-> ${P}.tar.gz"
	KEYWORDS="~amd64 ~x86"
fi

LICENSE="GPL-3+"
SLOT="0"

# Cask is a hard dependency for tests; it is ran by helper functions too.
RESTRICT="test"

BDEPEND="app-emacs/tablist"
DEPEND="
	app-text/poppler:=[cairo,png]
	dev-libs/glib:2=
	media-libs/freetype:2=
	media-libs/harfbuzz:=
	media-libs/libpng:=
	x11-libs/cairo:=
"
RDEPEND="
	${DEPEND}
	${BDEPEND}
"

DOCS=( NEWS README.org )
SITEFILE="50${PN}-gentoo.el"

src_prepare() {
	elisp_src_prepare

	cd server || die
	eautoreconf
}

src_configure() {
	cd server || die
	econf
}

src_compile() {
	BYTECOMPFLAGS="-L lisp" elisp-compile lisp/*.el
	elisp-make-autoload-file lisp/${PN}-autoloads.el lisp

	emake -C server
}

src_install() {
	elisp-install ${PN} lisp/*.el*
	elisp-site-file-install "${FILESDIR}"/${SITEFILE}

	emake -C server DESTDIR="${D}" install

	einstalldocs
}