class Guile < Formula desc "GNU Ubiquitous Intelligent Language for Extensions" homepage "https://www.gnu.org/software/guile/" url "https://ftpmirror.gnu.org/guile/guile-2.2.1.tar.xz" mirror "https://ftp.gnu.org/gnu/guile/guile-2.2.1.tar.xz" sha256 "f21512374a6d553ec45fd6b09c73dd1ddce93315621f3856e72efa9aab811a66" bottle do sha256 "ff5d3434f9a3b502c21f315f89cf741634d2feabe02dd3ec43cf552ff8566d34" => :sierra sha256 "dcbc75eca00c1430f52ea68ba4b4c1fe4024f67abec080b744cd41df8d45f858" => :el_capitan sha256 "a4143497532ff4b50fb2f45f142ce4de57a61a615160c0222ea3ccf877a3adb6" => :yosemite end head do url "https://git.savannah.gnu.org/git/guile.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "gettext" => :build end depends_on "pkg-config" => :run # guile-config is a wrapper around pkg-config. depends_on "libtool" => :run depends_on "libffi" depends_on "libunistring" depends_on "bdw-gc" depends_on "gmp" depends_on "readline" fails_with :clang do build 211 cause "Segfaults during compilation" end def install system "./autogen.sh" unless build.stable? system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-libreadline-prefix=#{Formula["readline"].opt_prefix}", "--with-libgmp-prefix=#{Formula["gmp"].opt_prefix}" system "make", "install" # A really messed up workaround required on macOS --mkhl Pathname.glob("#{lib}/*.dylib") do |dylib| lib.install_symlink dylib.basename => "#{dylib.basename(".dylib")}.so" end (share/"gdb/auto-load").install Dir["#{lib}/*-gdb.scm"] end test do hello = testpath/"hello.scm" hello.write <<-EOS.undent (display "Hello World") (newline) EOS ENV["GUILE_AUTO_COMPILE"] = "0" system bin/"guile", hello end end