[ create a new paste ] login | about

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

Plain Text, pasted on May 14:
--- zorba-old/PKGBUILD	2013-04-27 21:51:34.000000000 +0400
+++ zorba/PKGBUILD	2013-05-14 18:17:54.789333914 +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'
+         'ca1db97d939e54f7ebe78dd22147a1b4')
 
-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"
 }
 



Create a new paste based on this one


Comments: