49 lines
1.8 KiB
Ruby
49 lines
1.8 KiB
Ruby
class GnuCobol < Formula
|
|
desc "Implements much of the COBOL 85 and COBOL 2002 standards"
|
|
homepage "https://sourceforge.net/projects/open-cobol/"
|
|
url "https://downloads.sourceforge.net/project/open-cobol/gnu-cobol/2.2/gnucobol-2.2.tar.xz"
|
|
sha256 "dc18fc45c269debfe86a4bbe20a7250983cba6238ea1917e135df5926cd024a0"
|
|
|
|
bottle do
|
|
sha256 "5ddea71e8cdfe35bcf7affb34e375a5e81a7766c89fad399413bc1c5a343cdbd" => :high_sierra
|
|
sha256 "edca8c6964dcf160fe177b015ac015386f75925da3ab0e58d7c397fb0dca401d" => :sierra
|
|
sha256 "cbaa173aa41c70f1c58c084fc76a25d875724c541289012b58d5850b1c1783ed" => :el_capitan
|
|
end
|
|
|
|
depends_on "berkeley-db"
|
|
depends_on "gmp"
|
|
|
|
conflicts_with "open-cobol",
|
|
:because => "both install `cob-config`, `cobc` and `cobcrun` binaries"
|
|
|
|
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
|
|
gmp = Formula["gmp"]
|
|
bdb = Formula["berkeley-db"]
|
|
ENV.append "CPPFLAGS", "-I#{gmp.opt_include} -I#{bdb.opt_include}"
|
|
ENV.append "LDFLAGS", "-L#{gmp.opt_lib} -L#{bdb.opt_lib}"
|
|
|
|
system "./configure", "--disable-debug",
|
|
"--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--prefix=#{prefix}",
|
|
"--with-libiconv-prefix=/usr",
|
|
"--with-libintl-prefix=/usr"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"hello.cob").write <<~EOS
|
|
* COBOL must be indented
|
|
000001 IDENTIFICATION DIVISION.
|
|
000002 PROGRAM-ID. hello.
|
|
000003 PROCEDURE DIVISION.
|
|
000004 DISPLAY "Hello World!".
|
|
000005 STOP RUN.
|
|
EOS
|
|
system "#{bin}/cobc", "-x", "hello.cob"
|
|
system "./hello"
|
|
end
|
|
end
|