Merge pull request #183917 from uri-canva/bazel-libtool

bazel_5: get libtool from path
This commit is contained in:
Uri Baghin 2022-07-31 12:41:25 +10:00 committed by GitHub
commit e30abcd5d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -377,9 +377,10 @@ stdenv.mkDerivation rec {
# invocations of gcc to clang, but vanilla clang doesn't
sed -i -e 's;_find_generic(repository_ctx, "gcc", "CC", overriden_tools);_find_generic(repository_ctx, "clang", "CC", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
sed -i -e 's;/usr/bin/libtool;${cctools}/bin/libtool;g' tools/cpp/unix_cc_configure.bzl
sed -i -e 's;"/usr/bin/libtool";_find_generic(repository_ctx, "libtool", "LIBTOOL", overriden_tools);g' tools/cpp/unix_cc_configure.bzl
wrappers=( tools/cpp/osx_cc_wrapper.sh tools/cpp/osx_cc_wrapper.sh.tpl )
for wrapper in "''${wrappers[@]}"; do
sed -i -e "s,/usr/bin/gcc,${stdenv.cc}/bin/clang,g" $wrapper
sed -i -e "s,/usr/bin/install_name_tool,${cctools}/bin/install_name_tool,g" $wrapper
done
'';