After trying Fink for a short while and DarwinPorts for a bit longer, after finally downloading and compiling all my stuff manually, I decided to give Homebrew a try. I run an old Mac Mini with Mac OS 10.6.8 on it. I did the radical thing and deleted all the stuff I installed myself:
sudo mv /usr/local /Users/alex/Desktop
I’m hoping to list all the stuff I will subsequently install on this page. Wish me luck!
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" brew doctor brew tap homebrew/dupes # rsync brew install git brew install gnupg # gpg brew install w3m # view html files and browse the web in a terminal brew install rsync # backup brew install id3lib # id3info, id3tag brew install poppler # pdfimages brew install gnutls # starttls brew install bitlbee # IRC and instant messaging brew install nmap # portscanning brew install flvstreamer # download .flv files brew install ffmpeg # convert flv to mp3 brew install mpg321 # play them brew install gv # view pdf files in Emacs, requires https://xquartz.macosforge.org/landing/ brew install fdupes # find duplicate files brew install wget # wget is sometimes more intuitive than curl brew install pdfjam # resizing PDF files brew install sane-backends # scanner brew install trash # use from the commandline to trash instead of delete brew install --HEAD avidemux # simple video editing
brew rmtree to delete unused dependencies.
$ brew tap beeftornado/rmtree && brew install beeftornado/rmtree/brew-rmtree
Don’t forget to
brew cleanup every now and then!
curl -kL http://install.perlbrew.pl | bash perlbrew install perl-stable perlbrew install-cpanm cpanm --notest XML::LibXML cpanm Captcha::reCAPTCHA ...
alex@Megabombus:~$ emacs dyld: Library not loaded: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.3.dylib Referenced from: /usr/local/bin/emacs Reason: image not found Abort trap: 6
alex@Megabombus:~$ brew reinstall emacs-mac ==> Reinstalling railwaycat/emacsmacport/emacs-mac --with-xml2 --with-official-icon --with-gnutls --with-imagemagick ==> Downloading https://bitbucket.org/mituharu/emacs-mac/get/emacs-25.1-mac-6.1.tar.gz Already downloaded: /Users/alex/Library/Caches/Homebrew/emacs-mac-emacs-25.1-z-mac-6.1.tar.gz ==> Downloading https://s3.amazonaws.com/emacs-mac-port/Emacs25.icns Already downloaded: /Users/alex/Library/Caches/Homebrew/emacs-mac--official-icon-25.icns ==> ./autogen.sh ==> ./configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.1/shar ==> make ... ==> Summary 🍺 /usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.1: 4,067 files, 109.7M, built in 20 minutes 31 seconds
I did not about this:
alex@Megabombus:~$ brew cleanup ... ==> This operation has freed approximately 8.1G of disk space.
I wanted to use
GD::Barcode::QRcode but it would not work. Was
GD not installed? I tried to install it using
cpanm GD but it wouldn’t work. Tests kept failing.
I had something installed via Homebrew. OK, so
brew unlink gd and see whether that helps. Now try installing
cpanm GD and I get a different problem. Apparently my
libgd is borked. I see unmet recommended dependencies when looking at
brew info libgd. One strikes me as particularly odd: no
libpng installed. Trying
brew reinstall libgd now. Regenerating the font cache seems to take a while.
I am already regretting this.
And indeed, it doesn’t help.
cpanm GD still fails.
alex@Megabombus:~/.cpanm/work/1480171923.14458/GD-2.56$ prove -v -b -l t/GD.t t/GD.t .. 1..11 ok 1 - use GD; ok 2 - use GD::Simple; # Testing using gd2 support. ok 3 - image comparison test 1 ok 4 - image comparison test 2 ok 5 - image comparison test 3 ok 6 - image comparison test 4 ok 7 - image comparison test 5 ok 8 - image comparison test 6 not ok 9 - image comparison test 7 ok 10 - round trip gd ok 11 - round trip gd2 # Failed test 'image comparison test 7' # at t/GD.t line 249. # Looks like you failed 1 test of 11. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/11 subtests Test Summary Report ------------------- t/GD.t (Wstat: 256 Tests: 11 Failed: 1) Failed test: 9 Non-zero exit status: 1 Files=1, Tests=11, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.16 cusr 0.03 csys = 0.24 CPU) Result: FAIL
Looking at the test code, it seems that the essential bits are related to fonts:
# Some TTFs $im->stringFT($black,FONT,12.0,0.0,20,20,"Hello world!") || warn $@; $im->stringFT($red,FONT,14.0,0.0,20,80,"Hello world!") || warn $@; $im->stringFT($blue,FONT,30.0,-0.5,60,100,"Goodbye cruel world!") || warn $@;
cpanm -f GD…
Same procedure as always, one would think. But somehow, it manages to be different every single time.
This is what I want:
alex@Megabombus:~$ brew install railwaycat/emacsmacport/emacs-mac --with-gnutls --with-imagemagick --with-official-icon --with-xml2 ==> Installing emacs-mac from railwaycat/emacsmacport ...
Homebrew also wanted me to do some other stuff, oh well.
alex@Megabombus:~$ sudo chown root:wheel /usr/local alex@Megabombus:~$ sudo mv /opt/homebrew-cask/Caskroom /usr/local
w3m is a text browser. I use it a lot if I need to test stuff. Recently, I got an email saying that Emacs Wiki had an invalid certificate. Everything seemed to be fine, however. But a few minutes ago, I tried to run
w3m https://www.emacswiki.org/ from my Terminal (OSX El Capitan) and got an SSL error.
alex@Megabombus:~$ w3m -dump_extra https://www.emacswiki.org/ SSL error: error:00000000:lib(0):func(0):reason(0) w3m: Can't load https://www.emacswiki.org/.
As it turns out, a simple reinstall switched from libssl 0.9.8 to 1.0.0 and now it works.
alex@Megabombus:~$ otool -L `which w3m` /usr/local/bin/w3m: /usr/local/lib/libgc.1.dylib (compatibility version 2.0.0, current version 2.3.0) /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 50.0.0) /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 50.0.0) /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) alex@Megabombus:~$ brew reinstall w3m ==> Reinstalling w3m ==> Downloading https://homebrew.bintray.com/bottles/w3m-0.5.3.el_capitan.bottle.tar.gz ######################################################################## 100,0% ==> Pouring w3m-0.5.3.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/w3m/0.5.3: 23 files, 1.7M alex@Megabombus:~$ otool -L `which w3m` /usr/local/bin/w3m: /usr/local/opt/bdw-gc/lib/libgc.1.dylib (compatibility version 2.0.0, current version 2.3.0) /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
How does one remove all the unused dependencies hanging around? I have no idea. If you want to remove a particular package and all it’s unused dependencies, you could use brew rmtree.
Yesterday, I used something different: First, I used
brew leaves to create a list of stuff that isn’t a dependency for anything else I have installed. Then I edited this list down to the stuff I wanted to keep and ran brew_clean on it.
This removed a lot of packages, but also resulted in many messages like these:
Uninstalling /usr/local/Cellar/glibmm/2.46.3... (1,674 files, 43.6M) glibmm 2.40.0, 2.42.0, 2.44.0 are still installed. Remove them all with `brew uninstall --force glibmm`.
So I had to go through the output and manually uninstall the older versions.
$ brew uninstall --force glibmm Uninstalling glibmm... (4,832 files, 113.4M)
I didn’t know brew was keeping so many old versions around! I should have used brew cleanup.
Just to be sure, I ran it.
$ brew cleanup ... ==> This operation has freed approximately 6.8G of disk space.
Wow! I don’t think I ran this, ever.
I had a few messages saying that I had not installed the latest version:
Warning: Skipping homebrew/dupes/rsync: most recent version 3.1.2 not installed
brew upgrade followed it by another
==> This operation has freed approximately 5.6G of disk space.
This is amazing.
My take away:
brew leavesand delete packages you no longer care about
brew rmtreeand use it when deleting packages in order to delete former dependencies
brew cleanupevery now and then to delete old versions
A reminder for my future self: When fixing something in
/usr/local (which is the domain of Homebrew, just commit it, and then:
git push email@example.com:kensanata/homebrew.git
Also, as noted in the pull request: “For future reference the preferred commit message format for simple version updates is libcaca 0.99b19.”
You are welcome, future me.
Also, I managed to make a mess of merges, consecutive commits, pushed and all, and now I’m confused. Aaargh!
It all started with this:
alex@Megabombus:~$ inkscape dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib Referenced from: /usr/local/bin/inkscape Reason: image not found Trace/BPT trap: 5
It seemed I had 1.5 and 1.6 in the Homebrew Cellar, but only 1.6 was installed. I tried to have both libraries linked but missed this hint:
ln -s /usr/local/Cellar/libpng/1.5.18/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib
(It would have been 1.5.17 in my case.)
Instead I deleted both versions of libpng and hoped that reinstalling all the stuff would work.
brew update && brew upgrade
But look at this:
alex@Megabombus:~$ brew reinstall inkscape ==> Reinstalling inkscape intltool: Unsatisfied dependency: XML::Parser Homebrew does not provide Perl dependencies; install with: cpan -i XML::Parser Error: An unsatisfied requirement failed this build.
Now we’re switching from Homebrew issues to Perl issues!
alex@Megabombus:~$ cpanm XML::Parser --> Working on XML::Parser Fetching http://www.cpan.org/authors/id/T/TO/TODDR/XML-Parser-2.41.tar.gz ... OK Configuring XML-Parser-2.41 ... OK Building and testing XML-Parser-2.41 ... FAIL ! Installing XML::Parser failed. See /Users/alex/.cpanm/work/1398513458.18494/build.log for details. Retry with --force to force install it. alex@Megabombus:~$ less /Users/alex/.cpanm/work/1398513458.18494/build.log
Looking at the log file:
PERL_DL_NONLAZY=1 /Users/alex/perl5/perlbrew/perls/perl-5.18.1/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t Can't load '/Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/arch/auto/XML/Parser/Expat/Expat.bundle' for module XML::Parser::Expat: dlopen(/Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/arch/auto/XML/Parser/Expat/Expat.bundle, 2): no suitable image found. Did find: /Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/arch/auto/XML/Parser/Expat/Expat.bundle: mach-o, but wrong architecture at /Users/alex/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1/darwin-2level/DynaLoader.pm line 194. at /Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/lib/XML/Parser.pm line 18. Compilation failed in require at /Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/lib/XML/Parser.pm line 18.
WTF “wrong architecture”? Now I’m thinking of our recent upgrade of the laptop to OSX Mavericks. Oh, and before that I migrated my account from the old Mac Mini using Mac OS 10.6.8 to this laptop… Considering that we’re using Perlbrew and that the resulting Perl is stored in my home directory, this might indeed be an issue.
Thus, deeper into the rabbit hole we go!
alex@Megabombus:~$ perlbrew install perl-stable Fetching perl 5.18.2 as /Users/alex/perl5/perlbrew/dists/perl-5.18.2.tar.bz2 Download http://www.cpan.org/src/5.0/perl-5.18.2.tar.bz2 to /Users/alex/perl5/perlbrew/dists/perl-5.18.2.tar.bz2 Installing /Users/alex/perl5/perlbrew/build/perl-5.18.2 into ~/perl5/perlbrew/perls/perl-5.18.2 ...
I think I will go and take some pretty pictures in the mean time.
In the end, everything seems to be ready.
alex@Megabombus:~$ cpanm XML::Parser ! ! Can't write to /Library/Perl/5.16 and /usr/local/bin: Installing modules to /Users/alex/perl5 ! To turn off this warning, you have to do one of the following: ! - run me as a root or with --sudo option (to install to /Library/Perl/5.16 and /usr/local/bin) ! - Configure local::lib your existing local::lib in this shell to set PERL_MM_OPT etc. ! - Install local::lib by running the following commands ! ! cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) ! XML::Parser is up to date. (2.41) alex@Megabombus:~$ cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) --> Working on local::lib Fetching http://www.cpan.org/authors/id/E/ET/ETHER/local-lib-2.000011.tar.gz ... OK Configuring local-lib-2.000011 ... OK ==> Found dependencies: ExtUtils::MakeMaker --> Working on ExtUtils::MakeMaker Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-6.96.tar.gz ... OK Configuring ExtUtils-MakeMaker-6.96 ... OK Building and testing ExtUtils-MakeMaker-6.96 ... OK Successfully installed ExtUtils-MakeMaker-6.96 (upgraded from 6.63_02) Building and testing local-lib-2.000011 ... OK Successfully installed local-lib-2.000011 2 distributions installed
I did notice something strange, though. When I opened a new terminal:
ERROR: The installation "perl-5.18.1" is unknown.
I had to manually change perl-5.18.1 to perl-5.18.2 in my
# DO NOT EDIT THIS FILE export PERLBREW_MANPATH="/Users/alex/perl5/perlbrew/perls/perl-5.18.2/man" export PERLBREW_PATH="/Users/alex/perl5/perlbrew/bin:/Users/alex/perl5/perlbrew/perls/perl-5.18.2/bin" export PERLBREW_PERL="perl-5.18.2" export PERLBREW_ROOT="/Users/alex/perl5/perlbrew" export PERLBREW_VERSION="0.66"
Yeah, ignore the comment on the first line. I wonder why perlbrew didn’t do this automatically when I uninstalled 5.18.1 and installed 5.18.2. Oh well.
And now, Inkscape!
alex@Megabombus:~$ brew reinstall inkscape ==> Reinstalling inkscape ==> Installing inkscape dependency: boost-build ==> Downloading https://github.com/boostorg/build/archive/boost-1.55.0.tar.gz ######################################################################## 100.0% ==> ./bootstrap.sh =º /usr/local/Cellar/boost-build/1.55.0: 269 files, 3.0M, built in 65 seconds ==> Installing inkscape ==> Downloading https://downloads.sourceforge.net/project/inkscape/inkscape/0.48.4/inkscape-0.48.4.tar.gz Already downloaded: /Library/Caches/Homebrew/inkscape-0.48.4.tar.gz ==> ./configure --prefix=/usr/local/Cellar/inkscape/0.48.4 --enable-lcms --disable-poppler-cairo ==> make install collect2: ld returned 1 exit status make: *** [inkview] Error 1 make: *** Waiting for unfinished jobs.... make: *** [inkscape] Error 1 make: *** [install-recursive] Error 1 READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting These open issues may also help: inkscape fails on 10.9.2 (https://github.com/Homebrew/homebrew/issues/28556)
OK, following the instructions of mistydemeo:
alex@Megabombus:~$ rm -rf /Library/Caches/Homebrew/inkscape--bzr alex@Megabombus:~$ brew install inkscape --HEAD Warning: inkscape-HEAD already installed alex@Megabombus:~$ brew uninstall inkscape Uninstalling /usr/local/Cellar/inkscape/HEAD... alex@Megabombus:~$ brew install inkscape --HEAD ==> Cloning lp:inkscape/0.48.x Not checking SSL certificate for xmlrpc.launchpad.net. You have not informed bzr of your Launchpad ID, and you must do this to write to Launchpad or access private data. See "bzr help launchpad-login". ==> ./autogen.sh/s / Build phase:Apply phase:adding file 280/282 ==> ./configure --prefix=/usr/local/Cellar/inkscape/HEAD --enable-lcms --disable-poppler-cairo ==> make install 🍺 /usr/local/Cellar/inkscape/HEAD: 853 files, 81M, built in 22.6 minutes
Testing… YES!! 😺 👍