Skip to content

Commit

Permalink
python-uranium: Update to 5.6.0
Browse files Browse the repository at this point in the history
**Summary**
No changelog provided.

Signed-off-by: Evan Maddock <maddock.evan@vivaldi.net>
  • Loading branch information
EbonJaeger committed Mar 22, 2024
1 parent 105e894 commit 268f7de
Show file tree
Hide file tree
Showing 12 changed files with 3,014 additions and 26 deletions.
5 changes: 5 additions & 0 deletions packages/py/python-uranium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In version 5 of all their software, Ultimaker went all-in on their custom build system and Windows bits.
To avoid dealing with all of that, we do what Fedora does and use the version 4 CMake build files.

When updating, make sure to use the same version and files that Fedora is using.
Their source repository can be found [here](https://src.fedoraproject.org/rpms/python-uranium).
63 changes: 63 additions & 0 deletions packages/py/python-uranium/files/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
project(uranium NONE)

cmake_minimum_required(VERSION 3.6)

message(STATUS ${CMAKE_MODULE_PATH})

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/
${CMAKE_MODULE_PATH})
include(UraniumTranslationTools)

include(GNUInstallDirs)

find_package(PythonInterp 3 REQUIRED)

message("Using python version ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")

# # Checks using pylint
# Note that we use exit 0 here to not mark the build as a failure on check failure
# In addition, the specified pylint configuration uses the spellchecker plugin. This required python-enchant to be installed.
add_custom_target(check)
add_custom_command(TARGET check POST_BUILD COMMAND "PYTHONPATH=${CMAKE_SOURCE_DIR}" ${PYTHON_EXECUTABLE} -m pylint --rcfile=${CMAKE_SOURCE_DIR}/pylint.cfg UM --msg-template=\"{path}:{line}: [{msg_id}({symbol}) , {obj}] {msg}\" > ${CMAKE_BINARY_DIR}/pylint.log || exit 0 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

# # Check using Mypy
add_custom_target(typecheck)
add_custom_command(TARGET typecheck POST_BUILD COMMAND ${PYTHON_EXECUTABLE} run_mypy.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

# # Tests
include(UraniumTests)

# # Benchmarks
# add_custom_target(benchmark)
# file(GLOB bench_files tests/benchmarks/*/profile*.py)
# foreach(file ${bench_files})
# add_custom_command(TARGET benchmark POST_BUILD COMMAND "PYTHONPATH=${CMAKE_SOURCE_DIR}" kernprof ARGS -l -v ${file})
# endforeach()


# Documentation
find_package(Doxygen)
if(${DOXYGEN_FOUND})
add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()

# Extract Strings
add_custom_target(extract-messages ${CMAKE_SOURCE_DIR}/scripts/extract-messages ${CMAKE_SOURCE_DIR} uranium)

# Build Translations
CREATE_TRANSLATION_TARGETS()


if(EXISTS /etc/debian_version)
install(DIRECTORY UM DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}/dist-packages)
else()
install(DIRECTORY UM DESTINATION lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
endif()
install(FILES ${CMAKE_SOURCE_DIR}/cmake/UraniumTranslationTools.cmake
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules/ )
install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/uranium)

# Detect plugins to install
include(UraniumPluginInstall)

include(CPackConfig.cmake)
34 changes: 34 additions & 0 deletions packages/py/python-uranium/files/CPackConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
set(CPACK_PACKAGE_VENDOR "Ultimaker")
set(CPACK_PACKAGE_CONTACT "Arjen Hiemstra <a.hiemstra@ultimaker.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Uranium 3D Application Framework")
set(CPACK_PACKAGE_VERSION_MAJOR 15)
set(CPACK_PACKAGE_VERSION_MINOR 05)
set(CPACK_PACKAGE_VERSION_PATCH 93)
set(CPACK_GENERATOR "DEB;RPM")

set(RPM_REQUIRES
"python3 >= 3.5.0"
"python3-qt5 >= 5.6.0"
"qt5-qtquickcontrols >= 5.6.0"
"arcus >= 15.05.90"
)
string(REPLACE ";" "," RPM_REQUIRES "${RPM_REQUIRES}")
set(CPACK_RPM_PACKAGE_REQUIRES ${RPM_REQUIRES})

set(DEB_DEPENDS
"python3 (>= 3.5.0)"
"python3-pyqt5 (>= 5.6.0)"
"python3-pyqt5.qtopengl (>= 5.6.0)"
"python3-pyqt5.qtquick (>= 5.6.0)"
"python3-pyqt5.qtsvg (>= 5.6.0)"
"qml-module-qtquick2 (>= 5.6.0)"
"qml-module-qtquick-window2 (>= 5.6.0)"
"qml-module-qtquick-layouts (>= 5.6.0)"
"qml-module-qtquick-dialogs (>= 5.6.0)"
"qml-module-qtquick-controls (>= 5.6.0)"
"arcus (>= 15.05.90)"
)
string(REPLACE ";" "," DEB_DEPENDS "${DEB_DEPENDS}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS ${DEB_DEPENDS})

include(CPack)

0 comments on commit 268f7de

Please sign in to comment.