homebrew-core/Formula/wayland.rb

50 lines
1.3 KiB
Ruby

class Wayland < Formula
desc "Protocol for a compositor to talk to its clients"
homepage "https://wayland.freedesktop.org"
url "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-1.21.0.tar.xz"
sha256 "6dc64d7fc16837a693a51cfdb2e568db538bfdc9f457d4656285bb9594ef11ac"
license "MIT"
livecheck do
url "https://wayland.freedesktop.org/releases.html"
regex(/href=.*?wayland[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 x86_64_linux: "ac0ecd9ccb7dbc439469abf7fa23400d8027488c168d61f0dc3df457c4186979"
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on :linux
uses_from_macos "expat"
uses_from_macos "libffi"
uses_from_macos "libxml2"
def install
mkdir "build" do
system "meson", *std_meson_args, "-Dtests=false", "-Ddocumentation=false", ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
end
test do
(testpath/"test.c").write <<~EOS
#include "wayland-server.h"
#include "wayland-client.h"
int main(int argc, char* argv[]) {
const char *socket;
struct wl_protocol_logger *logger;
return 0;
}
EOS
system ENV.cc, "test.c", "-o", "test", "-I#{include}"
system "./test"
assert_equal 0, $CHILD_STATUS.exitstatus
end
end