From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 65FF415802C for ; Wed, 18 Dec 2024 00:14:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C12BCE0858; Wed, 18 Dec 2024 00:14:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0EF7FE0856 for ; Wed, 18 Dec 2024 00:14:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BF3E8340BE0 for ; Wed, 18 Dec 2024 00:14:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 169851E15 for ; Wed, 18 Dec 2024 00:14:11 +0000 (UTC) From: "Julien Roy" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Julien Roy" Message-ID: <1734422905.c5de74406c9d29b89fee2f7daf4524f67f37b48c.julien@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: media-gfx/mayo/, media-gfx/mayo/files/ X-VCS-Repository: repo/proj/guru X-VCS-Files: media-gfx/mayo/files/mayo-0.8.0-opencascade7_8.patch media-gfx/mayo/mayo-0.8.0-r3.ebuild X-VCS-Directories: media-gfx/mayo/ media-gfx/mayo/files/ X-VCS-Committer: julien X-VCS-Committer-Name: Julien Roy X-VCS-Revision: c5de74406c9d29b89fee2f7daf4524f67f37b48c X-VCS-Branch: master Date: Wed, 18 Dec 2024 00:14:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1c66d979-3f31-4398-b0f1-dd85c3b63986 X-Archives-Hash: 21159f5760fb11b2e0e0ccc87a4bb1d0 commit: c5de74406c9d29b89fee2f7daf4524f67f37b48c Author: Ivan Lloro gmail com> AuthorDate: Tue Dec 17 08:08:25 2024 +0000 Commit: Julien Roy jroy ca> CommitDate: Tue Dec 17 08:08:25 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c5de7440 media-gfx/mayo: opencascade 7.8 compatible Signed-off-by: Ivan Lloro gmail.com> .../mayo/files/mayo-0.8.0-opencascade7_8.patch | 184 +++++++++++++++++++++ media-gfx/mayo/mayo-0.8.0-r3.ebuild | 41 +++++ 2 files changed, 225 insertions(+) diff --git a/media-gfx/mayo/files/mayo-0.8.0-opencascade7_8.patch b/media-gfx/mayo/files/mayo-0.8.0-opencascade7_8.patch new file mode 100644 index 000000000..04fdc3090 --- /dev/null +++ b/media-gfx/mayo/files/mayo-0.8.0-opencascade7_8.patch @@ -0,0 +1,184 @@ +From d1b3545e9257b3bba26b3c2805b510af5d163048 Mon Sep 17 00:00:00 2001 +From: Hugues Delorme +Date: Wed, 10 Jan 2024 16:57:08 +0100 +Subject: [PATCH] Port to OpenCascade 7.8.0 + +--- + mayo.pro | 36 +++++++++++++++++++++++--------- + src/app/widget_main_control.cpp | 1 - + src/base/brep_utils.cpp | 8 +++++-- + src/base/brep_utils.h | 2 +- + src/base/caf_utils.h | 4 +++- + src/base/tkernel_utils.h | 2 ++ + tests/test_base.cpp | 5 +++-- + +diff --git a/mayo.pro b/mayo.pro +index a21b22d..f2bd14e 100644 +--- a/mayo.pro ++++ b/mayo.pro +@@ -173,19 +173,36 @@ LIBS += \ + -lTKXmlXCAF \ + -lTKXSBase \ + +-versionAtLeast(OCC_VERSION_STR, 7.7.0) { +- LIBS += -lTKXDE ++versionAtLeast(OCC_VERSION_STR, 7.8.0) { ++ # -- IGES support ++ LIBS += -lTKDEIGES ++ # -- STEP support ++ LIBS += -lTKDESTEP ++ # -- STL support ++ LIBS += -lTKDESTL ++ # -- VRML support ++ LIBS += -lTKDEVRML ++} else { ++ # -- IGES support ++ LIBS += -lTKIGES -lTKXDEIGES ++ # -- STEP support ++ LIBS += -lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXDESTEP ++ # -- STL support ++ LIBS += -lTKSTL ++ # -- VRML support ++ LIBS += -lTKVRML ++ ++ versionAtLeast(OCC_VERSION_STR, 7.7.0) { ++ LIBS += -lTKXDE ++ } + } + +-# -- IGES support +-LIBS += -lTKIGES -lTKXDEIGES +-# -- STEP support +-LIBS += -lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKXDESTEP +-# -- STL support +-LIBS += -lTKSTL + # -- OBJ/glTF support + versionAtLeast(OCC_VERSION_STR, 7.4.0) { + LIBS += -lTKRWMesh ++ versionAtLeast(OCC_VERSION_STR, 7.8.0) { ++ LIBS += -lTKDEOBJ -lTKDEGLTF ++ } + } else { + SOURCES -= \ + src/io_occ/io_occ_base_mesh.cpp \ +@@ -205,8 +222,7 @@ versionAtLeast(OCC_VERSION_STR, 7.4.0) { + SOURCES -= src/io_occ/io_occ_obj_writer.cpp + message(OBJ writer disabled because OpenCascade < v7.6) + } +-# -- VRML support +-LIBS += -lTKVRML ++ + !versionAtLeast(OCC_VERSION_STR, 7.7.0) { + SOURCES -= src/io_occ/io_occ_vrml_reader.cpp + message(VRML reader disabled because OpenCascade < v7.7) +diff --git a/src/app/widget_main_control.cpp b/src/app/widget_main_control.cpp +index 51eca63..3240e3a 100644 +--- a/src/app/widget_main_control.cpp ++++ b/src/app/widget_main_control.cpp +@@ -312,7 +312,6 @@ QWidget* WidgetMainControl::recreateLeftHeaderPlaceHolder() + + WidgetGuiDocument* WidgetMainControl::widgetGuiDocument(int idx) const + { +- assert(idx == -1 || (0 <= idx && idx < m_ui->stack_GuiDocuments->count())); + return qobject_cast(m_ui->stack_GuiDocuments->widget(idx)); + } + +diff --git a/src/base/brep_utils.cpp b/src/base/brep_utils.cpp +index 1b2f119..b694f5b 100644 +--- a/src/base/brep_utils.cpp ++++ b/src/base/brep_utils.cpp +@@ -59,9 +59,13 @@ bool BRepUtils::moreComplex(TopAbs_ShapeEnum lhs, TopAbs_ShapeEnum rhs) + return lhs < rhs; + } + +-int BRepUtils::hashCode(const TopoDS_Shape& shape) ++size_t BRepUtils::hashCode(const TopoDS_Shape& shape) + { +- return !shape.IsNull() ? shape.HashCode(INT_MAX) : -1; ++#if OCC_VERSION_HEX >= OCC_VERSION_CHECK(7, 8, 0) ++ return std::hash{}(shape); ++#else ++ return shape.HashCode(INT_MAX); ++#endif + } + + std::string BRepUtils::shapeToString(const TopoDS_Shape& shape) +diff --git a/src/base/brep_utils.h b/src/base/brep_utils.h +index 76830e8..a98dd2e 100644 +--- a/src/base/brep_utils.h ++++ b/src/base/brep_utils.h +@@ -53,7 +53,7 @@ struct BRepUtils { + // Returns hash code computed from 'shape' + // Computation uses the internal TShape and Location, but Orientation is not considered + // Returned hash code is in the range [1, max(int)] +- static int hashCode(const TopoDS_Shape& shape); ++ static size_t hashCode(const TopoDS_Shape& shape); + + // Serializes 'shape' into a string representation + static std::string shapeToString(const TopoDS_Shape& shape); +diff --git a/src/base/caf_utils.h b/src/base/caf_utils.h +index d849de5..8863aa5 100644 +--- a/src/base/caf_utils.h ++++ b/src/base/caf_utils.h +@@ -6,6 +6,7 @@ + + #pragma once + ++#include + #include + #include + #include +@@ -43,7 +44,7 @@ struct CafUtils { + + } // namespace Mayo + +- ++#if OCC_VERSION_HEX < 0x070800 + #include + namespace std { + +@@ -55,6 +56,7 @@ template<> struct hash { + }; + + } // namespace std ++#endif + + // -- + // -- Implementation +diff --git a/src/base/tkernel_utils.h b/src/base/tkernel_utils.h +index 3dd4500..4f1d97a 100644 +--- a/src/base/tkernel_utils.h ++++ b/src/base/tkernel_utils.h +@@ -55,6 +55,7 @@ public: + + } // namespace Mayo + ++#if OCC_VERSION_HEX < OCC_VERSION_CHECK(7, 8, 0) + namespace std { + + // Specialization of C++11 std::hash<> functor for opencascade::handle<> objects +@@ -65,3 +66,4 @@ template struct hash> { + }; + + } // namespace std ++#endif +diff --git a/tests/test_base.cpp b/tests/test_base.cpp +index e98f482..b28040e 100644 +--- a/tests/test_base.cpp ++++ b/tests/test_base.cpp +@@ -653,9 +653,10 @@ void TestBase::BRepUtils_test() + const TopoDS_Shape shapeNull; + const TopoDS_Shape shapeBase = BRepPrimAPI_MakeBox(25, 25, 25); + const TopoDS_Shape shapeCopy = shapeBase; +- QCOMPARE(BRepUtils::hashCode(shapeNull), -1); +- QVERIFY(BRepUtils::hashCode(shapeBase) >= 0); ++ const TopoDS_Shape shapeOther = BRepPrimAPI_MakeBox(40, 40, 40); ++ QCOMPARE(BRepUtils::hashCode(shapeNull), BRepUtils::hashCode(TopoDS_Shape{})); + QCOMPARE(BRepUtils::hashCode(shapeBase), BRepUtils::hashCode(shapeCopy)); ++ QVERIFY(BRepUtils::hashCode(shapeBase) != BRepUtils::hashCode(shapeOther)); + } + } + +-- +2.45.2 + diff --git a/media-gfx/mayo/mayo-0.8.0-r3.ebuild b/media-gfx/mayo/mayo-0.8.0-r3.ebuild new file mode 100644 index 000000000..efa6ba2f6 --- /dev/null +++ b/media-gfx/mayo/mayo-0.8.0-r3.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit qmake-utils desktop xdg + +DESCRIPTION="Opensource 3D CAD viewer and converter" +HOMEPAGE="https://github.com/fougue/mayo" +SRC_URI="https://github.com/fougue/mayo/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + dev-qt/qttranslations:6 + dev-qt/qtbase:6[opengl] + >=media-libs/assimp-5.3.1 + >=sci-libs/opencascade-7.8.0 +" + +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-nogit.patch + "${FILESDIR}"/${P}-gcc14.patch + "${FILESDIR}"/${P}-opencascade7_8.patch +) + +src_configure() { + eqmake6 "CASCADE_INC_DIR=/usr/include/opencascade" "CASCADE_LIB_DIR=/usr/$(get_libdir)/opencascade" "ASSIMP_INC_DIR=/usr/include/assimp" "ASSIMP_LIB_DIR=/usr/$(get_libdir)" mayo.pro +} + +src_install() { + emake install INSTALL_ROOT="${ED}" + dobin mayo + newicon -s scalable images/appicon.svg mayo.svg + make_desktop_entry "mayo %F" Mayo mayo "Graphics;" "MimeType=model/step;model/iges;model/brep;image/vnd.dxf;model/obj;model/gltf+json;model/gltf+binary;model/vrml;model/stl;model/x.stl-ascii;model/x.stl-binary;application/x-amf;application/x-coff;application/x-coffexec;model/3mf;image/x-3ds;model/vnd.collada+xml;model/x3d+binary;model/x3d+fastinfoset;model/x3d+vrml;model/x3d+xml;model/x3d-vrml;application/directx;" + einstalldocs +}