How to link brew-cask make to brew cmake - macos

I did brew cask install cmake, but when I was about to brew install something, brew wants to install cmake.
How can I let brew know that there's already cmake available?

You can’t. Homebrew and Homebrew Cask are separate projects that install things in different ways. Homebrew assumes you don’t have cmake if it’s not installed through Homebrew so it’ll refuse to install even if a cmake binary exists in the PATH. It has no way to ensure this cmake binary is indeed the cmake it’s looking for.
A hacky way would be to edit the formula you want to install (brew edit <formula>); remove the line with depends_on "cmake" => :build; install it (brew install <formula>); then add the line back again.

Related

Assign dependencies python version while brew installing

New for homebrew
Now want to install autojump via brew install autojump, which need to install python#3.9 as denpendency. I already have python#3.8 installed via brew and don't want an another version.
python#3.8 also satisfy autojump from it's homgpage
Impossible, that's not how Homebrew works.
Installing autojump with homebrew is basically
Creating a virtual environment with Python#3.9 (Homebrew always chooses the latest Python)
Install autojump package in that environment.
Unless you modify the autojump homebrew formula, You can't reuse python#3.8.
You can try the following
brew install autojump --ignore-dependencies

How to handle Homebrew formula dependencies after having installed an older version

For various project-specific reasons, I have downgraded my boost (and boost-python) Homebrew installation to boost159 from boost (aka Boost 1.62.0 as of the writing of this question). The homebrew/versions/boost159 and boost-python159 formulas are keg-only and therefore I had to link them manually:
brew tap homebrew/versions
brew remove --force boost
brew remove --force boost-python
brew install boost159
brew link --force --overwrite boost159
brew install boost-python159
brew link --force --overwrite boost-python159
So far so good. But then, when I want to install some unrelated Homebrew formula that has a dependency on boost, Homebrew tries to brew install boost (Boost 1.62.0) and fails to link it:
[34m==>[0m [1mPouring boost-1.62.0.el_capitan.bottle.tar.gz[0m
[31mError:[0m The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/boost/accumulators/accumulators.hpp
Target /usr/local/include/boost/accumulators/accumulators.hpp
is a symlink belonging to boost159. You can unlink it:
brew unlink boost159
To force the link and overwrite all conflicting files:
brew link --overwrite boost
To list all files that would be deleted:
brew link --overwrite --dry-run boost
Possible conflicting files are:
/usr/local/include/boost/accumulators/accumulators.hpp -> /usr/local/Cellar/boost159/1.59.0/include/boost/accumulators/accumulators.hpp
[...]
Is there a way to make other formulas use boost159 instead of boost ? Please note that boost159 must be linked for other parts of the projects (not in my control) to work. That is, I can't leave it unlinked and set build variables instead.
PS. This is all taking place in a CI build actually, making the error much more disruptive.
References
Homebrew install specific version of formula?
Probably you just have to patch your local formulas. In my opinion the whole versions support in brew is an unholy hack and one of the reasons why I do not use brew for build time development dependencies.

Installing GLFW on OSX

I've been all over the internet and I simply cannot find a way to install GLFW for OSX and use it with Xcode. A lot of articles use cmake for this, which I tried to install but I still can't access it from the terminal.
I just need a simple step-by-step guide for installing it because I'm going to lose my mind.
Thanks
I use homebrew to install GLFW. Once brew has been configured, use the commands
brew tap homebrew/versions
brew install --build-bottle --static glfw2
If you are still running into trouble with this and want to use homebrew, change the install command to reflect the newer GLFW version (3 as of this writing)
brew tap homebrew/versions
brew install --build-bottle --static glfw3

CMake GUI on Mac

I can't find where I can get the GUI tool for CMake on MacOSX. I see references to it online but nothing else. I got CMake using MacPorts but on Windows I am used to using the GUI.
Does it exist on Mac and where/how do I get it?
you need to install the gui variant:
sudo port install cmake +gui
you may need to run sudo port uninstall cmake first.
Cask is outdated now. You can install cmake using:
brew install --cask cmake
Try installing the cmake GUI using brew cask
brew cask install cmake
how to install brew cask
Install Homebrew first How to install homebrew
Add the brew cask to using the command brew tap caskroom/cask
here it is:
http://www.cmake.org/cmake/resources/software.html
extra plugins will imported by their own extensions so no OS compatibility is needed ;)

Install autoreconf on OS X v10.7 (Lion)?

I'm attempting to re-install Ruby 1.9.3 with a patch that will allow me to use ruby-debug.
When following the instructions and running
rvm reinstall 1.9.3 --patch debug --force-autoconf
It runs through and after applying the patch spits out:
rvm requires autoreconf to install the selected ruby interpreter however autoreconf was not found in the PATH.
Unfortunately, googling around for how to install autoreconf on OS X v10.7 (Lion) (or much information about it at all) seems to be a dead end.
If you are using Homebrew, try
brew install automake
Which should also install autoconf and allow rvm to finish installing.
If you want to do this using MacPorts instead of Homebrew, you can do:
sudo port install automake autoconf libtool
I had the same problem and this solved it for me.
If you're using brew, then the autoreconf utility is part of the autoconf package, so install it via:
brew install autoconf
If the problem persists, consider either reinstall or link it again. Use locate autoreconf to find out where it is.
Also check if /usr/local/bin/autoreconf exists (and is linked into the right place), and you've the /usr/local/bin path added in your /etc/paths file.
By downloading the .pkg file from MacPorts and installing it, it does the trick for me.
I had a similar problem, but because Homebrew moved away from the Cellar directory, but for some reasons binaries of this package were still there.
I reinstalled autoconf with the following command and autoreconf is in the right PATH now: brew reinstall autoconf
I solved my autoreconf problem adding the path to my shell:
sudo pico /etc/paths
then I added the line
/sw/bin
where I found the autoreconf and autoconf files and saved everything.
Since then I can use autoreconf without any problems.

Resources