1 exe = executable('gst-plugin-scanner',
2 'gst-plugin-scanner.c',
4 include_directories : [configinc],
5 dependencies : [gst_dep, mathlib, gmodule_dep,],
6 install_dir : helpers_install_dir,
10 meson.add_devenv({'GST_PLUGIN_SCANNER': exe.full_path()})
12 # Used in test env setup to make tests find plugin scanner in build tree
13 gst_scanner_dir = meson.current_build_dir()
16 executable('gst-completion-helper',
17 'gst-completion-helper.c',
19 include_directories : [configinc],
20 dependencies : [gst_dep],
21 install_dir : helpers_install_dir,
28 if host_system == 'android'
29 message('PTP not supported on Android because of permissions.')
30 elif host_system == 'windows'
31 message('PTP not supported on Windows, not ported yet.')
32 elif host_system == 'ios'
33 message('PTP not supported on iOS because of permissions.')
34 elif ['linux', 'darwin', 'netbsd', 'freebsd', 'openbsd', 'kfreebsd', 'dragonfly', 'sunos', 'gnu', 'gnu/kfreebsd'].contains(host_system)
35 message('PTP supported on ' + host_system + '.')
38 message('PTP not supported on ' + host_system + ', not ported yet.')
42 cdata.set('HAVE_PTP', 1, description : 'PTP support available')
44 if cc.compiles('''#include <sys/ioctl.h>
46 int some_func (void) {
49 ioctl(0, SIOCGIFCONF, &ifc);
50 ioctl(0, SIOCGIFFLAGS, &ifr);
51 ioctl(0, SIOCGIFHWADDR, &ifr);
52 return ifr.ifr_hwaddr.sa_data[0];
54 name : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR available')
55 cdata.set('HAVE_SIOCGIFCONF_SIOCGIFFLAGS_SIOCGIFHWADDR', 1,
56 description : 'SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR is available')
59 if cc.compiles('''#include <ifaddrs.h>
61 #include <net/if_dl.h>
62 int some_func (void) {
63 struct ifaddrs *ifaddr;
65 return (ifaddr->ifa_flags & IFF_LOOPBACK) && ifaddr->ifa_addr->sa_family != AF_LINK;
66 }''', name : 'getifaddrs() and AF_LINK available')
67 cdata.set('HAVE_GETIFADDRS_AF_LINK', 1,
68 description : 'getifaddrs() and AF_LINK is available')
71 setcap_prog = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
72 cap_dep = dependency('libcap', required: false)
74 # user/group to change to in gst-ptp-helper
75 ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
76 if ptp_helper_setuid_user != ''
77 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_USER', ptp_helper_setuid_user,
78 description : 'PTP helper setuid user')
80 ptp_helper_setuid_group = get_option('ptp-helper-setuid-group')
81 if ptp_helper_setuid_group != ''
82 cdata.set_quoted('HAVE_PTP_HELPER_SETUID_GROUP', ptp_helper_setuid_group,
83 description : 'PTP helper setuid group')
86 # how to install gst-ptp-helper
87 with_ptp_helper_permissions = get_option('ptp-helper-permissions')
88 if with_ptp_helper_permissions == 'auto'
89 if setcap_prog.found() and cap_dep.found()
90 with_ptp_helper_permissions = 'capabilities'
92 with_ptp_helper_permissions = 'setuid-root'
95 message('How to install gst-ptp-helper: ' + with_ptp_helper_permissions)
97 if with_ptp_helper_permissions == 'none'
99 elif with_ptp_helper_permissions == 'setuid-root'
100 cdata.set('HAVE_PTP_HELPER_SETUID', 1,
101 description : 'Use setuid-root for permissions in PTP helper')
102 elif with_ptp_helper_permissions == 'capabilities'
103 if not setcap_prog.found()
104 error('capabilities-based ptp-helper-permissions requested, but could not find setcap tool.')
105 elif not cap_dep.found()
106 error('capabilities-based ptp-helper-permissions requested, but could not find libcap.')
108 cdata.set('HAVE_PTP_HELPER_CAPABILITIES', 1,
109 description : 'Use capabilities for permissions in PTP helper')
111 error('Unexpected ptp helper permissions value: ' + with_ptp_helper_permissions)
114 exe = executable('gst-ptp-helper', 'gst-ptp-helper.c',
116 include_directories : [configinc, libsinc],
117 dependencies : [gst_dep, gio_dep, mathlib, cap_dep],
118 install_dir : helpers_install_dir,
121 meson.add_install_script('ptp_helper_post_install.sh',
122 helpers_install_dir, with_ptp_helper_permissions,
123 setcap_prog.found() ? setcap_prog.full_path() : '')
124 meson.add_devenv({'GST_PTP_HELPER': exe.full_path()})
127 install_data(['gst_gdb.py', 'glib_gobject_helper.py'],
128 install_dir : join_paths(get_option('datadir'), 'gstreamer-@0@'.format(apiversion), 'gdb'),
129 install_tag : 'devel')
131 gdbconf = configuration_data()
132 gdbconf.set('GST_API_VERSION', apiversion)
133 gdbconf.set('DATADIR', '@0@/@1@'.format(get_option('prefix'), get_option('datadir')))
135 if host_system != 'windows'
136 # XXX: We add a leading './' because prefix is an absolute path and we
137 # need it to be a relative path so that join_paths appends it to the end.
138 gdb_install_dir = join_paths(get_option('datadir'), 'gdb', 'auto-load', './' + get_option('prefix'), get_option('libdir'))
140 # FIXME: Cannot install on Windows because the path will contain a drive
141 # letter and colons are not allowed in paths.
142 gdb_install_dir = disabler()
144 configure_file(input : 'libgstreamer-gdb.py.in',
145 output : 'libgstreamer-@0@.so.@1@-gdb.py'.format(apiversion, libversion),
146 install_dir : gdb_install_dir,
147 install_tag : 'devel',
148 configuration : gdbconf)