Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: Fix rustlib dylib IDs in post_install. #14490

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Formula/rust.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Rust < Formula
desc "Safe, concurrent, practical language"
homepage "https://www.rust-lang.org/"
revision 1

stable do
url "https://static.rust-lang.org/dist/rustc-1.18.0-src.tar.gz"
Expand Down Expand Up @@ -101,6 +102,14 @@ def install
rm_rf prefix/"lib/rustlib/install.log"
end

def post_install
Dir["#{lib}/rustlib/**/*.dylib"].each do |dylib|
chmod 0664, dylib
MachO::Tools.change_dylib_id(dylib, "@rpath/#{File.basename(dylib)}")
chmod 0444, dylib
end
end

test do
system "#{bin}/rustdoc", "-h"
(testpath/"hello.rs").write <<-EOS.undent
Expand Down