Merge pull request #33762 from kierdavis/fix-avr-gcc-ar
avrgcc: bake path to avr-ar into avr-gcc-ar
This commit is contained in:
commit
9c3b2b6ad3
2 changed files with 25 additions and 0 deletions
15
pkgs/development/misc/avr/gcc/avrbinutils-path.patch
Normal file
15
pkgs/development/misc/avr/gcc/avrbinutils-path.patch
Normal file
|
@ -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
|
|
@ -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 ];
|
||||
|
|
Loading…
Reference in a new issue