Source

pyside_aur / python-pyside-tools / py3build.patch

Full commit
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbc8536..5b2e7be 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")
@@ -45,7 +53,12 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pysideuic
 # Man pages for pyside-uic
 if (NOT win32)
     file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/pysideuic/*.1")
-    install(FILES ${manpages} DESTINATION share/man/man1)
+
+    # install man files with suffix
+    foreach(manfile ${manpages})
+        get_filename_component(fname ${manfile} NAME_WE)
+        install(FILES ${manfile} DESTINATION share/man/man1 RENAME ${fname}${tools_SUFFIX}.1)
+    endforeach(manfile)
 endif()
 
 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake"
diff --git a/pylupdate/CMakeLists.txt b/pylupdate/CMakeLists.txt
index bc1bd88..cf7ecbd 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}
@@ -33,6 +34,11 @@ install(TARGETS pyside-lupdate RUNTIME DESTINATION bin)
 # Man pages
 if (NOT win32)
     file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/*.1")
-    install(FILES ${manpages} DESTINATION share/man/man1)
+
+    # install man files with suffix
+    foreach(manfile ${manpages})
+        get_filename_component(fname ${manfile} NAME_WE)
+        install(FILES ${manfile} DESTINATION share/man/man1 RENAME ${fname}${tools_SUFFIX}.1)
+    endforeach(manfile)
 endif()
 
diff --git a/pyrcc/CMakeLists.txt b/pyrcc/CMakeLists.txt
index c804bd5..cb69b23 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}
@@ -15,6 +16,11 @@ install(TARGETS pyside-rcc RUNTIME DESTINATION bin)
 # Man pages
 if (NOT win32)
     file(GLOB manpages "${CMAKE_CURRENT_SOURCE_DIR}/*.1")
-    install(FILES ${manpages} DESTINATION share/man/man1)
+
+    # install man files with suffix
+    foreach(manfile ${manpages})
+        get_filename_component(fname ${manfile} NAME_WE)
+        install(FILES ${manfile} DESTINATION share/man/man1 RENAME ${fname}${tools_SUFFIX}.1)
+    endforeach(manfile)
 endif()