Commits

arsooy  committed c041185

enabling install alongside PySide for Python 2

  • Participants
  • Parent commits cd7b41f

Comments (0)

Files changed (12)

File python-libshiboken/PKGBUILD

 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')
+source=("http://www.pyside.org/files/shiboken-$pkgver.tar.bz2"
+        'py3build.patch')
+md5sums=('9c9d696c8c426fb5abf28a6bd3759558'
+         '3e0bb8ae72d2331dd8cd676dd78e5a91')
 
 
 build() {
-    cd "$srcdir"
+    cd "$srcdir/shiboken-$pkgver"
 
+    msg "Applying patches ..."
+    # this patch is to differentiate our build as Python 3
+    patch -p1 -N < ../py3build.patch
+
+    # of course, if you want to undo the patches you can use:
+    #  $ patch -p1 -R < ../py3build.patch
+
+    cd ..
     if [ -d build ] ; then
         msg "Removing last build ..."
         rm -rf build

File python-libshiboken/py3build.patch

+diff --git a/libshiboken/CMakeLists.txt b/libshiboken/CMakeLists.txt
+index feb8498..594d6d1 100644
+--- a/libshiboken/CMakeLists.txt
++++ b/libshiboken/CMakeLists.txt
+@@ -7,6 +7,10 @@ else()
+     set(shiboken_SUFFIX "")
+ endif()
+ 
++if (USE_PYTHON3)
++    set(shiboken_SUFFIX "-py3")
++endif()
++
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/sbkversion.h.in"
+                "${CMAKE_CURRENT_BINARY_DIR}/sbkversion.h" @ONLY)
+ 

File python-pyside-tools/PKGBUILD

 replaces=('pyside-tools-py3')
 source=("http://www.pyside.org/files/pyside-tools-$pkgver.tar.bz2"
         '2to3.patch'
-        'py3.patch')
+        'py3uic.patch'
+        'py3build.patch')
 md5sums=('14d3a36df06d680357d7bc1960f19a6d'
          '88ca14b1e58ca167564afd215930a84b'
-         '9f78b19484675d24008abdc9f03a6085')
+         '9e4d6f040e442713f5e74fc8aae6d8e6'
+         'c6a93ca5a200ec6b2601e8349db08bae')
 
 
 build() {
 
     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
+    patch -p1 < ../2to3.patch
+    # this patch to make pyside-uic valid for Python 3
+    patch -p1 < ../py3uic.patch
+    # this patch is to differentiate our build as Python 3
+    patch -p1 < ../py3build.patch
 
     # of course, if you want to undo the patches you can use:
-    #  $ patch -p1 -R < ../../py3.patch
-    #  $ patch -p1 -R < ../../2to3.patch
+    #  $ patch -p1 -R < ../py3build.patch
+    #  $ patch -p1 -R < ../py3uic.patch
+    #  $ patch -p1 -R < ../2to3.patch
 
     cd ..
     if [ -d build ] ; then
     mkdir build
     cd build
 
+    cmake ../pyside-tools-$pkgver -DCMAKE_INSTALL_PREFIX=/usr  \
+                                  -DCMAKE_BUILD_TYPE=Release   \
+                                  -DPYTHON_EXECUTABLE=$_pyexec \
+                                  -DUSE_PYTHON3=TRUE
+    make
+
     # 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
 }
 
 

File 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
- 

File python-pyside-tools/py3build.patch

+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bbc8536..90e3626 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,13 +13,20 @@ set(pyside_tools_VERSION "${pyside_tools_MAJOR_VERSION}.${pyside_tools_MINOR_VER
+ 
+ configure_file("pysideuic/__init__.py.in" "__init__.py" @ONLY)
+ 
++option(USE_PYTHON3 "Build pyside-tools (pyside-uic) for Python 3." TRUE)
+ option(BUILD_TESTS "Build tests." TRUE)
+ 
++if (USE_PYTHON3)
++    set(tools_SUFFIX "-py3")
++else()
++    set(tools_SUFFIX "")
++endif()
++
+ # UIC stuff
+ 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)
+@@ -32,7 +39,8 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pyside-uic
+         PERMISSIONS
+         OWNER_EXECUTE OWNER_WRITE OWNER_READ
+         GROUP_EXECUTE GROUP_READ
+-        WORLD_EXECUTE WORLD_READ)
++        WORLD_EXECUTE WORLD_READ
++        RENAME pyside-uic${tools_SUFFIX})
+ 
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py"
+         DESTINATION "${SITE_PACKAGE}/pysideuic")
+diff --git a/pylupdate/CMakeLists.txt b/pylupdate/CMakeLists.txt
+index bc1bd88..acc8759 100644
+--- a/pylupdate/CMakeLists.txt
++++ b/pylupdate/CMakeLists.txt
+@@ -15,6 +15,7 @@ set(lupdate_MOC_HEADERS translator.h)
+ qt4_wrap_cpp(lupdate_MOC_OUTFILES ${lupdate_MOC_HEADERS})
+ 
+ add_executable(pyside-lupdate ${lupdate_SRC} ${lupdate_MOC_OUTFILES})
++set_target_properties(pyside-lupdate PROPERTIES OUTPUT_NAME pyside-lupdate${tools_SUFFIX})
+ include_directories(pyside-lupdate
+                     ${CMAKE_CURRENT_SOURCE_DIR}
+                     ${QT_INCLUDE_DIR}
+diff --git a/pyrcc/CMakeLists.txt b/pyrcc/CMakeLists.txt
+index c804bd5..aeb5a46 100644
+--- a/pyrcc/CMakeLists.txt
++++ b/pyrcc/CMakeLists.txt
+@@ -1,5 +1,6 @@
+ 
+ add_executable(pyside-rcc main.cpp rcc.cpp)
++set_target_properties(pyside-rcc PROPERTIES OUTPUT_NAME pyside-rcc${tools_SUFFIX})
+ include_directories(pyside-rcc
+                     ${QT_INCLUDE_DIR}
+                     ${QT_QT_INCLUDE_DIR}

File python-pyside-tools/py3uic.patch

+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
+ 

File python-pyside/PKGBUILD

 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')
+source=("http://www.pyside.org/files/pyside-qt4.7+$pkgver.tar.bz2"
+        'py3build.patch')
+md5sums=('233f0c6d2b3daf58cf88877d7f74557b'
+         '9192daeca5058ec83001143dc6d5a324')
 
 
 build() {
-    cd "$srcdir"
+    cd "$srcdir/pyside-qt4.7+$pkgver"
 
+    msg "Applying patches ..."
+    # this patch is to use Python 3 libraries & generator
+    patch -p1 -N < ../py3build.patch
+
+    # of course, if you want to undo the patches you can use:
+    #  $ patch -p1 -R < ../py3build.patch
+
+    cd ..
     if [ -d build ] ; then
         msg "Removing last build ..."
         rm -rf build
 
     cmake ../pyside-qt4.7+$pkgver -DCMAKE_INSTALL_PREFIX=/usr \
                                   -DCMAKE_BUILD_TYPE=Release  \
-                                  -DBUILD_TESTS=FALSE         \
                                   -DUSE_PYTHON3=TRUE
     make
 }

File python-pyside/py3build.patch

+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0151eea..93408d5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -77,6 +77,10 @@ endif()
+ set(PYSIDE_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" CACHE STRING "Qt version used to compile PySide" FORCE)
+ if(ENABLE_VERSION_SUFFIX)
+       set(pyside_SUFFIX "-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}")
++else()
++    if (USE_PYTHON3)
++        set(pyside_SUFFIX "-py3")
++    endif()
+ endif()
+ 
+ include(${QT_USE_FILE})
+@@ -152,7 +156,7 @@ if (NOT SITE_PACKAGE)
+     endif()
+ endif()
+ 
+-set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero)
++set(GENERATOR_EXTRA_FLAGS --generator-set=py3-shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero)
+ if(WIN32 OR DEFINED AVOID_PROTECTED_HACK)
+     message(STATUS "PySide will be generated avoiding the protected hack!")
+     set(GENERATOR_EXTRA_FLAGS ${GENERATOR_EXTRA_FLAGS} --avoid-protected-hack)
+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)

File python-shibokengenerator/PKGBUILD

 license=('LGPL')
 url='http://www.pyside.org'
 depends=('python' 'qt>=4.7' 'openssl' 'generatorrunner>=0.6.16')
-makedepends=('cmake' 'automoc4' 'patch')
+makedepends=('cmake' 'automoc4' 'sed' 'patch')
 replaces=('shibokengenerator-py3')
 source=("http://www.pyside.org/files/shiboken-$pkgver.tar.bz2"
-        "pythonsuffix.patch")
+        'py3build.patch'
+        'pacman_vars.patch')
 md5sums=('9c9d696c8c426fb5abf28a6bd3759558'
-         '6e33e6e68ffc18785b6aaebc36c905ed')
+         'f8ea281b3e22e7ccc9752e301f40cd67'
+         '2ed6e5f86e3daed2c50a32ef6a7b88a5')
 
 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
+    # this patch is to differentiate our build as Python 3
+    patch -p1 -N < ../py3build.patch
+    # this patch is to make it much easier to veriables from cmake
+    patch -p1 -N < ../pacman_vars.patch
 
     # of course, if you want to undo the patches you can use:
-    #  $ patch -p1 -R < ../../pythonsuffix.patch
+    #  $ patch -p1 -R < ../pacman_vars.patch
+    #  $ patch -p1 -R < ../py3build.patch
 
     cd ..
     if [ -d build ] ; then
     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/
+    # get some variables for our purpose
+    SHIBOKEN_SUFFIX=$(sed -n '2p' ../data/pacman_vars)
+    PYTHON_SUFFIX=$(sed -n '3p' ../data/pacman_vars)
+
+    mkdir -m 755 -p $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
+    install -m 755 ../data/ShibokenConfig.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
+    install -m 755 ../data/ShibokenConfigVersion.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
     if [ -e ../data/ShibokenConfig-python$_pyver.cmake ] ; then
-        install -m 755 ../data/ShibokenConfig-python$_pyver.cmake $pkgdir/usr/lib/cmake/Shiboken-$pkgver/
+        install -m 755 ../data/ShibokenConfig-python$_pyver.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$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/
+        if [ -e ../data/ShibokenConfig$PYTHON_SUFFIX.cmake ] ; then
+            install -m 755 ../data/ShibokenConfig$PYTHON_SUFFIX.cmake $pkgdir/usr/lib/cmake/Shiboken$SHIBOKEN_SUFFIX-$pkgver/
         else
-            msg "Unable to get pythonsuffix!"
+            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/
+    install -m 755 ../data/shiboken$SHIBOKEN_SUFFIX.pc $pkgdir/usr/lib/pkgconfig/
 }

File python-shibokengenerator/pacman_vars.patch

+diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
+index c40d552..9129670 100644
+--- a/data/CMakeLists.txt
++++ b/data/CMakeLists.txt
+@@ -8,6 +8,11 @@ add_custom_target(data)
+ add_dependencies(data shiboken)
+ get_target_property(SHIBOKEN_GENERATOR shiboken OUTPUT_NAME)
+ 
++if (USE_PYTHON3)
++    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pacman_vars.in"
++                   "${CMAKE_CURRENT_BINARY_DIR}/pacman_vars" @ONLY)
++endif()
++
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfig.cmake.in"
+                "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.cmake" @ONLY)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfig-spec.cmake.in"
+diff --git a/data/pacman_vars.in b/data/pacman_vars.in
+new file mode 100644
+index 0000000..d2019fa
+--- /dev/null
++++ b/data/pacman_vars.in
+@@ -0,0 +1,3 @@
++@shiboken_VERSION@
++@shiboken_SUFFIX@
++@PYTHON_SUFFIX@

File python-shibokengenerator/py3build.patch

+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d0a014c..f54c08f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -30,6 +30,7 @@ if (USE_PYTHON3)
+     set(PYTHON_DEBUG_LIBRARIES ${PYTHON3_DEBUG_LIBRARIES})
+     set(PYTHONINTERP_FOUND ${PYTHON3INTERP_FOUND})
+     set(PYTHON_EXECUTABLE ${PYTHON3_EXECUTABLE})
++    set(shiboken_SUFFIX "-py3")
+ else()
+     find_package(PythonLibs 2.6)
+     find_package(PythonInterpWithDebug)
+diff --git a/data/ShibokenConfig.cmake.in b/data/ShibokenConfig.cmake.in
+index 7d8bc86..7155469 100644
+--- a/data/ShibokenConfig.cmake.in
++++ b/data/ShibokenConfig.cmake.in
+@@ -2,4 +2,4 @@ if (NOT PYTHON_SUFFIX)
+     message(STATUS "Using default python: @PYTHON_SUFFIX@")
+     SET(PYTHON_SUFFIX @PYTHON_SUFFIX@)
+ endif()
+-include(@LIB_INSTALL_DIR@/cmake/Shiboken-@shiboken_VERSION@/ShibokenConfig${PYTHON_SUFFIX}.cmake)
++include(@LIB_INSTALL_DIR@/cmake/Shiboken@shiboken_SUFFIX@-@shiboken_VERSION@/ShibokenConfig${PYTHON_SUFFIX}.cmake)
+diff --git a/generator/CMakeLists.txt b/generator/CMakeLists.txt
+index f3cbe08..03a00fd 100644
+--- a/generator/CMakeLists.txt
++++ b/generator/CMakeLists.txt
+@@ -17,7 +17,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
+                     ${QT_QTCORE_INCLUDE_DIR})
+ 
+ add_library(shiboken_generator SHARED ${shiboken_SRC})
+-set_property(TARGET shiboken_generator PROPERTY PREFIX "")
++set_property(TARGET shiboken_generator PROPERTY PREFIX "py3-")
+ 
+ target_link_libraries(shiboken_generator
+                       ${APIEXTRACTOR_LIBRARY}
+diff --git a/generator/main.cpp b/generator/main.cpp
+index 8545bcc..98dcb50 100644
+--- a/generator/main.cpp
++++ b/generator/main.cpp
+@@ -28,7 +28,7 @@
+ int main(int argc, char* argv[])
+ {
+     QStringList args;
+-    args.append("--generator-set=shiboken");
++    args.append("--generator-set=py3-shiboken");
+     for (int i = 1; i < argc; i++) {
+         if (QString("--version") == argv[i]) {
+             std::cout << "shiboken v" SHIBOKEN_VERSION << std::endl;

File 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}")