gtk-vnc 1.0.0

Closes #42908.

Signed-off-by: Chongyu Zhu <i@lembacon.com>
This commit is contained in:
Tom Schoonjans 2019-08-07 21:05:00 +01:00 committed by Chongyu Zhu
parent 1cd20870c7
commit 1653ae6fc6
No known key found for this signature in database
GPG key ID: 1A43E3C9100B38F5

View file

@ -1,9 +1,8 @@
class GtkVnc < Formula
desc "VNC viewer widget for GTK"
homepage "https://wiki.gnome.org/Projects/gtk-vnc"
url "https://download.gnome.org/sources/gtk-vnc/0.9/gtk-vnc-0.9.0.tar.xz"
sha256 "3a9a88426809a5df2c14353cd9839b8c8163438cb708b31d8048c79d180fcab7"
revision 1
url "https://download.gnome.org/sources/gtk-vnc/1.0/gtk-vnc-1.0.0.tar.xz"
sha256 "a81a1f1a79ad4618027628ffac27d3391524c063d9411c7a36a5ec3380e6c080"
bottle do
sha256 "9a9ede3c57a077ae5c902388bad783b6a808ef7f4c80f0f9eb8a51a3cecea9c1" => :mojave
@ -13,39 +12,101 @@ class GtkVnc < Formula
depends_on "gettext" => :build
depends_on "gobject-introspection" => :build
depends_on "intltool" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "python" => :build
depends_on "gnutls"
depends_on "gtk+3"
depends_on "libgcrypt"
# Fails with Xcode 7.1 or older
# error: use of undeclared identifier 'MAP_ANONYMOUS'
# Upstream bug: https://bugzilla.gnome.org/show_bug.cgi?id=602371
depends_on :macos => :yosemite
# submitted upstream at https://gitlab.gnome.org/GNOME/gtk-vnc/merge_requests/4
patch :DATA
def install
args = %W[
--prefix=#{prefix}
--with-gtk=3.0
--with-examples
--disable-vala
--enable-introspection
]
# fix "The deprecated ucontext routines require _XOPEN_SOURCE to be defined"
ENV.append "CPPFLAGS", "-D_XOPEN_SOURCE=600"
# for MAP_ANON
ENV.append "CPPFLAGS", "-D_DARWIN_C_SOURCE"
system "./configure", *args
system "make"
system "make", "install"
mkdir "build" do
system "meson", "--prefix=#{prefix}", "-Dwith-vala=false", ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
end
test do
system "#{bin}/gvncviewer", "--help-all"
system "#{bin}/gvnccapture", "--help"
end
end
__END__
diff --git a/src/meson.build b/src/meson.build
index 956f189..e238bc3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -89,7 +89,7 @@ else
endif
gvnc_link_args = []
-if host_machine.system() != 'windows'
+if meson.get_compiler('c').has_link_argument('-Wl,--no-undefined')
gvnc_link_args += ['-Wl,--no-undefined']
endif
@@ -116,6 +116,15 @@ gvnc_inc = [
top_incdir,
]
+c_args = []
+
+if host_machine.system() == 'darwin'
+ # fix "The deprecated ucontext routines require _XOPEN_SOURCE to be defined"
+ c_args += ['-D_XOPEN_SOURCE=600']
+ # for MAP_ANON
+ c_args += ['-D_DARWIN_C_SOURCE']
+endif
+
gvnc = library(
'gvnc-1.0',
sources: gvnc_sources,
@@ -123,8 +132,10 @@ gvnc = library(
include_directories: gvnc_inc,
link_args: gvnc_link_args,
version: '0.0.1',
+ darwin_versions: ['1.0', '1.1'],
soversion: '0',
install: true,
+ c_args: c_args,
)
gvnc_dep = declare_dependency(
@@ -178,7 +189,7 @@ if libpulse_dep.found()
]
gvncpulse_link_args = []
- if host_machine.system() != 'windows'
+ if meson.get_compiler('c').has_link_argument('-Wl,--no-undefined')
gvncpulse_link_args += ['-Wl,--no-undefined']
endif
@@ -206,6 +217,7 @@ if libpulse_dep.found()
include_directories: gvncpulse_inc,
link_args: gvncpulse_link_args,
version: '0.0.1',
+ darwin_versions: ['1.0', '1.1'],
soversion: '0',
install: true,
)
@@ -337,7 +349,7 @@ endforeach
gtk_vnc_link_args = []
-if host_machine.system() != 'windows'
+if meson.get_compiler('c').has_link_argument('-Wl,--no-undefined')
gtk_vnc_link_args += ['-Wl,--no-undefined']
endif
@@ -369,6 +381,7 @@ gtk_vnc = library(
include_directories: gtk_vnc_inc,
link_args: gtk_vnc_link_args,
version: '0.0.2',
+ darwin_versions: ['1.0', '1.2'],
soversion: '0',
install: true,
)