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

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Utilities for Broadcom-based cable modems"
HOMEPAGE="https://github.com/jclehner/bcm2-utils"
SRC_URI="https://github.com/jclehner/bcm2-utils/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="
	dev-libs/boost
	dev-libs/openssl
"
RDEPEND="dev-libs/openssl"

src_prepare(){
	default
	sed -i 's@shell git describe --always@shell git describe --always 2>/dev/null@' "Makefile" || die
}

src_compile(){
	emake \
		CC="$(tc-getCC)" \
		CXX="$(tc-getCXX)" \
		CFLAGS="${CFLAGS} '-DVERSION=\"v${PV}\"'" \
		CXXFLAGS="${CXXFLAGS} '-DVERSION=\"v${PV}\"'" \
		LDFLAGS="${LDFLAGS}"
}

src_install(){
	mkdir -p "${D}/usr/bin" || die
	emake PREFIX="${D}/usr" install
}

src_test(){
	emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
		LDFLAGS="${LDFLAGS}" check
}