[ create a new paste ] login | about

Link: http://codepad.org/ksO98uu5    [ raw code | fork ]

Plain Text, pasted on May 14:
diff -rNu3 zorba-old/PKGBUILD zorba/PKGBUILD
--- zorba-old/PKGBUILD	2013-04-27 21:51:34.000000000 +0400
+++ zorba/PKGBUILD	2013-05-14 19:47:51.548968524 +0400
@@ -1,8 +1,9 @@
 # Author: Mathieu Boespflug <mboes@tweag.net> (original 0.9.21)
 # Maintainer: Alexey Stukalov <astukalov@gmail.com> (updated to 2.x)
+# Contributor: Nikolay Amiantov <nikoamia@gmail.com> (added bindings packaging)
 pkgname=zorba  
 pkgver=2.8.0
-pkgrel=2
+pkgrel=3
 pkgdesc="General purpose embeddable XQuery processor written in C++."
 url="http://www.zorba-xquery.com/"
 arch=('i686' 'x86_64')
@@ -11,32 +12,50 @@
          'libxslt>=1.1.24'
          'icu>=3.6'
          'boost>=1.47'
-         'xerces-c>=3.0.0')
+         'xerces-c>=3.0.0'
+)
 optdepends=('curl>=7.21.0: REST and HTTP support'
-            #'swig>=1.3.40: Java/PHP/Python/Ruby bindings'
+            'python2: python bindings'
+            'java-runtime: java bindings'
+            'ruby: ruby bindings'
 )
 makedepends=('cmake>=2.6.4'
              'flex>=2.5.33'
              'bison>=2.4'
              'gcc>=4.7'
+             'swig>=1.3.40'
+             'python2'
+             'java-environment'
+             'ruby'
 )
 source=(http://launchpad.net/$pkgname/trunk/2.8/+download/$pkgname-$pkgver.tar.gz
-	item_handle.patch
+        item_handle.patch
+        bindings_dirs.patch
 )
 md5sums=('5b13e8e3294fb61102ecf35f1ae58360'
-         '1c1f05f3919bcc78337976f4c68c21f9')
+         '1c1f05f3919bcc78337976f4c68c21f9'
+         'df5c9930f77a10a7cb284a3041f730be')
 
-build() {
-  cd $srcdir/${pkgname}-${pkgver}
+prepare() {
+  cd "$srcdir/${pkgname}-${pkgver}"
   patch -p0 -i ../item_handle.patch
+  patch -p1 -i ../bindings_dirs.patch
 
-  mkdir build || return 0
-  cd build
+  mkdir build
+}
+
+build() {
+  cd "$srcdir/${pkgname}-${pkgver}/build"
+
+  python_ver="$(python2 -c 'import sys; print(sys.version[:3])')"
+  ruby_ver="$(ruby -e 'puts RUBY_VERSION')"
 
   msg2 Configuring...
   cmake -Wno-dev \
         -DCMAKE_CXX_FLAGS="${CXXFLAGS} -std=gnu++11 -Wno-c++0x-compat" \
         -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
+        -DPYTHON_INSTALL_PATH="/lib/python$python_ver/site-packages" \
+        -DRUBY_INSTALL_PATH="/lib/ruby/vendor_ruby/$ruby_ver/$CARCH-linux" \
         $srcdir/${pkgname}-${pkgver}
 
   msg2 Compiling...
@@ -44,7 +63,12 @@
 }
 
 package() {
-  cd $srcdir/${pkgname}-${pkgver}/build
-  make DESTDIR=$pkgdir install
+  cd "$srcdir/${pkgname}-${pkgver}/build"
+  make "DESTDIR=$pkgdir" install
+
+  # compile python bindings
+  python_ver="$(python2 -c 'import sys; print(sys.version[:3])')"
+  python2 -m compileall "$pkgdir/usr/lib/python$python_ver"
+  python2 -Om compileall "$pkgdir/usr/lib/python$python_ver"
 }
 
diff -rNu3 zorba-old/bindings_dirs.patch zorba/bindings_dirs.patch
--- zorba-old/bindings_dirs.patch	1970-01-01 03:00:00.000000000 +0300
+++ zorba/bindings_dirs.patch	2013-05-14 19:46:36.602414438 +0400
@@ -0,0 +1,61 @@
+diff -ru3 zorba-2.8.0/swig/python/CMakeLists.txt zorba-2.8.0-new/swig/python/CMakeLists.txt
+--- zorba-2.8.0/swig/python/CMakeLists.txt	2013-01-22 12:35:39.000000000 +0400
++++ zorba-2.8.0-new/swig/python/CMakeLists.txt	2013-05-14 19:44:47.167051848 +0400
+@@ -33,18 +33,16 @@
+     CONFIGURE_FILE(${PYTHON_DEBUG_LIBRARIES}  ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+   ENDIF (WIN32)
+   
+-  EXECUTE_PROCESS (
+-    COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig;print sysconfig.get_python_lib(0)"
+-    OUTPUT_VARIABLE PYTHON_INSTALL_PATH
+-    OUTPUT_STRIP_TRAILING_WHITESPACE
+-  )
+-   
+   FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h")
+   FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
+     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../${ZORBA_API_HEADER}"  "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_API_HEADER}")
+   ENDFOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
+ 
+-  SET (PYTHON_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/share/python")
++  IF (NOT DEFINED PYTHON_INSTALL_PATH)
++    SET (PYTHON_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/share/python")
++  ELSE (NOT DEFINED PYTHON_INSTALL_PATH)
++    SET (PYTHON_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PATH}")
++  ENDIF (NOT DEFINED PYTHON_INSTALL_PATH)
+ 
+   IF (NOT WIN32)   
+     INSTALL (
+diff -ru3 zorba-2.8.0/swig/ruby/CMakeLists.txt zorba-2.8.0-new/swig/ruby/CMakeLists.txt
+--- zorba-2.8.0/swig/ruby/CMakeLists.txt	2013-01-22 12:35:39.000000000 +0400
++++ zorba-2.8.0-new/swig/ruby/CMakeLists.txt	2013-05-14 19:44:36.642112280 +0400
+@@ -48,23 +48,24 @@
+     SET_TARGET_PROPERTIES( ${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PREFIX "" )
+   ENDIF ( LINUX OR CYGWIN OR APPLE )
+ 
+-  EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']"
+-    OUTPUT_VARIABLE RUBY_SITEARCH_DIR)
+-
+   FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h")
+   FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
+     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../${ZORBA_API_HEADER}"  "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_API_HEADER}")
+   ENDFOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
+ 
+-  SET (RUBY_SITEARCH_DIR "${CMAKE_INSTALL_PREFIX}/share/ruby")
++  IF ( NOT DEFINED RUBY_INSTALL_PATH )
++    SET (RUBY_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/share/ruby")
++  ELSE ( NOT DEFINED RUBY_INSTALL_PATH )
++    SET (RUBY_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${RUBY_INSTALL_PATH}")
++  ENDIF ( NOT DEFINED RUBY_INSTALL_PATH )
+   
+   IF ( APPLE )
+     INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}zorba_api.bundle
+-    DESTINATION ${RUBY_SITEARCH_DIR} )
++    DESTINATION ${RUBY_INSTALL_PATH} )
+   ELSE ( APPLE )
+     IF ( LINUX )
+       INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.so
+-      DESTINATION ${RUBY_SITEARCH_DIR}
++      DESTINATION ${RUBY_INSTALL_PATH}
+       COMPONENT ruby_swig )
+     ELSE ( LINUX )
+       IF (MSVC_IDE)



Create a new paste based on this one


Comments: