Skip to content

Instantly share code, notes, and snippets.

@bartvandendriessche
Created February 24, 2011 19:36
Show Gist options
  • Save bartvandendriessche/842727 to your computer and use it in GitHub Desktop.
Save bartvandendriessche/842727 to your computer and use it in GitHub Desktop.
Brew formula that applies a quick patch to the fish source before installing. This patch fixes the "5 second freeze" fish on osx sometimes has.
require 'formula'
class Fishpatch < Formula
url 'http://downloads.sourceforge.net/project/fish/fish/1.23.1/fish-1.23.1.tar.bz2'
homepage 'http://fishshell.org/'
md5 'ead6b7c6cdb21f35a3d4aa1d5fa596f1'
depends_on 'readline'
skip_clean 'share/doc'
def install
system "sed -e 's/tv.tv_sec=5/tv.tv_sec=0/g' -e 's/tv.tv_usec=0/tv.tv_usec=10000/g' proc.c > temp.c"
system "mv temp.c proc.c"
system "./configure", "--prefix=#{prefix}", "--without-xsel"
system "make install"
end
def caveats
"You will need to add #{HOMEBREW_PREFIX}/bin/fish to /etc/shells\n"+
"Run `chsh -s #{HOMEBREW_PREFIX}/bin/fish' to make fish your default shell."
end
end
@bartvandendriessche
Copy link
Author

To install the patched fish, follow these steps:

  1. if you have fish installed already, uninstall it:
    $ brew uninstall
  2. download the script above and save it as /usr/local/Library/Formula/fispatch.rb
  3. install patched fish:
    $ brew install fishpatch

The actual fix was found in benhoskings' fish clone: https://github.com/benhoskings/fish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment