From 0028351ed0e99739c1e1b6be360f4c32dbb71bd8 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 25 Sep 2017 10:56:13 -0300 Subject: [PATCH 1/3] glib: Make GObject.NativeType public This is needed in GStreamer for the DynamicSignal part and is generaly useful. --- Source/glib/Object.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/glib/Object.cs b/Source/glib/Object.cs index 7adb3dc4b..34518b5a1 100644 --- a/Source/glib/Object.cs +++ b/Source/glib/Object.cs @@ -674,7 +674,7 @@ namespace GLib { get { return NativeType.ToString (); } } - internal GLib.GType NativeType { + public GLib.GType NativeType { get { return LookupGType (); } } From 58001e6fc889de797b34d4011b624541f499d9e6 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 25 Sep 2017 11:44:14 -0300 Subject: [PATCH 2/3] build: Add keyfile as project argument And delay signing when using csc --- Source/atk/meson.build | 3 +-- Source/cairo/meson.build | 2 -- Source/gdk/meson.build | 3 +-- Source/gio/meson.build | 3 +-- Source/glib/meson.build | 3 +-- Source/gtk/meson.build | 3 +-- Source/meson.build | 4 ++++ Source/pango/meson.build | 3 +-- 8 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Source/atk/meson.build b/Source/atk/meson.build index f8e44bd74..8298dd306 100644 --- a/Source/atk/meson.build +++ b/Source/atk/meson.build @@ -1,4 +1,3 @@ -snk = join_paths(meson.current_source_dir(), '..', 'gtk-sharp.snk') pkg = 'atk' assembly_name = pkg + '-sharp' @@ -23,7 +22,7 @@ sources = [ ] atk_sharp = library(assembly_name, source_gen, sources, assemblyinfo, - cs_args: ['-unsafe', '-keyfile:' + snk], + cs_args: ['-unsafe'], link_with: glib_sharp, install: install, install_dir: lib_install_dir diff --git a/Source/cairo/meson.build b/Source/cairo/meson.build index 5c2c855b3..327ab52c9 100644 --- a/Source/cairo/meson.build +++ b/Source/cairo/meson.build @@ -1,4 +1,3 @@ -snk = join_paths(meson.current_source_dir(), 'mono.snk') assembly_name = 'cairo-sharp' raw_api_fname = join_paths(meson.current_source_dir(), 'cairo-api.raw') @@ -62,7 +61,6 @@ sources = [ ] cairo_sharp = library(assembly_name, sources, assemblyinfo, - cs_args: ['-keyfile:' + snk], install: install, install_dir: lib_install_dir ) diff --git a/Source/gdk/meson.build b/Source/gdk/meson.build index c78f423df..420ca0312 100644 --- a/Source/gdk/meson.build +++ b/Source/gdk/meson.build @@ -1,4 +1,3 @@ -snk = join_paths(meson.current_source_dir(), '..', 'gtk-sharp.snk') pkg = 'gdk' assembly_name = pkg + '-sharp' symbols = join_paths(meson.current_source_dir(), 'gdk-symbols.xml') @@ -65,7 +64,7 @@ sources = [ deps = [glib_sharp, pango_sharp, cairo_sharp, gio_sharp] gdk_sharp = library(assembly_name, source_gen, sources, assemblyinfo, - cs_args: ['-unsafe', '-keyfile:' + snk], + cs_args: ['-unsafe'], link_with: deps, install: install, install_dir: lib_install_dir diff --git a/Source/gio/meson.build b/Source/gio/meson.build index 1b858c80d..b7ec09e4f 100644 --- a/Source/gio/meson.build +++ b/Source/gio/meson.build @@ -1,4 +1,3 @@ -snk = join_paths(meson.current_source_dir(), '..', 'gtk-sharp.snk') pkg = 'gio' assembly_name = pkg + '-sharp' @@ -30,7 +29,7 @@ sources = [ ] gio_sharp = library(assembly_name, source_gen, sources, assemblyinfo, - cs_args: ['-unsafe', '-keyfile:' + snk], + cs_args: ['-unsafe'], link_with: glib_sharp, install: install, install_dir: lib_install_dir diff --git a/Source/glib/meson.build b/Source/glib/meson.build index d436f67fd..ee8620e6e 100644 --- a/Source/glib/meson.build +++ b/Source/glib/meson.build @@ -1,4 +1,3 @@ -snk = join_paths(meson.current_source_dir(), '..', 'gtk-sharp.snk') assembly_name = 'glib-sharp' configure_file(input: 'glib-sharp.dll.config.in', @@ -93,7 +92,7 @@ sources = [ glib_sharp = library(assembly_name, sources, assemblyinfo, - cs_args: ['-unsafe', '-keyfile:' + snk], + cs_args: ['-unsafe'], install: install, install_dir: lib_install_dir ) diff --git a/Source/gtk/meson.build b/Source/gtk/meson.build index ec9eafede..7e2cd03da 100644 --- a/Source/gtk/meson.build +++ b/Source/gtk/meson.build @@ -1,4 +1,3 @@ -snk = join_paths(meson.current_source_dir(), '..', 'gtk-sharp.snk') pkg = 'gtk' assembly_name = pkg + '-sharp' symbols = join_paths(meson.current_source_dir(), pkg + '-symbols.xml') @@ -135,7 +134,7 @@ sources = [ deps = [glib_sharp, pango_sharp, cairo_sharp, gio_sharp, atk_sharp, gdk_sharp] gtk_sharp = library(assembly_name, source_gen, sources, assemblyinfo, - cs_args: ['-unsafe', '-keyfile:' + snk, '-nowarn:0618,0612,0169'], + cs_args: ['-unsafe', '-nowarn:0618,0612,0169'], link_with: deps, install: install, install_dir: lib_install_dir diff --git a/Source/meson.build b/Source/meson.build index d69b2804e..744de3f6e 100644 --- a/Source/meson.build +++ b/Source/meson.build @@ -17,6 +17,7 @@ runtime = '' if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimized' runtime_debug_flags=' --debug' endif + if csc.get_id() == 'mono' if not csc.version().version_compare(mono_required_version) error('Mono required version @0@ not found (@1@)'.format( @@ -27,6 +28,9 @@ if csc.get_id() == 'mono' if mono_runtime_dep.found() runtime = 'mono' + runtime_debug_flags endif + + add_project_arguments('-keyfile:' + join_paths(meson.current_source_dir(), 'gtk-sharp.snk'), + languages: ['cs']) endif install = get_option('install') diff --git a/Source/pango/meson.build b/Source/pango/meson.build index 36d0d9649..56cff0212 100644 --- a/Source/pango/meson.build +++ b/Source/pango/meson.build @@ -1,4 +1,3 @@ -snk = join_paths(meson.current_source_dir(), '..', 'gtk-sharp.snk') pkg = 'pango' assembly_name = pkg + '-sharp' raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.raw') @@ -59,7 +58,7 @@ sources = [ deps = [glib_sharp, cairo_sharp] pango_sharp = library(assembly_name, source_gen, sources, assemblyinfo, - cs_args: ['-unsafe', '-keyfile:' + snk], + cs_args: ['-unsafe'], link_with: deps, install: install, install_dir: lib_install_dir From 0f58e7e25396b09ec3ef53a81f540c0d3dc2d9d4 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 25 Sep 2017 11:56:16 -0300 Subject: [PATCH 3/3] Make sure to run exes within mono if required --- Source/gio/generated/generate_code.py | 10 +++++++--- Source/meson.build | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/gio/generated/generate_code.py b/Source/gio/generated/generate_code.py index 12168fe8c..3c36254da 100644 --- a/Source/gio/generated/generate_code.py +++ b/Source/gio/generated/generate_code.py @@ -37,12 +37,17 @@ if __name__ == "__main__": shutil.copyfile(opts.api_raw, api_xml) + if shutil.which('mono'): + launcher = ['mono'] + else: + launcher = [] + cmd = [opts.gapi_fixup, "--api=" + api_xml] if opts.metadata: cmd += ["--metadata=" + opts.metadata] if opts.symbols: cmd.extend(['--symbols=' + opts.symbols]) - subprocess.check_call(cmd) + subprocess.check_call(launcher + cmd) cmd = [ opts.gapi_codegen, '--generate', api_xml, @@ -57,8 +62,7 @@ if __name__ == "__main__": cmd += ['-I' + i for i in opts.extra_includes] - print(' '.join(cmd)) - subprocess.check_call(cmd) + subprocess.check_call(launcher + cmd) # WORKAROUND: Moving files into the out directory with special names # as meson doesn't like path separator in output names. diff --git a/Source/meson.build b/Source/meson.build index 744de3f6e..b33b3b867 100644 --- a/Source/meson.build +++ b/Source/meson.build @@ -30,7 +30,7 @@ if csc.get_id() == 'mono' endif add_project_arguments('-keyfile:' + join_paths(meson.current_source_dir(), 'gtk-sharp.snk'), - languages: ['cs']) + language: ['cs']) endif install = get_option('install')