Skip to content

Commit 4583800

Browse files
woodruffwilovezfs
authored andcommitted
rust: fix rustlib dylib IDs in post_install.
This is the less invasive version of Homebrew/brew#2764. Closes #14490. Signed-off-by: ilovezfs <[email protected]>
1 parent d920b93 commit 4583800

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Formula/rust.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class Rust < Formula
22
desc "Safe, concurrent, practical language"
33
homepage "https://www.rust-lang.org/"
4+
revision 1
45

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

105+
def post_install
106+
Dir["#{lib}/rustlib/**/*.dylib"].each do |dylib|
107+
chmod 0664, dylib
108+
MachO::Tools.change_dylib_id(dylib, "@rpath/#{File.basename(dylib)}")
109+
chmod 0444, dylib
110+
end
111+
end
112+
104113
test do
105114
system "#{bin}/rustdoc", "-h"
106115
(testpath/"hello.rs").write <<-EOS.undent

0 commit comments

Comments
 (0)