I'm trying to install an older version of CMake to compile a software that requires it (https://github.com/horosproject/horos)
If you use brew install cmake it will install 3.20 versions, but I need to install 3.19.2 to get the compilation to work.
You would think this would be easy but I have been struggling. Here are some things I have tried:
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/481056b12a782e11b43670f406b1674b05990d0d/Formula/cmake.rb && brew install ./cmake.rb
This command downloads the raw formula and then attempts to install based on some answers I have seen since the brew versions command is deprecated.
Attempting to run the command above gives me the following errors:
Warning: Calling `cellar` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256` with a `cellar:` argument instead.
Warning: Calling `sha256 "digest" => :tag` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Warning: Calling `sha256 "digest" => :tag` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Warning: Calling `sha256 "digest" => :tag` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Warning: Calling `sha256 "digest" => :tag` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Error: Failed to load cask: ./cmake.rb
Cask 'cmake' is unreadable: wrong constant name #<Class:0x00007fe8f24621b0>
Warning: Treating ./cmake.rb as a formula.
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/manifests/3.19.2
##O#- #
curl: (22) The requested URL returned error: 404
Error: Failed to download resource "cmake_bottle_manifest"
Download failed: https://ghcr.io/v2/homebrew/core/cmake/manifests/3.19.2
I think it's not working because I need authentication for the manifest download, but this should have worked before without any issues or anything like this required, leaving me to believe I'm probably doing something incorrect.
Any help is appreciated! A successful result would result in cmake --version saying it's version 3.19.2. Also I want to confirm that I know cmake is 100% the issue since I have the compilation of Horos working on my other machine.
Which leaves another possibility of me copying the cmake from there but I'm not sure how to do that correctly or how hard that would be? (if that is even proper procedure, not to mention that would not help future readers of this question).
Extra Info:
Here is an example of a formula I found for an older version of cmake.
https://github.com/Homebrew/homebrew-core/commits/master/Formula/cmake.rb
above is a list of all the different versions
strange part is... if you use this method with the newest bottle 3.20 it works!
UPDATE::
So I was reading another answer and it appears this error is caused by cURL being out of date. So I updated to the latest cURL (confirmed it still works with the newest version), then went back to the old and now I get a different error.
https://superuser.com/questions/1647213/brew-install-fails-downloading-from-ghcr-io-macos-mojave
The above is where I learned about the cURL version fix.
Now my error is this:
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/d1a6d9cec03e43ae276ab6423fba0b91b69a1945/Formula/cmake.rb && brew install ./cmake.rb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1961 100 1961 0 0 46229 0 --:--:-- --:--:-- --:--:-- 50282
/usr/local/Homebrew/Library/Homebrew/formulary.rb:84:in `rescue in block in load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:77:in `block in load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:90:in `load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:110:in `load_formula_from_path'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:195:in `load_file'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:185:in `klass'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:180:in `get_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:404:in `factory'
/usr/local/Homebrew/Library/Homebrew/cli/named_args.rb:98:in `load_formula_or_cask'
/usr/local/Homebrew/Library/Homebrew/cli/named_args.rb:57:in `block in to_formulae_and_casks'
/usr/local/Homebrew/Library/Homebrew/cli/named_args.rb:56:in `each'
/usr/local/Homebrew/Library/Homebrew/cli/named_args.rb:56:in `flat_map'
/usr/local/Homebrew/Library/Homebrew/cli/named_args.rb:56:in `to_formulae_and_casks'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:158:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:122:in `<main>'
Error: cmake: Calling `cellar` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256` with a `cellar:` argument instead
running brew style --fix ./cmake.rb will fix the error above but then I get the exact same error again!
brew install ./cmake.rb
Error: Failed to load cask: ./cmake.rb
Cask 'cmake' is unreadable: wrong constant name #<Class:0x00007fc2138b7f90>
Warning: Treating ./cmake.rb as a formula.
==> Downloading https://ghcr.io/v2/homebrew/core/cmake/manifests/3.19.2
curl: (22) The requested URL returned error: 404
Error: Failed to download resource "cmake_bottle_manifest"
Download failed: https://ghcr.io/v2/homebrew/core/cmake/manifests/3.19.2
I'm at wits end in frustration and seem to be going in circles. Any help is greatly appreciated!