Commits

arsooy committed 6c63ff4

first commit to manage pyside_aur under version control

Comments (0)

Files changed (7)

python-libshiboken/PKGBUILD

+# Maintainer: arlx_ignacy <ziphims@gmail.com>
+# Contributor: Matthias Maennich <arch@maennich.net>
+
+# modify these two to whatever Python 3 interpreter you're targetting; on my
+# system I use the vanilla python3
+_pyver=3
+_pyexec=/usr/bin/python$_pyver
+
+pkgname=python-libshiboken
+pkgver=1.1.0
+pkgrel=1
+pkgdesc='Support library for Python 3 bindings to Qt toolkit'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url='http://www.pyside.org'
+depends=('python' 'qt>=4.7' 'openssl')
+makedepends=('cmake' 'automoc4' 'generatorrunner>=0.6.16')
+replaces=('libshiboken-py3')
+source=("http://www.pyside.org/files/shiboken-$pkgver.tar.bz2")
+md5sums=('9c9d696c8c426fb5abf28a6bd3759558')
+
+
+build() {
+    cd "$srcdir"
+
+    if [ -d build ] ; then
+        msg "Removing last build ..."
+        rm -rf build
+    fi
+
+    mkdir build
+    cd build
+
+    cmake ../shiboken-$pkgver -DCMAKE_INSTALL_PREFIX=/usr  \
+                              -DCMAKE_BUILD_TYPE=Release   \
+                              -DBUILD_TESTS=FALSE          \
+                              -DPYTHON_EXECUTABLE=$_pyexec \
+                              -DUSE_PYTHON3=TRUE
+    make libshiboken
+}
+
+
+package() {
+    cd "$srcdir/build/libshiboken"
+    make DESTDIR=$pkgdir install
+}

python-pyside-tools/2to3.patch

+diff --git a/pysideuic/Compiler/proxy_type.py b/pysideuic/Compiler/proxy_type.py
+index c80843a..0708ecc 100644
+--- a/pysideuic/Compiler/proxy_type.py
++++ b/pysideuic/Compiler/proxy_type.py
+@@ -26,7 +26,7 @@ from pysideuic.Compiler.misc import Literal, moduleMember
+ class ProxyType(type):
+     def __init__(*args):
+         type.__init__(*args)
+-        for cls in args[0].__dict__.values():
++        for cls in list(args[0].__dict__.values()):
+             if type(cls) is ProxyType:
+                 cls.module = args[0].__name__
+ 
+diff --git a/pysideuic/Compiler/qobjectcreator.py b/pysideuic/Compiler/qobjectcreator.py
+index d46acc0..491a8e0 100644
+--- a/pysideuic/Compiler/qobjectcreator.py
++++ b/pysideuic/Compiler/qobjectcreator.py
+@@ -116,7 +116,7 @@ class _CustomWidgetLoader(object):
+             _, module = self._widgets[widget]
+             imports.setdefault(module, []).append(widget)
+ 
+-        for module, classes in imports.items():
++        for module, classes in list(imports.items()):
+             write_code("from %s import %s" % (module, ", ".join(classes)))
+ 
+ 
+diff --git a/pysideuic/icon_cache.py b/pysideuic/icon_cache.py
+index 523d207..d8c699c 100644
+--- a/pysideuic/icon_cache.py
++++ b/pysideuic/icon_cache.py
+@@ -113,7 +113,7 @@ class _IconSet(object):
+         if self._use_fallback:
+             icon.addFile(self._fallback)
+         else:
+-            for role, pixmap in self._roles.items():
++            for role, pixmap in list(self._roles.items()):
+                 if role.endswith("off"):
+                     mode = role[:-3]
+                     state = qtgui_module.QIcon.Off
+diff --git a/pysideuic/port_v2/as_string.py b/pysideuic/port_v2/as_string.py
+index 23272b2..cb7780c 100644
+--- a/pysideuic/port_v2/as_string.py
++++ b/pysideuic/port_v2/as_string.py
+@@ -23,7 +23,7 @@ import re
+ 
+ 
+ def as_string(obj, encode=True):
+-    if isinstance(obj, basestring):
++    if isinstance(obj, str):
+         s = '"' + _escape(obj.encode('UTF-8')) + '"'
+         return s
+ 
+diff --git a/pysideuic/port_v2/invoke.py b/pysideuic/port_v2/invoke.py
+index 7652904..5128092 100644
+--- a/pysideuic/port_v2/invoke.py
++++ b/pysideuic/port_v2/invoke.py
+@@ -33,16 +33,16 @@ def invoke(driver):
+     try:
+         exit_status = driver.invoke()
+ 
+-    except IOError, e:
++    except IOError as e:
+         driver.on_IOError(e)
+ 
+-    except SyntaxError, e:
++    except SyntaxError as e:
+         driver.on_SyntaxError(e)
+ 
+-    except NoSuchWidgetError, e:
++    except NoSuchWidgetError as e:
+         driver.on_NoSuchWidgetError(e)
+ 
+-    except Exception, e:
++    except Exception as e:
+         driver.on_Exception(e)
+ 
+     return exit_status
+diff --git a/pysideuic/port_v2/load_plugin.py b/pysideuic/port_v2/load_plugin.py
+index 5212d6f..b85ec76 100644
+--- a/pysideuic/port_v2/load_plugin.py
++++ b/pysideuic/port_v2/load_plugin.py
+@@ -33,7 +33,7 @@ def load_plugin(plugin, plugin_globals, plugin_locals):
+         exec(plugin.read(), plugin_globals, plugin_locals)
+     except ImportError:
+         return False
+-    except Exception, e:
++    except Exception as e:
+         raise WidgetPluginError("%s: %s" % (e.__class__, str(e)))
+ 
+     return True
+diff --git a/pysideuic/port_v2/proxy_base.py b/pysideuic/port_v2/proxy_base.py
+index 732b2e2..23f4dba 100644
+--- a/pysideuic/port_v2/proxy_base.py
++++ b/pysideuic/port_v2/proxy_base.py
+@@ -23,5 +23,5 @@
+ from pysideuic.Compiler.proxy_type import ProxyType
+ 
+ 
+-class ProxyBase(object):
+-    __metaclass__ = ProxyType
++class ProxyBase(object, metaclass=ProxyType):
++    pass
+diff --git a/pysideuic/port_v2/string_io.py b/pysideuic/port_v2/string_io.py
+index 4657b52..adb9f12 100644
+--- a/pysideuic/port_v2/string_io.py
++++ b/pysideuic/port_v2/string_io.py
+@@ -22,6 +22,6 @@
+ 
+ # Import the StringIO object.
+ try:
+-    from cStringIO import StringIO
++    from io import StringIO
+ except ImportError:
+-    from StringIO import StringIO
++    from io import StringIO
+diff --git a/pysideuic/uiparser.py b/pysideuic/uiparser.py
+index c49bfe1..4c7cbe1 100644
+--- a/pysideuic/uiparser.py
++++ b/pysideuic/uiparser.py
+@@ -41,7 +41,7 @@ DEBUG = logger.debug
+ 
+ if sys.version_info < (2,4,0):
+     def reversed(seq):
+-        for i in xrange(len(seq)-1, -1, -1):
++        for i in range(len(seq)-1, -1, -1):
+             yield seq[i]
+ 
+ QtCore = None

python-pyside-tools/PKGBUILD

+# Maintainer: arlx_ignacy <ziphims@gmail.com>
+# Contributor: Matthias Maennich <arch@maennich.net>
+
+# modify these two to whatever Python 3 interpreter you're targetting; on my
+# system I use the vanilla python3
+_pyver=3
+_pyexec=/usr/bin/python$_pyver
+
+pkgname=python-pyside-tools
+pkgver=0.2.13
+pkgrel=1
+pkgdesc='PySide development tools (pyuic and pyrcc) for Python 3.'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url="http://www.pyside.org"
+depends=('python-pyside>=1.1.0' 'python')
+makedepends=('cmake' 'automoc4' 'python-shibokengenerator>=1.1.0' 'patch' 'sed')
+replaces=('pyside-tools-py3')
+source=("http://www.pyside.org/files/pyside-tools-$pkgver.tar.bz2"
+        '2to3.patch'
+        'py3.patch')
+md5sums=('14d3a36df06d680357d7bc1960f19a6d'
+         '88ca14b1e58ca167564afd215930a84b'
+         '9f78b19484675d24008abdc9f03a6085')
+
+
+build() {
+    cd "$srcdir/pyside-tools-$pkgver"
+
+    msg "Applying patches ..."
+    # this patch from running 2to3-3.2
+    patch -p1 < ../../2to3.patch
+    # this patch to make it runable on Python 3
+    patch -p1 < ../../py3.patch
+
+    # of course, if you want to undo the patches you can use:
+    #  $ patch -p1 -R < ../../py3.patch
+    #  $ patch -p1 -R < ../../2to3.patch
+
+    cd ..
+    if [ -d build ] ; then
+        msg "Removing last build ..."
+        rm -rf build
+    fi
+
+    mkdir build
+    cd build
+
+    # change interpreter to what we set it to
+    sed -i -e "1c #!$_pyexec" ../pyside-tools-$pkgver/pyside-uic
+    chmod 755 ../pyside-tools-$pkgver/pyside-uic
+
+    cmake ../pyside-tools-$pkgver -DCMAKE_INSTALL_PREFIX=/usr             \
+                                  -DCMAKE_BUILD_TYPE=Release              \
+                                  -DPYTHON_EXECUTABLE=$_pyexec
+    make
+}
+
+
+package() {
+    cd "$srcdir/build"
+    make DESTDIR=$pkgdir install
+}

python-pyside-tools/py3.patch

+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bbc8536..b47081b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,7 +19,7 @@ option(BUILD_TESTS "Build tests." TRUE)
+ if (NOT SITE_PACKAGE)
+     execute_process(
+         COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\
+-            print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}')"
++            print(sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}'))"
+         OUTPUT_VARIABLE SITE_PACKAGE
+     OUTPUT_STRIP_TRAILING_WHITESPACE)
+     if (NOT SITE_PACKAGE)
+diff --git a/pysideuic/objcreator.py b/pysideuic/objcreator.py
+index 80c0a89..542974b 100644
+--- a/pysideuic/objcreator.py
++++ b/pysideuic/objcreator.py
+@@ -24,7 +24,7 @@ import sys
+ import os.path
+ 
+ from pysideuic.exceptions import NoSuchWidgetError, WidgetPluginError
+-from port_v2.load_plugin import load_plugin
++from pysideuic.port_v2.load_plugin import load_plugin
+ 
+ 
+ # The list of directories that are searched for widget plugins.  This is
+diff --git a/pysideuic/port_v2/as_string.py b/pysideuic/port_v2/as_string.py
+index cb7780c..ddb65fd 100644
+--- a/pysideuic/port_v2/as_string.py
++++ b/pysideuic/port_v2/as_string.py
+@@ -24,7 +24,7 @@ import re
+ 
+ def as_string(obj, encode=True):
+     if isinstance(obj, str):
+-        s = '"' + _escape(obj.encode('UTF-8')) + '"'
++        s = '"' + _escape(obj) + '"'
+         return s
+ 
+     return str(obj)
+diff --git a/pysideuic/port_v2/ascii_upper.py b/pysideuic/port_v2/ascii_upper.py
+index 05843bf..dbb0c51 100644
+--- a/pysideuic/port_v2/ascii_upper.py
++++ b/pysideuic/port_v2/ascii_upper.py
+@@ -23,7 +23,7 @@ import string
+ 
+ 
+ # A translation table for converting ASCII lower case to upper case.
+-_ascii_trans_table = string.maketrans(string.ascii_lowercase,
++_ascii_trans_table = str.maketrans(string.ascii_lowercase,
+         string.ascii_uppercase)
+ 
+ 
+diff --git a/pysideuic/uiparser.py b/pysideuic/uiparser.py
+index 4c7cbe1..82823fb 100644
+--- a/pysideuic/uiparser.py
++++ b/pysideuic/uiparser.py
+@@ -31,9 +31,9 @@ except ImportError:
+     from xml.etree.ElementTree import parse, SubElement
+ 
+ 
+-from exceptions import NoSuchWidgetError
+-from objcreator import QObjectCreator
+-from properties import Properties
++from pysideuic.exceptions import NoSuchWidgetError
++from pysideuic.objcreator import QObjectCreator
++from pysideuic.properties import Properties
+ 
+ 
+ logger = logging.getLogger(__name__)
+diff --git a/tests/rcc/run_test.sh b/tests/rcc/run_test.sh
+index f3b7882..6f592dd 100755
+--- a/tests/rcc/run_test.sh
++++ b/tests/rcc/run_test.sh
+@@ -8,6 +8,6 @@
+ # $3: qrc file
+ 
+ export PYTHONPATH=$PYTHONPATH:`pwd`
+-$1 -o `basename $3 .qrc`_rc.py $3
++$1 -py3 -o `basename $3 .qrc`_rc.py $3
+ `pkg-config shiboken --variable=python_interpreter` $2
+ 

python-pyside/PKGBUILD

+# Maintainer: arlx_ignacy <ziphims@gmail.com>
+# Contributor: Matthias Maennich <arch@maennich.net>
+
+# modify these two to whatever Python 3 interpreter you're targetting; on my
+# system I use the vanilla python3
+_pyver=3
+_pyexec=/usr/bin/python$_pyver
+
+pkgname=python-pyside
+pkgver=1.1.0
+pkgrel=1
+pkgdesc='A set of Python 3.x bindings licensed under LGPL for the Qt toolkit'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url='http://www.pyside.org'
+depends=('python-libshiboken>=1.1.0' 'python' 'qt>=4.7' 'phonon' 'mesa')
+makedepends=('cmake' 'automoc4' 'python-shibokengenerator>=1.1.0')
+replaces=('pyside-py3')
+source=("http://www.pyside.org/files/pyside-qt4.7+$pkgver.tar.bz2")
+md5sums=('233f0c6d2b3daf58cf88877d7f74557b')
+
+
+build() {
+    cd "$srcdir"
+
+    if [ -d build ] ; then
+        msg "Removing last build ..."
+        rm -rf build
+    fi
+
+    mkdir build
+    cd build
+
+    cmake ../pyside-qt4.7+$pkgver -DCMAKE_INSTALL_PREFIX=/usr \
+                                  -DCMAKE_BUILD_TYPE=Release  \
+                                  -DBUILD_TESTS=FALSE         \
+                                  -DUSE_PYTHON3=TRUE
+    make
+}
+
+package() {
+    cd "$srcdir/build"
+    make DESTDIR=$pkgdir install
+}

python-shibokengenerator/PKGBUILD

+# Maintainer: arlx_ignacy <ziphims@gmail.com>
+# Contributor: Matthias Maennich <arch@maennich.net>
+
+# modify these two to whatever Python 3 interpreter you're targetting; on my
+# system I use the vanilla python3
+_pyver=3
+_pyexec=/usr/bin/python$_pyver
+
+pkgname=python-shibokengenerator
+pkgver=1.1.0
+pkgrel=1
+pkgdesc='Python 3 bindings generator that uses API Extractor and outputs CPython code.'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url='http://www.pyside.org'
+depends=('python' 'qt>=4.7' 'openssl' 'generatorrunner>=0.6.16')
+makedepends=('cmake' 'automoc4' 'patch')
+replaces=('shibokengenerator-py3')
+source=("http://www.pyside.org/files/shiboken-$pkgver.tar.bz2"
+        "pythonsuffix.patch")
+md5sums=('9c9d696c8c426fb5abf28a6bd3759558'
+         '6e33e6e68ffc18785b6aaebc36c905ed')
+
+build() {
+    cd "$srcdir/shiboken-$pkgver"
+
+    msg "Applying patches ..."
+    # this patch is to make it much easier to get python suffix
+    patch -p1 -N < ../../pythonsuffix.patch
+
+    # of course, if you want to undo the patches you can use:
+    #  $ patch -p1 -R < ../../pythonsuffix.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=TRUE
+    make shiboken
+}
+
+package() {
+    cd "$srcdir/build/generator"
+    make DESTDIR=$pkgdir install
+
+    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
+        pythonsuffix=$(cat ../data/pythonsuffix)
+        if [ -e ../data/ShibokenConfig$pythonsuffix.cmake ] ; then
+            install -m 755 ../data/ShibokenConfig$pythonsuffix.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
+        else
+            msg "Unable to get pythonsuffix .."
+        fi
+    fi
+
+    mkdir -m 755 -p $pkgdir/usr/lib/pkgconfig/
+    install -m 755 ../data/shiboken.pc $pkgdir/usr/lib/pkgconfig/
+}

python-shibokengenerator/pythonsuffix.patch

+diff --git a/data/pythonsuffix.in b/data/pythonsuffix.in
+new file mode 100644
+index 0000000..081d7a7
+--- /dev/null
++++ b/data/pythonsuffix.in
+@@ -0,0 +1 @@
++@shiboken_SUFFIX@@PYTHON_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@
+\ No newline at end of file
+diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
+index c40d552..9c2baf2 100644
+--- a/data/CMakeLists.txt
++++ b/data/CMakeLists.txt
+@@ -16,6 +16,8 @@ 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)
++configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pythonsuffix.in"
++               "${CMAKE_CURRENT_BINARY_DIR}/pythonsuffix" @ONLY)
+ 
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.cmake"
+         DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken-${shiboken_VERSION}")