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

# Cyclone is a self-hosting Scheme to C compiler
# cyclone-bootstrap is the Cyclone source transpiled by it to C.

EAPI=8

inherit flag-o-matic toolchain-funcs

DESCRIPTION="R7RS Scheme to C compiler"
HOMEPAGE="http://justinethier.github.io/cyclone/"

if [[ "${PV}" == *9999* ]] ; then
	inherit git-r3

	EGIT_REPO_URI="https://github.com/justinethier/${PN}-bootstrap.git"
else
	SRC_URI="https://github.com/justinethier/${PN}-bootstrap/archive/v${PV}.tar.gz
		-> ${P}.tar.gz"
	S="${WORKDIR}/${PN}-bootstrap-${PV}"

	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
fi

LICENSE="MIT"
SLOT="0"

RDEPEND="
	dev-libs/concurrencykit
"
DEPEND="
	${RDEPEND}
"

src_configure() {
	export CYC_GCC_OPT_FLAGS="${CFLAGS}"

	append-cflags -fPIC -Iinclude
	append-ldflags -L.
	tc-export AR CC RANLIB
}

src_compile() {
	local -a myopts=(
		PREFIX="/usr"
		CYC_GCC_OPT_FLAGS="${CYC_GCC_OPT_FLAGS}"
		AR="$(tc-getAR)"
		CC="$(tc-getCC)"
		RANLIB="$(tc-getRANLIB)"
	)
	emake "${myopts[@]}"
}

src_test() {
	emake LDFLAGS="" test
}

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