about summary refs log tree commit diff
path: root/pkgs/tools/misc/expect
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-03-04 20:35:28 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-03-05 18:14:36 +0100
commitcda4171d11c837c8d8349731719e57f8e8f3e89a (patch)
treea6ff6369bdaf7c312d8a2122b4d38b11b592ad5c /pkgs/tools/misc/expect
parent96ff4141984383bbf9bdbfca7edb4fd054ee7fcc (diff)
expect: fix cross-compilation
Closes #114983
Diffstat (limited to 'pkgs/tools/misc/expect')
-rw-r--r--pkgs/tools/misc/expect/default.nix22
1 files changed, 15 insertions, 7 deletions
diff --git a/pkgs/tools/misc/expect/default.nix b/pkgs/tools/misc/expect/default.nix
index 718da8dca4a70..74c2fd0313b0e 100644
--- a/pkgs/tools/misc/expect/default.nix
+++ b/pkgs/tools/misc/expect/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, tcl, makeWrapper, autoreconfHook }:
+{ lib, stdenv, buildPackages, fetchurl, tcl, makeWrapper, autoreconfHook, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "expect";
@@ -9,19 +9,27 @@ stdenv.mkDerivation rec {
     sha256 = "0d1cp5hggjl93xwc8h1y6adbnrvpkk0ywkd00inz9ndxn21xm9s9";
   };
 
-  buildInputs = [ tcl ];
-  nativeBuildInputs = [ makeWrapper autoreconfHook ];
-
-  hardeningDisable = [ "format" ];
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/buildroot/buildroot/master/package/expect/0001-enable-cross-compilation.patch";
+      sha256 = "1jwx2l1slidvcpahxbyqs942l81jd62rzbxliyd9lwysk38c8b6b";
+    })
+  ];
 
   postPatch = ''
     sed -i "s,/bin/stty,$(type -p stty),g" configure.in
   '';
 
+  nativeBuildInputs = [ autoreconfHook makeWrapper tcl ];
+  buildInputs = [ tcl ];
+
+  strictDeps = true;
+  hardeningDisable = [ "format" ];
+
   configureFlags = [
-    "--with-tcl=${tcl}/lib"
+    "--with-tcl=${buildPackages.tcl}/lib"
     "--with-tclinclude=${tcl}/include"
-    "--exec-prefix=\${out}"
+    "--exec-prefix=${placeholder "out"}"
   ];
 
   postInstall = ''