From 5eb5e609b2638e5e93fe8eea679e8765a58b4d73 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Feb 07 2012 19:23:40 +0000 Subject: Adapted to Ruby 1.9.3 --- diff --git a/libsolv-newruby.patch b/libsolv-newruby.patch new file mode 100644 index 0000000..15a2cea --- /dev/null +++ b/libsolv-newruby.patch @@ -0,0 +1,15 @@ +diff -up libsolv/bindings/solv.i.newruby libsolv/bindings/solv.i +--- libsolv/bindings/solv.i.newruby 2012-02-07 20:15:17.909237059 +0100 ++++ libsolv/bindings/solv.i 2012-02-07 20:15:53.612790703 +0100 +@@ -143,9 +143,9 @@ + int size, i; + VALUE *o; + queue_init(&$1); +- size = RARRAY($input)->len; ++ size = RARRAY_LEN($input); + i = 0; +- o = RARRAY($input)->ptr; ++ o = RARRAY_PTR($input); + for (i = 0; i < size; i++, o++) { + int v; + int e = SWIG_AsVal_int(*o, &v); diff --git a/libsolv-rubyinclude.patch b/libsolv-rubyinclude.patch new file mode 100644 index 0000000..bb44d76 --- /dev/null +++ b/libsolv-rubyinclude.patch @@ -0,0 +1,30 @@ +diff -up libsolv/bindings/ruby/CMakeLists.txt.rubyinclude libsolv/bindings/ruby/CMakeLists.txt +--- libsolv/bindings/ruby/CMakeLists.txt.rubyinclude 2012-02-07 18:49:31.075581334 +0100 ++++ libsolv/bindings/ruby/CMakeLists.txt 2012-02-07 19:55:59.627717571 +0100 +@@ -6,8 +6,17 @@ ELSE (USE_VENDORDIRS) + SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR}) + ENDIF (USE_VENDORDIRS) + ++EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['arch']" ++ 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") diff --git a/libsolv.spec b/libsolv.spec index 0b73fc0..2d13c50 100644 --- a/libsolv.spec +++ b/libsolv.spec @@ -7,12 +7,14 @@ Name: libsolv Version: 0.0.0 -Release: 1.git%{gitrev}%{?dist} +Release: 2.git%{gitrev}%{?dist} License: BSD Url: https://github.com/openSUSE/libsolv # git clone https://github.com/openSUSE/libsolv.git # git archive %{gitrev} --prefix=libsolv/ | xz > libsolv-%{gitrev}.tar.xz Source: libsolv-%{gitrev}.tar.xz +Patch0: libsolv-rubyinclude.patch +Patch1: libsolv-newruby.patch Group: Development/Libraries Summary: Package dependency solver BuildRequires: cmake libdb-devel expat-devel rpm-devel zlib-devel @@ -79,6 +81,8 @@ Perl bindings for sat solver. %prep %setup -q -n libsolv +%patch0 -p1 -b .rubyinclude +%patch1 -p1 -b .newruby %build %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ @@ -137,6 +141,10 @@ make DESTDIR=$RPM_BUILD_ROOT install %{python_sitearch}/* %changelog +* Tue Feb 7 2012 Karel Klíč - 0.0.0-2.git857fe28%{?dist} +- Adapted to Ruby 1.9.3 (workaround for broken CMake in Fedora and + ruby template correction in bindings) + * Thu Feb 2 2012 Karel Klíč - 0.0.0-1.git857fe28 - Initial packaging - Based on Jindra Novy's spec file