Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inetutils: cross compile #57819

Merged
merged 1 commit into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pkgs/tools/networking/inetutils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
---
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