2018-08-18 18:06:49 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch
|
|
|
|
, libxslt, docbook_xsl, docbook_xml_dtd_44
|
2018-09-02 10:40:46 +00:00
|
|
|
, libcap, nettle, libidn2, openssl
|
2018-08-18 18:06:49 +00:00
|
|
|
}:
|
2004-08-05 19:30:00 +00:00
|
|
|
|
2018-09-02 10:40:46 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2013-03-18 11:21:00 +00:00
|
|
|
let
|
2018-08-18 18:06:49 +00:00
|
|
|
time = "20180629";
|
2018-09-02 10:40:46 +00:00
|
|
|
# ninfod probably could build on cross, but the Makefile doesn't pass --host
|
|
|
|
# etc to the sub configure...
|
|
|
|
withNinfod = stdenv.hostPlatform == stdenv.buildPlatform;
|
|
|
|
sunAsIsLicense = {
|
|
|
|
fullName = "AS-IS, SUN MICROSYSTEMS license";
|
|
|
|
url = "https://github.com/iputils/iputils/blob/s${time}/rdisc.c";
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation {
|
2013-03-18 11:21:00 +00:00
|
|
|
name = "iputils-${time}";
|
2013-06-04 12:18:55 +00:00
|
|
|
|
2018-08-18 18:06:49 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iputils";
|
|
|
|
repo = "iputils";
|
|
|
|
rev = "s${time}";
|
|
|
|
sha256 = "19rpl48pjgmyqlm4h7sml5gy7yg4cxciadxcs24q1zj40c05jls0";
|
2004-08-05 19:30:00 +00:00
|
|
|
};
|
|
|
|
|
2018-08-18 18:06:49 +00:00
|
|
|
patches = [
|
2018-09-02 10:40:46 +00:00
|
|
|
(fetchpatch {
|
2018-08-18 18:06:49 +00:00
|
|
|
name = "dont-hardcode-the-location-of-xsltproc.patch";
|
|
|
|
url = "https://github.com/iputils/iputils/commit/d0ff83e87ea9064d9215a18e93076b85f0f9e828.patch";
|
|
|
|
sha256 = "05wrwf0bfmax69bsgzh3b40n7rvyzw097j8z5ix0xsg0kciygjvx";
|
|
|
|
})
|
2018-09-24 14:56:59 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "add-missing-idn-declarations.patch";
|
|
|
|
url = "https://github.com/iputils/iputils/commit/5007d7067918fb3d950d34c01d059e5222db679a.patch";
|
|
|
|
sha256 = "0dhgxdhjcbb2q6snm3mjp38l066knykmrx4k8rn167cizn7akpdx";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-ping-idn.patch";
|
|
|
|
url = "https://github.com/iputils/iputils/commit/25899e849aa3abc1ad29ebf0b830262a859eaed5.patch";
|
|
|
|
sha256 = "1bqjcdjjnc2j6indcli7s7gbbhkcaligvh94asixfrmjzkbn533n";
|
|
|
|
})
|
2018-08-18 18:06:49 +00:00
|
|
|
];
|
|
|
|
|
2013-03-18 14:07:03 +00:00
|
|
|
prePatch = ''
|
2018-08-18 18:06:49 +00: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
|
2018-09-02 10:40:46 +00:00
|
|
|
makeFlags = optional stdenv.hostPlatform.isMusl "USE_IDN=no";
|
2013-06-04 12:18:55 +00:00
|
|
|
|
2018-08-18 18:06:49 +00:00
|
|
|
nativeBuildInputs = [ libxslt.bin ];
|
2018-09-02 10:40:46 +00:00
|
|
|
buildInputs = [ libcap nettle ]
|
|
|
|
++ optional (!stdenv.hostPlatform.isMusl) libidn2
|
|
|
|
++ optional withNinfod openssl; # TODO: Build with nettle
|
2013-03-18 14:07:03 +00:00
|
|
|
|
2018-09-02 10:40:46 +00:00
|
|
|
buildFlags = "man all" + optionalString withNinfod " ninfod";
|
2013-03-18 14:07:03 +00:00
|
|
|
|
2018-09-02 10:40:46 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/man/man8
|
2013-03-18 14:07:03 +00:00
|
|
|
|
2018-09-02 10:40:46 +00:00
|
|
|
for tool in arping clockdiff ping rarpd rdisc tftpd tracepath traceroute6; do
|
|
|
|
cp $tool $out/bin/
|
|
|
|
cp doc/$tool.8 $out/share/man/man8/
|
|
|
|
done
|
|
|
|
|
|
|
|
# TODO: Requires kernel module pg3
|
|
|
|
cp ipg $out/bin/
|
|
|
|
cp doc/pg3.8 $out/share/man/man8/
|
|
|
|
'' + optionalString withNinfod ''
|
|
|
|
cp ninfod/ninfod $out/bin/
|
|
|
|
cp doc/ninfod.8 $out/share/man/man8/
|
|
|
|
'';
|
2013-06-04 12:18:55 +00:00
|
|
|
|
2018-09-02 10:40:46 +00:00
|
|
|
meta = {
|
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-09-02 10:40:46 +00:00
|
|
|
license = with licenses; [ gpl2Plus bsd3 sunAsIsLicense ];
|
2018-04-15 08:27:09 +00:00
|
|
|
platforms = platforms.linux;
|
2018-08-18 18:06:49 +00:00
|
|
|
maintainers = with maintainers; [ primeos lheckemann ];
|
2011-02-02 16:05:18 +00:00
|
|
|
};
|
2004-08-05 19:30:00 +00:00
|
|
|
}
|