gplugin/gplugin

Add preliminary meson build.
feature/meson
2016-09-26, Elliott Sales de Andrade
092effa35253
Parents f3779e07c963
Children aee3a6f05682
Add preliminary meson build.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,119 @@
+if get_option('gtk3')
+
+###############################################################################
+# Build Info
+###############################################################################
+GTK3 = dependency('gtk+-3.0', version : '>=3.0.0')
+
+GPLUGIN_GTK_LD_CURRENT = 0
+GPLUGIN_GTK_LD_REVISION = 1
+GPLUGIN_GTK_LD_AGE = 0
+GPLUGIN_GTK_LD_VERSION = '@0@.@1@.@2@'.format(
+ GPLUGIN_GTK_LD_CURRENT,
+ GPLUGIN_GTK_LD_REVISION,
+ GPLUGIN_GTK_LD_AGE)
+
+GPLUGIN_GTK_SOURCES = [
+ 'gplugin-gtk-plugin-info.c',
+ 'gplugin-gtk-store.c',
+ 'gplugin-gtk-view.c',
+]
+
+GPLUGIN_GTK_HEADERS = [
+ 'gplugin-gtk-plugin-info.h',
+ 'gplugin-gtk-store.h',
+ 'gplugin-gtk-view.h',
+]
+
+GPLUGIN_GTK_PRIVATE_SOURCES = [
+]
+
+GPLUGIN_GTK_PRIVATE_HEADERS = [
+]
+
+GPLUGIN_GTK_BUILT_SOURCES = [
+]
+
+GPLUGIN_GTK_BUILT_HEADERS = [
+]
+
+###############################################################################
+# Configure Files
+###############################################################################
+GPLUGIN_GTK_H_INCLUDES = ''
+
+foreach header : GPLUGIN_GTK_HEADERS
+ GPLUGIN_GTK_H_INCLUDES = '@0@\n#include <gplugin-gtk/@1@>'.format(
+ GPLUGIN_GTK_H_INCLUDES,
+ header)
+endforeach
+
+conf = configuration_data()
+conf.set('GPLUGIN_GTK_H_INCLUDES', GPLUGIN_GTK_H_INCLUDES)
+gplugin_gtk_h = configure_file(
+ input : 'gplugin-gtk.h.in',
+ output : 'gplugin-gtk.h',
+ configuration : conf,
+ install : true,
+ install_dir : get_option('includedir') + '/gplugin-1.0')
+
+configure_file(
+ input : 'gplugin-gtk.pc.in',
+ output : 'gplugin-gtk.pc',
+ configuration : conf,
+ install : true,
+ install_dir : get_option('libdir') + '/pkgconfig')
+
+###############################################################################
+# Library Target
+###############################################################################
+gplugin_gtk = shared_library('gplugin-gtk',
+ GPLUGIN_GTK_SOURCES,
+ GPLUGIN_GTK_HEADERS,
+ GPLUGIN_GTK_PRIVATE_SOURCES,
+ GPLUGIN_GTK_PRIVATE_HEADERS,
+ GPLUGIN_GTK_BUILT_SOURCES,
+ GPLUGIN_GTK_BUILT_HEADERS,
+ c_args : ['-DGPLUGIN_GTK_COMPILATION', '-DG_LOG_DOMAIN="GPluginGtk"'],
+ include_directories : toplevel_inc,
+ dependencies : [gplugin_dep, GTK3],
+ soversion : GPLUGIN_GTK_LD_CURRENT,
+ version : GPLUGIN_GTK_LD_VERSION,
+ install : true
+)
+
+# install the normal includes into the gplugin-gtk subdirectory
+install_headers(
+ GPLUGIN_GTK_HEADERS,
+ subdir : 'gplugin-1.0/gplugin-gtk'
+)
+
+# install the GtkBuilder files
+install_data(
+ 'gplugin-gtk-plugin-info.ui',
+ install_dir : get_option('datadir') + '/gplugin/gplugin-gtk/'
+)
+
+###############################################################################
+# Application Target
+###############################################################################
+gplugin_gtk_viewer = executable('gplugin-gtk-viewer',
+ 'gplugin-gtk-viewer.c',
+ link_with : [gplugin_gtk],
+ dependencies : [gplugin_dep, GTK3],
+ install : true
+)
+
+if get_option('help2man')
+ gplugin_gtk_viewer_man = custom_target('gplugin-gtk-viewer.1',
+ command : [help2man,
+ '--name=View installed plugins', '--section=1',
+ '--help-option=--help-all',
+ '--output', '@OUTPUT@',
+ gplugin_gtk_viewer],
+ output : 'gplugin-gtk-viewer.1',
+ install : true,
+ install_dir : get_option('mandir') + '/man1')
+endif
+
+endif # gtk3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,281 @@
+###############################################################################
+# Library
+###############################################################################
+
+GPLUGIN_LD_CURRENT = 0
+GPLUGIN_LD_REVISION = 1
+GPLUGIN_LD_AGE = 0
+GPLUGIN_LD_VERSION = '@0@.@1@.@2@'.format(
+ GPLUGIN_LD_CURRENT,
+ GPLUGIN_LD_REVISION,
+ GPLUGIN_LD_AGE)
+
+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_h = gnome.mkenums('gplugin-enums.h',
+ sources : ENUM_HEADERS,
+ template : 'gplugin-enums.h.tmpl',
+ identifier_prefix : 'GPlugin',
+ install : true,
+ install_dir : get_option('includedir') + '/gplugin-1.0/gplugin')
+enums_c = gnome.mkenums('gplugin-enums.c',
+ sources : ENUM_HEADERS,
+ template : 'gplugin-enums.c.tmpl',
+ identifier_prefix : 'GPlugin')
+
+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 : get_option('includedir') + '/gplugin-1.0/gplugin')
+GPLUGIN_PUBLIC_BUILT_HEADERS += [
+ gplugin_version_h
+]
+
+configure_file(
+ input : 'gplugin.pc.in',
+ output : 'gplugin.pc',
+ configuration : version_conf,
+ install : true,
+ install_dir : get_option('libdir') + '/pkgconfig')
+configure_file(
+ input : 'gplugin-uninstalled.pc.in',
+ output : 'gplugin-uninstalled.pc',
+ configuration : version_conf)
+
+
+# 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],
+ soversion : GPLUGIN_LD_CURRENT,
+ version : GPLUGIN_LD_VERSION,
+ install : true
+)
+gplugin_dep = declare_dependency(
+ include_directories : [toplevel_inc, include_directories('.')],
+ link_with : gplugin,
+ dependencies : [GLIB, GOBJECT]
+)
+
+# 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',
+ '--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'],
+ namespace : 'GPlugin',
+ symbol_prefix : 'gplugin',
+ nsversion : '@0@.0'.format(GPLUGIN_MAJOR_VERSION),
+ install : true)
+# # For loader plugin tests dependencies
+# set(GPLUGIN_GIR_TARGETS ${GPLUGIN_GIR_TARGETS} PARENT_SCOPE)
+endif
+
+###############################################################################
+# Install Stuff
+###############################################################################
+# install the normal includes into the gplugin subdirectory
+install_headers(
+ GPLUGIN_HEADERS,
+ GPLUGIN_NATIVE_HEADERS,
+ subdir : 'gplugin-1.0/gplugin'
+)
+
+###############################################################################
+# subdirectories
+###############################################################################
+if get_option('testing')
+ subdir('tests')
+endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/bad-plugins/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,3 @@
+shared_library('query-error', 'query-error.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/bind-local/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,3 @@
+shared_library('bind-local', 'bind-local.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/dynamic-type/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,10 @@
+dynamic_type_provider = shared_library('dynamic-type-provider',
+ 'dynamic-type-provider.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('dynamic-type-user', 'dynamic-type-user.c',
+ name_prefix : '',
+ # FIXME: Only here because meson defaults to -Wl,--no-undefined.
+ link_with : [dynamic_type_provider],
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/id-collision/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,7 @@
+shared_library('id-collision1', 'id-collision1.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('id-collision2', 'id-collision2.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/load-on-query-fail/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,3 @@
+shared_library('load-on-query-fail', 'load-on-query-fail.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/load-on-query-pass/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,3 @@
+shared_library('load-on-query-pass', 'load-on-query-pass.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,182 @@
+###############################################################################
+# Subdirectories
+###############################################################################
+subdir('plugins')
+subdir('bad-plugins')
+subdir('dynamic-type')
+subdir('id-collision')
+subdir('load-on-query-pass')
+subdir('load-on-query-fail')
+subdir('versioned-dependencies')
+subdir('bind-local')
+
+###############################################################################
+# Tests
+###############################################################################
+
+#######################################
+# Simple Tests (single file)
+#######################################
+e = executable('test-core', 'test-core.c',
+ c_args : [
+ '-DTEST_DIR="@0@/plugins/"'.format(
+ meson.current_build_dir()),
+ '-DTEST_ID_DIR="@0@/id-collision/"'.format(
+ meson.current_build_dir()),
+ ],
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Core', e)
+
+e = executable('test-option-group', 'test-option-group.c',
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Option Group', e)
+
+e = executable('test-plugin-manager-paths', 'test-plugin-manager-paths.c',
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Plugin Manager Paths', e)
+
+e = executable('test-plugin-info', 'test-plugin-info.c',
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Plugin Info', e)
+
+e = executable('test-signals', 'test-signals.c',
+ c_args : ['-DTEST_DIR="@0@/plugins/"'.format(meson.current_build_dir())],
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Signals', e)
+
+e = executable('test-version-compare', 'test-version-compare.c',
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Version Compare', e)
+
+#######################################
+# Dynamic Type
+#######################################
+e = executable('test-dynamic-type', 'test-dynamic-type.c',
+ c_args : [
+ '-DTEST_DYNAMIC_DIR="@0@/dynamic-type/"'.format(
+ meson.current_build_dir())
+ ],
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Dynamic Type', e)
+#add_dependencies(test-dynamic-type dynamic-type-provider dynamic-type-user)
+
+#######################################
+# ID Collision
+#######################################
+e = executable('test-id-collision', 'test-id-collision.c',
+ c_args : [
+ '-DTEST_ID_DIR="@0@/id-collision/"'.format(
+ meson.current_build_dir()),
+ ],
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('ID Collision', e)
+#add_dependencies(test-id-collision id-collision1 id-collision2)
+
+#######################################
+# Load On Query
+#######################################
+e = executable('test-load-on-query', 'test-load-on-query.c',
+ c_args : [
+ '-DTEST_DIR="@0@/plugins/"'.format(
+ meson.current_build_dir()),
+ '-DTEST_LOAD_ON_QUERY_PASS_DIR="@0@/load-on-query-pass"'.format(
+ meson.current_build_dir()),
+ '-DTEST_LOAD_ON_QUERY_FAIL_DIR="@0@/load-on-query-fail"'.format(
+ meson.current_build_dir())
+ ],
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Load On Query', e)
+#add_dependencies(test-load-on-query load-on-query-pass load-on-query-fail)
+
+#######################################
+# Versioned Dependencies
+#######################################
+e = executable('test-versioned-dependencies', 'test-versioned-dependencies.c',
+ c_args : [
+ '-DTEST_VERSIONED_DEPENDENCY_DIR="@0@/versioned-dependencies"'.format(
+ meson.current_build_dir()),
+ ],
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Versioned Dependencies', e)
+#add_dependencies(test-versioned-dependencies
+# super-dependent
+# no-version
+# exact1
+# exact2
+# greater
+# greater-equal
+# less
+# less-equal
+# bar
+# baz
+# fez
+#)
+
+#######################################
+# Native Loader
+#######################################
+e = executable('test-native-loader', 'test-native-loader.c',
+ c_args : [
+ '-DTEST_DIR="@0@/plugins/"'.format(
+ meson.current_build_dir()),
+ '-DTEST_BAD_DIR="@0@/bad-plugins/"'.format(
+ meson.current_build_dir()),
+ '-DTEST_ID_DIR="@0@/id-collision/"'.format(
+ meson.current_build_dir()),
+ ],
+ link_with : gplugin_loader_tests,
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Native Loader', e)
+#add_dependencies(test-native-loader
+# basic-plugin
+# dependent-plugin
+# broken-dependent-plugin
+# query-error
+#
+# load-exception
+# load-failed
+# unload-failed
+#)
+
+###############################################################################
+# Bind Local
+###############################################################################
+e = executable('test-bind-local', 'test-bind-local.c',
+ c_args : [
+ '-DTEST_BIND_LOCAL_DIR="@0@/bind-local/"'.format(
+ meson.current_build_dir()),
+ '-DTEST_BAD_DIR="@0@/bad-plugins/"'.format(
+ meson.current_build_dir()),
+ '-DTEST_ID_DIR="@0@/id-collision/"'.format(
+ meson.current_build_dir()),
+ ],
+ dependencies : [gplugin_dep, GLIB, GOBJECT])
+test('Bind Local', e)
+#add_dependencies(test-bind-local bind-local)
+
+###############################################################################
+# GTester Stuff
+###############################################################################
+#set(GTESTER_TESTS "${TESTS}")
+#set(GTESTER_LOG "testgplugin.xml")
+#set(GTESTER_JUNIT "testgplugin-junit.xml")
+
+#add_custom_command(
+# COMMAND ${GTESTER} -k --verbose -o ${GTESTER_LOG} ${GTESTER_TESTS}
+# OUTPUT ${GTESTER_LOG}
+# DEPENDS ${TESTS}
+# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+#)
+#
+#add_custom_command(
+# COMMAND ${XSLTPROC} -o ${GTESTER_JUNIT} --nonet
+# ${CMAKE_SOURCE_DIR}/xsl/gtester-junit.xsl
+# ${GTESTER_LOG}
+# OUTPUT ${GTESTER_JUNIT}
+# DEPENDS ${GTESTER_LOG}
+# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+#)
+#
+#add_custom_target(tests ALL
+# DEPENDS ${GTESTER_LOG} ${GTESTER_JUNIT}
+#)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/plugins/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,23 @@
+shared_library('basic-plugin', 'basic-plugin.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('dependent-plugin', 'dependent-plugin.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('broken-dependent-plugin', 'broken-dependent-plugin.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('load-failed', 'load-failed.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('load-exception', 'load-exception.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('unload-failed', 'unload-failed.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/tests/versioned-dependencies/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,43 @@
+shared_library('super-dependent', 'super-dependent.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('no-version', 'no-version.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('exact1', 'exact1.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('exact2', 'exact2.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('greater', 'greater.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('greater-equal', 'greater-equal.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('less', 'less.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('less-equal', 'less-equal.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('bar', 'bar.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('baz', 'baz.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
+
+shared_library('fez', 'fez.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep, GLIB])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lua/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,54 @@
+if get_option('lua')
+ if not get_option('gobject-introspection')
+ error('Lua plugin requires GObject Introspection.')
+ endif
+
+ GPLUGIN_LUA_SOURCES = [
+ 'gplugin-lua-core.c',
+ 'gplugin-lua-loader.c',
+ 'gplugin-lua-plugin.c',
+ ]
+
+ GPLUGIN_LUA_HEADERS = [
+ 'gplugin-lua-loader.h',
+ 'gplugin-lua-plugin.h',
+ ]
+
+ _LUAS = [['lua', '>=5.1.0'],
+ ['lua5.1', '>=5.1.0'],
+ ['luajit', '>=2.0.0'],
+ ['lua5.2', '>=5.2.0']]
+ LUA_FOUND = false
+ foreach _LUA : _LUAS
+ if not LUA_FOUND
+ LUA = dependency(_LUA[0], version : _LUA[1], required : false)
+ LUA_FOUND = LUA.found()
+ endif
+ endforeach
+
+ if not LUA_FOUND
+ error('No usable Lua library was found')
+ endif
+
+ # Compile and run our lua-lgi test program
+ lua_lgi_test = compiler.run(files('gplugin-lua-test-lgi.c'),
+ dependencies : LUA,
+ name : 'lua "lgi" module')
+ if not lua_lgi_test.compiled() or lua_lgi_test.returncode() != 0
+# error('Failed to find the "lgi" lua module')
+ endif
+
+ # now add the library
+ shared_library('gplugin-lua',
+ GPLUGIN_LUA_SOURCES,
+ GPLUGIN_LUA_HEADERS,
+ name_prefix : '',
+ dependencies : [LUA, gplugin_dep],
+ install : true,
+ install_dir : get_option('libdir') + '/gplugin'
+ )
+endif # lua
+
+if get_option('testing')
+ subdir('tests')
+endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lua/tests/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,29 @@
+if get_option('lua')
+
+e = executable('test-lua-loader', 'test-lua-loader.c',
+ c_args : [
+ '-DLUA_LOADER_DIR="@0@/lua"'.format(meson.build_root()),
+ '-DLUA_PLUGIN_DIR="@0@/lua-plugins"'.format(
+ meson.current_source_dir()),
+ '-DMOONSCRIPT_PLUGIN_DIR="@0@/moonscript-plugins"'.format(
+ meson.current_source_dir()),
+ ],
+ link_with : gplugin_loader_tests,
+ dependencies : [GLIB, GOBJECT, LUA, gplugin_dep])
+test('Lua Loader', e)
+
+if get_option('moonscript-tests')
+ e = executable('test-lua-moon-loader', 'test-lua-moon-loader.c',
+ c_args : [
+ '-DLUA_LOADER_DIR="@0@/lua"'.format(meson.build_root()),
+ '-DLUA_PLUGIN_DIR="@0@/lua-plugins"'.format(
+ meson.current_source_dir()),
+ '-DMOONSCRIPT_PLUGIN_DIR="@0@/moonscript-plugins"'.format(
+ meson.current_source_dir()),
+ ],
+ link_with : gplugin_loader_tests,
+ dependencies : [GLIB, GOBJECT, LUA, gplugin_dep])
+ test('Lua Moon Loader', e)
+endif
+
+endif # lua
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,145 @@
+###############################################################################
+# Project Info
+###############################################################################
+project('gplugin', 'c', meson_version : '>0.34.0',
+ default_options : ['c_std=c99'])
+
+GPLUGIN_MAJOR_VERSION = 0
+GPLUGIN_MINOR_VERSION = 25
+GPLUGIN_MICRO_VERSION = 0
+GPLUGIN_EXTRA_VERSION = ''
+
+GPLUGIN_VERSION = '@0@.@1@.@2@@3@'.format(
+ GPLUGIN_MAJOR_VERSION,
+ GPLUGIN_MINOR_VERSION,
+ GPLUGIN_MICRO_VERSION,
+ GPLUGIN_EXTRA_VERSION)
+
+version_conf = configuration_data()
+version_conf.set('GPLUGIN_MAJOR_VERSION', GPLUGIN_MAJOR_VERSION)
+version_conf.set('GPLUGIN_MINOR_VERSION', GPLUGIN_MINOR_VERSION)
+version_conf.set('GPLUGIN_MICRO_VERSION', GPLUGIN_MICRO_VERSION)
+version_conf.set('GPLUGIN_EXTRA_VERSION', GPLUGIN_EXTRA_VERSION)
+version_conf.set('GPLUGIN_VERSION', GPLUGIN_VERSION)
+
+LOCALE_DIR = get_option('prefix') + '/locale'
+add_global_arguments('-DLOCALEDIR="@0@"'.format(LOCALE_DIR), language : 'c')
+
+###############################################################################
+# Dependencies
+###############################################################################
+if get_option('help2man')
+ help2man = find_program('help2man')
+endif
+
+GLIB = dependency('glib-2.0', version : '>=2.32.0')
+GOBJECT = dependency('gobject-2.0')
+
+# we separate gmodule out so our test aren't linked to it
+GMODULE = dependency('gmodule-2.0')
+
+gnome = import('gnome')
+
+if get_option('testing')
+ GTESTER = find_program('gtester')
+ XSLTPROC = find_program('xsltproc')
+endif
+
+###############################################################################
+# NLS
+###############################################################################
+GETTEXT_PACKAGE = 'gplugin'
+
+add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(GETTEXT_PACKAGE),
+ language : 'c')
+
+if get_option('nls')
+ i18n = import('i18n')
+endif
+
+###############################################################################
+# Build Info
+###############################################################################
+compiler = meson.get_compiler('c')
+
+add_global_arguments(
+ '-DPREFIX="@0@"'.format(get_option('prefix')),
+ '-DLIBDIR="@0@"'.format(get_option('libdir')),
+ '-DGPLUGIN_WEBSITE="http://bitbucket.org/gplugin/main"',
+ language : 'c'
+)
+
+if compiler.has_argument('-Wformat')
+ add_global_arguments('-Wformat', language : 'c')
+ if compiler.compiles('int i;\n',
+ name : '-Werror=format-security',
+ args : ['-Wformat', '-Werror=format-security'])
+ add_global_arguments('-Werror=format-security', language : 'c')
+ endif
+endif
+
+# check if we're using gcc
+if compiler.get_id() == 'gcc'
+ add_global_arguments(
+ '-DGPLUGIN_UNUSED=__attribute__((unused))',
+ '-ggdb',
+ language : 'c'
+ )
+else
+ add_global_arguments(
+ '-DGPLUGIN_UNUSED=',
+ language : 'c'
+ )
+endif
+
+toplevel_inc = include_directories('.')
+
+###############################################################################
+# Subdirectories
+###############################################################################
+subdir('gplugin')
+subdir('gplugin-gtk')
+subdir('plugins')
+subdir('po')
+
+subdir('lua')
+subdir('perl')
+subdir('python')
+
+###############################################################################
+# Install stuff
+###############################################################################
+# documentation
+install_data('ChangeLog', 'INSTALL', 'README', 'HACKING',
+ install_dir : get_option('datadir'))
+
+###############################################################################
+# make dist
+###############################################################################
+#set(ARCHIVES
+# gplugin-${GPLUGIN_VERSION}.tar.bz2
+# gplugin-${GPLUGIN_VERSION}.tar.gz
+# gplugin-${GPLUGIN_VERSION}.zip
+#)
+
+#set(SIGNATURES)
+
+#foreach(ARCHIVE ${ARCHIVES})
+# add_custom_command(
+# COMMAND hg archive ${ARCHIVE}
+# OUTPUT ${ARCHIVE}
+# DEPENDS .
+# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+# )
+#
+# add_custom_command(
+# COMMAND gpg --yes -abs ${ARCHIVE}
+# OUTPUT ${ARCHIVE}.asc
+# DEPENDS . ${ARCHIVE}
+# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+# )
+#
+# list(APPEND SIGNATURES ${ARCHIVE}.asc)
+#endforeach(ARCHIVE)
+#
+#add_custom_target(dist DEPENDS ${ARCHIVES} ${SIGNATURES})
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/meson_options.txt Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,56 @@
+###############################################################################
+# Options
+###############################################################################
+option(
+ 'gobject-introspection',
+ type : 'boolean', value : true,
+ description : 'Whether or not to build a GObject Introspection type library'
+)
+
+option(
+ 'nls',
+ type : 'boolean', value : true,
+ description : 'Install translation files'
+)
+
+option(
+ 'testing',
+ type : 'boolean', value : true,
+ description : 'Whether or not to run unit tests while compiling'
+)
+
+option(
+ 'help2man',
+ type : 'boolean', value : true,
+ description : 'Whether or not to build man pages from --help output'
+)
+
+option(
+ 'gtk3',
+ type : 'boolean', value : true,
+ description : 'Whether or not to build the gtk3 library'
+)
+
+option(
+ 'lua',
+ type : 'boolean', value : true,
+ description : 'Whether or not to build the Lua plugin loader'
+)
+
+option(
+ 'moonscript-tests',
+ type : 'boolean', value : false,
+ description : 'Whether or not to run the moonscript tests'
+)
+
+option(
+ 'perl',
+ type : 'boolean', value : false,
+ description : 'Whether or not to build the Perl plugin loader'
+)
+
+option(
+ 'python',
+ type : 'boolean', value : true,
+ description : 'Whether or not to build the Python 3.x plugin loader'
+)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/perl/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,37 @@
+if get_option('perl')
+ if not get_option('gobject-introspection')
+ error('Perl plugin requires GObject Introspection.')
+ endif
+
+ GPLUGIN_PERL_SOURCES = [
+ 'gplugin-perl-core.c',
+ 'gplugin-perl-loader.c',
+ 'gplugin-perl-plugin.c',
+ ]
+
+ GPLUGIN_PERL_HEADERS = [
+ 'gplugin-perl-loader.h',
+ 'gplugin-perl-plugin.h',
+ ]
+
+ PERL = find_program('perl')
+ PERL_CFLAGS = run_command(PERL, '-MExtUtils::Embed', '-e', 'ccopts').stdout()
+ PERL_LDFLAGS = run_command(PERL, '-MExtUtils::Embed', '-e', 'ldopts').stdout()
+
+ message('PERL_CFLAGS ' + PERL_CFLAGS)
+ message('PERL_LDFLAGS ' + PERL_LDFLAGS)
+
+ PERL_CFLAGS = PERL_CFLAGS.split()
+ PERL_LDFLAGS = PERL_LDFLAGS.split()
+
+ shared_library('gplugin-perl',
+ GPLUGIN_PERL_SOURCES,
+ GPLUGIN_PERL_HEADERS,
+ c_args : PERL_CFLAGS,
+ link_args : PERL_LDFLAGS,
+ name_prefix : '',
+ dependencies : [gplugin_dep],
+ install : true,
+ install_dir : get_option('libdir') + '/gplugin'
+ )
+endif # perl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,6 @@
+shared_library('gplugin-license-check',
+ 'gplugin-license-check.c',
+ name_prefix : '',
+ dependencies : [gplugin_dep],
+ install : true,
+ install_dir : get_option('libdir') + '/gplugin')
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/po/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,3 @@
+if get_option('nls')
+# GETTEXTIZE_TRANSLATIONS(UPDATE)
+endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/python/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,59 @@
+if get_option('python')
+ if not get_option('gobject-introspection')
+ error('Python plugin requires GObject Introspection.')
+ endif
+
+ GPLUGIN_PYTHON_SOURCES = [
+ 'gplugin-python-core.c',
+ 'gplugin-python-loader.c',
+ 'gplugin-python-plugin.c',
+ 'gplugin-python-utils.c',
+ ]
+
+ GPLUGIN_PYTHON_HEADERS = [
+ 'gplugin-python-loader.h',
+ 'gplugin-python-plugin.h',
+ 'gplugin-python-utils.h',
+ ]
+
+ PYTHON3 = dependency('python3')
+
+ PYGOBJECT = dependency('pygobject-3.0', version : '>=3.0.0')
+
+ # Compile and run our python-gi test program
+ python_gi_test = compiler.run(files('gplugin-python-test-pygobject.c'),
+ dependencies : [GLIB, PYTHON3, PYGOBJECT],
+ name : 'Python GI')
+ if not python_gi_test.compiled() or python_gi_test.returncode() != 0
+# error('pygobject does not work with python3')
+ endif
+
+ # Now add our libraries
+ gplugin_python_inc = include_directories('.')
+ gplugin_python = shared_library('gplugin-python',
+ GPLUGIN_PYTHON_SOURCES,
+ GPLUGIN_PYTHON_HEADERS,
+ name_prefix : '',
+ dependencies : [PYTHON3, PYGOBJECT, gplugin_dep],
+ install : true,
+ install_dir : get_option('libdir') + '/gplugin'
+ )
+ gplugin_python_dep = declare_dependency(
+ include_directories : gplugin_python_inc,
+ link_with : gplugin_python,
+ )
+
+ gplugin_python_static = static_library('gplugin-python-static',
+ GPLUGIN_PYTHON_SOURCES,
+ GPLUGIN_PYTHON_HEADERS,
+ dependencies : [PYTHON3, PYGOBJECT, gplugin_dep],
+ )
+ gplugin_python_static_dep = declare_dependency(
+ include_directories : gplugin_python_inc,
+ link_with : gplugin_python_static,
+ )
+endif # python
+
+if get_option('testing')
+ subdir('tests')
+endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/python/tests/meson.build Mon Sep 26 03:24:14 2016 -0400
@@ -0,0 +1,26 @@
+if get_option('python')
+
+e = executable('test-python-loader', 'test-python-loader.c',
+ include_directories : include_directories('.'),
+ c_args : [
+ '-DPYTHON_LOADER_DIR="@0@/python"'.format(meson.build_root()),
+ '-DPYTHON_PLUGIN_DIR="@0@/plugins"'.format(meson.current_source_dir()),
+ ],
+ link_with : gplugin_loader_tests,
+ dependencies : [GLIB, GOBJECT, PYTHON3, PYGOBJECT, gplugin_dep])
+test('Python loader', e)
+
+# we can't see the symbols in gplugin-python externally, so use the static
+# version for testing
+e = executable('test-python-utils', 'test-python-utils.c',
+ include_directories : include_directories('.'),
+ c_args : [
+ '-DPYTHON_LOADER_DIR="@0@/python"'.format(meson.build_root()),
+ '-DPYTHON_PLUGIN_DIR="@0@/plugins"'.format(meson.current_source_dir()),
+ ],
+ link_with : [gplugin_loader_tests],
+ dependencies : [GLIB, GOBJECT, PYTHON3, PYGOBJECT,
+ gplugin_python_static_dep])
+test('Python utils', e)
+
+endif # python