2014-03-25 20:11:22 +00:00
|
|
|
class Cweb < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Literate documentation system for C, C++, and Java"
|
2014-03-25 20:11:22 +00:00
|
|
|
homepage "http://www-cs-faculty.stanford.edu/~uno/cweb.html"
|
|
|
|
url "ftp://ftp.cs.stanford.edu/pub/cweb/cweb-3.64ad.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "1f0bb7aa35b8d43b721d588ed5003620d38de1959652f23bac2847ffcb922c0f"
|
2014-03-25 20:11:22 +00:00
|
|
|
|
2014-03-26 16:24:24 +00:00
|
|
|
bottle do
|
2015-09-11 21:06:15 +00:00
|
|
|
revision 1
|
2016-02-23 21:33:00 +00:00
|
|
|
sha256 "2bc79b1783f9701b3f097ed1889686fbaf32dca3b3705f4130a251d004ee3683" => :el_capitan
|
2015-09-11 21:06:15 +00:00
|
|
|
sha256 "a70e1ba0613457638f5d41ef9aab280bfa4a98420f216ffec96ec4f313f3a825" => :yosemite
|
|
|
|
sha256 "6cca8e442e3722b5467677cd2a80a56375cb6ed513c8adfc1dee33b348db1bb9" => :mavericks
|
|
|
|
sha256 "8d678b6d7b67027135ebc455bfe003065b98f27180f2f4117ee21e0aeca788ab" => :mountain_lion
|
2014-03-26 16:24:24 +00:00
|
|
|
end
|
|
|
|
|
2014-03-25 20:11:22 +00:00
|
|
|
def install
|
|
|
|
ENV.deparallelize
|
|
|
|
|
|
|
|
macrosdir = (share/"texmf/tex/generic")
|
2015-07-05 19:37:29 +00:00
|
|
|
emacsdir = (share/"emacs/site-lisp/cweb")
|
2014-03-25 20:11:22 +00:00
|
|
|
cwebinputs = (lib/"cweb")
|
|
|
|
|
|
|
|
# make install doesn't use `mkdir -p` so this is needed
|
2015-08-03 12:55:31 +00:00
|
|
|
[bin, man1, macrosdir, emacsdir, cwebinputs].each(&:mkpath)
|
2014-03-25 20:11:22 +00:00
|
|
|
|
|
|
|
system "make", "install",
|
|
|
|
"DESTDIR=#{bin}/",
|
|
|
|
"MANDIR=#{man1}",
|
|
|
|
"MANEXT=1",
|
|
|
|
"MACROSDIR=#{macrosdir}",
|
|
|
|
"EMACSDIR=#{emacsdir}",
|
|
|
|
"CWEBINPUTS=#{cwebinputs}"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.w").write <<-EOS.undent
|
|
|
|
@* Hello World
|
|
|
|
This is a minimal program written in CWEB.
|
|
|
|
|
|
|
|
@c
|
|
|
|
#include <stdio.h>
|
|
|
|
void main() {
|
|
|
|
printf("Hello world!");
|
|
|
|
}
|
|
|
|
EOS
|
2014-05-20 16:16:03 +00:00
|
|
|
system bin/"ctangle", "test.w"
|
2014-03-25 20:11:22 +00:00
|
|
|
system ENV.cc, "test.c", "-o", "hello"
|
|
|
|
assert_equal "Hello world!", `./hello`
|
|
|
|
end
|
|
|
|
end
|