lib: Major rewrite of the libfprint core and API

This is a rewrite of the core based on GObject and Gio. This commit
breaks the build in a lot of ways, but basic functionality will start
working again with the next commits.
This commit is contained in:
Benjamin Berg
2019-07-03 23:29:05 +02:00
parent 30a449841c
commit 689aff0232
53 changed files with 8358 additions and 6759 deletions

View File

@@ -1,15 +1,27 @@
libfprint_sources = [
'fpi-async.c',
'fp-context.c',
'fp-device.c',
'fp-image.c',
'fp-print.c',
'fp-image-device.c',
'fpi-assembling.c',
'fpi-core.c',
'fpi-data.c',
'fpi-dev.c',
'fpi-dev-img.c',
'fpi-img.c',
'fpi-ssm.c',
'fpi-sync.c',
'fpi-poll.c',
'fpi-usb.c',
'fpi-usb-transfer.c',
]
libfprint_public_headers = [
'fp-context.h',
'fp-device.h',
'fp-image.h',
'fp-print.h',
]
libfprint_private_headers = [
'fpi-assembling.h',
'fpi-device.h',
'fpi-image.h',
'fpi-image-device.h',
'fpi-print.h',
]
nbis_sources = [
@@ -134,29 +146,32 @@ if aes3k
endif
other_sources = []
if imaging_dep.found()
other_sources += [ 'fpi-img-pixman.c' ]
endif
libfprint_sources += configure_file(input: 'empty_file',
output: 'drivers_definitions.h',
capture: true,
command: [
'echo',
drivers_struct_list
])
fp_enums = gnome.mkenums_simple('fp-enums',
sources: libfprint_public_headers,
install_header : true)
fp_enums_h = fp_enums[1]
libfprint_sources += configure_file(input: 'empty_file',
output: 'drivers_arrays.h',
capture: true,
command: [
'echo',
drivers_primitive_array + '\n\n' + drivers_img_array
])
fpi_enums = gnome.mkenums_simple('fpi-enums',
sources: libfprint_private_headers,
install_header : true)
fpi_enums_h = fpi_enums[1]
deps = [ mathlib_dep, glib_dep, gusb_dep, nss_dep, imaging_dep ]
drivers_sources += configure_file(input: 'empty_file',
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 + drivers_sources + nbis_sources + other_sources,
libfprint_sources + fp_enums + fpi_enums +
drivers_sources + nbis_sources + other_sources,
soversion: soversion,
version: libversion,
c_args: common_cflags + drivers_cflags,
@@ -164,14 +179,17 @@ libfprint = library('fprint',
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)
dependencies: [glib_dep, gusb_dep, gio_dep])
install_headers(['fprint.h'], subdir: 'libfprint')
install_headers(['fprint.h'] + libfprint_public_headers, subdir: 'libfprint')
udev_rules = executable('fprint-list-udev-rules',
'fprint-list-udev-rules.c',
@@ -197,3 +215,35 @@ supported_devices = executable('fprint-list-supported-devices',
],
dependencies: [ deps, libfprint_dep ],
install: false)
if get_option('introspection')
# We do *not* include the private header here
libfprint_girtarget = gnome.generate_gir(libfprint,
sources : fp_enums + [
libfprint_public_headers,
libfprint_sources,
],
nsversion : '2.0',
namespace : 'FPrint',
symbol_prefix : 'fp_',
identifier_prefix : 'Fp',
export_packages : 'fprint',
extra_args : [
'--c-include=fprint.h',
],
link_with : libfprint,
dependencies : [
gio_dep,
gusb_dep,
],
includes : [
'Gio-2.0',
'GObject-2.0',
'GUsb-1.0',
],
install : true
)
libfprint_gir = libfprint_girtarget[0]
libfprint_typelib = libfprint_girtarget[1]
endif