diff --git a/testing/uranium/874_fix-simplebutton-use-of-um-colorimage.patch b/testing/uranium/874_fix-simplebutton-use-of-um-colorimage.patch new file mode 100644 index 00000000000..3112c9c520a --- /dev/null +++ b/testing/uranium/874_fix-simplebutton-use-of-um-colorimage.patch @@ -0,0 +1,34 @@ +From 88fd460a63263d66173f1e0127b0f208577d7f4e Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/Ultimaker/Uranium/pull/874 +From: fieldOfView +Date: Sat, 20 May 2023 21:14:36 +0200 +Subject: [PATCH] Fix SimpleButton use of UM.ColorImage + +Fixes https://github.com/Ultimaker/Cura/issues/15524 +--- + UM/Qt/qml/UM/SimpleButton.qml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/UM/Qt/qml/UM/SimpleButton.qml b/UM/Qt/qml/UM/SimpleButton.qml +index d3d398753c..d3bd0e8e14 100644 +--- a/UM/Qt/qml/UM/SimpleButton.qml ++++ b/UM/Qt/qml/UM/SimpleButton.qml +@@ -1,7 +1,8 @@ +-// Copyright (c) 2018 Ultimaker B.V. ++// Copyright (c) 2023 Ultimaker B.V. + // Uranium is released under the terms of the LGPLv3 or higher. + + import QtQuick 2.1 ++import UM 1.5 as UM + + MouseArea + { +@@ -27,7 +28,7 @@ MouseArea + radius: 0 + } + +- ColorImage ++ UM.ColorImage + { + id: image + diff --git a/testing/uranium/APKBUILD b/testing/uranium/APKBUILD index 29a62b9e2db..84c1eccd722 100644 --- a/testing/uranium/APKBUILD +++ b/testing/uranium/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Anjandev Momi pkgname=uranium pkgver=5.2.2 -pkgrel=1 +pkgrel=2 pkgdesc="A Python framework for building Desktop applications" url="https://github.com/Ultimaker/Uranium" arch="noarch !armhf !riscv64" # armhf: no py3-qt5, rv64: no py3-shapely @@ -20,6 +20,9 @@ checkdepends="py3-pytest py3-pytest-benchmark py3-twisted" options="!check" # checks broken from 5.x onward source="$pkgname-$pkgver.tar.gz::https://github.com/Ultimaker/Uranium/archive/refs/tags/$pkgver.tar.gz cmake.patch + 874_fix-simplebutton-use-of-um-colorimage.patch + fix-logger-used-but-not-imported.patch + qt-try-ints-then-bytes.patch cmake-helpers.patch" builddir="$srcdir/Uranium-$pkgver" @@ -51,5 +54,8 @@ package() { sha512sums=" a9c222400022e05b5c42c72843b024204a58f5d233805bdffa610a2d9cbd1873773868b049aabbe52c6e859f235ca5428fcdfdbb86651f428483999060611e10 uranium-5.2.2.tar.gz 196a04164de288f5bffeebb73ace9390059dcffebaf40395368f413d1af2e2c668d85dd4c761ad226732540d41598235c2c368152cc157d2e89445ce27738c9b cmake.patch +c50b37a3a44c4d4f66d115e72a430b82a8125efa49ce51271d5cad7fac15b2941a6a82b71fd07cef751b159296b64d783b348cebe7dfd865f0121815d2cf41f4 874_fix-simplebutton-use-of-um-colorimage.patch +78e1415133bc4135f93633375bdb71a9e04b9cd128067d223985d0878f0e3de3ed1d336117fc527f0804b99878bd56817e3eb7a5aa545cc877b9f43386e17e78 fix-logger-used-but-not-imported.patch +26489638fcf80822d16b0a295aee21a8973c23a023b1daf7f2cf5f7be7c56e72a15edd87ac6993f8a2ad09086d7d1a8b7d32247522c9429183625e3a0b63f2ae qt-try-ints-then-bytes.patch aa185ce3592036f045e3386266015cc08443c2e4f9b9a4c03c77c13525af98d68eaa3360e8858e0561417a826c73bf8a2b209bcad91d2cc16cce32fb0231fcf8 cmake-helpers.patch " diff --git a/testing/uranium/fix-logger-used-but-not-imported.patch b/testing/uranium/fix-logger-used-but-not-imported.patch new file mode 100644 index 00000000000..151893c2e04 --- /dev/null +++ b/testing/uranium/fix-logger-used-but-not-imported.patch @@ -0,0 +1,14 @@ +Patch-Source: https://src.fedoraproject.org/rpms/python-uranium/blob/rawhide/f/Uranium-5.3.0-qt-try-ints-then-bytes-for-gl-mask-functions.patch + +diff --git a/UM/View/SelectionPass.py.orig b/UM/View/SelectionPass.py +index 945b789..ef042a5 100644 +--- a/UM/View/SelectionPass.py.orig ++++ b/UM/View/SelectionPass.py +@@ -5,6 +5,7 @@ import enum + import random + from typing import TYPE_CHECKING + ++from UM.Logger import Logger + from UM.Resources import Resources + from UM.Application import Application + diff --git a/testing/uranium/qt-try-ints-then-bytes.patch b/testing/uranium/qt-try-ints-then-bytes.patch new file mode 100644 index 00000000000..8f7d6dbeeb6 --- /dev/null +++ b/testing/uranium/qt-try-ints-then-bytes.patch @@ -0,0 +1,96 @@ +Patch-Source: https://src.fedoraproject.org/rpms/python-uranium/blob/rawhide/f/Uranium-5.3.0-qt-try-ints-then-bytes-for-gl-mask-functions.patch + +diff --git a/UM/View/RenderBatch.py.orig b/UM/View/RenderBatch.py +index 6deeeb1..5f1eda5 100644 +--- a/UM/View/RenderBatch.py.orig ++++ b/UM/View/RenderBatch.py +@@ -186,10 +186,24 @@ class RenderBatch: + + if self._render_type == self.RenderType.Solid: + self._gl.glEnable(self._gl.GL_DEPTH_TEST) +- self._gl.glDepthMask(self._gl.GL_TRUE) ++ try: ++ self._gl.glDepthMask(self._gl.GL_TRUE) ++ except: ++ Logger.log("w", "glDepthMask does not like ints, trying bytes...") ++ try: ++ self._gl.glDepthMask(b'1') ++ except: ++ Logger.log("e", "glDepthMask does not like ints or bytes, no idea what it wants") + elif self._render_type == self.RenderType.Transparent: + self._gl.glEnable(self._gl.GL_DEPTH_TEST) +- self._gl.glDepthMask(self._gl.GL_FALSE) ++ try: ++ self._gl.glDepthMask(self._gl.GL_FALSE) ++ except: ++ Logger.log("w", "glDepthMask does not like ints, trying bytes...") ++ try: ++ self._gl.glDepthMask(b'1') ++ except: ++ Logger.log("e", "glDepthMask does not like ints or bytes, no idea what it wants") + elif self._render_type == self.RenderType.Overlay: + self._gl.glDisable(self._gl.GL_DEPTH_TEST) + +diff --git a/UM/View/RenderPass.py.orig b/UM/View/RenderPass.py +index 8068ddf..8cb4f67 100644 +--- a/UM/View/RenderPass.py.orig ++++ b/UM/View/RenderPass.py +@@ -93,8 +93,22 @@ class RenderPass: + self._fbo.bind() + + # Ensure we can actually write to the relevant FBO components. +- self._gl.glColorMask(self._gl.GL_TRUE, self._gl.GL_TRUE,self._gl.GL_TRUE, self._gl.GL_TRUE) +- self._gl.glDepthMask(self._gl.GL_TRUE) ++ try: ++ self._gl.glColorMask(self._gl.GL_TRUE, self._gl.GL_TRUE,self._gl.GL_TRUE, self._gl.GL_TRUE) ++ except: ++ Logger.log("w", "glColorMask does not like ints, trying bytes...") ++ try: ++ self._gl.glColorMask(b'1', b'1',b'1', b'1') ++ except: ++ Logger.log("e", "glColorMask does not like ints or bytes, no idea what it wants") ++ try: ++ self._gl.glDepthMask(self._gl.GL_TRUE) ++ except: ++ Logger.log("w", "glDepthMask does not like ints, trying bytes...") ++ try: ++ self._gl.glDepthMask(b'1') ++ except: ++ Logger.log("e", "glDepthMask does not like ints or bytes, no idea what it wants") + + self._gl.glClear(self._gl.GL_COLOR_BUFFER_BIT | self._gl.GL_DEPTH_BUFFER_BIT) + +diff --git a/UM/View/SelectionPass.py.orig b/UM/View/SelectionPass.py +index ef042a5..c28fe4f 100644 +--- a/UM/View/SelectionPass.py.orig ++++ b/UM/View/SelectionPass.py +@@ -110,13 +110,27 @@ class SelectionPass(RenderPass): + if selectable_objects: + batch.render(self._scene.getActiveCamera()) + +- self._gl.glColorMask(self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_FALSE) ++ try: ++ self._gl.glColorMask(self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_FALSE) ++ except: ++ Logger.log("w", "glColorMask does not like ints, trying bytes...") ++ try: ++ self._gl.glColorMask(b'1', b'1', b'1', b'0') ++ except: ++ Logger.log("e", "glColorMask does not like ints or bytes, no idea what it wants") + self._gl.glDisable(self._gl.GL_DEPTH_TEST) + + tool_handle.render(self._scene.getActiveCamera()) + + self._gl.glEnable(self._gl.GL_DEPTH_TEST) +- self._gl.glColorMask(self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_TRUE) ++ try: ++ self._gl.glColorMask(self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_TRUE, self._gl.GL_TRUE) ++ except: ++ Logger.log("w", "glColorMask does not like ints, trying bytes...") ++ try: ++ self._gl.glColorMask(b'1', b'1', b'1', b'1') ++ except: ++ Logger.log("e", "glColorMask does not like ints or bytes, no idea what it wants") + + self.release() +