3
0
Fork 0
forked from mirrors/nixpkgs

inetutils: cross compile

This commit is contained in:
Michael Eden 2019-03-16 11:46:37 -04:00 committed by Frederik Rietdijk
parent ad7e58727d
commit 19094e72bf
2 changed files with 39 additions and 1 deletions

View file

@ -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

View file

@ -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 <eric@eukrea.com>
---
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