meson: Use preferred syntax everywhere

Meson files are normally using 4-spaces to indent and functions use first
parameter on the same line while others at next indentation level, not
following the parenthesis indentation.

So adapt libfprint to follow the meson standard.
This commit is contained in:
Marco Trevisan (Treviño) 2019-11-21 20:37:17 +01:00
parent dd7d1baece
commit 099fa9f005
7 changed files with 116 additions and 116 deletions

View file

@ -1,21 +1,24 @@
gtk_test_resources = gnome.compile_resources('gtk-test-resources', 'gtk-libfprint-test.gresource.xml',
source_dir : '.',
c_name : 'gtk_test')
gtk_test_resources = gnome.compile_resources('gtk-test-resources',
'gtk-libfprint-test.gresource.xml',
source_dir : '.',
c_name : 'gtk_test')
prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
executable('gtk-libfprint-test',
[ 'gtk-libfprint-test.c', gtk_test_resources ],
dependencies: [ libfprint_dep, gtk_dep ],
include_directories: [
root_inc,
],
c_args: [ common_cflags,
'-DPACKAGE_VERSION="' + meson.project_version() + '"' ],
install: true,
install_dir: bindir)
[ 'gtk-libfprint-test.c', gtk_test_resources ],
dependencies: [ libfprint_dep, gtk_dep ],
include_directories: [
root_inc,
],
c_args: [
common_cflags,
'-DPACKAGE_VERSION="' + meson.project_version() + '"'
],
install: true,
install_dir: bindir)
appdata = 'org.freedesktop.libfprint.Demo.appdata.xml'
install_data(appdata,

View file

@ -1,14 +1,14 @@
subdir('xml')
private_headers = [
'config.h',
'nbis-helpers.h',
'fprint.h',
'fp_internal.h',
'config.h',
'nbis-helpers.h',
'fprint.h',
'fp_internal.h',
# Subdirectories to ignore
'drivers',
'nbis',
# Subdirectories to ignore
'drivers',
'nbis',
]
html_images = [
@ -25,20 +25,20 @@ glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
gnome.gtkdoc('libfprint',
main_xml: 'libfprint-docs.xml',
src_dir: join_paths(meson.source_root(), 'libfprint'),
dependencies: libfprint_dep,
content_files: content_files,
expand_content_files: expand_content_files,
scan_args: [
#'--rebuild-sections',
'--ignore-decorators=API_EXPORTED',
'--ignore-headers=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
],
html_assets: html_images,
install: true)
main_xml: 'libfprint-docs.xml',
src_dir: join_paths(meson.source_root(), 'libfprint'),
dependencies: libfprint_dep,
content_files: content_files,
expand_content_files: expand_content_files,
scan_args: [
#'--rebuild-sections',
'--ignore-decorators=API_EXPORTED',
'--ignore-headers=' + ' '.join(private_headers),
],
fixxref_args: [
'--html-dir=@0@'.format(docpath),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
],
html_assets: html_images,
install: true)

View file

@ -7,4 +7,6 @@ ent_conf.set('PACKAGE_TARNAME', 'libfprint-' + meson.project_version())
ent_conf.set('PACKAGE_URL', 'https://fprint.freedesktop.org/')
ent_conf.set('PACKAGE_VERSION', meson.project_version())
ent_conf.set('PACKAGE_API_VERSION', '1.0')
configure_file(input: 'gtkdocentities.ent.in', output: 'gtkdocentities.ent', configuration: ent_conf)
configure_file(input: 'gtkdocentities.ent.in',
output: 'gtkdocentities.ent',
configuration: ent_conf)

View file

@ -2,18 +2,18 @@
examples = [ 'enroll', 'verify', 'manage-prints' ]
foreach example: examples
executable(example,
[example + '.c', 'storage.c', 'utilities.c'],
dependencies: [libfprint_dep, glib_dep],
include_directories: [
root_inc,
],
c_args: common_cflags)
[ example + '.c', 'storage.c', 'utilities.c' ],
dependencies: [ libfprint_dep, glib_dep ],
include_directories: [
root_inc,
],
c_args: common_cflags)
endforeach
executable('cpp-test',
'cpp-test.cpp',
dependencies: libfprint_dep,
include_directories: [
root_inc,
],
c_args: common_cflags)
'cpp-test.cpp',
dependencies: libfprint_dep,
include_directories: [
root_inc,
],
c_args: common_cflags)

View file

@ -162,73 +162,73 @@ endif
other_sources = []
fp_enums = gnome.mkenums_simple('fp-enums',
sources: libfprint_public_headers,
install_header : true)
sources: libfprint_public_headers,
install_header : true)
fp_enums_h = fp_enums[1]
fpi_enums = gnome.mkenums_simple('fpi-enums',
sources: libfprint_private_headers,
install_header : true)
sources: libfprint_private_headers,
install_header : true)
fpi_enums_h = fpi_enums[1]
drivers_sources += configure_file(input: 'empty_file',
output: 'fp-drivers.c',
capture: true,
command: [
'echo',
drivers_type_list + '\n\n' + drivers_type_func
])
output: 'fp-drivers.c',
capture: true,
command: [
'echo',
drivers_type_list + '\n\n' + drivers_type_func
])
mapfile = 'libfprint.ver'
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
deps = [ mathlib_dep, glib_dep, gusb_dep, nss_dep, imaging_dep, gio_dep ]
libfprint = library('fprint',
libfprint_sources + fp_enums + fpi_enums +
drivers_sources + nbis_sources + other_sources,
soversion: soversion,
version: libversion,
c_args: common_cflags + drivers_cflags,
include_directories: [
root_inc,
include_directories('nbis/include'),
],
link_args : vflag,
link_depends : mapfile,
dependencies: deps,
install: true)
libfprint_sources + fp_enums + fpi_enums +
drivers_sources + nbis_sources + other_sources,
soversion: soversion,
version: libversion,
c_args: common_cflags + drivers_cflags,
include_directories: [
root_inc,
include_directories('nbis/include'),
],
link_args : vflag,
link_depends : mapfile,
dependencies: deps,
install: true)
libfprint_dep = declare_dependency(link_with: libfprint,
sources: [ fp_enums_h ],
include_directories: root_inc,
dependencies: [glib_dep, gusb_dep, gio_dep])
sources: [ fp_enums_h ],
include_directories: root_inc,
dependencies: [ glib_dep, gusb_dep, gio_dep ])
install_headers(['fprint.h'] + libfprint_public_headers, subdir: 'libfprint')
udev_rules = executable('fprint-list-udev-rules',
'fprint-list-udev-rules.c',
include_directories: [
root_inc,
],
dependencies: [ deps, libfprint_dep ],
install: false)
'fprint-list-udev-rules.c',
include_directories: [
root_inc,
],
dependencies: [ deps, libfprint_dep ],
install: false)
if get_option('udev_rules')
custom_target('udev-rules',
output: '60-fprint-autosuspend.rules',
capture: true,
command: [ udev_rules ],
install: true,
install_dir: udev_rules_dir)
output: '60-fprint-autosuspend.rules',
capture: true,
command: [ udev_rules ],
install: true,
install_dir: udev_rules_dir)
endif
supported_devices = executable('fprint-list-supported-devices',
'fprint-list-supported-devices.c',
include_directories: [
root_inc,
],
dependencies: [ deps, libfprint_dep ],
install: false)
'fprint-list-supported-devices.c',
include_directories: [
root_inc,
],
dependencies: [ deps, libfprint_dep ],
install: false)
if get_option('introspection')
@ -256,8 +256,7 @@ if get_option('introspection')
'GObject-2.0',
'GUsb-1.0',
],
install : true
)
install : true)
libfprint_gir = libfprint_girtarget[0]
libfprint_typelib = libfprint_girtarget[1]
endif

View file

@ -1,12 +1,12 @@
project('libfprint', [ 'c', 'cpp' ],
version: '1.90.0',
license: 'LGPLv2.1+',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
'c_std=c99',
],
meson_version: '>= 0.46.0')
version: '1.90.0',
license: 'LGPLv2.1+',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
'c_std=c99',
],
meson_version: '>= 0.46.0')
gnome = import('gnome')
@ -160,11 +160,10 @@ endif
pkgconfig = import('pkgconfig')
pkgconfig.generate(
name: 'libfprint',
description: 'Generic C API for fingerprint reader access',
version: meson.project_version(),
libraries: libfprint,
subdirs: 'libfprint',
filebase: 'libfprint2',
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
)
name: 'libfprint',
description: 'Generic C API for fingerprint reader access',
version: meson.project_version(),
libraries: libfprint,
subdirs: 'libfprint',
filebase: 'libfprint2',
install_dir: join_paths(get_option('libdir'), 'pkgconfig'))

View file

@ -16,8 +16,7 @@ envs.set('NO_AT_BRIDGE', '1')
if get_option('introspection')
if 'virtual_image' in drivers
test(
'virtual-image',
test('virtual-image',
find_program('virtual-image.py'),
args: '--verbose',
env: envs,
@ -26,8 +25,7 @@ if get_option('introspection')
endif
if 'vfs5011' in drivers
test(
'vfs5011',
test('vfs5011',
find_program('umockdev-test.py'),
args: join_paths(meson.current_source_dir(), 'vfs5011'),
env: envs,
@ -37,8 +35,7 @@ if get_option('introspection')
endif
if 'synaptics' in drivers
test(
'synaptics',
test('synaptics',
find_program('umockdev-test.py'),
args: join_paths(meson.current_source_dir(), 'synaptics'),
env: envs,