Skip to content

Commit

Permalink
Fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
froch committed Jul 3, 2024
1 parent 96303c2 commit 89622ac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:

- run: brew test-bot --only-tap-syntax

- run: brew test-bot --only-formulae
- run: |
brew install golang
brew test-bot --only-formulae
if: github.event_name == 'pull_request'
- name: Upload bottles as artifact
Expand Down
17 changes: 13 additions & 4 deletions lib/base.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "macho" # Ensure ruby-macho is required

class XiondBase < Formula
desc "Generalized Blockchain Abstraction Layer"
homepage "https://xion.burnt.com"
Expand All @@ -19,7 +17,7 @@ def self.init(version, sha256)
def install
# Homebrew forces us to download a tarball; this kills the git information
# So for `xiond version` to work after build, we need to fetch tags ie. nuke buildpath and clone the repo
Dir.chdir("/tmp") do
Dir.mktmpdir do
remove_dir(buildpath, true)
Dir.mkdir(buildpath)
system "git", "clone", "--depth", "1", "--branch", "v#{version}", "https://github.com/burnt-labs/xion.git", buildpath
Expand Down Expand Up @@ -76,10 +74,21 @@ def compile_and_install_xiond

system "make", "install"
bin.install "#{ENV.fetch("GOPATH", nil)}/bin/xiond"
end

# Homebrew linting fails on this system call
# it stubbornly requires a dependency on ruby-macho instead
# GTFO
def post_install
return unless OS.mac?

MachO::Tools.add_rpath("#{bin}/xiond", "#{HOMEBREW_PREFIX}/lib")
rpath = "#{HOMEBREW_PREFIX}/lib"
executable = "#{bin}/xiond"

# Check if the executable exists and modify the rpath
return unless File.exist?(executable)

system "install_name_tool", "-add_rpath", rpath, executable

Check failure on line 91 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

FormulaAudit/Miscellaneous: Use ruby-macho instead of calling "install_name_tool"

Check failure on line 91 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

FormulaAudit/Miscellaneous: Use ruby-macho instead of calling "install_name_tool"
end

def determine_libwasmvm_suffix
Expand Down

0 comments on commit 89622ac

Please sign in to comment.