author | Evangelos Foutras
<foutrelis@archlinux.org> 2020-12-12 11:24:56 UTC |
committer | Evangelos Foutras
<foutrelis@archlinux.org> 2020-12-12 11:24:56 UTC |
parent | a91ba2f51561e895d096652d34cfffba97a45b80 |
FindPySide2Tools.cmake | +0 | -112 |
PKGBUILD | +15 | -21 |
diff --git a/FindPySide2Tools.cmake b/FindPySide2Tools.cmake deleted file mode 100644 index 216da5f..0000000 --- a/FindPySide2Tools.cmake +++ /dev/null @@ -1,112 +0,0 @@ -# Try to find PySide2 utilities, PYSIDE2UIC and PYSIDE2RCC: -# PYSIDE2UICBINARY - Location of PYSIDE2UIC executable -# PYSIDE2RCCBINARY - Location of PYSIDE2RCC executable -# PYSIDE2_TOOLS_FOUND - PySide2 utilities found. - -# Also provides macro similar to FindQt4.cmake's WRAP_UI and WRAP_RC, -# for the automatic generation of Python code from Qt4's user interface -# ('.ui') and resource ('.qrc') files. These macros are called: -# - PYSIDE_WRAP_UI -# - PYSIDE_WRAP_RC - -IF(PYSIDE2UICBINARY AND PYSIDE2RCCBINARY) - # Already in cache, be silent - set(PYSIDE2_TOOLS_FOUND_QUIETLY TRUE) -ENDIF(PYSIDE2UICBINARY AND PYSIDE2RCCBINARY) - -if(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - #pyside2 tools are often in same location as python interpreter - get_filename_component(PYTHON_BIN_DIR ${PYTHON_EXECUTABLE} PATH) - set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR}) -endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - -# Since Qt v5.14, pyside2-uic and pyside2-rcc are directly provided by Qt5Core uic and rcc, with '-g python' option -# We test Qt5Core version to act accordingly - -FIND_PACKAGE(Qt5Core) - -IF(Qt5Core_VERSION VERSION_LESS 5.14) - # Legacy (< 5.14) - FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} pyuic5 HINTS ${PYSIDE_BIN_DIR}) - FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} pyrcc5 HINTS ${PYSIDE_BIN_DIR}) - set(UICOPTIONS "") - set(RCCOPTIONS "") -ELSE(Qt5Core_VERSION VERSION_LESS 5.14) - # New (>= 5.14) - FIND_PROGRAM(PYSIDE2UICBINARY NAMES uic-qt5 uic pyside2-uic) - set(UICOPTIONS "--generator=python") - FIND_PROGRAM(PYSIDE2RCCBINARY NAMES rcc-qt5 rcc pyside2-rcc) - set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1") -ENDIF(Qt5Core_VERSION VERSION_LESS 5.14) - -MACRO(PYSIDE_WRAP_UI outfiles) - FOREACH(it ${ARGN}) - GET_FILENAME_COMPONENT(outfile ${it} NAME_WE) - GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) - SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py) - #ADD_CUSTOM_TARGET(${it} ALL - # DEPENDS ${outfile} - #) - if(WIN32 OR APPLE) - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND ${PYSIDE2UICBINARY} ${UICOPTIONS} ${infile} -o ${outfile} - MAIN_DEPENDENCY ${infile} - ) - else() - # Especially on Open Build Service we don't want changing date like - # pyside2-uic generates in comments at beginning., which is why - # we follow the tool command with in-place sed. - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND "${PYSIDE2UICBINARY}" ${UICOPTIONS} "${infile}" -o "${outfile}" - COMMAND sed -i "/^# /d" "${outfile}" - MAIN_DEPENDENCY "${infile}" - ) - endif() - list(APPEND ${outfiles} ${outfile}) - ENDFOREACH(it) -ENDMACRO (PYSIDE_WRAP_UI) - -MACRO(PYSIDE_WRAP_RC outfiles) - FOREACH(it ${ARGN}) - GET_FILENAME_COMPONENT(outfile ${it} NAME_WE) - GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) - SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py") - #ADD_CUSTOM_TARGET(${it} ALL - # DEPENDS ${outfile} - #) - if(WIN32 OR APPLE) - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND ${PYSIDE2RCCBINARY} ${RCCOPTIONS} ${infile} -o ${outfile} - MAIN_DEPENDENCY ${infile} - ) - else() - # Especially on Open Build Service we don't want changing date like - # pyside-rcc generates in comments at beginning, which is why - # we follow the tool command with in-place sed. - ADD_CUSTOM_COMMAND(OUTPUT "${outfile}" - COMMAND "${PYSIDE2RCCBINARY}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}" - COMMAND sed -i "/^# /d" "${outfile}" - MAIN_DEPENDENCY "${infile}" - ) - endif() - list(APPEND ${outfiles} ${outfile}) - ENDFOREACH(it) -ENDMACRO (PYSIDE_WRAP_RC) - -IF(EXISTS ${PYSIDE2UICBINARY} AND EXISTS ${PYSIDE2RCCBINARY}) - set(PYSIDE2_TOOLS_FOUND TRUE) -ENDIF(EXISTS ${PYSIDE2UICBINARY} AND EXISTS ${PYSIDE2RCCBINARY}) - -if(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY) - if (NOT PySide2Tools_FIND_QUIETLY) - message(STATUS "Found PySide2 tools: ${PYSIDE2UICBINARY}, ${PYSIDE2RCCBINARY}") - endif (NOT PySide2Tools_FIND_QUIETLY) -else(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY) - if(PySide2Tools_FIND_REQUIRED) - message(FATAL_ERROR "PySide2 tools could not be found, but are required.") - else(PySide2Tools_FIND_REQUIRED) - if (NOT PySide2Tools_FIND_QUIETLY) - message(STATUS "PySide2 tools: not found.") - endif (NOT PySide2Tools_FIND_QUIETLY) - endif(PySide2Tools_FIND_REQUIRED) -endif(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY) diff --git a/PKGBUILD b/PKGBUILD index 4893e0d..d4c9fb0 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -10,7 +10,8 @@ pkgname=freecad pkgver=0.18.5 -pkgrel=3 +_commit=734202bc810bf61bd6f66bdc060e6951bd0d134d # tag: 0.18.5 +pkgrel=4 pkgdesc='General purpose 3D CAD modeler' arch=(x86_64) url='https://freecadweb.org/' @@ -20,13 +21,19 @@ depends=(boost-libs glew jsoncpp libspnav med netcdf opencascade74 openmpi qt5-tools qt5-webkit qt5-x11extras shared-mime-info xerces-c) makedepends=(boost cmake coin eigen gcc-fortran gendesk git ninja pyside2 python-shiboken2 shiboken2 swig) -source=("git+https://github.com/FreeCAD/FreeCAD#commit=980bf9060e28555fecd9e3462f68ca74007b70f8" # tag: 0.18.4 - 'https://raw.githubusercontent.com/FreeCAD/FreeCAD/d06d5687c1498354483aff95093d7f798c2985f2/cMake/FindPySide2Tools.cmake' +source=("git+https://github.com/FreeCAD/FreeCAD#commit=$_commit" + "$pkgname-qt-5.14.patch::https://github.com/FreeCAD/FreeCAD/commit/17ed2b196a58.patch" + "$pkgname-qt-5.14-version.patch::https://github.com/FreeCAD/FreeCAD/commit/1666b28836ba.patch" + "$pkgname-qt-5.15.patch::https://github.com/FreeCAD/FreeCAD/commit/b2882c699b14.patch" + "$pkgname-py38.patch::https://github.com/FreeCAD/FreeCAD/commit/6eacb17b3e03.patch" "$pkgname-py39.patch::https://github.com/FreeCAD/FreeCAD/commit/ae641dc5278e.patch" "$pkgname-boost-1.73.patch::https://github.com/FreeCAD/FreeCAD/commit/200c7c7e00d5.patch" freecad.xml) sha256sums=('SKIP' - '421a364ad214a25be578d81edc9960daab87d7b26f341022aa22dd15b9df621b' + '9af1f0b85a58acad3035fd5abfaf60f57f6a5424101cb328f16468a9e4aebfa5' + 'a74b2f0a48056f73d4b5adaf37bb71750b140bb05a4e417b8c7ed35f294facde' + '820d863794a0dbf0ca1dbe5a419d1823202b2459fee1cc8751a61af67a735bb6' + '3d2570c143825acd01b8eeb645fc450566e9ac20d6333de9e17cbc10fb5a13e0' 'de1d61c18d329e0903d5c1bc27b9c4e28c4911380bdd4b6c49da5b63740862f1' '99a55f06e9d3be3385cb41d747b1a6c9515b010d867bdeeda000a45c0014a89e' '4ee1daf47c8371a3e17173d85a0dd4a106dacd7899d783ccd97a6f3e0dd1a21f') @@ -34,28 +41,15 @@ sha256sums=('SKIP' prepare() { cd FreeCAD + patch -Np1 -i ../$pkgname-qt-5.14.patch + patch -Np1 -i ../$pkgname-qt-5.14-version.patch + patch -Np1 -i ../$pkgname-qt-5.15.patch + patch -Np1 -i ../$pkgname-py38.patch patch -Np1 -i ../$pkgname-py39.patch patch -Np1 -i ../$pkgname-boost-1.73.patch - # Use the fixed version of FindPySide2Tools.cmake - cp -f "$srcdir/FindPySide2Tools.cmake" cMake/FindPySide2Tools.cmake - - # Fix Qt5 version detection - sed -i 's/Qt5Core_VERSION LESS/Qt5Core_VERSION VERSION_LESS/g' \ - cMake/FindPySide2Tools.cmake - cd src - # Update swigpyrun.in for Python 3.8 - sed -i 's/interp->modules/PyImport_GetModuleDict()/g' Base/swigpyrun.inl - - # Fix for Qt 5.15 - sed -i 's/\(.*\)include <QPainter>$/&\n\1include <QPainterPath>/' \ - Mod/Image/Gui/OpenGLImageBox.cpp - - # Compensate for the unusual Shiboken versioning scheme - sed -i 's/SHIBOKEN_MICRO_VERSION/0/g' Gui/WidgetFactory.cpp - # Fix missing "std::" qualifiers, sledge hammer style find . \ ! -wholename "*/Mod/Sketcher/*" \