Homebrew

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

Use 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!

Perl

Possibly related… :)

curl -kL http://install.perlbrew.pl | bash
perlbrew install perl-stable
perlbrew install-cpanm
cpanm --notest XML::LibXML
cpanm Captcha::reCAPTCHA
...

2016-09-21 OSX Emacs

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

Tags:

Add Comment

2016-07-18 w3m and Emacs Wiki

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/.

Thanks to twb on #emacs, I found the problem. He said: “What’s ldd called on OS X? Find out if w3m is using gnutls or openssl.” The equivalent to ldd on OSX is otool -L.

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)

Tags:

Add Comment

2016-03-24 Homebrew, Uninstalling

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

I ran brew upgrade followed it by another brew clean.

==> This operation has freed approximately 5.6G of disk space.

This is amazing.

My take away:

  1. check the output of brew leaves and delete packages you no longer care about
  2. install brew rmtree and use it when deleting packages in order to delete former dependencies
  3. run brew cleanup every now and then to delete old versions

Tags: RSS

Add Comment

2014-06-04 Homebrew, GitHub

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 git@github.com:kensanata/homebrew.git

Commits will show up in my Homebrew fork and I’ll be able to create a pull request from there. Such as this one.

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!

Tags: RSS RSS

Add Comment

2014-04-26 Down the rabbit hole of software installing

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 ~/.perlbrew/init file:

# 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[1]: *** [inkview] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [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)

Whaaaaaat!?

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!! ๐Ÿ˜บ ๐Ÿ‘

Tags: RSS RSS RSS

Add Comment

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.