Skip to content

Instantly share code, notes, and snippets.

@mt3
Created April 26, 2010 18:47
Show Gist options
  • Save mt3/379720 to your computer and use it in GitHub Desktop.
Save mt3/379720 to your computer and use it in GitHub Desktop.
class StanfordParser <Formula
url 'http://nlp.stanford.edu/software/stanford-parser-2010-02-26.tgz'
homepage 'http://nlp.stanford.edu/software/lex-parser.shtml'
md5 '25e26c79d221685956d2442592321027'
version '1.6.2'
JAR = 'stanford-parser.jar'
def install
# install files into directories
(prefix+"lib").install Dir["*.jar"]
prefix.install Dir["*"]
# install a shell script in bin that executes .jar file using the script at bottom of file
(bin+'stanford_parser').write(eval('"'+DATA.read+'"'))
# create symlinks
FileUtils.ln_s "#{prefix}/lexparser.csh", "#{HOMEBREW_PREFIX}/bin/"
FileUtils.ln_s "#{prefix}/makeSerialized.csh", "#{HOMEBREW_PREFIX}/bin/"
FileUtils.ln_s "#{prefix}/lexparser-ar-rosetta.sh", "#{HOMEBREW_PREFIX}/bin/"
FileUtils.ln_s "#{prefix}/lexparser-gui.csh", "#{HOMEBREW_PREFIX}/bin/"
#remove Windows files
rm Dir["#{prefix}/*.{bat,dll,exe}"]
end
def caveats
"This software requires Java 5 (JDK 1.5.0+).
Check that the command \"java -version\" works and gives 1.5+."
end
end
!/bin/sh
echo "some scripted stuff here"
@adamv
Copy link

adamv commented Apr 26, 2010

Line 10 can just be "lib.install", since (prefix+"lib") is already defined as lib.

Lines 17-20 could perhaps be in a loop over the filenames.

Line 23, to remove Windows files, should be done at the top of install; we like to remove files before install instead of after.

Not sure that the caveats is needed; what OS X machines don't have JDK 1.5 installed?

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