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 3 bottle do sha256 big_sur: "6fd6c24befec836a6bdeb0880f909113379d901a7774b87daca85c9f66c32fa6" sha256 catalina: "f523137760d386fefaadc6f2beaf0057fdc66abd94b25f1babb7a5ac5f7c2448" sha256 mojave: "63ea10560a98e90a910d88146f973fe072dd3e7392a0ba1c5e99be0c9d4f3011" 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" # Patch to fix build for icu4c 68.2 patch do url "https://raw.githubusercontent.com/Homebrew/formula-patches/d7db3f02fe5dcd1f73c216efcb0bb79ac03a819f/urweb/icu4c68-2.patch" sha256 "8ec1ec5bec95e9feece8ff4e9c0435ada0ba2edbe48439fb88af4d56adcf2b3e" end 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 Welcome! fun main () = return Go there 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