merge in the osx homebrew fixes
--- a/CMakeLists.txt Sun May 15 23:22:42 2016 -0500
+++ b/CMakeLists.txt Sun Aug 21 23:23:29 2016 -0500
@@ -17,6 +17,9 @@
# don't force target names to match a pattern
cmake_policy(SET CMP0037 OLD)
+ cmake_policy(SET CMP0042 NEW) endif(${CMAKE_VERSION} VERSION_GREATER "3.0.0")
###############################################################################
@@ -156,16 +159,16 @@
# check if we're using gcc
-if(CMAKE_COMPILER_IS_GNUCC)
+if(CMAKE_COMPILER_IS_GNUCC OR APPLE) -DGPLUGIN_UNUSED=__attribute__\(\(unused\)\)
-else(CMAKE_COMPILER_IS_GNUCC)
+else(CMAKE_COMPILER_IS_GNUCC OR APPLE) -endif(CMAKE_COMPILER_IS_GNUCC)
+endif(CMAKE_COMPILER_IS_GNUCC OR APPLE) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/HACKING.OSX Sun Aug 21 23:23:29 2016 -0500
@@ -0,0 +1,28 @@
+There are a few notes about building on OSX. +First off, building has *ONLY* been tested against homebrew. If you want to +support fink or macports, please let me know and I will merge your pull +For the Lua loader to work, you need to install lgi from luarocks either +systemwide or to a virtual environment created by LuaDist, vert, or something +When you're building lgi against homebrew you'll have to set the +PKG_CONFIG_PATH environment variable since homebrew does not install libffi +systemwide. This is easily done via: + export PKG_CONFIG_PATH=$(brew --prefix libffi)/lib/pkgconfig +and then running "luarocks install lgi" +If you're using homebrew, you need to install pygobject3 with + brew install pygobject3 --with-python3 --- a/gplugin/CMakeLists.txt Sun May 15 23:22:42 2016 -0500
+++ b/gplugin/CMakeLists.txt Sun Aug 21 23:23:29 2016 -0500
@@ -222,30 +222,25 @@
###############################################################################
- message("The GObject Introspection build always fails on OS X, "
- include(GObjectIntrospection)
+ include(GObjectIntrospection) - set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_BINARY_DIR}")
+ set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_BINARY_DIR}")
- FILENAME GPlugin-${GPLUGIN_MAJOR_VERSION}.0.gir
- PACKAGES glib-2.0 gmodule-2.0 gobject-2.0
- SCANNER_ARGS --add-include-path=${CMAKE_CURRENT_SOURCE_DIR}
- --include=GModule-2.0 --include=GObject-2.0
- COMPILER_ARGS --includedir=${CMAKE_CURRENT_SOURCE_DIR}
- SYMBOL_PREFIXES gplugin
- SOURCES ${GPLUGIN_SOURCES} ${GPLUGIN_HEADERS}
- BUILT_SOURCES ${GPLUGIN_PUBLIC_BUILT_SOURCES}
- ${GPLUGIN_PUBLIC_BUILT_HEADERS}
- # For loader plugin tests dependencies
- set(GPLUGIN_GIR_TARGETS ${GPLUGIN_GIR_TARGETS} PARENT_SCOPE)
+ FILENAME GPlugin-${GPLUGIN_MAJOR_VERSION}.${GPLUGIN_MINOR_VERSION}.gir + PACKAGES glib-2.0 gmodule-2.0 gobject-2.0 + SCANNER_ARGS --add-include-path=${CMAKE_CURRENT_SOURCE_DIR} + --include=GModule-2.0 --include=GObject-2.0 + COMPILER_ARGS --includedir=${CMAKE_CURRENT_SOURCE_DIR} + SYMBOL_PREFIXES gplugin + SOURCES ${GPLUGIN_SOURCES} ${GPLUGIN_HEADERS} + BUILT_SOURCES ${GPLUGIN_PUBLIC_BUILT_SOURCES} + ${GPLUGIN_PUBLIC_BUILT_HEADERS} + # For loader plugin tests dependencies + set(GPLUGIN_GIR_TARGETS ${GPLUGIN_GIR_TARGETS} PARENT_SCOPE) ###############################################################################
--- a/gplugin/tests/CMakeLists.txt Sun May 15 23:22:42 2016 -0500
+++ b/gplugin/tests/CMakeLists.txt Sun Aug 21 23:23:29 2016 -0500
@@ -3,7 +3,15 @@
###############################################################################
macro(add_test_plugin plugin)
add_library(${plugin} MODULE ${plugin}.c)
- set_target_properties(${plugin} PROPERTIES PREFIX "")
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang") + set(LINK_FLAGS "-undefined dynamic_lookup") + endif(CMAKE_C_COMPILER_ID MATCHES "Clang") + set_target_properties(${plugin} PROPERTIES + LINK_FLAGS "${LINK_FLAGS}" target_link_libraries(${plugin} ${GLIB_LIBRARIES} gplugin)
endmacro(add_test_plugin)
--- a/lua/CMakeLists.txt Sun May 15 23:22:42 2016 -0500
+++ b/lua/CMakeLists.txt Sun Aug 21 23:23:29 2016 -0500
@@ -33,6 +33,8 @@
include_directories(${LUA_INCLUDE_DIRS})
+ link_directories(${LUA_LIBRARY_DIRS}) message(STATUS "checking for lua module 'lgi'")
# compile our lua-lgi test program
@@ -42,6 +44,7 @@
-DINCLUDE_DIRECTORIES:STRING=${LUA_INCLUDE_DIRS}
-DLINK_LIBRARIES:STRING=${LUA_LIBRARIES}
+ -DLINK_DIRECTORIES:STRING=${LUA_LIBRARY_DIRS} COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/gplugin-lua-test-lgi
--- a/lua/gplugin-lua-test-lgi.c Sun May 15 23:22:42 2016 -0500
+++ b/lua/gplugin-lua-test-lgi.c Sun Aug 21 23:23:29 2016 -0500
@@ -16,18 +16,46 @@
+_add_require_path(lua_State *L, const char *path) { + const char *pkg_path = NULL; + lua_getglobal(L, "package"); + lua_getfield(L, -1, "path"); // get field "path" from table at top of stack (-1) + pkg_path = lua_tostring(L, -1); // grab path string from top of stack + memset(buff, 0, sizeof(buff)); + snprintf(buff, sizeof(buff), "%s;%s", pkg_path, path); + lua_pop(L, 1); // pop off the path field + lua_pushstring(L, buff); // push the new one + lua_setfield(L, -2, "path"); // set the field "path" in table at -2 with value at top of stack + lua_pop( L, 1 ); // get rid of package table from top of stack main(int argc, char *argv[]) {
- lua_State *L = luaL_newstate();
+ /* add some additional paths to package.path */ + //_add_require_path(L, "/usr/local/lib/luarocks/rocks"); + /* now try to do the require */ lua_getglobal(L, "require");
lua_pushstring(L, "lgi");
--- a/python/CMakeLists.txt Sun May 15 23:22:42 2016 -0500
+++ b/python/CMakeLists.txt Sun Aug 21 23:23:29 2016 -0500
@@ -32,6 +32,8 @@
${PYGOBJECT_INCLUDE_DIRS}
+ link_directories(${PYTHON3_LIBRARY_DIRS}) message(STATUS "checking if pygobject works with python3")
set(GPLUGIN_PYTHON_TEST_PYGOBJECT_INCLUDES)