From d0002786c6ccf648e609f6b9e5dcef0f90dbd816 Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Fri, 20 Nov 2020 17:47:36 +0100 Subject: [PATCH] wayland (new formula) --- .github/workflows/tests-linux.yml | 1 + Formula/wayland.rb | 45 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Formula/wayland.rb diff --git a/.github/workflows/tests-linux.yml b/.github/workflows/tests-linux.yml index e7deb069199..209e3acf1a8 100644 --- a/.github/workflows/tests-linux.yml +++ b/.github/workflows/tests-linux.yml @@ -19,6 +19,7 @@ on: - "Formula/libtirpc.rb" - "Formula/linux-headers.rb" - "Formula/strace.rb" + - "Formula/wayland.rb" jobs: check_labels_linux: runs-on: ubuntu-latest diff --git a/Formula/wayland.rb b/Formula/wayland.rb new file mode 100644 index 00000000000..21c960bf33e --- /dev/null +++ b/Formula/wayland.rb @@ -0,0 +1,45 @@ +class Wayland < Formula + desc "Protocol for a compositor to talk to its clients" + homepage "https://wayland.freedesktop.org" + url "https://wayland.freedesktop.org/releases/wayland-1.18.0.tar.xz" + sha256 "4675a79f091020817a98fd0484e7208c8762242266967f55a67776936c2e294d" + license "MIT" + + depends_on "pkg-config" => :build + depends_on :linux + + uses_from_macos "expat" + uses_from_macos "libffi" + uses_from_macos "libxml2" + + def install + args = %W[ + --prefix=#{prefix} + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-dependency-tracking + --disable-silent-rules + --disable-documentation + ] + + system "./configure", *args + system "make" + system "make", "install" + 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