diff options
| author | Geoff Nixon | 2014-02-11 17:24:10 -0800 |
|---|---|---|
| committer | Mike McQuaid | 2014-03-08 00:46:42 +0000 |
| commit | eeaf6985b1b5af26d11f3c9f28aa8f669f41a69b (patch) | |
| tree | d5b7cc984cd30bc48a8b905034a6f85f2e83f44e | |
| parent | e96d7a50f3a69f87eeda6a82918475bb0d006b7d (diff) | |
| download | homebrew-eeaf6985b1b5af26d11f3c9f28aa8f669f41a69b.tar.bz2 | |
ksh 93u+
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Closes #26644.
| -rw-r--r-- | Library/Formula/ksh.rb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Library/Formula/ksh.rb b/Library/Formula/ksh.rb new file mode 100644 index 000000000..be2c50049 --- /dev/null +++ b/Library/Formula/ksh.rb @@ -0,0 +1,53 @@ +require "formula" + +class KshDownloadStrategy < NoUnzipCurlDownloadStrategy + # AT&T requires the following credentials to "assent" to the OSS license. + def credentials + "I.accept.www.opensource.org.licenses.eclipse:." + end + + def curl(*args) + args << "-u" << credentials + super + end +end + +class Ksh < Formula + homepage "http://www.kornshell.com" + url "http://www2.research.att.com/~astopen/download/tgz/ast-ksh.2012-08-01.tgz", + :using => KshDownloadStrategy + sha1 "316428e9937806183a134aa1669dea40c3a73695" + version "93u+" # Versioning scheme: + means "+ patches", - means "beta/alpha". + + resource "init" do + url "http://www2.research.att.com/~astopen/download/tgz/INIT.2012-08-01.tgz", + :using => KshDownloadStrategy + sha1 "0b472a615db384fe707042baaa3347dc1aa1c81e" + end + + def install + (buildpath/"lib/package/tgz").install resource("init"), Dir["*.tgz"] + + system "tar", "xzf", "lib/package/tgz/INIT.2012-08-01.tgz" + system "/bin/ksh", "bin/package", "read" + + # Needed due to unusal build system. + ENV["HOMEBREW_CCCFG"] += "O" + + # From Apple"s ksh makefile. + kshcppdefines = "-DSHOPT_SPAWN=0 -D_ast_int8_t=int64_t -D_lib_memccpy" + system "/bin/ksh", "bin/package", "make", "CCFLAGS=#{kshcppdefines}" + + bin.install "arch/darwin.i386-64/bin/ksh" => "ksh93" + ln_s "#{bin}/ksh93", "#{bin}/ksh" + + man1.install "arch/darwin.i386-64/man/man1/sh.1" => "ksh93.1" + ln_s "#{man}/ksh93.1", "#{man}/ksh.1" + end + + def caveats; <<-EOS.undent + We have agreed to the Eclipse Public License on your behalf. + If this is unacceptable for any reason, please uninstall. + EOS + end +end |
