From 94046f9e04f8008cbb471cd8501468f8b10c62f2 Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 9 Nov 2024 14:02:07 -0600 Subject: [PATCH] freecad@0.21.2_py310: attempt to fix pyside runtime error with post install step --- Formula/freecad@0.21.2_py310.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Formula/freecad@0.21.2_py310.rb b/Formula/freecad@0.21.2_py310.rb index 5f5e06ff..097b2d19 100644 --- a/Formula/freecad@0.21.2_py310.rb +++ b/Formula/freecad@0.21.2_py310.rb @@ -341,12 +341,22 @@ def install def post_install if OS.mac? ohai "the value of prefix = #{prefix}" - ln_s "#{prefix}/MacOS/FreeCAD", "#{HOMEBREW_PREFIX}/bin/freecad", force: true - ln_s "#{prefix}/MacOS/FreeCADCmd", "#{HOMEBREW_PREFIX}/bin/freecadcmd", force: true + freecad_path = Pathname.new("#{prefix}/MacOS/FreeCAD") + freecadcmd_path = Pathname.new("#{prefix}/MacOS/FreeCADCmd") + + ln_s freecad_path.relative_path_from(Pathname.new("#{HOMEBREW_PREFIX}/bin")), "#{HOMEBREW_PREFIX}/bin/freecad", +force: true + ln_s freecadcmd_path.relative_path_from(Pathname.new("#{HOMEBREW_PREFIX}/bin")), +"#{HOMEBREW_PREFIX}/bin/freecadcmd", force: true elsif OS.linux? ohai "the value of prefix = #{prefix}" - ln_s "#{bin}/FreeCAD", "#{HOMEBREW_PREFIX}/bin/freecad", force: true - ln_s "#{bin}/FreeCADCmd", "#{HOMEBREW_PREFIX}/bin/freecadcmd", force: true + freecad_path = Pathname.new("#{bin}/FreeCAD") + freecadcmd_path = Pathname.new("#{bin}/FreeCADCmd") + + ln_s freecad_path.relative_path_from(Pathname.new("#{HOMEBREW_PREFIX}/bin")), "#{HOMEBREW_PREFIX}/bin/freecad", +force: true + ln_s freecadcmd_path.relative_path_from(Pathname.new("#{HOMEBREW_PREFIX}/bin")), +"#{HOMEBREW_PREFIX}/bin/freecadcmd", force: true end end