Created
November 2, 2013 02:12
-
-
Save erochest/7274727 to your computer and use it in GitHub Desktop.
Using `cabal-install` to generate installable package for [brew](http://brew.sh/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USAGE=<<EOF | |
cabal-brew PACKAGE VERSION | |
EOF | |
CABAL=cabal | |
package="$1" | |
keg="cabal-$package" | |
version="$2" | |
sandbox="/usr/local/Cellar/$keg/$version" | |
if [ -d /usr/local/Cellar/$keg ] ; then | |
echo "Cleaning out old keg for $keg" | |
brew unlink $keg | |
rm -rf /usr/local/Cellar/$keg | |
fi | |
pushd /tmp | |
[ -f cabal.sandbox.config ] && rm cabal.sandbox.config | |
echo "$CABAL $package-$version => $sandbox" | |
${CABAL} sandbox init --sandbox=$sandbox | |
${CABAL} install $package-$version | |
brew link --overwrite $keg | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment