Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable audio/video streaming; overhaul build #83

Merged
merged 3 commits into from
Feb 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 79 additions & 4 deletions spice-gtk.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class SpiceGtk < Formula
desc "GTK client/libraries for SPICE"
homepage "https://www.spice-space.org"
url "https://www.spice-space.org/download/gtk/spice-gtk-0.31.tar.bz2"
sha256 "c72b4d202b1c0b71d6e24ce5caf914d6dddbcf4010d10db9c2d8e73af728c1ca"
url "https://www.spice-space.org/download/gtk/spice-gtk-0.34.tar.bz2"
sha256 "e9720e01165f8451c9f3f58ad50e3afb990993b81cc2db86b3661b7ac5b976ee"

depends_on "gobject-introspection" => :build
depends_on "intltool" => :build
Expand All @@ -16,22 +16,97 @@ class SpiceGtk < Formula
depends_on "glib"
depends_on "gtk+3"
depends_on "jpeg"
depends_on "lz4"
depends_on "openssl"
depends_on "pango"
depends_on "pixman"
depends_on "spice-protocol"
depends_on "usbredir"
# TODO: audio

# for --enable-gst(audio|video)
depends_on "gstreamer"
depends_on "gst-libav"
depends_on "gst-plugins-base"
depends_on "gst-plugins-good"
depends_on "gst-plugins-bad"
depends_on "gst-plugins-ugly"

# need autogen to regen after patching the build
depends_on "autogen"
depends_on "automake"
depends_on "autoconf"

# compile vncdisplaykeymap.c as objc to fix include issue
patch :DATA

def install
ENV['CFLAGS'] = "-Wno-cast-align -Wno-error"
ENV['XML_CATALOG_FILES'] = "/usr/local/etc/xml/catalog"

mv "src/vncdisplaykeymap.c", "src/vncdisplaykeymap.m"

system "autoreconf", "-v", "--force", "--install"
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--with-gtk=3.0",
"--enable-introspection",
"--enable-vala",
"--with-audio=no",
"--enable-gstvideo",
"--enable-gstaudio",
"--enable-gstreamer=1.0",
"--with-lz4",
"--with-coroutine=gthread",
"--prefix=#{prefix}"
system "make", "install"
end
end
__END__
diff --git a/configure.ac b/configure.ac
index f915d81..10ef73d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,7 @@ AC_SUBST(SPICE_GTK_LOCALEDIR)

GTK_DOC_CHECK([1.14],[--flavour no-tmpl])

+AC_PROG_OBJC
AC_PROG_CC
AC_PROG_CC_C99
if test "x$ac_cv_prog_cc_c99" = xno; then
diff --git a/src/Makefile.am b/src/Makefile.am
index 5430d84..dad3fa5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -125,7 +125,7 @@ SPICE_GTK_SOURCES_COMMON = \
spice-widget.c \
spice-widget-priv.h \
spice-file-transfer-task.h \
- vncdisplaykeymap.c \
+ vncdisplaykeymap.m \
vncdisplaykeymap.h \
spice-grabsequence.c \
spice-grabsequence.h \
@@ -481,7 +481,7 @@ spice-widget-enums.h: spice-widget.h
$< > $@


-vncdisplaykeymap.c: $(KEYMAPS)
+vncdisplaykeymap.m: $(KEYMAPS)
$(KEYMAPS): $(srcdir)/$(KEYMAP_GEN) $(srcdir)/$(KEYMAP_CSV)

vncdisplaykeymap_xorgevdev2xtkbd.c:
diff --git a/spice-common/m4/spice-deps.m4 b/spice-common/m4/spice-deps.m4
index 68e3091..2e4c305 100644
--- a/spice-common/m4/spice-deps.m4
+++ b/spice-common/m4/spice-deps.m4
@@ -1,10 +1,3 @@
-# For autoconf < 2.63
-m4_ifndef([AS_VAR_APPEND],
- AC_DEFUN([AS_VAR_APPEND], $1=$$1$2))
-m4_ifndef([AS_VAR_COPY],
- [m4_define([AS_VAR_COPY],
- [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])])
-

# SPICE_WARNING(warning)
# SPICE_PRINT_MESSAGES
8 changes: 3 additions & 5 deletions spice-protocol.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
class SpiceProtocol < Formula
desc "Headers for SPICE protocol"
homepage "https://www.spice-space.org/"
url "https://www.spice-space.org/download/releases/spice-protocol-0.12.12.tar.bz2"
sha256 "17abdc2743b5d44b0f4423b61c44aafe9f2078c27218aeea78c2d02a5c409d03"
url "https://www.spice-space.org/download/releases/spice-protocol-0.12.13.tar.bz2"
sha256 "89ee11b202d2268e061788e6ace114e1ff18c7620ae64d1ca3aba252ee7c9933"

def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
system "./configure", "--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
Expand Down
3 changes: 1 addition & 2 deletions usbredir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class Usbredir < Formula
depends_on "libusb"

def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
system "./configure", "--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
Expand Down
58 changes: 44 additions & 14 deletions virt-manager.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class VirtManager < Formula
desc "App for managing virtual machines"
homepage "https://virt-manager.org/"
url "https://virt-manager.org/download/sources/virt-manager/virt-manager-1.4.1.tar.gz"
sha256 "e6c549999f14fbda210c07821910bfa35c086542e166f8b00d7c83717e9f3944"
url "https://virt-manager.org/download/sources/virt-manager/virt-manager-1.4.2.tar.gz"
sha256 "43e440bb099facf59b59c27c2fc4eb2c42ef0d4ed8d67d93c9e3d98538b6d574"

depends_on "intltool" => :build
depends_on "pkg-config" => :build
Expand All @@ -19,33 +19,50 @@ class VirtManager < Formula
depends_on "pygobject3"
depends_on "spice-gtk"
depends_on "vte3"
depends_on :x11
# TODO: audio
depends_on :python

resource "libvirt-python" do
url "https://libvirt.org/sources/python/libvirt-python-3.4.0.tar.gz"
sha256 "afa77781f518988f164dd5f99d1844034ca807a8e731e07cbae18474d250b511"
url "https://libvirt.org/sources/python/libvirt-python-3.7.0.tar.gz"
sha256 "1e4a8a8b08ef8f2502088f26ce3aced415d55ef808d8301dfed023f45154c06f"
end

resource "idna" do
url "https://pypi.io/packages/source/i/idna/idna-2.6.tar.gz"
sha256 "2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f"
end

resource "certifi" do
url "https://pypi.io/packages/source/c/certifi/certifi-2017.7.27.1.tar.gz"
sha256 "40523d2efb60523e113b44602298f0960e900388cf3bb6043f645cf57ea9e3f5"
end

resource "chardet" do
url "https://pypi.io/packages/source/c/chardet/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end

resource "urllib3" do
url "https://pypi.io/packages/source/u/urllib3/urllib3-1.22.tar.gz"
sha256 "cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"
end

resource "requests" do
url "https://pypi.io/packages/source/r/requests/requests-2.12.5.tar.gz"
sha256 "d902a54f08d086a7cc6e58c20e2bb225b1ae82c19c35e5925269ee94fb9fce00"
url "https://pypi.io/packages/source/r/requests/requests-2.18.4.tar.gz"
sha256 "9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e"
end

resource "ipaddr" do
url "https://pypi.io/packages/source/i/ipaddr/ipaddr-2.1.11.tar.gz"
sha256 "1b555b8a8800134fdafe32b7d0cb52f5bdbfdd093707c3dd484c5ea59f1d98b7"
end

patch :DATA # OS X does not conform to PEP 394, python2 symlink missing
# macOS does not conform to PEP 394, python2 symlink missing
# virt-manager does not launch on macOS unless --no-fork flag is provided
patch :DATA

def install
# update location of cpu_map.xml
# https://github.com/jeffreywildman/homebrew-virt-manager/issues/15
inreplace "virtinst/capabilities.py", "/usr/share/libvirt/cpu_map.xml", "#{HOMEBREW_PREFIX}/share/libvirt/cpu_map.xml"

ENV.prepend_create_path "PYTHONPATH", "#{libexec}/vendor/lib/python2.7/site-packages"
%w[libvirt-python requests ipaddr].each do |r|
%w[libvirt-python idna certifi chardet urllib3 requests ipaddr].each do |r|
resource(r).stage { system "python", *Language::Python.setup_install_args(libexec/"vendor") }
end

Expand Down Expand Up @@ -129,3 +146,16 @@ def post_install
#
# Copyright 2013-2014 Red Hat, Inc.
# Cole Robinson <[email protected]>

--- a/virt-manager
+++ b/virt-manager
@@ -156,7 +156,8 @@
help="Print debug output to stdout (implies --no-fork)",
default=False)
parser.add_argument("--no-fork", action="store_true",
- help="Don't fork into background on startup")
+ help="Don't fork into background on startup",
+ default=True)
parser.add_argument("--no-conn-autostart", action="store_true",
dest="skip_autostart", help="Do not autostart connections")
parser.add_argument("--spice-disable-auto-usbredir", action="store_true",
11 changes: 5 additions & 6 deletions virt-viewer.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class VirtViewer < Formula
desc "App for virtualized guest interaction"
homepage "https://virt-manager.org/"
url "https://virt-manager.org/download/sources/virt-viewer/virt-viewer-4.0.tar.gz"
sha256 "1c427b0ea104539342519334735e6f667d5784c42a5aafc253b580875d88fa1f"
url "https://virt-manager.org/download/sources/virt-viewer/virt-viewer-6.0.tar.gz"
sha256 "9037bd7773da4dae761871ec1ab646cfefb4d7e48b1504dddf315a548ccb18b2"

depends_on "intltool" => :build
depends_on "libtool" => :build
Expand All @@ -16,13 +16,12 @@ class VirtViewer < Formula
depends_on "shared-mime-info"
depends_on "spice-gtk"
depends_on "spice-protocol"
depends_on :x11
# TODO: audio

def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
system "./configure", "--disable-silent-rules",
"--disable-update-mimedb",
"--with-gtk-vnc",
"--with-spice-gtk",
"--with-gtk=3.0",
"--prefix=#{prefix}"
system "make", "install"
Expand Down