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

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Web application platform for writing scalable, concurrent web based processes"
HOMEPAGE="https://kore.io/
	https://github.com/jorisvink/kore/"

if [[ ${PV} == *9999* ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://git.kore.io/kore.git"
else
	SRC_URI="https://kore.io/releases/${P}.tar.gz"
	KEYWORDS="~amd64 ~x86"
fi

LICENSE="ISC"
SLOT="0"
IUSE="+acme +curl debug +http +json +openssl postgres +threads"
REQUIRED_USE="acme? ( curl openssl )"

RDEPEND="
	curl? ( net-misc/curl:= )
	json? ( dev-libs/yajl:= )
	openssl? ( dev-libs/openssl:= )
	postgres? ( dev-db/postgresql:= )
"
DEPEND="${RDEPEND}"

PATCHES=(
	"${FILESDIR}"/${PN}-4.2.3-makefile.patch
	"${FILESDIR}"/${PN}-4.2.3-kodev-makefile.patch
)

DOCS=( README.md )

src_prepare() {
	default

	sed -i 's|-Werror||g' kodev/Makefile tools/kore-serve/conf/build.conf || die
}

src_compile() {
	tc-export CC

	# See https://github.com/jorisvink/kore#building-kore
	env ACME=$(usex acme 1 '')                      \
		CURL=$(usex curl 1 '')                      \
		DEBUG=$(usex debug 1 '')                    \
		JSONRPC=$(usex json 1 '')                   \
		NOHTTP=$(usex http '' 1)                    \
		PGSQL=$(usex postgres 1 '')                 \
		TASKS=$(usex threads 1 '')                  \
		TLS_BACKEND=$(usex openssl openssl none)    \
		CFLAGS="${CFLAGS} ${LDFLAGS}"               \
		LDFLAGS="${LDFLAGS}"                        \
		PREFIX=/usr                                 \
		emake
}

src_install() {
	emake DESTDIR="${D}" PREFIX=/usr install

	einstalldocs
}