2014-09-04 15:59:04 +00:00
|
|
|
class GnuCobol < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Implements much of the COBOL 85 and COBOL 2002 standards"
|
2014-09-04 15:59:04 +00:00
|
|
|
homepage "http://www.opencobol.org/"
|
2015-05-03 01:00:49 +00:00
|
|
|
revision 1
|
2014-10-21 07:05:57 +00:00
|
|
|
|
|
|
|
stable do
|
|
|
|
url "https://downloads.sourceforge.net/project/open-cobol/gnu-cobol/1.1/gnu-cobol-1.1.tar.gz"
|
2015-05-03 01:00:49 +00:00
|
|
|
sha256 "5cd6c99b2b1c82fd0c8fffbb350aaf255d484cde43cf5d9b92de1379343b3d7e"
|
2014-10-21 07:05:57 +00:00
|
|
|
|
|
|
|
fails_with :clang do
|
|
|
|
cause <<-EOS.undent
|
|
|
|
Building with Clang configures GNU-COBOL to use Clang as its compiler,
|
|
|
|
which causes subsequent GNU-COBOL-based builds to fail.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
2014-09-04 15:59:04 +00:00
|
|
|
|
2014-09-08 20:45:11 +00:00
|
|
|
devel do
|
|
|
|
version "2.0_nightly_r411"
|
|
|
|
url "https://downloads.sourceforge.net/project/open-cobol/gnu-cobol/2.0/gnu-cobol-2.0_nightly_r411.tar.gz"
|
2015-05-03 01:00:49 +00:00
|
|
|
sha256 "5d6d767bf0255fa63bc5c26493d53f4749eb0e369b81c626d156f346b3664fe7"
|
2014-09-08 20:45:11 +00:00
|
|
|
end
|
|
|
|
|
2014-09-08 08:21:39 +00:00
|
|
|
bottle do
|
2015-05-19 17:29:30 +00:00
|
|
|
revision 2
|
|
|
|
sha256 "2836f2bf3362ff9e9d9578a42e7207a3c29411d481279e46c723df8ac5189292" => :yosemite
|
|
|
|
sha256 "c24443ab3ac33ae5d8f1092cba070e62fdc5fbd4cced94fa813b5494424d8aa4" => :mavericks
|
|
|
|
sha256 "3be8e2c52d16b4a829f8669636d2e13f0346855899605e02cb7c6e8c47234b20" => :mountain_lion
|
2014-09-08 08:21:39 +00:00
|
|
|
end
|
|
|
|
|
2014-09-04 15:59:04 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "berkeley-db4"
|
|
|
|
depends_on "gmp"
|
2015-01-06 08:14:31 +00:00
|
|
|
depends_on "gcc"
|
2014-09-04 15:59:04 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
# both environment variables are needed to be set
|
|
|
|
# the cobol compiler takes these variables for calling cc during its run
|
|
|
|
# if the paths to gmp and bdb are not provided, the run of cobc fails
|
2014-09-08 08:33:18 +00:00
|
|
|
gmp = Formula["gmp"]
|
|
|
|
bdb = Formula["berkeley-db4"]
|
2014-09-04 15:59:04 +00:00
|
|
|
ENV.append "CPPFLAGS", "-I#{gmp.opt_include} -I#{bdb.opt_include}"
|
|
|
|
ENV.append "LDFLAGS", "-L#{gmp.opt_lib} -L#{bdb.opt_lib}"
|
|
|
|
|
2014-09-08 08:33:18 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--infodir=#{info}"]
|
|
|
|
args << "--with-libiconv-prefix=/usr"
|
|
|
|
args << "--with-libintl-prefix=/usr"
|
2014-09-08 20:45:11 +00:00
|
|
|
|
|
|
|
if build.stable?
|
|
|
|
system "aclocal"
|
|
|
|
|
|
|
|
# fix referencing of libintl and libiconv for ld
|
|
|
|
# bug report can be found here: https://sourceforge.net/p/open-cobol/bugs/93/
|
|
|
|
inreplace "configure", "-R$found_dir", "-L$found_dir"
|
|
|
|
|
|
|
|
args << "--with-cc=#{ENV.cc}"
|
|
|
|
end
|
|
|
|
|
2014-09-04 15:59:04 +00:00
|
|
|
system "./configure", *args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-09-08 08:33:18 +00:00
|
|
|
(testpath/"hello.cob").write <<-EOS
|
|
|
|
IDENTIFICATION DIVISION.
|
2014-09-04 15:59:04 +00:00
|
|
|
PROGRAM-ID. hello.
|
|
|
|
PROCEDURE DIVISION.
|
|
|
|
DISPLAY "Hello World!".
|
2014-09-08 08:33:18 +00:00
|
|
|
STOP RUN.
|
|
|
|
EOS
|
|
|
|
system "#{bin}/cobc", "-x", testpath/"hello.cob"
|
|
|
|
system testpath/"hello"
|
2014-09-04 15:59:04 +00:00
|
|
|
end
|
|
|
|
end
|