|
| 1 | +class BlueprintCompiler < Formula |
| 2 | + desc "Markup language and compiler for GTK 4 user interfaces" |
| 3 | + homepage "https://gnome.pages.gitlab.gnome.org/blueprint-compiler/" |
| 4 | + url "https://gitlab.gnome.org/GNOME/blueprint-compiler.git", |
| 5 | + tag: "v0.16.0", |
| 6 | + revision: "04ef0944db56ab01307a29aaa7303df6067cb3c0" |
| 7 | + license "LGPL-3.0-or-later" |
| 8 | + head "https://gitlab.gnome.org/GNOME/blueprint-compiler.git", branch: "main" |
| 9 | + |
| 10 | + bottle do |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "934e915f724789737e2aff49d9607966366342257941e1f44ee5d03c358d331a" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "934e915f724789737e2aff49d9607966366342257941e1f44ee5d03c358d331a" |
| 13 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "934e915f724789737e2aff49d9607966366342257941e1f44ee5d03c358d331a" |
| 14 | + sha256 cellar: :any_skip_relocation, sonoma: "6bea1eb3d4da51a7e9e8ee222b7c8dec211a3cbffc00932d1e26ffc6645d499e" |
| 15 | + sha256 cellar: :any_skip_relocation, ventura: "6bea1eb3d4da51a7e9e8ee222b7c8dec211a3cbffc00932d1e26ffc6645d499e" |
| 16 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "dd8299938011b24bc84df5f61ec14fea43ccd470ada9f70e92a14e195a138a8b" |
| 17 | + end |
| 18 | + |
| 19 | + depends_on "meson" => :build |
| 20 | + depends_on "ninja" => :build |
| 21 | + |
| 22 | + depends_on "gtk4" |
| 23 | + depends_on "pygobject3" |
| 24 | + |
| 25 | + def install |
| 26 | + system "meson", "setup", "build", *std_meson_args |
| 27 | + system "meson", "compile", "-C", "build", "--verbose" |
| 28 | + system "meson", "install", "-C", "build" |
| 29 | + end |
| 30 | + |
| 31 | + test do |
| 32 | + (testpath/"test.blp").write <<~BLUEPRINT |
| 33 | + using Gtk 4.0; |
| 34 | +
|
| 35 | + template $MyAppWindow: ApplicationWindow { |
| 36 | + default-width: 600; |
| 37 | + default-height: 300; |
| 38 | + title: _("Hello, Blueprint!"); |
| 39 | +
|
| 40 | + [titlebar] |
| 41 | + HeaderBar {} |
| 42 | +
|
| 43 | + Label { |
| 44 | + label: bind template.main_text; |
| 45 | + } |
| 46 | + } |
| 47 | + BLUEPRINT |
| 48 | + output = shell_output("#{bin}/blueprint-compiler compile #{testpath}/test.blp") |
| 49 | + assert_match "Hello, Blueprint!", output |
| 50 | + end |
| 51 | +end |
0 commit comments