Skip to content

Commit

Permalink
Yeet.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Sep 3, 2024
1 parent 2f30bd0 commit c0b0e48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions brew-pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def patchelf(root_dir, prefix_path, binary)
# Get the list of linked libraries with otool
stdout, status = Open3.capture2("otool -L #{binary_path}")

# TODO: Remove
# Debug information
ohai "Before patching:"
ohai "#{stdout}"

# Remove the first line which is unnecesary
Expand All @@ -50,8 +51,9 @@ def patchelf(root_dir, prefix_path, binary)
# Patch the library path relative to the binary path
system("install_name_tool", "-change", lib, new_lib, binary_path)

# TODO: Remove
# Debug information
stdout, status = Open3.capture2("otool -L #{binary_path}")
ohai "After patching:"
ohai "#{stdout}"
ohai "patchelf(#{root_dir}, #{prefix_path}, #{lib.delete_prefix(prefix_path)})"

Expand Down Expand Up @@ -206,6 +208,8 @@ def pkg
ohai "Staging directory #{HOMEBREW_CELLAR}/#{formula.name}/#{dep_version}"
safe_system "mkdir", "-p", "#{staging_root}/Cellar/#{formula.name}/"
safe_system "rsync", "-a", "#{HOMEBREW_CELLAR}/#{formula.name}/#{dep_version}", "#{staging_root}/Cellar/#{formula.name}/"
safe_system "mkdir", "-p", "#{staging_root}/opt"
safe_system "ln", "-s", "#{staging_root}/Cellar/#{formula.name}/#{dep_version}", "#{staging_root}/opt/#{formula.name}"
end
end

Expand Down

0 comments on commit c0b0e48

Please sign in to comment.