about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-01-12 10:59:42 +0000
committerGitHub <noreply@github.com>2018-01-12 10:59:42 +0000
commit9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4 (patch)
treee4bec94f1961c77bd91b716613a546a6550ea19d
parent6bbf50374fee84eb5d89e3c255d53e451f1beae9 (diff)
parent6bfa42218ddf2054f735145940585d05d84aaf64 (diff)
downloadnixlib-9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4.tar
nixlib-9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4.tar.gz
nixlib-9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4.tar.bz2
nixlib-9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4.tar.lz
nixlib-9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4.tar.xz
nixlib-9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4.tar.zst
nixlib-9c3b2b6ad33df1433c7b9c5235b6680d0a3132d4.zip
Merge pull request #33762 from kierdavis/fix-avr-gcc-ar
avrgcc: bake path to avr-ar into avr-gcc-ar
-rw-r--r--pkgs/development/misc/avr/gcc/avrbinutils-path.patch15
-rw-r--r--pkgs/development/misc/avr/gcc/default.nix10
2 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/development/misc/avr/gcc/avrbinutils-path.patch b/pkgs/development/misc/avr/gcc/avrbinutils-path.patch
new file mode 100644
index 000000000000..f0ec21b7589f
--- /dev/null
+++ b/pkgs/development/misc/avr/gcc/avrbinutils-path.patch
@@ -0,0 +1,15 @@
+diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
+index 838ebc2..3ac4ee7 100644
+--- a/gcc/gcc-ar.c
++++ b/gcc/gcc-ar.c
+@@ -118,8 +118,8 @@ setup_prefixes (const char *exec_path)
+ 				dir_separator, NULL);
+   prefix_from_string (self_libexec_prefix, &target_path);
+ 
+-  /* Add path as a last resort.  */
+-  prefix_from_env ("PATH", &path);
++  /* Add path to avrbinutils.  */
++  prefix_from_string ("@avrbinutils@/bin", &path);
+ }
+ 
+ int 
diff --git a/pkgs/development/misc/avr/gcc/default.nix b/pkgs/development/misc/avr/gcc/default.nix
index f456214f9442..0bfa6d1f238d 100644
--- a/pkgs/development/misc/avr/gcc/default.nix
+++ b/pkgs/development/misc/avr/gcc/default.nix
@@ -11,6 +11,16 @@ stdenv.mkDerivation {
     sha256 = "0fihlcy5hnksdxk0sn6bvgnyq8gfrgs8m794b1jxwd1dxinzg3b0";
   };
 
+  patches = [
+    ./avrbinutils-path.patch
+  ];
+
+  # avrbinutils-path.patch introduces a reference to @avrbinutils@, substitute
+  # it now.
+  postPatch = ''
+    substituteInPlace gcc/gcc-ar.c --subst-var-by avrbinutils ${avrbinutils}
+  '';
+
   buildInputs = [ gmp mpfr libmpc zlib avrbinutils ];
 
   nativeBuildInputs = [ texinfo ];