Adapted to Ruby 1.9.3

This commit is contained in:
Karel Klic 2012-02-07 20:23:40 +01:00
parent 732335eba7
commit 5eb5e609b2
3 changed files with 54 additions and 1 deletions

15
libsolv-newruby.patch Normal file
View File

@ -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);

30
libsolv-rubyinclude.patch Normal file
View File

@ -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")

View File

@ -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íč <kklic@redhat.com> - 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íč <kklic@redhat.com> - 0.0.0-1.git857fe28
- Initial packaging
- Based on Jindra Novy's spec file