From 19094e72bfef820be862b6b9aa17b52eefc52696 Mon Sep 17 00:00:00 2001 From: Michael Eden Date: Sat, 16 Mar 2019 11:46:37 -0400 Subject: [PATCH] inetutils: cross compile --- pkgs/tools/networking/inetutils/default.nix | 14 +++++++++- .../inetutils-1_9-PATH_PROCNET_DEV.patch | 26 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/networking/inetutils/inetutils-1_9-PATH_PROCNET_DEV.patch diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix index 1d2bfdc91189..612e3ec0f835 100644 --- a/pkgs/tools/networking/inetutils/default.nix +++ b/pkgs/tools/networking/inetutils/default.nix @@ -11,9 +11,21 @@ stdenv.mkDerivation rec { patches = [ ./whois-Update-Canadian-TLD-server.patch ./service-name.patch + # https://git.congatec.com/yocto/meta-openembedded/commit/3402bfac6b595c622e4590a8ff5eaaa854e2a2a3 + ./inetutils-1_9-PATH_PROCNET_DEV.patch ]; - buildInputs = [ ncurses /* for `talk' */ perl /* for `whois' */ help2man ]; + nativeBuildInputs = [ help2man perl /* for `whois' */ ]; + buildInputs = [ ncurses /* for `talk' */ ]; + + # Don't use help2man if cross-compiling + # https://lists.gnu.org/archive/html/bug-sed/2017-01/msg00001.html + # https://git.congatec.com/yocto/meta-openembedded/blob/3402bfac6b595c622e4590a8ff5eaaa854e2a2a3/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.1.bb#L44 + preConfigure = let + isCross = stdenv.hostPlatform != stdenv.buildPlatform; + in lib.optionalString isCross '' + export HELP2MAN=true + ''; configureFlags = [ "--with-ncurses-include-dir=${ncurses.dev}/include" ] ++ lib.optionals stdenv.hostPlatform.isMusl [ # Musl doesn't define rcmd diff --git a/pkgs/tools/networking/inetutils/inetutils-1_9-PATH_PROCNET_DEV.patch b/pkgs/tools/networking/inetutils/inetutils-1_9-PATH_PROCNET_DEV.patch new file mode 100644 index 000000000000..2592989a90a3 --- /dev/null +++ b/pkgs/tools/networking/inetutils/inetutils-1_9-PATH_PROCNET_DEV.patch @@ -0,0 +1,26 @@ +inetutils: define PATH_PROCNET_DEV if not already defined + +this prevents the following compilation error : +system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function) + +this patch comes from : + http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/ + +Upstream-Status: Inappropriate [not author] + +Signed-of-by: Eric BĂ©nard +--- +diff -Naur inetutils-1.9.orig/ifconfig/system/linux.c inetutils-1.9/ifconfig/system/linux.c +--- inetutils-1.9.orig/ifconfig/system/linux.c 2012-01-04 16:31:36.000000000 -0500 ++++ inetutils-1.9/ifconfig/system/linux.c 2012-01-04 16:40:53.000000000 -0500 +@@ -49,6 +49,10 @@ + #include "../ifconfig.h" + + ++#ifndef PATH_PROCNET_DEV ++ #define PATH_PROCNET_DEV "/proc/net/dev" ++#endif ++ + /* ARPHRD stuff. */ + + static void