Renaming files in the installation part of the homebrew formula

I am writing a homegrown formula that installs an alternative version of clang. As I want both the original, system clangand modified clang in my PATH, I would like to rename the changed to clang-omp.

One attempt to do this in the installation part of the formula. Unfortunately, unsuccessfully.

def install
  #...
  system "./configure", "--prefix=#{prefix}"
  system "make", "install"

  # The following isn't working:
  (bin/'clang').mv 'clang-omp'
  (bin/'clang++').mv 'clang++-omp'
end

Another idea was to mark the formula as keg-onlyand create a binary installation manually when changing the names.

Another approach (perhaps the best) is to customize the symbolic links created in /usr/local/bin/*. But I can not find information on the step of creating a symbolic link.

+4
source share
1 answer

install: mv bin/"clang", bin/"clang-omp"

, . /usr/local/Library/Formula , .

+3

All Articles