Installing older version of imagemagick with homebrew - macos

I need to install an older version of imagemagick (6.5.9-3), I can see it in the list of available versions
> brew versions
6.6.1-5 git checkout 1c9f04e Library/Formula/imagemagick.rb
6.5.9-8 git checkout 685dbff Library/Formula/imagemagick.rb
6.5.9-3 git checkout 258720c Library/Formula/imagemagick.rb
6.5.6-5 git checkout 7c90d02 Library/Formula/imagemagick.rb
6.5.5-10 git checkout b01c13d Library/Formula/imagemagick.rb
but when I checkout that version with
> git checkout 258720c Library/Formula/imagemagick.rb
and then run
> brew install imagemagick
I get an error saying that
Error: imagemagick is a head-only formula
Install with `brew install --HEAD imagemagick
Why is brew listing those versions if it can't install them?
So the question remains, how to install an older version of imagemagick with brew?
(This solution is not working any longer: Cannot install older version of ImageMagick via Homebrew)
Thanks in advance for your help.

You can define your own Homebrew formula in a GitHub Gist and install it with
brew install path/to/your/GistToYourPersonalImageMagickFormula
for example here or here

If it's for Ruby 1.8.6 compatibility, or any 6.5.9-x version will do, there is an ImageMagick 6.5.9.x formula provided as imagemagick-ruby186 in the homebrew-versions tap. This will be easiest, and will be supported by future updates.
brew tap homebrew/versions
brew install imagemagick-ruby186
Those 6.5.9.x versions of the original imagemagick formula are so old that they may have compatibility problems with the current brew ruby scripts. (They currently give "Formulae require at least a URL" errors; your error was probably a similar issue.) To get those to install, you'll probably have to roll back all of Homebrew to that point in time before doing the build, with a git checkout on the entire repo, not just the one file.
That other answer you linked will fail for the same reason - it's another mechanism of doing the same thing, just acquiring the old version of the imagemagick.rb formula via the web instead of through git, so it'll have the same compatibility problems.

Related

When brew does not have latest package version

How do I force brew to install latest version of neovim (ver 0.5.0) when brew's formula only has 0.4.3?
I have tried:
brew update
brew upgrade neovim
And it says: Warning: neovim 0.4.3 already installed
I went brew's git repo and checked on neovim formula. Brew has neovim's 0.4.3, not 0.5.0. So brew update/upgrade is not going to help. https://github.com/Homebrew/homebrew-core/blob/master/Formula/neovim.rb
I'm thinking of just downloading neovim from neovim repo and installing it manually, but I'm afraid I'll have to manage updates and dependencies if I do this manual install.
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
tar xzf nvim-macos.tar.gz
./nvim-osx64/bin/nvim
What should I do?
I fixed this with the following steps:
1) Unlink old neovim version:
brew unlink neovim ... and 2)
Install pointing to head:
brew install --HEAD neovim
... This installed neovim 0.5.0.
According to the brew doc, brew install --HEAD will install the master branch of the package. For neovim, it means that the latest version of neovim will be built for you, which may not be stable enough or even compile.
I suggest you install the nightly binary version of neovim. The best way to get the nightly version is to download from the binary release. No dependency is required to install if you download the binary release.
If you don't want to do this manually, you can write a bash script to automate this.

OpenSSL 1.0.2m on macOS

For building one particular library I need openssl library version 1.0.2m with devel package. I am working on macOS. Using brew install openssl installs latest version 1.1.1d.
Since OpenSSL 1.0.2 is end of lifed by the end of 2019, it is no longer available via Homebrew. This is mentioned in the Homebrew 2.2.0 announcement.
It is fairly straightforward to build and install OpenSSL 1.0.2 yourself from source. You can download your required version from the Old 1.0.2 Releases page and follow the instructions found in INSTALL.
It may be possible as well to recover an older formula and install from that, but I can not guarantee how well that works. The following steps did complete the installation process:
$ git clone https://github.com/Homebrew/homebrew-core.git
$ cd homebrew-core
$ git checkout 75b57384 Formula/openssl.rb
$ brew install Formula/openssl.rb
For me, this showed:
Warning: openssl 1.1.1d is available and more recent than version 1.0.2m.
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2m.high_sierra.bottle.tar.gz
and went on happily after that. A quick try at the end gives some confidence that it worked out well:
$ /usr/local/opt/openssl/bin/openssl version
OpenSSL 1.0.2m 2 Nov 2017
If you prefer not to use git directly, you can also try downloading that version of openssl.rb from gitHub.com and run brew install on it.
If you wonder where that commit hash came from, I happened to know that the formula used to be called -- surprise -- openssl.rb (but using git to query for removed files would have worked as well). Therefore, I inspected the history for Formula/openssl.rb and found:
$ git log -- Formula/openssl.rb
...
commit 75b573845a17aaf3f7c84dc58e97cf5fe39a502b
Author: BrewTestBot <brew-test-bot#googlegroups.com>
Date: Thu Nov 2 17:20:33 2017 +0000
openssl: update 1.0.2m bottle.
Recently I was struggling due to the recent update in openssl version from 1.0 to 1.1 and wanted to revert it back to older version. No other solution except the one given below worked for me:
brew install rbenv/tap/openssl#1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl#1.0'
gem update --system
Instead of downloading the specific version of Formula/openssl.rb you can just use the raw reference to the file with the specific commit SHA as mentioned here.
So for the last update to version 1.0.2t the SHA is 8b9d6d688f483a0f33fcfc93d433de501b9c3513
commit 8b9d6d688f483a0f33fcfc93d433de501b9c3513
Author: BrewTestBot <homebrew-test-bot#lists.sfconservancy.org>
Date: Sat Sep 28 19:38:49 2019 +0000
openssl: update 1.0.2t bottle.
So I would execute the following command to install 1.0.2t.
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8b9d6d688f483a0f33fcfc93d433de501b9c3513/Formula/openssl.rb
1- Download the file:
wget https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
2 - Run brew with the file downloaded:
brew install openssl.rb
Other solutions won't work because you will get this error "Calling Installation of openssl from a GitHub commit URL is disabled! Use 'brew extract openssl' to stable tap on GitHub instead." the following steps will fix it:
First go to the local installation of homebrew
cd /usr/local/Homebrew/
Homebrew 2.5 remove the option to install formulas directly from git repos so we need to checkout an older version
git checkout 2.3.0
Install openssl latest 1.0.x version
HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Go back to current version of homebrew
git co -
Tell brew to use the old version of openssl this way you can chose wich version to use if you have both intalled
brew switch openssl 1.0.2t
Update - I think I've been getting downvotes because I've simply posted a link without the solution. So here's the solution:
Download this formula for OpenSSL V1.0 (It is patched to work with the arm64 processor)
Install it brew install openssl#1.0.rb
Add this version to the beginning of your PATH.
Note: Make sure that RVM is the last PATH variable change in your shell config file (.zshrc / .bashrc)
echo 'export PATH="/opt/homebrew/opt/openssl#1.0/bin:$PATH"' >> ~/.zshrc
Export some required environment variables
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.0/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.0/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl#1.0/lib/pkgconfig"
Reload your shell config source ~/.zshrc
Verify your openssl version
> openssl version
OpenSSL 1.0.2u 20 Dec 2019
Disable RVM autolibs rvm autolibs disable
Export some env variables to avoid compilation errors
export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC
export optflags="-Wno-error=implicit-function-declaration"
Install Ruby
rvm install 2.3.0 --with-openssl-dir=/opt/homebrew/opt/openssl#1.0
Ref
Maybe it's not a perfect idea, but it solved my problem (libssl.1.0.0.dylib image not found):
sudo ln -s /usr/lib/libssl.dylib /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
sudo ln -s /usr/lib/libcrypto.dylib /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Hope it works for you!
See this reply
Here is the linux-brew formula for openssl#1.0.2
brew install https://raw.githubusercontent.com/Homebrew/linuxbrew-core/20ab55b304597c6c47149dc0e50bd5f7ea45b678/Formula/openssl.rb

Homebrew: Can't install with options through brew (macOS Mojave)

I need to install sphinx via homebrew with flags, but there is error
$ brew install sphinx --mysql --pgsql
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
Usage: brew install [options] formula
Install formula.
formula is usually the name of the formula to install, but it can be specified
in several different ways.
Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will be run for the
installed formulae or, every 30 days, for all formulae.
--------------------------------------
Error: invalid option: --mysql
$ brew -v
Homebrew 2.1.6
Homebrew/homebrew-core (git revision bacd7; last commit 2019-06-25)
Homebrew/homebrew-cask (git revision 48e24; last commit 2019-06-25)
Try manticore (the sphinx fork). We added recently a tap, just brew tap manticoresoftware/tap && brew install manticoresearch. Formula compiles with support for all connectors (mysql,postgres,odbc).
--option support from hombrew-core formulae has been removed since Homebrew 2.0.0. Just the formulae repo homebrew-core, but not the brew command drops the support for --option, which means you can still define and use --option in your custom formula.
Release Note of Homebrew 2.0.0
Homebrew does not have any formulae with options in Homebrew/homebrew-core. Options will still be supported and encouraged by third-party taps. This change allows us to better focus on delivering binary packages rather than options. Formulae with options had to be built from source, could not be tested on our CI system and provided a disproportionate support burden on our volunteer maintainers.
If you wanna additional dependencies in a package, you have to modify the formula and build it by yourself.

git version and brew upgrade on different versions, no xcode, need fix

which git
gives me: /usr/bin/git
git --version
gives me: git version 1.8.5.2 (Apple Git-48)
brew upgrade git
gives me: Error: git-1.9.0 already installed
So I ask: What's up? and How do I fix it?
This is because you are using version of git that was installed not by brew. Brew stores its git install in the path /usr/local/bin/git You must remove the git that was not installed by brew, or change the order of your $PATHS to check /usr/local/(bin|sbin) first.

Command-line SVN client for Mac

I purchased a new Mac running Mac OS X v10.8.5 (Mountain Lion). I've seen it written in various places that SVN is installed on OS X by default, but when I open a terminal and type which svn the program is not found. I've also run find / -name svn to check if it's installed somewhere that hasn't been added the the PATH variable.
So it seems like svn is not installed. Where can I get an OS X version of the official command-line SVN client?
The default SVN version which is installed along with Xcode command line tools is 1.7.x. If you're fine with this version, than that should be enough. I want to select my SVN version and for that I'm using Homebrew.
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install SVN:
brew install svn
To install a specific SVN version, check available versions:
brew versions svn
This command will list all available SVN versions.
Here's how you can install other than the default version (based on this gist)
# Update brew
brew update
# Switch to brew base directory
cd $( brew --prefix )
# Check old versions
brew versions svn
# Here's sample output
1.8.9 git checkout 9b75c92 /usr/local/Library/Formula/subversion.rb
1.8.8 git checkout c6cf8ac /usr/local/Library/Formula/subversion.rb
1.8.5 git checkout fa4311c /usr/local/Library/Formula/subversion.rb
1.8.4 git checkout ce669eb /usr/local/Library/Formula/subversion.rb
1.8.3 git checkout 9b438ce /usr/local/Library/Formula/subversion.rb
1.8.0 git checkout f56b641 /usr/local/Library/Formula/subversion.rb
1.8.1 git checkout 55577bb /usr/local/Library/Formula/subversion.rb
1.7.10 git checkout 0060dc3 /usr/local/Library/Formula/subversion.rb
1.7.9 git checkout b0e6223 /usr/local/Library/Formula/subversion.rb
1.7.8 git checkout f7a42d2 /usr/local/Library/Formula/subversion.rb
1.7.7 git checkout a6dcc41 /usr/local/Library/Formula/subversion.rb
1.7.6 git checkout 6b8d25f /usr/local/Library/Formula/subversion.rb
1.7.5 git checkout 5d5cd70 /usr/local/Library/Formula/subversion.rb
1.7.4 git checkout dc4245c /usr/local/Library/Formula/subversion.rb
1.7.3 git checkout eb97154 /usr/local/Library/Formula/subversion.rb
1.7.2 git checkout d89bf83 /usr/local/Library/Formula/subversion.rb
1.6.17 git checkout 6e2d550 /usr/local/Library/Formula/subversion.rb
1.6.16 git checkout 83ed494 /usr/local/Library/Formula/subversion.rb
# Install SVN version 1.6.17. You can just copy line from output
git checkout 6e2d550 /usr/local/Library/Formula/subversion.rb
brew install subversion
# Switch to SVN version 1.6
brew switch subversion 1.6.17
Now that the older SVN version is installed, we can re-install the latest formula in order to keep our repository clean:
git checkout -- Library/Formula/subversion.rb
Now you can switch between versions using svn switch command.
Make sure that brew's executables are first in your environment path. Check in your .bash_profile that path is set as follows:
export PATH=/usr/local/bin:${PATH}
For me, it just worked with brew on MacOS version 10.15.4
COMMAND:- brew install svn
That is all, you will have an svn command-line client installed.
Happy Coding!
If you have HomeBrew installed,
try this command: brew install subversion
after that, brew link subversion
Hopefully, you will be good to go.
Subversion itself is no longer included with OS X. It's now included as part of Xcode. So one option is to install Xcode and then install the Command Line Tools. If you're not going to install Xcode anyway then you may be better off downloading a different installation of Subversion. On top of that the Xcode version is usually fairly behind on releases now.
So I'd suggest getting it from one of the sources on the Subversion Projects Binaries Page.
You can get SVN with Xcode, Homebrew, MacPorts, and probably other sources as well. The latter two options will probably stay more up to date than Xcode's installation.
Xcode's command line tools can be downloaded from here: https://developer.apple.com/downloads/index.action#
April 2014 version direct download link:
https://developer.apple.com/downloads/download.action?path=Developer_Tools/command_line_tools_os_x_mavericks_for_xcode__april_2014/command_line_tools_for_osx_mavericks_april_2014.dmg
For newer users or Mojave OS users:
I am using my MAC running Mojave OS. It seems that Apple fixed Mojave and updated OS so that SVN is added back again (it was not by default when Mojave was out). To check if you have SVN installed simple run terminal (command+space than type 'terminal' and press enter).
In terminal type :
svn --version
or:
svn help
If you don't see "unknown command", you have SVN installed already. Otherwise try updating Mojave OS in case you avoid auto updates.

Resources