gplugin/gplugin

closing this branch as there is no demand for this
feature/ruby-loader
16 months ago, Gary Kramlich
d44bad5e041e
closing this branch as there is no demand for this
###############################################################################
# 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('gplugin-enums',
sources : ENUM_HEADERS,
c_template : 'gplugin-enums.c.tmpl',
h_template : 'gplugin-enums.h.tmpl',
identifier_prefix : 'GPlugin',
install_header : true,
install_dir : join_paths(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
]
###############################################################################
# gplugin-marshallers.[ch] generation
###############################################################################
marshallers = gnome.genmarshal('gplugin-marshallers',
sources : 'gplugin-marshallers.list',
prefix : 'gplugin_marshal')
marshallers_c = marshallers[0]
marshallers_h = marshallers[1]
GPLUGIN_PRIVATE_BUILT_HEADERS += [
marshallers_h
]
GPLUGIN_PRIVATE_BUILT_SOURCES += [
marshallers_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 : join_paths(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 : join_paths(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 : join_paths(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}',
],
)
# nls
if get_option('nls')
# gettextize_pot_file(
# SORT
# LANGUAGES C
# SOURCES ${GPLUGIN_SOURCES} ${GPLUGIN_NATIVE_SOURCES} gplugin-query.c
# BUILT_SOURCES ${GPLUGIN_PUBLIC_BUILT_SOURCES}
# FILENAME gplugin.pot
# )
endif
###############################################################################
# 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 : join_paths(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'],
namespace : 'GPlugin',
symbol_prefix : 'gplugin',
nsversion : '@0@.0'.format(GPLUGIN_MAJOR_VERSION),
install : true)
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('tests')
if ENABLE_DOC
subdir('reference')
endif