49 lines
1.5 KiB
Ruby
49 lines
1.5 KiB
Ruby
class Fltk < Formula
|
|
desc "Cross-platform C++ GUI toolkit"
|
|
homepage "https://www.fltk.org/"
|
|
url "https://www.fltk.org/pub/fltk/1.3.6/fltk-1.3.6-source.tar.gz"
|
|
sha256 "9aac75ef9e9b7bd7b5338a4c0d4dd536e6c22ea7b15ea622aa1d8f1fa30d37ab"
|
|
|
|
livecheck do
|
|
url "https://www.fltk.org/software.php"
|
|
regex(/href=.*?fltk[._-]v?(\d+(?:\.\d+)+(?:-\d+)?)-source\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "8a38a916979fe3cd382d683bcd0c0cea2322a1754024e6afe99c9c9591bb8724"
|
|
sha256 big_sur: "ec58967d86a8068d770f5c1f8a5650ff7a4c334d952b51220564e1539b1c54de"
|
|
sha256 catalina: "94960f1fd2d833812056ef8d8be09b563331277b6b30b49e527d2a28d1454fb8"
|
|
sha256 mojave: "137faeafeb34fe3517d79aebb9c3fcfb2c959729e46d59d62be6203c2a520f39"
|
|
end
|
|
|
|
depends_on "jpeg"
|
|
depends_on "libpng"
|
|
|
|
def install
|
|
system "./configure", "--prefix=#{prefix}",
|
|
"--enable-threads",
|
|
"--enable-shared"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.cpp").write <<~EOS
|
|
#include <FL/Fl.H>
|
|
#include <FL/Fl_Window.H>
|
|
#include <FL/Fl_Box.H>
|
|
int main(int argc, char **argv) {
|
|
Fl_Window *window = new Fl_Window(340,180);
|
|
Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!");
|
|
box->box(FL_UP_BOX);
|
|
box->labelfont(FL_BOLD+FL_ITALIC);
|
|
box->labelsize(36);
|
|
box->labeltype(FL_SHADOW_LABEL);
|
|
window->end();
|
|
return 0;
|
|
}
|
|
EOS
|
|
system ENV.cxx, "test.cpp", "-L#{lib}", "-lfltk", "-o", "test"
|
|
system "./test"
|
|
end
|
|
end
|