libsolv/libsolv-rubyinclude.patch

31 lines
1.2 KiB
Diff
Raw Normal View History

2012-02-07 19:23:40 +00:00
diff -up libsolv/bindings/ruby/CMakeLists.txt.rubyinclude libsolv/bindings/ruby/CMakeLists.txt
--- libsolv/bindings/ruby/CMakeLists.txt.rubyinclude 2012-06-07 10:06:19.372687533 +0200
+++ libsolv/bindings/ruby/CMakeLists.txt 2012-06-07 10:09:57.313968719 +0200
@@ -6,8 +6,17 @@ ELSE (USE_VENDORDIRS AND RUBY_VENDORARCH
2012-02-07 19:23:40 +00:00
SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR})
ENDIF (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR)
2012-02-07 19:23:40 +00:00
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['arch']"
2012-02-07 19:23:40 +00:00
+ OUTPUT_VARIABLE RUBY_ARCH)
+
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubyhdrdir']"
+ OUTPUT_VARIABLE RUBY_HDR_DIR)
+
+SET(RUBY_INCLUDE_DIRS ${RUBY_HDR_DIR} ${RUBY_HDR_DIR}/${RUBY_ARCH})
+
MESSAGE (STATUS "Ruby executable: ${RUBY_EXECUTABLE}")
MESSAGE (STATUS "Ruby installation dir: ${RUBY_INSTALL_DIR}")
+MESSAGE (STATUS "Ruby include dir: ${RUBY_INCLUDE_DIRS}")
ADD_CUSTOM_COMMAND (
OUTPUT solv_ruby.c
@@ -17,7 +26,7 @@ ADD_CUSTOM_COMMAND (
)
ADD_DEFINITIONS(-Wno-unused)
-INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH})
+INCLUDE_DIRECTORIES (${RUBY_INCLUDE_DIRS})
ADD_LIBRARY (bindings_ruby SHARED solv_ruby.c)
SET_TARGET_PROPERTIES (bindings_ruby PROPERTIES PREFIX "" OUTPUT_NAME "solv")