diff --git a/cad/kicad/Makefile b/cad/kicad/Makefile index cb7500771af8..e9edb9fac51b 100644 --- a/cad/kicad/Makefile +++ b/cad/kicad/Makefile @@ -1,69 +1,69 @@ PORTNAME= kicad PORTVERSION= 7.0.2 -PORTREVISION= 5 +PORTREVISION= 6 PORTEPOCH= 2 CATEGORIES= cad MASTER_SITES= https://gitlab.com/${PORTNAME}/code/${PORTNAME}/-/archive/${DISTVERSION}${DISTVERSIONSUFFIX}/ MAINTAINER= cmt@FreeBSD.org COMMENT= Schematic and PCB editing software WWW= https://kicad.org/ LICENSE= GPLv2 BUILD_DEPENDS= ${LOCALBASE}/include/glm/glm.hpp:math/glm \ swig:devel/swig LIB_DEPENDS= libboost_thread.so:devel/boost-libs \ libharfbuzz.so:print/harfbuzz \ libngspice.so:cad/ngspice_rework@shlib \ libTKernel.so:cad/opencascade \ libpixman-1.so:x11/pixman \ libpng.so:graphics/png \ libcurl.so:ftp/curl \ libGLEW-wayland.so:graphics/glew-wayland \ libfreetype.so:print/freetype2 \ libfontconfig.so:x11-fonts/fontconfig \ libodbc.so:databases/unixODBC USES= cmake:noninja compiler:c++17-lang desktop-file-utils gl \ gnome pkgconfig python shared-mime-info shebangfix \ tar:bz2 xorg SHEBANG_FILES= pcbnew/python/plugins/touch_slider_wizard.py USE_XORG= ice x11 xext USE_GL= gl glu glut USE_WX= 3.2 WX_COMPS= python:lib wx USE_GNOME= atk cairo gdkpixbuf2 gtk30 pango CXXFLAGS+= -std=c++11 -I${WRKSRC}/include -I${LOCALBASE}/include CXXFLAGS_powerpc= -O0 # not using "bundled glew" breaks the 3d viewer CMAKE_ARGS= -DwxWidgets_CONFIG_EXECUTABLE=${WX_CONFIG} \ -DwxWidgets_USE_UNICODE=ON \ -DwxWidgets_wxrc_EXECUTABLE=${WXRC_CMD} \ -DKICAD_SCRIPTING_WXPYTHON=ON \ -DKICAD_USE_EGL=ON \ -DKICAD_USE_BUNDLED_GLEW=ON \ -DNANODBC_ENABLE_BOOST=ON \ -DOCC_INCLUDE_DIR=${LOCALBASE}/include/OpenCASCADE CMAKE_ENV+= DODBC_PATH=${LOCALBASE} USE_LDCONFIG= yes PLIST_SUB= DESKTOPDIR=${DESKTOPDIR:S|^${PREFIX}/||} OPTIONS_DEFINE= DOXYGEN NLS OPTIONS_SUB= yes NLS_USES= gettext DOXYGEN_VARS= LICENSE+=GFDL LICENSE_COMB=multi DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen DOXYGEN_ALL_TARGET= all doxygen-docs CONFLICTS_INSTALL= kicad-devel # bin/_cvpcb.kiface pre-configure: ${REINPLACE_CMD} -e 's|/usr/local/bin/xdg-open|${LOCALBASE}/bin/xdg-open|' \ ${WRKSRC}/common/pgm_base.cpp .include diff --git a/cad/kicad/files/patch-cmake_FindOCC.cmake b/cad/kicad/files/patch-cmake_FindOCC.cmake new file mode 100644 index 000000000000..88569eabb1a4 --- /dev/null +++ b/cad/kicad/files/patch-cmake_FindOCC.cmake @@ -0,0 +1,35 @@ +--- cmake/FindOCC.cmake.orig 2023-04-13 20:27:39 UTC ++++ cmake/FindOCC.cmake +@@ -45,7 +45,7 @@ set( OCC_LIBS + TKGeomAlgo + TKGeomBase + TKHLR +- TKIGES ++ TKDEIGES + TKLCAF + TKMath + TKMesh +@@ -55,18 +55,15 @@ set( OCC_LIBS + TKPrim + TKService + TKShHealing +- TKSTEP209 +- TKSTEPAttr +- TKSTEPBase +- TKSTEP +- TKSTL ++ TKDESTEP ++ TKDESTL + TKTObj + TKTopAlgo + TKV3d +- TKVRML ++ TKDEVRML + TKXCAF +- TKXDEIGES +- TKXDESTEP ++ TKXSDRAWIGES ++ TKXSDRAWSTEP + TKXMesh + TKXmlL + TKXml diff --git a/cad/kicad/files/patch-CMakeModules_KiCadFullVersion.cmake b/cad/kicad/files/patch-cmake_KiCadFullVersion.cmake similarity index 75% rename from cad/kicad/files/patch-CMakeModules_KiCadFullVersion.cmake rename to cad/kicad/files/patch-cmake_KiCadFullVersion.cmake index 654deae40d10..39dea0eea338 100644 --- a/cad/kicad/files/patch-CMakeModules_KiCadFullVersion.cmake +++ b/cad/kicad/files/patch-cmake_KiCadFullVersion.cmake @@ -1,13 +1,13 @@ ---- ./cmake/KiCadFullVersion.cmake.orig 2023-01-25 21:49:08.004539000 +0100 -+++ ./cmake/KiCadFullVersion.cmake 2023-01-25 21:49:50.772285000 +0100 +--- cmake/KiCadFullVersion.cmake.orig 2023-04-13 20:27:39 UTC ++++ cmake/KiCadFullVersion.cmake @@ -27,10 +27,6 @@ # repository), or the version from KiCadVersion.cmake. The user-provided # KICAD_VERSION_EXTRA is then appended to the base version string. -# Use git to determine the version string if it's available. -include( ${KICAD_CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake ) -create_git_version_header( ${SRC_PATH} ) - # $KICAD_VERSION is set in KiCadVersion.cmake or by git (if it is available). set( KICAD_VERSION_FULL "${KICAD_VERSION}" ) diff --git a/cad/kicad/files/patch-eeschema_sim_sim__plot__frame.cpp b/cad/kicad/files/patch-eeschema_sim_sim__plot__frame.cpp index ba2c5ec1a4dd..9f409544dd76 100644 --- a/cad/kicad/files/patch-eeschema_sim_sim__plot__frame.cpp +++ b/cad/kicad/files/patch-eeschema_sim_sim__plot__frame.cpp @@ -1,11 +1,11 @@ ---- eeschema/sim/sim_plot_frame.cpp.orig 2023-01-25 22:50:55.894239000 +0100 -+++ eeschema/sim/sim_plot_frame.cpp 2023-01-27 00:25:46.086158000 +0100 +--- eeschema/sim/sim_plot_frame.cpp.orig 2023-04-13 20:27:39 UTC ++++ eeschema/sim/sim_plot_frame.cpp @@ -27,6 +27,8 @@ #include #include +#undef WXWIN_COMPATIBILITY_2_8 + // For some obscure reason, needed on msys2 with some wxWidgets versions (3.0) to avoid // undefined symbol at link stage (due to use of #include ) // Should not create issues on other platforms diff --git a/cad/kicad/files/patch-job_use_dynamic_cast_for_updating b/cad/kicad/files/patch-job_use_dynamic_cast_for_updating index 9b6be4f43bcd..c86b00d5fd54 100644 --- a/cad/kicad/files/patch-job_use_dynamic_cast_for_updating +++ b/cad/kicad/files/patch-job_use_dynamic_cast_for_updating @@ -1,171 +1,167 @@ commit d631231335b93cbccc7e0c12a2dcd3296ea5ab29 Author: Christoph Moench-Tegeder Date: Fri Mar 24 21:59:39 2023 +0100 do not use dynamic_cast for upcasting to JOB Based on my understanding of dynamic_cast, the base class needs to be virtual when upcasting a pointer of a derived object to one of it's base classes, and JOB is "not virtual enough", at least not for clang c++ (at least version 15 and 13, as reported by Pero Orsolic on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270273 - I re-verified the problem on LLVM 13 myself). This changes all obvious cases of the upcast-to-JOB to static_cast, I did not check for other classes (there are just too many for doing that in my spare time). Credits to Pero Orsolic for reporting the first cases of this in the PDF export in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270273 . -diff --git eeschema/eeschema_jobs_handler.cpp eeschema/eeschema_jobs_handler.cpp -index 61462793ee..ce312d5100 100644 ---- eeschema/eeschema_jobs_handler.cpp +--- eeschema/eeschema_jobs_handler.cpp.orig 2023-04-13 20:27:39 UTC +++ eeschema/eeschema_jobs_handler.cpp -@@ -111,7 +111,7 @@ REPORTER& EESCHEMA_JOBS_HANDLER::Report( const wxString& aText, SEVERITY aSeveri +@@ -111,7 +111,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPdf( JOB* aJob ) int EESCHEMA_JOBS_HANDLER::JobExportPdf( JOB* aJob ) { - JOB_EXPORT_SCH_PDF* aPdfJob = dynamic_cast( aJob ); + JOB_EXPORT_SCH_PDF* aPdfJob = static_cast( aJob ); if( !aPdfJob ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -147,7 +147,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPdf( JOB* aJob ) +@@ -147,7 +147,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportSvg( JOB* aJob ) int EESCHEMA_JOBS_HANDLER::JobExportSvg( JOB* aJob ) { - JOB_EXPORT_SCH_SVG* aSvgJob = dynamic_cast( aJob ); + JOB_EXPORT_SCH_SVG* aSvgJob = static_cast( aJob ); if( !aSvgJob ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -183,7 +183,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportSvg( JOB* aJob ) +@@ -183,7 +183,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportNetlist( JOB* aJob int EESCHEMA_JOBS_HANDLER::JobExportNetlist( JOB* aJob ) { - JOB_EXPORT_SCH_NETLIST* aNetJob = dynamic_cast( aJob ); + JOB_EXPORT_SCH_NETLIST* aNetJob = static_cast( aJob ); if( !aNetJob ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -281,7 +281,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportNetlist( JOB* aJob ) +@@ -281,7 +281,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPythonBom( JOB* aJ int EESCHEMA_JOBS_HANDLER::JobExportPythonBom( JOB* aJob ) { - JOB_EXPORT_SCH_PYTHONBOM* aNetJob = dynamic_cast( aJob ); + JOB_EXPORT_SCH_PYTHONBOM* aNetJob = static_cast( aJob ); SCHEMATIC* sch = EESCHEMA_HELPERS::LoadSchematic( aNetJob->m_filename, SCH_IO_MGR::SCH_KICAD ); -@@ -447,7 +447,7 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob, +@@ -447,7 +447,7 @@ int EESCHEMA_JOBS_HANDLER::JobSymExportSvg( JOB* aJob int EESCHEMA_JOBS_HANDLER::JobSymExportSvg( JOB* aJob ) { - JOB_SYM_EXPORT_SVG* svgJob = dynamic_cast( aJob ); + JOB_SYM_EXPORT_SVG* svgJob = static_cast( aJob ); wxFileName fn( svgJob->m_libraryPath ); fn.MakeAbsolute(); -@@ -510,7 +510,7 @@ int EESCHEMA_JOBS_HANDLER::JobSymExportSvg( JOB* aJob ) +@@ -510,7 +510,7 @@ int EESCHEMA_JOBS_HANDLER::JobSymUpgrade( JOB* aJob ) int EESCHEMA_JOBS_HANDLER::JobSymUpgrade( JOB* aJob ) { - JOB_SYM_UPGRADE* upgradeJob = dynamic_cast( aJob ); + JOB_SYM_UPGRADE* upgradeJob = static_cast( aJob ); wxFileName fn( upgradeJob->m_libraryPath ); fn.MakeAbsolute(); -diff --git pcbnew/pcbnew_jobs_handler.cpp pcbnew/pcbnew_jobs_handler.cpp -index be0f806dea..e045f864de 100644 ---- pcbnew/pcbnew_jobs_handler.cpp +--- pcbnew/pcbnew_jobs_handler.cpp.orig 2023-04-13 20:27:39 UTC +++ pcbnew/pcbnew_jobs_handler.cpp -@@ -76,7 +76,7 @@ PCBNEW_JOBS_HANDLER::PCBNEW_JOBS_HANDLER() +@@ -76,7 +76,7 @@ int PCBNEW_JOBS_HANDLER::JobExportStep( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportStep( JOB* aJob ) { - JOB_EXPORT_PCB_STEP* aStepJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_STEP* aStepJob = static_cast( aJob ); if( aStepJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -119,7 +119,7 @@ int PCBNEW_JOBS_HANDLER::JobExportStep( JOB* aJob ) +@@ -119,7 +119,7 @@ int PCBNEW_JOBS_HANDLER::JobExportSvg( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportSvg( JOB* aJob ) { - JOB_EXPORT_PCB_SVG* aSvgJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_SVG* aSvgJob = static_cast( aJob ); if( aSvgJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -152,7 +152,7 @@ int PCBNEW_JOBS_HANDLER::JobExportSvg( JOB* aJob ) +@@ -152,7 +152,7 @@ int PCBNEW_JOBS_HANDLER::JobExportDxf( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportDxf( JOB* aJob ) { - JOB_EXPORT_PCB_DXF* aDxfJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_DXF* aDxfJob = static_cast( aJob ); if( aDxfJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -207,7 +207,7 @@ int PCBNEW_JOBS_HANDLER::JobExportDxf( JOB* aJob ) +@@ -207,7 +207,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob ) { - JOB_EXPORT_PCB_PDF* aPdfJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_PDF* aPdfJob = static_cast( aJob ); if( aPdfJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -257,7 +257,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPdf( JOB* aJob ) +@@ -257,7 +257,7 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob ) { - JOB_EXPORT_PCB_GERBERS* aGerberJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_GERBERS* aGerberJob = static_cast( aJob ); if( aGerberJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -368,7 +368,7 @@ void PCBNEW_JOBS_HANDLER::populateGerberPlotOptionsFromJob( PCB_PLOT_PARAMS& +@@ -368,7 +368,7 @@ int PCBNEW_JOBS_HANDLER::JobExportGerber( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportGerber( JOB* aJob ) { - JOB_EXPORT_PCB_GERBER* aGerberJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_GERBER* aGerberJob = static_cast( aJob ); if( aGerberJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -414,7 +414,7 @@ static DRILL_PRECISION precisionListForMetric( 3, 3 ); +@@ -414,7 +414,7 @@ int PCBNEW_JOBS_HANDLER::JobExportDrill( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportDrill( JOB* aJob ) { - JOB_EXPORT_PCB_DRILL* aDrillJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_DRILL* aDrillJob = static_cast( aJob ); if( aDrillJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -522,7 +522,7 @@ int PCBNEW_JOBS_HANDLER::JobExportDrill( JOB* aJob ) +@@ -522,7 +522,7 @@ int PCBNEW_JOBS_HANDLER::JobExportPos( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportPos( JOB* aJob ) { - JOB_EXPORT_PCB_POS* aPosJob = dynamic_cast( aJob ); + JOB_EXPORT_PCB_POS* aPosJob = static_cast( aJob ); if( aPosJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -597,7 +597,7 @@ extern FOOTPRINT* try_load_footprint( const wxFileName& aFileName, IO_MGR::PCB_F +@@ -597,7 +597,7 @@ int PCBNEW_JOBS_HANDLER::JobExportFpUpgrade( JOB* aJob int PCBNEW_JOBS_HANDLER::JobExportFpUpgrade( JOB* aJob ) { - JOB_FP_UPGRADE* upgradeJob = dynamic_cast( aJob ); + JOB_FP_UPGRADE* upgradeJob = static_cast( aJob ); if( upgradeJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; -@@ -668,7 +668,7 @@ int PCBNEW_JOBS_HANDLER::JobExportFpUpgrade( JOB* aJob ) +@@ -668,7 +668,7 @@ int PCBNEW_JOBS_HANDLER::JobExportFpSvg( JOB* aJob ) int PCBNEW_JOBS_HANDLER::JobExportFpSvg( JOB* aJob ) { - JOB_FP_EXPORT_SVG* svgJob = dynamic_cast( aJob ); + JOB_FP_EXPORT_SVG* svgJob = static_cast( aJob ); if( svgJob == nullptr ) return CLI::EXIT_CODES::ERR_UNKNOWN; diff --git a/cad/kicad/files/patch-pcbnew_import__gfx_dxf__import__plugin.cpp b/cad/kicad/files/patch-pcbnew_import__gfx_dxf__import__plugin.cpp index aee69e61ffff..82200f8c0966 100644 --- a/cad/kicad/files/patch-pcbnew_import__gfx_dxf__import__plugin.cpp +++ b/cad/kicad/files/patch-pcbnew_import__gfx_dxf__import__plugin.cpp @@ -1,50 +1,50 @@ ---- pcbnew/import_gfx/dxf_import_plugin.cpp.orig 2023-01-25 22:16:35.742131000 +0100 -+++ pcbnew/import_gfx/dxf_import_plugin.cpp 2023-01-25 23:02:52.939723000 +0100 +--- pcbnew/import_gfx/dxf_import_plugin.cpp.orig 2023-04-13 20:27:39 UTC ++++ pcbnew/import_gfx/dxf_import_plugin.cpp @@ -28,6 +28,9 @@ // like void DXF_IMPORT_PLUGIN::addLine( const DL_LineData& data ) when a line is read. // this function just add the BOARD entity from dxf parameters (start and end point ...) +#ifdef __BSD_VISIBLE +#undef __BSD_VISIBLE +#endif #include "dxf_import_plugin.h" #include -@@ -580,7 +583,7 @@ +@@ -580,7 +583,7 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseDa // For now, we assume ellipses in the XY plane. VECTOR2D center( mapX( centerCoords.x ), mapY( centerCoords.y ) ); - VECTOR2D major( mapX( majorCoords.x ), mapY( majorCoords.y ) ); + VECTOR2D vmajor( mapX( majorCoords.x ), mapY( majorCoords.y ) ); // DXF elliptical arcs store their angles in radians (unlike circular arcs which use degrees) // The arcs wind CCW as in KiCad. The end angle must be greater than the start angle, and if -@@ -598,7 +601,7 @@ +@@ -598,7 +601,7 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseDa if( aData.ratio == 1.0 ) { - double radius = major.EuclideanNorm(); + double radius = vmajor.EuclideanNorm(); if( startAngle == endAngle ) { -@@ -616,7 +619,7 @@ +@@ -616,7 +619,7 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseDa } std::vector> splines; - ELLIPSE ellipse( center, major, aData.ratio, startAngle, endAngle ); + ELLIPSE ellipse( center, vmajor, aData.ratio, startAngle, endAngle ); TransformEllipseToBeziers( ellipse, splines ); -@@ -630,8 +633,8 @@ +@@ -630,8 +633,8 @@ void DXF_IMPORT_PLUGIN::addEllipse( const DL_EllipseDa bufferToUse->AddSpline( b.Start, b.C1, b.C2, b.End, lineWidth ); // Naive bounding - updateImageLimits( center + major ); - updateImageLimits( center - major ); + updateImageLimits( center + vmajor ); + updateImageLimits( center - vmajor ); } diff --git a/cad/kicad/files/patch-thirdparty_glew_CMakeLists.txt b/cad/kicad/files/patch-thirdparty_glew_CMakeLists.txt index 18c5a496dd6c..07d970b22fa6 100644 --- a/cad/kicad/files/patch-thirdparty_glew_CMakeLists.txt +++ b/cad/kicad/files/patch-thirdparty_glew_CMakeLists.txt @@ -1,10 +1,10 @@ ---- thirdparty/glew/CMakeLists.txt.orig 2022-05-07 15:44:23 +0200 +--- thirdparty/glew/CMakeLists.txt.orig 2023-04-13 20:27:39 UTC +++ thirdparty/glew/CMakeLists.txt -@@ -5,6 +5,7 @@ +@@ -5,6 +5,7 @@ target_include_directories( glew PRIVATE "${CMAKE_CURR # The actual include directories will be added to the global include paths as # system headers target_include_directories( glew PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" ) +target_include_directories( glew SYSTEM PRIVATE "${CMAKE_INSTALL_PREFIX}/include" ) # Definitions for compiling GLEW staticly for EGL (extracted from the main GLEW CMakeLists.txt file) add_definitions( -DGLEW_STATIC )