Update the gjs loader for the meson build system
--- a/gjs/CMakeLists.txt Mon Jun 05 22:33:20 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
- "Whether or not to build the GJS JavaScript plugin loader"
- set(GPLUGIN_GJS_SOURCES
- set(GPLUGIN_GJS_HEADERS
- pkg_check_modules(GJS REQUIRED gjs-1.0>=1.32.0)
- include_directories(${GJS_INCLUDE_DIRS})
- link_directories(${GJS_LIBRARY_DIRS})
- add_library(gplugin-gjs MODULE
- target_compile_features(gplugin-gjs PRIVATE cxx_deleted_functions)
- set_target_properties(gplugin-gjs PROPERTIES PREFIX "")
- target_link_libraries(gplugin-gjs
- install(TARGETS gplugin-gjs DESTINATION lib/gplugin)
- add_subdirectory(tests)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/meson.build Mon Jun 05 23:09:04 2017 -0500
@@ -0,0 +1,55 @@
+ if not get_option('gobject-introspection') + error('gnome-javascript plugin requires GObject Introspection.') + GPLUGIN_GJS_SOURCES = [ + 'gplugin-gjs-loader.cc', + 'gplugin-gjs-plugin.cc', + GPLUGIN_GJS_HEADERS = [ + 'gplugin-gjs-loader.h', + 'gplugin-gjs-plugin.h', + GJS = dependency('gjs-1.0', version: '>=1.32.0') + MOZJS = dependency('mozjs-24', version: '>=24.0.0') + # tell meson we need cpp since we have gjs + '-DPREFIX="@0@"'.format(get_option('prefix')), + '-DLIBDIR="@0@"'.format(get_option('libdir')), + '-DGPLUGIN_WEBSITE="http://bitbucket.org/gplugin/main"', + # check if we're using gcc + if meson.get_compiler('cpp').get_id() == 'gcc' or host_machine.platform() == 'darwin' + '-DGPLUGIN_UNUSED=__attribute__((unused))', + shared_library('gplugin-gjs', + dependencies : [GIO, GJS, MOZJS, gplugin_dep], + install_dir : join_paths(get_option('libdir'), 'gplugin'), +if get_option('testing') --- a/gjs/tests/CMakeLists.txt Mon Jun 05 22:33:20 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-macro(add_gjs_gtest target)
- add_executable(${target} ${target}.c)
- target_link_libraries(${target}
- ${GLIB_LIBRARIES} ${GJS_LIBRARIES} gplugin
- add_dependencies(${target} gplugin-gjs)
- get_target_property(_output_name ${target} RUNTIME_OUTPUT_NAME)
- if(NOT ${_output_name})
- get_target_property(_output_name ${target} LOCATION)
- endif(NOT ${_output_name})
- list(APPEND GJS_TESTS ${_output_name})
- -DGJS_LOADER_DIR="${CMAKE_BINARY_DIR}/gjs"
- -DGJS_PLUGIN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/plugins"
-add_gjs_gtest(test-gjs-loader)
-target_link_libraries(test-gjs-loader gplugin-loader-tests)
-set(GTESTER_GJS_TESTS "${GJS_TESTS}")
-set(GTESTER_GJS_LOG "test-gplugin-gjs.xml")
-set(GTESTER_GJS_JUNIT "test-gplugin-gjs-junit.xml")
- COMMAND ${GTESTER} -k --verbose -o ${GTESTER_GJS_LOG} ${GJS_TESTS}
- OUTPUT ${GTESTER_GJS_LOG}
- DEPENDS gplugin gplugin-gjs
- ${GJS_TESTS} ${CMAKE_CURRENT_SOURCE_DIR}/plugins
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMAND ${XSLTPROC} -o ${GTESTER_GJS_JUNIT} --nonet
- ${CMAKE_SOURCE_DIR}/xsl/gtester-junit.xsl
- OUTPUT ${GTESTER_GJS_JUNIT}
- DEPENDS ${GTESTER_GJS_LOG}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-add_custom_target(gjs-tests ALL
- DEPENDS ${GTESTER_GJS_LOG} ${GTESTER_GJS_JUNIT} ${GJS_TESTS}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gjs/tests/meson.build Mon Jun 05 23:09:04 2017 -0500
@@ -0,0 +1,13 @@
+e = executable('test-gjs-loader', 'test-gjs-loader.c', + include_directories : include_directories('.'), + '-DGJS_LOADER_DIR="@0@/gjs"'.format(meson.build_root()), + '-DGJS_PLUGIN_DIR="@0@/plugins"'.format(meson.current_source_dir()), + link_with : gplugin_loader_tests, + dependencies : [GLIB, GOBJECT, GJS, gplugin_dep]) +test('GNOME JavaScript loader', e) --- a/gjs/tests/test-gjs-loader.c Mon Jun 05 22:33:20 2017 -0500
+++ b/gjs/tests/test-gjs-loader.c Mon Jun 05 23:09:04 2017 -0500
@@ -1,5 +1,5 @@
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
+ * Copyright (C) 2011-2017 Gary Kramlich <grim@reaperworld.com> * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
--- a/meson.build Mon Jun 05 22:33:20 2017 -0500
+++ b/meson.build Mon Jun 05 23:09:04 2017 -0500
@@ -37,6 +37,7 @@
GLIB = dependency('glib-2.0', version : '>=2.34.0')
GOBJECT = dependency('gobject-2.0')
+GIO = dependency('gio-2.0') # we separate gmodule out so our test aren't linked to it
GMODULE = dependency('gmodule-2.0')
--- a/meson_options.txt Mon Jun 05 22:33:20 2017 -0500
+++ b/meson_options.txt Mon Jun 05 23:09:04 2017 -0500
@@ -26,6 +26,12 @@
+ type : 'boolean', value : true, + description : 'Whether or not to build the GNOME JavaScript plugin loader' type : 'boolean', value : true,
description : 'Whether or not to build the gtk3 library'