diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index de49fe5182a3..124b95ee04c5 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { sha256 = "1q5vjcvw4f067c63vj2n3xggvk5prm11571x6vnqiav47vdbqvni"; }; + patches = [ ./linux-specific-header.patch ]; + crossAttrs = { # Work around use of `AC_RUN_IFELSE'. preConfigure = "export scanf_cv_type_modifier=ms"; diff --git a/pkgs/os-specific/linux/util-linux/linux-specific-header.patch b/pkgs/os-specific/linux/util-linux/linux-specific-header.patch new file mode 100644 index 000000000000..8d0b57dea3fb --- /dev/null +++ b/pkgs/os-specific/linux/util-linux/linux-specific-header.patch @@ -0,0 +1,16 @@ +The header is Linux-only and breaks GNU/Hurd builds. + +--- util-linux-2.20.1/term-utils/write.c 2012-03-07 23:06:14.000000000 +0100 ++++ util-linux-2.20.1/term-utils/write.c 2012-03-07 23:06:19.000000000 +0100 +@@ -57,7 +57,9 @@ + #include + #include + #include +-#include ++#ifdef __linux__ ++# include ++#endif + #include + #include "c.h" + #include "carefulputc.h" +