Source

pyside_aur / python-pyside-tools / py3build.patch

Full commit
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbc8536..56982ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,12 +14,13 @@ set(pyside_tools_VERSION "${pyside_tools_MAJOR_VERSION}.${pyside_tools_MINOR_VER
 configure_file("pysideuic/__init__.py.in" "__init__.py" @ONLY)
 
 option(BUILD_TESTS "Build tests." TRUE)
+set(tools_SUFFIX "-python3")
 
 # 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 +33,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 +47,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()
 
diff --git a/pyrcc/main.cpp b/pyrcc/main.cpp
index d9cecca..11aadeb 100644
--- a/pyrcc/main.cpp
+++ b/pyrcc/main.cpp
@@ -37,7 +37,7 @@
 // Some static globals
 static QString initName;
 static bool verbose = false;
-static int py_version = 2;
+static int py_version = 3; // arsooy_: by default this binary will create output for Python 3
 static int compressLevel = CONSTANT_COMPRESSLEVEL_DEFAULT;
 static int compressThreshold = CONSTANT_COMPRESSTHRESHOLD_DEFAULT;
 static QString resourceRoot;
@@ -97,8 +97,8 @@ int showHelp(const char *argv0, const QString &error)
     fprintf(stderr, "Usage: %s  [options] <inputs>\n\n"
             "Options:\n"
             "    -o file           Write output to file rather than stdout\n"
-            "    -py2              Generate code for any Python v2.x version (default)\n"
-            "    -py3              Generate code for any Python v3.x version\n"
+            "    -py2              Generate code for any Python v2.x version\n"
+            "    -py3              Generate code for any Python v3.x version (default)\n"
             "    -name name        Create an external initialization function with name\n"
             "    -threshold level  Threshold to consider compressing files\n"
             "    -compress level   Compress input files by level\n"