I'm writing a homebrew formula, that installs a alternate clang version. As I want
both, the original, system-provided clang
and the modified clang in my PATH, I would like to rename the modified one to clang-omp
.
One attempt is to do this in the install-part of the formula. Sadly without success.
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-only
, and create install the binaries manually while changing the names.
Yet another approach (maybe the best) might be to configure the symlinks created in /usr/local/bin/*
. But I can't find any information on the symlink creation step.
In install
: mv bin/"clang", bin/"clang-omp"
Grepping through the installed formulas in e.g. /usr/local/Library/Formula can give you a good sense of what works.
According to this paragraph of the Homebrew formula cookbook documentation, one could rename a package by using the =>
notation, e.g.:
def install
bin.install "n3dr-macos-10.15" => "n3dr"
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With