blob: 6cd530a3c6c753d9b0281c0405b67e45d8971050 (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake edo edos2unix
LWIP_BASE_S="${WORKDIR}"/${P%_p*}
LWIP_POSIX_S="${LWIP_BASE_S}"/contrib/ports/unix/posixlib
LWIP_TEST_S="${LWIP_BASE_S}"/contrib/ports/unix/check
DESCRIPTION="Small independent implementation of the TCP/IP protocol suite"
HOMEPAGE="https://savannah.nongnu.org/projects/lwip/"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="
https://https.git.savannah.gnu.org/git/lwip.git
https://github.com/lwip-tcpip/lwip
"
inherit git-r3
else
SRC_URI="mirror://nongnu/${PN}/${P%_p*}.zip"
if [[ ${PV} == *_p* ]] ; then
LWIP_PV=+dfsg1-${PV#*_p}
SRC_URI+=" mirror://debian/pool/main/l/${PN}/${PN}_${PV%_p*}${LWIP_PV}.debian.tar.xz"
fi
KEYWORDS="~amd64 ~x86"
fi
S="${LWIP_POSIX_S}"
LICENSE="BSD"
SLOT="0"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="
test? (
dev-libs/check
dev-python/python-subunit
)
"
BDEPEND="app-arch/unzip"
# Patches to be applied at LWIP_BASE_S, not LWIP_POSIX_S
BASE_PATCHES=(
"${FILESDIR}"/${PN}-2.2.1-fix-tests-use-lwip-helpers.patch
)
src_prepare() {
cd "${LWIP_BASE_S}" || die
# The .zips produced by upstream have Windows line-endings, but
# the Debian patches don't. But always do this for consistency
# for user patches.
edos2unix $(find "${LWIP_BASE_S}" -type 'f' || die)
if [[ ${PV} == *_p* ]] ; then
BASE_PATCHES+=( $(awk '{print $1}' "${WORKDIR}"/debian/patches/series | sed -e '/^#/d' -e "s:^:${WORKDIR}/debian/patches/:") )
fi
eapply "${BASE_PATCHES[@]}"
sed -i -e 's:-Werror::' \
contrib/ports/CMakeCommon.cmake \
contrib/ports/Common.allports.mk || die
sed -i -e '/LWIP_USE_SANITIZERS/d' \
contrib/ports/unix/check/CMakeLists.txt || die
cd "${LWIP_POSIX_S}" || die
cmake_src_prepare
if use test ; then
CMAKE_USE_DIR="${LWIP_TEST_S}" BUILD_DIR="${WORKDIR}"/${P}_build/test cmake_src_prepare
fi
}
src_configure() {
cmake_src_configure
if use test ; then
CMAKE_USE_DIR="${LWIP_TEST_S}" BUILD_DIR="${WORKDIR}"/${P}_build/test cmake_src_configure
fi
}
src_compile() {
cmake_src_compile
if use test ; then
CMAKE_USE_DIR="${LWIP_TEST_S}" BUILD_DIR="${WORKDIR}"/${P}_build/test cmake_src_compile
fi
}
src_test() {
CMAKE_USE_DIR="${LWIP_TEST_S}" BUILD_DIR="${WORKDIR}"/${P}_build/test cmake_src_test
edo "${WORKDIR}"/${P}_build/test/lwip_unittests
}
|