homebrew-core/Formula/urweb.rb

55 lines
1.6 KiB
Ruby

class Urweb < Formula
desc "Ur/Web programming language"
homepage "http://www.impredicative.com/ur/"
url "https://github.com/urweb/urweb/releases/download/20200209/urweb-20200209.tar.gz"
sha256 "ac3010c57f8d90f09f49dfcd6b2dc4d5da1cdbb41cbf12cb386e96e93ae30662"
revision 2
bottle do
sha256 "ea2ccdf37715d601fb22b301e9646d8a56bd408b88c8f83e2feda08d3695712c" => :catalina
sha256 "edfad2dea9f27c87d7a68396f50cbbf6d345edf6059abf555ad6c7d2d0bc2177" => :mojave
sha256 "ccc6d329298c6d3f3f4ba7e67b8be51017b7f95dad00de35d63fe49c670f1ee2" => :high_sierra
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "mlton" => :build
depends_on "gmp"
depends_on "icu4c"
depends_on "openssl@1.1"
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--with-openssl=#{Formula["openssl@1.1"].opt_prefix}
--prefix=#{prefix}
SITELISP=$prefix/share/emacs/site-lisp/urweb
ICU_INCLUDES=-I#{Formula["icu4c"].opt_include}
ICU_LIBS=-L#{Formula["icu4c"].opt_lib}
]
system "./configure", *args
system "make", "install"
end
test do
(testpath/"hello.ur").write <<~EOS
fun target () = return <xml><body>
Welcome!
</body></xml>
fun main () = return <xml><body>
<a link={target ()}>Go there</a>
</body></xml>
EOS
(testpath/"hello.urs").write <<~EOS
val main : unit -> transaction page
EOS
(testpath/"hello.urp").write "hello"
system "#{bin}/urweb", "hello"
system "./hello.exe", "-h"
end
end