qulogic/gplugin

Update the debian package for the gir version number change. Split the typelibs into separate packages. Move the gir's to the dev packages. And set compat to 10 which is apparently the new value.
###############################################################################
# Library
###############################################################################
GPLUGIN_LIBRARY_VERSION = '0.1.0'
GPLUGIN_HEADERS = [
'gplugin-core.h',
'gplugin-loader.h',
'gplugin-manager.h',
'gplugin-options.h',
'gplugin-plugin.h',
'gplugin-plugin-info.h',
]
GPLUGIN_SOURCES = [
'gplugin-core.c',
'gplugin-plugin.c',
'gplugin-loader.c',
'gplugin-manager.c',
'gplugin-options.c',
'gplugin-plugin-info.c',
'gplugin-private.c',
'gplugin-version.c',
]
GPLUGIN_PUBLIC_BUILT_HEADERS = [
# Modified below.
]
GPLUGIN_PUBLIC_BUILT_SOURCES = [
# Modified below.
]
GPLUGIN_PRIVATE_HEADERS = [
'gplugin-file-tree.h',
]
GPLUGIN_PRIVATE_SOURCES = [
'gplugin-file-tree.c',
]
GPLUGIN_PRIVATE_BUILT_HEADERS = [
# Modified below.
]
GPLUGIN_PRIVATE_BUILT_SOURCES = [
# Modified below.
]
GPLUGIN_NATIVE_HEADERS = [
'gplugin-native-plugin.h',
'gplugin-native-loader.h',
]
GPLUGIN_NATIVE_SOURCES = [
'gplugin-native-plugin.c',
'gplugin-native-loader.c',
]
###############################################################################
# gplugin-enum.[ch] generation
###############################################################################
ENUM_HEADERS = [
'gplugin-plugin.h',
]
enums = gnome.mkenums_simple(
'gplugin-enums',
sources : ENUM_HEADERS,
install_header : true,
install_dir : get_option('includedir') / 'gplugin-1.0' / 'gplugin')
enums_c = enums[0]
enums_h = enums[1]
GPLUGIN_PUBLIC_BUILT_HEADERS += [
enums_h
]
GPLUGIN_PUBLIC_BUILT_SOURCES += [
enums_c
]
##############################################################################
# Helper Variables
###############################################################################
PRIVATE_HEADERS = GPLUGIN_PRIVATE_HEADERS + GPLUGIN_PRIVATE_BUILT_HEADERS + ['gplugin-private.h', 'gplugin-native-private.h']
###############################################################################
# Configure Files
###############################################################################
gplugin_version_h = configure_file(
input : 'gplugin-version.h.in',
output : 'gplugin-version.h',
configuration : version_conf,
install : true,
install_dir : get_option('includedir') / 'gplugin-1.0' / 'gplugin'
)
GPLUGIN_PUBLIC_BUILT_HEADERS += [
gplugin_version_h
]
gplugin_inc = include_directories('.')
# Build gplugin.h
GPLUGIN_H_INCLUDES = ''
foreach header : GPLUGIN_HEADERS
GPLUGIN_H_INCLUDES = '@0@\n#include <gplugin/@1@>'.format(
GPLUGIN_H_INCLUDES,
header)
endforeach
foreach header : ['gplugin-version.h', 'gplugin-enums.h'] # GPLUGIN_PUBLIC_BUILT_HEADERS
GPLUGIN_H_INCLUDES = '@0@\n#include <gplugin/@1@>'.format(
GPLUGIN_H_INCLUDES,
header)
endforeach
conf = configuration_data()
conf.set('GPLUGIN_H_INCLUDES', GPLUGIN_H_INCLUDES)
gplugin_h = configure_file(
input : 'gplugin.h.in',
output : 'gplugin.h',
configuration : conf,
install : true,
install_dir : get_option('includedir') / 'gplugin-1.0')
# Build gplugin-native.h
GPLUGIN_NATIVE_H_INCLUDES = ''
foreach header : GPLUGIN_NATIVE_HEADERS
GPLUGIN_NATIVE_H_INCLUDES = '@0@\n#include <gplugin/@1@>'.format(
GPLUGIN_NATIVE_H_INCLUDES,
header)
endforeach
conf = configuration_data()
conf.set('GPLUGIN_NATIVE_H_INCLUDES', GPLUGIN_NATIVE_H_INCLUDES)
gplugin_native_h = configure_file(
input : 'gplugin-native.h.in',
output : 'gplugin-native.h',
configuration : conf,
install : true,
install_dir : get_option('includedir') / 'gplugin-1.0')
###############################################################################
# Library target
###############################################################################
gplugin = shared_library('gplugin',
GPLUGIN_SOURCES,
GPLUGIN_NATIVE_SOURCES,
GPLUGIN_PUBLIC_BUILT_SOURCES,
GPLUGIN_PRIVATE_SOURCES,
GPLUGIN_PRIVATE_BUILT_SOURCES,
GPLUGIN_NATIVE_HEADERS,
GPLUGIN_HEADERS,
GPLUGIN_PUBLIC_BUILT_HEADERS,
PRIVATE_HEADERS,
gplugin_h,
gplugin_native_h,
c_args : ['-DGPLUGIN_COMPILATION', '-DG_LOG_DOMAIN="GPlugin"'],
include_directories : toplevel_inc,
dependencies : [GLIB, GOBJECT, GMODULE],
version : GPLUGIN_LIBRARY_VERSION,
install : true
)
gplugin_dep = declare_dependency(
include_directories : [toplevel_inc, include_directories('.')],
link_with : gplugin,
sources : GPLUGIN_PUBLIC_BUILT_HEADERS, # Ensure they're built before use.
dependencies : [GLIB, GOBJECT]
)
pkgconfig.generate(
name : 'libgplugin',
description : 'A fully featured GModule based plugin library',
version : meson.project_version(),
filebase : 'gplugin',
subdirs : 'gplugin-1.0',
libraries : gplugin,
requires : ['glib-2.0', 'gobject-2.0', 'gmodule-2.0'],
variables : [
'plugindir=${libdir}',
],
)
###############################################################################
# gplugin-query executable
###############################################################################
gplugin_query = executable('gplugin-query',
'gplugin-query.c',
dependencies : [gplugin_dep, GLIB, GOBJECT],
install : true)
if get_option('help2man')
custom_target('gplugin-query.1',
command : [help2man,
'--name=Query installed plugins', '--section=1',
'--help-option=--help-all', '--no-info',
'--output', '@OUTPUT@',
gplugin_query],
output : 'gplugin-query.1',
install : true,
install_dir : get_option('mandir') / 'man1')
endif
###############################################################################
# loader-tests static library
###############################################################################
gplugin_loader_tests = static_library('gplugin-loader-tests',
'gplugin-loader-tests.c',
'gplugin-loader-tests.h',
c_args : ['-DGI_TYPELIB_PATH="@0@"'.format(meson.current_build_dir())],
dependencies : [gplugin_dep],
)
###############################################################################
# GObject Introspection
###############################################################################
if get_option('gobject-introspection')
gplugin_gir = gnome.generate_gir(gplugin,
sources : GPLUGIN_SOURCES + GPLUGIN_HEADERS +
GPLUGIN_PUBLIC_BUILT_SOURCES +
GPLUGIN_PUBLIC_BUILT_HEADERS,
includes : ['GModule-2.0', 'GObject-2.0'],
header : 'gplugin.h',
namespace : 'GPlugin',
symbol_prefix : 'gplugin',
nsversion : '1.0',
install : true,
export_packages : ['gplugin'],
extra_args : ['--quiet', '-DGPLUGIN_COMPILATION'])
endif
###############################################################################
# Install Stuff
###############################################################################
# install the normal includes into the gplugin subdirectory
install_headers(
GPLUGIN_HEADERS,
GPLUGIN_NATIVE_HEADERS,
subdir : 'gplugin-1.0/gplugin'
)
###############################################################################
# subdirectories
###############################################################################
subdir('share')
subdir('tests')
if ENABLE_DOC
subdir('reference')
endif