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

EAPI=8

inherit flag-o-matic toolchain-funcs

DESCRIPTION="High performance base64 encoder and decoder"
HOMEPAGE="https://github.com/skeeto/race64"
SRC_URI="https://github.com/skeeto/${PN}/releases/download/v${PV}/${P}.tar.xz"

LICENSE="Unlicense"
SLOT="0"
KEYWORDS="~amd64"
IUSE="openmp"

pkg_pretend() {
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

pkg_setup() {
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

src_compile() {
	use openmp && append-flags -fopenmp
	$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o ${PN} ${PN}.c || die
}

src_test() {
	./test.sh || die 'test failed'
}

src_install() {
	dobin ${PN}
	doman ${PN}.1
}