51 lines
1.7 KiB
Diff
51 lines
1.7 KiB
Diff
Source: maxice8
|
|
Upstream: no but feel free to get it upstream where it should be
|
|
Reason: Conditionalize gobject intropection allowing cross compilation
|
|
|
|
Note that this isn't in upstreamable condition (missing checks for vapi depending on gir for example)
|
|
and considering it is gnome-tech it is very unlikely that it will ever get merged
|
|
--- gusb/meson.build
|
|
+++ gusb/meson.build
|
|
@@ -67,10 +67,17 @@ gusb = shared_library(
|
|
install : true
|
|
)
|
|
|
|
+deps = [ 'gio-2.0', 'libusb-1.0' ]
|
|
+
|
|
+with_gir = get_option('gir')
|
|
+if with_gir
|
|
+ deps += [ 'gobject-2.0' ]
|
|
+endif
|
|
+
|
|
pkgg = import('pkgconfig')
|
|
pkgg.generate(
|
|
libraries : gusb,
|
|
- requires : [ 'gio-2.0', 'gobject-2.0', 'libusb-1.0' ],
|
|
+ requires : deps,
|
|
subdirs : 'gusb-1',
|
|
version : meson.project_version(),
|
|
name : 'gusb',
|
|
@@ -78,6 +85,7 @@ pkgg.generate(
|
|
description : 'GUsb is a GLib binding for libusb1',
|
|
)
|
|
|
|
+if with_gir
|
|
libgusb_girtarget = gnome.generate_gir(gusb,
|
|
sources : [
|
|
gusb_version_h,
|
|
@@ -119,6 +127,7 @@ libgusb_girtarget = gnome.generate_gir(gusb,
|
|
)
|
|
libgusb_gir = libgusb_girtarget[0]
|
|
libgusb_typelib = libgusb_girtarget[1]
|
|
+endif
|
|
|
|
if get_option('vapi')
|
|
gnome.generate_vapi('gusb',
|
|
--- meson_options.txt
|
|
+++ meson_options.txt
|
|
@@ -2,3 +2,4 @@ option('tests', type : 'boolean', value : true, description : 'Build self tests'
|
|
option('vapi', type : 'boolean', value : true, description : 'Build VAPI')
|
|
option('usb_ids', type : 'string', value : '/usr/share/hwdata/usb.ids', description : 'Path to usb.ids file')
|
|
option('docs', type : 'boolean', value : true, description : 'Generate documentation')
|
|
+option('gir', type : 'boolean', value : true, description : 'Generate gobject introspection data')
|