From 3c3ad616d2cc630c42eb422205fcab981799fa39 Mon Sep 17 00:00:00 2001 From: Tom Schoonjans Date: Wed, 12 Dec 2018 17:07:47 +0000 Subject: [PATCH] plplot: fix @rpath in dylib IDs Closes #35036. Signed-off-by: Chongyu Zhu --- Formula/plplot.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Formula/plplot.rb b/Formula/plplot.rb index 84456f6df74f1..a7a568483ecb6 100644 --- a/Formula/plplot.rb +++ b/Formula/plplot.rb @@ -3,6 +3,7 @@ class Plplot < Formula homepage "https://plplot.sourceforge.io" url "https://downloads.sourceforge.net/project/plplot/plplot/5.14.0%20Source/plplot-5.14.0.tar.gz" sha256 "331009037c9cad9fcefacd7dbe9c7cfae25e766f5590f9efd739a294c649df97" + revision 1 bottle do sha256 "36438c5bc345b831ea582a17e3fc3ded683015f3df45a9f77ca110fa36065359" => :mojave @@ -42,6 +43,16 @@ def install system "make" system "make", "install" end + + # fix rpaths + cd (lib.to_s) do + Dir["*.dylib"].select { |f| File.ftype(f) == "file" }.each do |f| + MachO::Tools.dylibs(f).select { |d| d.start_with?("@rpath") }.each do |d| + d_new = d.sub("@rpath", opt_lib.to_s) + MachO::Tools.change_install_name(f, d, d_new) + end + end + end end test do