From nobody Mon Mar 24 22:13:58 2025 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZM6lW1WYcz5rXBw; Mon, 24 Mar 2025 22:13:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZM6lV4dqMz3F1k; Mon, 24 Mar 2025 22:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742854438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6pL7Y9v8/zAp8VoGWsiifBUMI9BPR+z33vGXfOExSYE=; b=HGWmrRncgvZ9Y1i+0aoCw/AScGIZCdVmrbMo04KvHJ9V9E1ZSVII0VN6fRObnBRlrj2bjK XAqZPlcjjCscGQNX9TYXrBtuHiJNyfXeM7qd/TxPFOMRzC0FmathxKwrQuMBFJ5dCIPSga +tPRLamrZi+VOR/5iLaAsH2wCT9pCfHJ4cUEwZq0sRcCdO3xi8ZpyUKlrfm3/PorWJo0qK mkkoVb+HMFFikbnw9X/Fw8XSWl7zw6aTd8xxb5lTUAj4FF+9TQcejegWurMxqRNbURIwk0 SoTsSllmP9kGW0BYYG77Z4iC6BI1aHtXdal/UyEicaHYJjvnCLl08v+/5WXqOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1742854438; a=rsa-sha256; cv=none; b=iubl2Zmtc3eLF7stcVLY7JGxAt1/kjgI/GorGzmSukbgp7xTEuPZxo5AzeJXBmzDhGzCEs EeO8PAaJ6nhfiBRluzjjJRGKfMbxWI+ddzZS7xDhLT9ge3OFDuTXfjLVmp9MSNebE8bSoj 2qTAv7n0DF/U/NAMc+iNn22df4RuTUjkNUi/ZJwDDC81fcsHSfMhSAM/esfk4g2NCmp5Gp 1/NI42k1d3MIGYH6rxrX4VKf4igJHqCuCNZM1jgA9dNfZbjGB/gyn+g0xhTF/P9MRPG9gY qE+3EOgWe/WrukSReRfzZwu+uwTwyCcVNzMC6io68243SHF3u4EV/kb1FuvEHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742854438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6pL7Y9v8/zAp8VoGWsiifBUMI9BPR+z33vGXfOExSYE=; b=ey4iO9AF00S/eI7xyC4VpauW1nFBX4+kvQIkMFluPQ2G1hXt/6PrrP6gK6ewcLELJWD7l8 CDm1XhVK82kmCRA4BWYTA0aDdR4tqpxwD+Ds7RmJily8u2tp5Ivy+RgyPwoyWtxNVIkADR PnARFFb2mrdOvDIcZyvAxMwCZYCOHe1B+u6GCycTk38xywoCZOPVU5T0NiJSh7k+bdNsmz Ulq1zmalLFnYK1iUKqtyeuR5Alj80GV91vc69jpNOwuWwhSUz9FDIko39UAI+fs+JX68pu wyPvcPn6aaXiFOPVjnM4xBzX8LBvjVrtyx0+6EY3vJ4byLS4skcfFDSskh/XfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZM6lV43t8z1C0b; Mon, 24 Mar 2025 22:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 52OMDweT095572; Mon, 24 Mar 2025 22:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52OMDw2c095569; Mon, 24 Mar 2025 22:13:58 GMT (envelope-from git) Date: Mon, 24 Mar 2025 22:13:58 GMT Message-Id: <202503242213.52OMDw2c095569@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: 46d3b8f4a284 - main - cad/freecad: optionize SpaceMouse support List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46d3b8f4a28431fbacb8029f905d1175ba3ae61e Auto-Submitted: auto-generated The branch main has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=46d3b8f4a28431fbacb8029f905d1175ba3ae61e commit 46d3b8f4a28431fbacb8029f905d1175ba3ae61e Author: Christoph Moench-Tegeder AuthorDate: 2025-03-24 22:04:24 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2025-03-24 22:04:24 +0000 cad/freecad: optionize SpaceMouse support Originially, FreeCAD picked up libspnav (SpaceMouse) support when the library was present in the system during build. That alone would be a minor problem, but people still insist on building in unclean systems. Additionally, libspnav support in FreeCAD was broken and resulted in build failure when accidentially building with libspnav (see above). Upstream fixed this in a series of changes touching many places and sometimes even depending on otherwise unrelated changes: importing all that would be close to updating to a snapshot. Instead, adopt the relevant fix for building with libspnav from upstream, and put the whole libspnav detection behind a cmake option (made accessible as a port option). PR: 285542 Reported by: Chad Jacob Milios --- cad/freecad/Makefile | 7 ++- cad/freecad/files/patch-spnav-support | 94 +++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 2 deletions(-) diff --git a/cad/freecad/Makefile b/cad/freecad/Makefile index 4f8d87554a63..b10760856548 100644 --- a/cad/freecad/Makefile +++ b/cad/freecad/Makefile @@ -1,6 +1,6 @@ PORTNAME= FreeCAD DISTVERSION= 1.0.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= cad MAINTAINER= cmt@FreeBSD.org @@ -102,10 +102,13 @@ CMAKE_ARGS+= -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \ CMAKE_INSTALL_PREFIX= ${PREFIX}/${PORTNAME} -OPTIONS_DEFINE= COLLADA +OPTIONS_DEFINE= COLLADA SPNAV COLLADA_DESC= Install pycollada for Collada files import COLLADA_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycollada>0:graphics/py-pycollada@${PY_FLAVOR} +SPNAV_DESC= Enable libspnav (SpaceMouse) support +SPNAV_CMAKE_BOOL= FREECAD_SPNAV_SUPPORT +SPNAV_LIB_DEPENDS= libspnav.so:misc/libspnav .include diff --git a/cad/freecad/files/patch-spnav-support b/cad/freecad/files/patch-spnav-support new file mode 100644 index 000000000000..e9b364d61f60 --- /dev/null +++ b/cad/freecad/files/patch-spnav-support @@ -0,0 +1,94 @@ +commit f2b872ba4dc509622bda2d86ce42e2464d40832b +Author: Christoph Moench-Tegeder +Date: Mon Mar 24 01:03:53 2025 +0100 + + attempt to fix building with libspnav + +diff --git cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake +index e9aa47fd6e..826c510ef0 100644 +--- cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake ++++ cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake +@@ -142,6 +142,7 @@ macro(InitializeFreeCADBuildOptions) + option(BUILD_CLOUD "Build the FreeCAD cloud module" OFF) + option(ENABLE_DEVELOPER_TESTS "Build the FreeCAD unit tests suit" ON) + ++ option(FREECAD_SPNAV_SUPPORT "Enable libspnav support" OFF) + if(MSVC) + set(FREECAD_3DCONNEXION_SUPPORT "NavLib" CACHE STRING "Select version of the 3Dconnexion device integration") + set_property(CACHE FREECAD_3DCONNEXION_SUPPORT PROPERTY STRINGS "NavLib" "Raw input") +diff --git src/Gui/CMakeLists.txt src/Gui/CMakeLists.txt +index 642f58568f..52cc393875 100644 +--- src/Gui/CMakeLists.txt ++++ src/Gui/CMakeLists.txt +@@ -133,7 +133,8 @@ if(${Qt5WinExtras_FOUND}) + ) + endif() + +-IF(SPNAV_FOUND) ++IF(FREECAD_SPNAV_SUPPORT AND SPNAV_FOUND) ++ add_definitions(-D_USE_3DCONNEXION_SDK) + if(SPNAV_USE_X11) + add_definitions(-DSPNAV_USE_X11) + if (FREECAD_QT_MAJOR_VERSION EQUAL 5 AND UNIX AND NOT APPLE) +@@ -175,7 +176,11 @@ IF(SPNAV_FOUND) + list(APPEND FreeCADGui_LIBS + ${SPNAV_LIBRARIES} + ) +-ENDIF(SPNAV_FOUND) ++ENDIF(FREECAD_SPNAV_SUPPORT AND SPNAV_FOUND) ++ ++IF(FREECAD_SPNAV_SUPPORT AND NOT SPNAV_FOUND) ++ MESSAGE(FATAL_ERROR "libspnav support requested but libspnav not found") ++ENDIF(FREECAD_SPNAV_SUPPORT AND NOT SPNAV_FOUND) + + IF(OCULUS_FOUND) + add_definitions(-DOCULUS_FOUND) +diff --git src/Gui/GuiApplicationNativeEventAware.cpp src/Gui/GuiApplicationNativeEventAware.cpp +index ba41901472..c0cf3c7666 100644 +--- src/Gui/GuiApplicationNativeEventAware.cpp ++++ src/Gui/GuiApplicationNativeEventAware.cpp +@@ -33,7 +33,7 @@ + + + #if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND) +-#if defined(Q_OS_LINUX) ++#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) + #if defined(SPNAV_USE_X11) + #include "3Dconnexion/GuiNativeEventLinuxX11.h" + #else +@@ -59,7 +59,15 @@ Gui::GUIApplicationNativeEventAware::~GUIApplicationNativeEventAware() = default + void Gui::GUIApplicationNativeEventAware::initSpaceball(QMainWindow *window) + { + #if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND) ++# if defined(USE_3DCONNEXION_NAVLIB) ++ ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath( ++ "User parameter:BaseApp/Preferences/View"); ++ if (nativeEvent && hViewGrp->GetBool("LegacySpaceMouseDevices", false)) { ++ nativeEvent->initSpaceball(window); ++ } ++# else + nativeEvent->initSpaceball(window); ++# endif + #else + Q_UNUSED(window); + #endif +diff --git src/Gui/View3DInventorViewer.cpp src/Gui/View3DInventorViewer.cpp +index 694f834583..d32c2486b5 100644 +--- src/Gui/View3DInventorViewer.cpp ++++ src/Gui/View3DInventorViewer.cpp +@@ -555,7 +555,15 @@ void View3DInventorViewer::init() + //filter a few qt events + viewerEventFilter = new ViewerEventFilter; + installEventFilter(viewerEventFilter); ++#if defined(USE_3DCONNEXION_NAVLIB) ++ ParameterGrp::handle hViewGrp = App::GetApplication().GetParameterGroupByPath( ++ "User parameter:BaseApp/Preferences/View"); ++ if (hViewGrp->GetBool("LegacySpaceMouseDevices", false)) { ++ getEventFilter()->registerInputDevice(new SpaceNavigatorDevice); ++ } ++#else + getEventFilter()->registerInputDevice(new SpaceNavigatorDevice); ++#endif + getEventFilter()->registerInputDevice(new GesturesDevice(this)); + + try{