Commits

arsooy committed bc862ee

Addition of Python 2 packages.
New Python 2 packages: python2-shiboken, python2-pyside, and
python2-pyside-tools created to be able to coexists with their
Python 3 counterpart.

Comments (0)

Files changed (5)

python2-pyside-tools/PKGBUILD

+# Maintainer: arlx_ignacy <ziphims@gmail.com>
+# Contributor: Matthias Maennich <arch@maennich.net>
+# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+
+
+# modify these two to whatever Python 2 interpreter you're targetting; on my
+# system I use the vanilla python2
+_pyver=2
+_pyexec=/usr/bin/python$_pyver
+
+pkgname=python2-pyside-tools
+pkgver=0.2.13
+pkgrel=1
+pkgdesc='PySide development tools (pyuic and pyrcc).'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url="http://www.pyside.org"
+depends=('python2-pyside>=1.1.0' 'python2')
+makedepends=('cmake' 'automoc4' 'python2-shiboken>=1.1.0' 'patch' 'sed')
+replaces=('pyside-tools')
+source=("http://www.pyside.org/files/pyside-tools-$pkgver.tar.bz2")
+md5sums=('14d3a36df06d680357d7bc1960f19a6d')
+
+
+build() {
+    cd "$srcdir/pyside-tools-$pkgver"
+
+    cd ..
+    if [ -d build ] ; then
+        msg "Removing last build ..."
+        rm -rf build
+    fi
+
+    mkdir build
+    cd build
+
+    cmake ../pyside-tools-$pkgver -DCMAKE_INSTALL_PREFIX=/usr  \
+                                  -DCMAKE_BUILD_TYPE=Release   \
+                                  -DPYTHON_EXECUTABLE=$_pyexec
+    make
+
+    # change interpreter to what we set it to
+    sed -i -e "1c #!$_pyexec" ../pyside-tools-$pkgver/pyside-uic
+}
+
+
+package() {
+    cd "$srcdir/build"
+    make DESTDIR=$pkgdir install
+}

python2-pyside/PKGBUILD

+# Maintainer: arlx_ignacy <ziphims@gmail.com>
+# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
+
+
+# modify these two to whatever Python 2 interpreter you're targetting; on my
+# system I use the vanilla python2
+_pyver=2
+_pyexec=/usr/bin/python$_pyver
+
+pkgname=python2-pyside
+pkgver=1.1.1
+pkgrel=1
+pkgdesc='CPython Qt bindings generated using the Shiboken generator.'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url='http://www.pyside.org'
+depends=('python2-shiboken>=1.1.1' 'python2' 'qt>=4.8' 'phonon' 'mesa')
+makedepends=('cmake' 'automoc4' 'python2-shiboken>=1.1.1')
+replaces=('pyside')
+source=("http://www.pyside.org/files/pyside-qt4.8+$pkgver.tar.bz2")
+md5sums=('0176d3746074afe47373d7302e1b4501')
+
+
+build() {
+    cd "$srcdir/pyside-qt4.8+$pkgver"
+
+    cd ..
+    if [ -d build ] ; then
+        msg "Removing last build ..."
+        rm -rf build
+    fi
+
+    mkdir build
+    cd build
+
+    cmake ../pyside-qt4.8+$pkgver -DCMAKE_INSTALL_PREFIX=/usr \
+                                  -DCMAKE_BUILD_TYPE=Release
+
+    make
+}
+
+package() {
+    cd "$srcdir/build"
+    make DESTDIR=$pkgdir install
+}

python2-pyside/cmake_fixes.patch

+diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
+index d8371c0..4c546dc 100644
+--- a/PySide/CMakeLists.txt
++++ b/PySide/CMakeLists.txt
+@@ -32,7 +32,7 @@ HAS_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
+ 
+ # install
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py"
+-        DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}")
++        DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}")
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml
+         DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pyside_global.h
+diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
+index 7625634..e2e2dbc 100644
+--- a/PySide/QtGui/CMakeLists.txt
++++ b/PySide/QtGui/CMakeLists.txt
+@@ -437,4 +437,4 @@ create_pyside_module(QtGui
+                      ""
+                      ${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml)
+ 
+-install(FILES ${pyside_SOURCE_DIR}/qpytextobject.h DESTINATION include/PySide/QtGui/)
++install(FILES ${pyside_SOURCE_DIR}/qpytextobject.h DESTINATION include/PySide${pyside_SUFFIX}/QtGui/)
+diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
+index 4fa878f..6c514f9 100644
+--- a/libpyside/CMakeLists.txt
++++ b/libpyside/CMakeLists.txt
+@@ -78,8 +78,8 @@ install(TARGETS pyside EXPORT pyside
+                        RUNTIME DESTINATION bin)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake"
+-        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
++        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide${pyside_SUFFIX}-${BINDING_API_VERSION}")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig${SHIBOKEN_PYTHON_SUFFIX}.cmake"
+-        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
++        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide${pyside_SUFFIX}-${BINDING_API_VERSION}")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake"
+-        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
++        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide${pyside_SUFFIX}-${BINDING_API_VERSION}")
+diff --git a/libpyside/PySideConfig.cmake.in b/libpyside/PySideConfig.cmake.in
+index b7f45e8..27c760f 100644
+--- a/libpyside/PySideConfig.cmake.in
++++ b/libpyside/PySideConfig.cmake.in
+@@ -2,4 +2,4 @@ if (NOT PYTHON_BASENAME)
+     message(STATUS "Using default python: @SHIBOKEN_PYTHON_SUFFIX@")
+     SET(PYTHON_BASENAME @SHIBOKEN_PYTHON_SUFFIX@)
+ endif()
+-include(@LIB_INSTALL_DIR@/cmake/PySide-@BINDING_API_VERSION@/PySideConfig${PYTHON_BASENAME}.cmake)
++include(@LIB_INSTALL_DIR@/cmake/PySide@pyside_SUFFIX@-@BINDING_API_VERSION@/PySideConfig${PYTHON_BASENAME}.cmake)

python2-shiboken/PKGBUILD

+# Maintainer: arlx_ignacy <ziphims@gmail.com>
+# Contributor: Matthias Maennich <arch@maennich.net>
+
+# modify these two to whatever Python 2 interpreter you're targetting; on my
+# system I use the vanilla python2
+_pyver=2
+_pyexec=/usr/bin/python$_pyver
+
+pkgname=python2-shiboken
+pkgver=1.1.1
+pkgrel=1
+pkgdesc='Python binding generator that uses API Extractor and outputs CPython code.'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url='http://www.pyside.org'
+depends=('python2' 'qt>=4.7' 'openssl')
+makedepends=('cmake' 'automoc4' 'sed' 'patch')
+replaces=('shibokengenerator', 'libshiboken')
+source=("http://www.pyside.org/files/shiboken-$pkgver.tar.bz2"
+        'cmake_vars.patch')
+md5sums=('fa451b6c4f3e06cce283a84550a96fd2'
+         '3ba4a76129899a2508fec517888bf6e8')
+
+build() {
+    cd "$srcdir/shiboken-$pkgver"
+
+    msg "Applying patches ..."
+    # this patch is to make it much easier to veriables from cmake
+    patch -p1 -N < ../cmake_vars.patch
+
+#    # of course, if you want to undo the patches you can use:
+#    #  $ patch -p1 -R < ../cmake_vars.patch
+
+    cd ..
+    if [ -d build ] ; then
+        msg "Removing last build ..."
+        rm -rf build
+    fi
+
+    mkdir -p build
+    cd build
+
+    cmake ../shiboken-$pkgver -DCMAKE_INSTALL_PREFIX=/usr  \
+                              -DCMAKE_BUILD_TYPE=Release   \
+                              -DBUILD_TESTS=FALSE          \
+                              -DPYTHON_EXECUTABLE=$_pyexec \
+                              -DUSE_PYTHON3=FALSE
+
+    # this will generate shiboken
+    make shiboken
+    # this will create libshiboken to work with Python 2
+    make libshiboken
+}
+
+package() {
+    # install generator
+    cd "$srcdir/build/generator"
+    make DESTDIR=$pkgdir install
+    # install libshiboken
+    cd "$srcdir/build/libshiboken"
+    make DESTDIR=$pkgdir install
+
+    # get some variables for our purpose
+    SHIBOKEN_SUFFIX=$(sed -n '2p' ../data/cmake_vars)
+    PYTHON_SUFFIX=$(sed -n '3p' ../data/cmake_vars)
+
+    mkdir -m 755 -p $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
+    install -m 755 ../data/ShibokenConfig.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
+    install -m 755 ../data/ShibokenConfigVersion.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
+    if [ -e ../data/ShibokenConfig-python$_pyver.cmake ] ; then
+        install -m 755 ../data/ShibokenConfig-python$_pyver.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
+    else
+        if [ -e ../data/ShibokenConfig$PYTHON_SUFFIX.cmake ] ; then
+            install -m 755 ../data/ShibokenConfig$PYTHON_SUFFIX.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
+        else
+            msg "Unable to resolve cmake config file for \"$PYTHON_SUFFIX\"."
+            return 1
+        fi
+    fi
+
+    mkdir -m 755 -p $pkgdir/usr/lib/pkgconfig/
+    install -m 755 ../data/shiboken.pc $pkgdir/usr/lib/pkgconfig/
+}

python2-shiboken/cmake_vars.patch

+diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
+index c40d552..474132e 100644
+--- a/data/CMakeLists.txt
++++ b/data/CMakeLists.txt
+@@ -16,6 +16,11 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfigVersion.cmake.in"
+                "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfigVersion.cmake" @ONLY)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shiboken.pc.in"
+                "${CMAKE_CURRENT_BINARY_DIR}/shiboken${shiboken_SUFFIX}.pc" @ONLY)
++# begin: arsooy_ changes
++# we need this to make makepkg's install() aware of cmake variables
++configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_vars.in"
++               "${CMAKE_CURRENT_BINARY_DIR}/cmake_vars" @ONLY)
++# end: arsooy_ changes
+ 
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.cmake"
+         DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken-${shiboken_VERSION}")
+diff --git a/data/cmake_vars.in b/data/cmake_vars.in
+new file mode 100644
+index 0000000..00a781c
+--- /dev/null
++++ b/data/cmake_vars.in
+@@ -0,0 +1,3 @@
++@shiboken_VERSION@
++@shiboken_SUFFIX@
++@PYTHON_SUFFIX@
+\ No newline at end of file