2018-08-18 19:06:49 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch
|
|
|
|
, libxslt, docbook_xsl, docbook_xml_dtd_44
|
2018-09-02 10:44:38 +01:00
|
|
|
, libcap, nettle, libidn2
|
2018-08-18 19:06:49 +01:00
|
|
|
}:
|
2004-08-05 20:30:00 +01:00
|
|
|
|
2013-03-18 11:21:00 +00:00
|
|
|
let
|
2018-08-18 19:06:49 +01:00
|
|
|
time = "20180629";
|
2013-03-18 11:21:00 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "iputils-${time}";
|
2013-06-04 13:18:55 +01:00
|
|
|
|
2018-08-18 19:06:49 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iputils";
|
|
|
|
repo = "iputils";
|
|
|
|
rev = "s${time}";
|
|
|
|
sha256 = "19rpl48pjgmyqlm4h7sml5gy7yg4cxciadxcs24q1zj40c05jls0";
|
2004-08-05 20:30:00 +01:00
|
|
|
};
|
|
|
|
|
2018-08-18 19:06:49 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "dont-hardcode-the-location-of-xsltproc.patch";
|
|
|
|
url = "https://github.com/iputils/iputils/commit/d0ff83e87ea9064d9215a18e93076b85f0f9e828.patch";
|
|
|
|
sha256 = "05wrwf0bfmax69bsgzh3b40n7rvyzw097j8z5ix0xsg0kciygjvx";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2013-03-18 14:07:03 +00:00
|
|
|
prePatch = ''
|
2018-08-18 19:06:49 +01:00
|
|
|
substituteInPlace doc/custom-man.xsl \
|
|
|
|
--replace "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" "${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl"
|
|
|
|
for xmlFile in doc/*.xml; do
|
|
|
|
substituteInPlace $xmlFile \
|
|
|
|
--replace "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" "${docbook_xml_dtd_44}/xml/dtd/docbook/docbookx.dtd"
|
|
|
|
done
|
2013-03-18 14:07:03 +00:00
|
|
|
'';
|
2011-02-02 16:05:18 +00:00
|
|
|
|
2018-01-14 07:02:05 +00:00
|
|
|
# Disable idn usage w/musl: https://github.com/iputils/iputils/pull/111
|
|
|
|
makeFlags = [ "USE_GNUTLS=no" ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "USE_IDN=no";
|
2013-06-04 13:18:55 +01:00
|
|
|
|
2018-08-18 19:06:49 +01:00
|
|
|
nativeBuildInputs = [ libxslt.bin ];
|
2016-05-13 02:53:37 +01:00
|
|
|
buildInputs = [
|
2018-09-02 10:44:38 +01:00
|
|
|
libcap nettle
|
2018-08-18 19:06:49 +01:00
|
|
|
] ++ stdenv.lib.optional (!stdenv.hostPlatform.isMusl) libidn2;
|
2013-03-18 14:07:03 +00:00
|
|
|
|
2018-02-27 23:11:17 +00:00
|
|
|
# ninfod probably could build on cross, but the Makefile doesn't pass --host etc to the sub configure...
|
2018-07-29 21:48:24 +01:00
|
|
|
buildFlags = "man all" + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) " ninfod";
|
2013-03-18 14:07:03 +00:00
|
|
|
|
2011-02-02 16:05:18 +00:00
|
|
|
installPhase =
|
|
|
|
''
|
2017-02-15 10:04:35 +00:00
|
|
|
mkdir -p $out/bin
|
2018-08-18 19:06:49 +01:00
|
|
|
cp -p arping clockdiff ping rarpd rdisc tftpd tracepath traceroute6 $out/bin/
|
2018-02-27 23:11:17 +00:00
|
|
|
if [ -x ninfod/ninfod ]; then
|
|
|
|
cp -p ninfod/ninfod $out/bin
|
|
|
|
fi
|
2013-03-18 14:07:03 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/man/man8
|
2018-08-18 19:06:49 +01:00
|
|
|
cd doc
|
2017-02-15 10:04:35 +00:00
|
|
|
cp -p \
|
2018-08-18 19:06:49 +01:00
|
|
|
arping.8 clockdiff.8 ninfod.8 pg3.8 ping.8 rarpd.8 rdisc.8 tftpd.8 tracepath.8 traceroute6.8 \
|
2016-10-28 19:05:35 +01:00
|
|
|
$out/share/man/man8
|
2011-02-02 16:05:18 +00:00
|
|
|
'';
|
2013-06-04 13:18:55 +01:00
|
|
|
|
2018-04-15 09:27:09 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-02-15 10:04:35 +00:00
|
|
|
homepage = https://github.com/iputils/iputils;
|
2011-02-02 16:05:18 +00:00
|
|
|
description = "A set of small useful utilities for Linux networking";
|
2018-08-18 19:06:49 +01:00
|
|
|
license = with licenses; [ gpl2Plus bsd3 ]; # TODO: AS-IS, SUN MICROSYSTEMS license
|
2018-04-15 09:27:09 +01:00
|
|
|
platforms = platforms.linux;
|
2018-08-18 19:06:49 +01:00
|
|
|
maintainers = with maintainers; [ primeos lheckemann ];
|
2011-02-02 16:05:18 +00:00
|
|
|
};
|
2004-08-05 20:30:00 +01:00
|
|
|
}
|