diff --git a/cad/kicad/Makefile b/cad/kicad/Makefile index 461b38343a5d..5894e5d6dad0 100644 --- a/cad/kicad/Makefile +++ b/cad/kicad/Makefile @@ -1,68 +1,69 @@ PORTNAME= kicad PORTVERSION= 7.0.1 +PORTREVISION= 1 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:3.5+ 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-job_use_dynamic_cast_for_updating b/cad/kicad/files/patch-job_use_dynamic_cast_for_updating new file mode 100644 index 000000000000..9b6be4f43bcd --- /dev/null +++ b/cad/kicad/files/patch-job_use_dynamic_cast_for_updating @@ -0,0 +1,171 @@ +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 +@@ -111,7 +111,7 @@ REPORTER& EESCHEMA_JOBS_HANDLER::Report( const wxString& aText, SEVERITY aSeveri + + 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 ) + + 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 ) + + 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 ) + + 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, + + 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 ) + + 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 +@@ -76,7 +76,7 @@ PCBNEW_JOBS_HANDLER::PCBNEW_JOBS_HANDLER() + + 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 ) + + 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 ) + + 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 ) + + 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 ) + + 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& + + 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 ); + + 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 ) + + 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 + + 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 ) + + 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;