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

EAPI=6

inherit scons-utils toolchain-funcs

DESCRIPTION="Peer-to-peer VPN software that abstracts a LAN over the Internet"
HOMEPAGE="http://www.freelan.org/"
SRC_URI="https://github.com/freelan-developers/freelan/archive/${PV}.tar.gz -> ${P}.tar.gz"

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

DEPEND="
	dev-libs/boost:=[threads]
	dev-libs/openssl:0=
	net-misc/curl:=
	virtual/libiconv
	net-libs/miniupnpc:=
"
RDEPEND="${DEPEND}"

PATCHES=(
	"${FILESDIR}"/${PN}-2.2-boost-1.70.patch
	"${FILESDIR}"/${PN}-2.2-boost-1.70-asio.patch
)

src_prepare() {
	export FREELAN_NO_GIT=1
	export FREELAN_NO_GIT_VERSION=${PV}

	sed -e "s/CXXFLAGS='-O3'/CXXFLAGS=''/" \
		-e "s/CXXFLAGS=\['-Werror'\]/CXXFLAGS=[]/" \
		-e "s/CXXFLAGS=\['-pedantic'\]/CXXFLAGS=[]/" \
		-i SConstruct || die
	default
}

src_compile() {
	tc-export CXX CC AR
	export LINK="$(tc-getCXX)"

	local MYSCONS=(
		"--mode=$(usex debug debug release)"
		prefix="${EPREFIX:-/}"
		bin_prefix="/usr"
		apps
	)
	escons "${MYSCONS[@]}"
}

src_install() {
	DESTDIR="${D}" escons --mode=release install prefix="${EPREFIX:-/}" bin_prefix="/usr"
	dobin build/release/bin/freelan
	dodoc CONTRIBUTING.md README.md

	newinitd "${FILESDIR}/openrc/freelan.initd" freelan
}