homebrew-core/Formula/spice-gtk.rb

101 lines
3.5 KiB
Ruby

class SpiceGtk < Formula
include Language::Python::Virtualenv
desc "GTK client/libraries for SPICE"
homepage "https://www.spice-space.org"
url "https://www.spice-space.org/download/gtk/spice-gtk-0.40.tar.xz"
sha256 "23f5ff7fa80b75647ce73cda5eaf8b322f3432dbbb7f6f3a839634618adbced3"
license all_of: ["GPL-2.0-or-later", "LGPL-2.1-or-later", "BSD-3-Clause"]
livecheck do
url "https://www.spice-space.org/download/gtk/"
regex(/href=.*?spice-gtk[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_monterey: "f8161b28e3cc0d1446594631094a4ad447eedcd0b61d575bb9f922c36a3af592"
sha256 arm64_big_sur: "20739ef4960c33ecb9b47faf65e7b9558ae27a7f69d285914804b0f8e62d4b1a"
sha256 monterey: "668f119fbe839ccecbe5d8ec12e6b65f101d88e1737b04ba2f75a4220392dd10"
sha256 big_sur: "ddc6164a653342713455e30972a7874d399d185dff288fd5b42f1424ff17d80f"
sha256 catalina: "76aa8d0050886028ee2f8e5080069d9d6d74a96529028e698a6f78f6fe1f10db"
sha256 x86_64_linux: "6d40f60a0f8b50bbc672cbc368983f2ed0995b106eb85544379735a031e2b1b9"
end
depends_on "gobject-introspection" => :build
depends_on "intltool" => :build
depends_on "libtool" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "python@3.9" => :build
depends_on "six" => :build
depends_on "vala" => :build
depends_on "atk"
depends_on "cairo"
depends_on "gdk-pixbuf"
depends_on "gettext"
depends_on "glib"
depends_on "gst-libav"
depends_on "gst-plugins-bad"
depends_on "gst-plugins-base"
depends_on "gst-plugins-good"
depends_on "gst-plugins-ugly"
depends_on "gstreamer"
depends_on "gtk+3"
depends_on "jpeg"
depends_on "json-glib"
depends_on "libusb"
depends_on "lz4"
depends_on "openssl@1.1"
depends_on "opus"
depends_on "pango"
depends_on "pixman"
depends_on "spice-protocol"
depends_on "usbredir"
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/31/df/789bd0556e65cf931a5b87b603fcf02f79ff04d5379f3063588faaf9c1e4/pyparsing-3.0.8.tar.gz"
sha256 "7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954"
end
def install
venv = virtualenv_create(buildpath/"venv", "python3")
venv.pip_install resources
ENV.prepend_path "PATH", buildpath/"venv/bin"
mkdir "build" do
system "meson", *std_meson_args, ".."
system "ninja"
system "ninja", "install"
end
end
test do
(testpath/"test.cpp").write <<~EOS
#include <spice-client.h>
#include <spice-client-gtk.h>
int main() {
return spice_session_new() ? 0 : 1;
}
EOS
system ENV.cc, "test.cpp",
"-I#{Formula["atk"].include}/atk-1.0",
"-I#{Formula["cairo"].include}/cairo",
"-I#{Formula["gdk-pixbuf"].include}/gdk-pixbuf-2.0",
"-I#{Formula["glib"].include}/glib-2.0",
"-I#{Formula["glib"].lib}/glib-2.0/include",
"-I#{Formula["gtk+3"].include}/gtk-3.0",
"-I#{Formula["harfbuzz"].opt_include}/harfbuzz",
"-I#{Formula["pango"].include}/pango-1.0",
"-I#{Formula["spice-protocol"].include}/spice-1",
"-I#{include}/spice-client-glib-2.0",
"-I#{include}/spice-client-gtk-3.0",
"-L#{lib}",
"-lspice-client-glib-2.0",
"-lspice-client-gtk-3.0",
"-o", "test"
system "./test"
end
end