summaryrefslogtreecommitdiff
blob: 49a249f77266872b55a7c7bded7d722f44dc9123 (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit edo toolchain-funcs

QUICKJS_HASH=2788d71e823b522b178db3b3660ce93689534e6d
QUICKJS_SHORT=2788d71
QUICKJS_S="${WORKDIR}/quickjs-${QUICKJS_HASH}"
QUICKJS_P="quickjs-${QUICKJS_SHORT}"

DESCRIPTION="Combination editor, browser, and mail client that is 100% text based"
HOMEPAGE="https://edbrowse.org"
SRC_URI="https://github.com/CMB/edbrowse/archive/v${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/bellard/quickjs/archive/${QUICKJS_HASH}.tar.gz -> ${QUICKJS_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~riscv ~x86"

RDEPEND="
	>=app-text/htmltidy-5.0.0:=
	dev-db/unixODBC
	dev-libs/libpcre2:=
	net-misc/curl
	sys-libs/readline:=
"
DEPEND="${RDEPEND}"
BDEPEND="
	dev-lang/perl
	sys-apps/ed
	virtual/pkgconfig
"

PATCHES=(
	"${FILESDIR}/${P}"-respect-ldflags.patch
)

src_prepare() {
	default

	cd "${QUICKJS_S}" || die
	eapply "${FILESDIR}/${P}"-quickjs-respect-flags.patch
}

src_compile() {
	# First build quickjs so we can link to its static library.
	# Also, quickjs doesn't appear to tag releases.
	edo tools/quickjobfixup "${QUICKJS_S}"
	emake -C "${QUICKJS_S}" CC="$(tc-getCC)" AR="$(tc-getAR)" libquickjs.a

	tc-export CC
	emake -C src QUICKJS_DIR="${QUICKJS_S}" STRIP=
}

src_install() {
	dobin src/edbrowse
	newman doc/man-edbrowse-debian.1 edbrowse.1
	DOCS="doc/sample*"
	HTML_DOCS="doc/*.html"
	einstalldocs
}