mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
ruby: fix cross compiling extensions
Update pkgs/development/interpreters/ruby/default.nix Co-authored-by: Artturi <Artturin@artturin.com>
This commit is contained in:
parent
86481573b0
commit
f5b5432450
1 changed files with 12 additions and 0 deletions
|
@ -187,6 +187,18 @@ let
|
||||||
sed -i '/CC_VERSION_MESSAGE/d' $rbConfig
|
sed -i '/CC_VERSION_MESSAGE/d' $rbConfig
|
||||||
''
|
''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Allow to override compiler. This is important for cross compiling as
|
||||||
|
# we need to set a compiler that is different from the build one.
|
||||||
|
awk -i inplace -F' = ' \
|
||||||
|
' # operate on the line starting with
|
||||||
|
/^ CONFIG\["CC"\]/ {
|
||||||
|
# replace the right hand side
|
||||||
|
sub($2, "ENV[\"CC\"] || \"1\"")
|
||||||
|
}; { print }' "$rbConfig"
|
||||||
|
# test that the line isn't mangled in case upstream made the above unnecessary
|
||||||
|
grep -qx ' CONFIG\["CC"\] = ENV\["CC"\] || "1"' "$rbConfig"
|
||||||
|
|
||||||
# Remove unnecessary external intermediate files created by gems
|
# Remove unnecessary external intermediate files created by gems
|
||||||
extMakefiles=$(find $out/lib/ruby/gems -name Makefile)
|
extMakefiles=$(find $out/lib/ruby/gems -name Makefile)
|
||||||
for makefile in $extMakefiles; do
|
for makefile in $extMakefiles; do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue