summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/openbsd-netcat/openbsd-netcat-1.105-r1.ebuild15
1 files changed, 13 insertions, 2 deletions
diff --git a/net-analyzer/openbsd-netcat/openbsd-netcat-1.105-r1.ebuild b/net-analyzer/openbsd-netcat/openbsd-netcat-1.105-r1.ebuild
index c4d9efa17197..f20c5c3d5566 100644
--- a/net-analyzer/openbsd-netcat/openbsd-netcat-1.105-r1.ebuild
+++ b/net-analyzer/openbsd-netcat/openbsd-netcat-1.105-r1.ebuild
@@ -4,7 +4,7 @@
EAPI=6
-inherit toolchain-funcs
+inherit toolchain-funcs flag-o-matic
DESCRIPTION="The OpenBSD network swiss army knife"
HOMEPAGE="http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/"
@@ -12,11 +12,12 @@ SRC_URI="http://http.debian.net/debian/pool/main/n/netcat-openbsd/netcat-openbsd
http://http.debian.net/debian/pool/main/n/netcat-openbsd/netcat-openbsd_${PV}-7.debian.tar.gz"
LICENSE="BSD"
SLOT="0"
+IUSE="elibc_Darwin"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x64-macos"
DEPEND="virtual/pkgconfig"
-RDEPEND="dev-libs/libbsd
+RDEPEND="!elibc_Darwin? ( dev-libs/libbsd )
!net-analyzer/netcat
!net-analyzer/netcat6
"
@@ -25,6 +26,16 @@ S=${WORKDIR}/netcat-openbsd-${PV}
PATCHES=( "${WORKDIR}/debian/patches" )
+src_prepare() {
+ default
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # Darwin = BSD, so remove libbsd dependency
+ sed -i -e '/#include/s|bsd/||' -e 's/strtonum/strtoimax/' *.[ch] || die
+ # Clang defaults to C99, but strtoimax isn't in C99
+ append-flags -DIPTOS_LOWCOST=0x02 -std=c89
+ fi
+}
+
src_compile() {
emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || die
}