diff --git a/cad/kicad/Makefile b/cad/kicad/Makefile index 6cfb1be3d698..664b286d3c7d 100644 --- a/cad/kicad/Makefile +++ b/cad/kicad/Makefile @@ -1,71 +1,69 @@ PORTNAME= kicad PORTVERSION= 7.0.2 PORTREVISION= 7 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 -BROKEN= fails to build with boost-1.86+ - 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-3d-viewer_3d__cache_3d__cache.cpp b/cad/kicad/files/patch-3d-viewer_3d__cache_3d__cache.cpp new file mode 100644 index 000000000000..643ed29c8485 --- /dev/null +++ b/cad/kicad/files/patch-3d-viewer_3d__cache_3d__cache.cpp @@ -0,0 +1,24 @@ +# this is a terrible hack - you can but should not copy this -- cmt +--- 3d-viewer/3d_cache/3d_cache.cpp.orig ++++ 3d-viewer/3d_cache/3d_cache.cpp +@@ -381,14 +381,17 @@ + dblock.process_bytes( block, bsize ); + + fclose( fp ); +- unsigned int digest[5]; +- dblock.get_digest( digest ); ++ union { ++ unsigned int digest[5]; ++ unsigned char boost_digest[20]; ++ } _digest; ++ dblock.get_digest( _digest.boost_digest ); + + // ensure MSB order + for( int i = 0; i < 5; ++i ) + { + int idx = i << 2; +- unsigned int tmp = digest[i]; ++ unsigned int tmp = _digest.digest[i]; + aSHA1Sum[idx+3] = tmp & 0xff; + tmp >>= 8; + aSHA1Sum[idx+2] = tmp & 0xff; diff --git a/cad/kicad/files/patch-common_kiid.cpp b/cad/kicad/files/patch-common_kiid.cpp new file mode 100644 index 000000000000..86b398ae2078 --- /dev/null +++ b/cad/kicad/files/patch-common_kiid.cpp @@ -0,0 +1,47 @@ +--- common/kiid.cpp.orig ++++ common/kiid.cpp +@@ -40,15 +40,15 @@ + + #include + +-// boost:mt19937 is not thread-safe ++// OBSOLTE: boost:mt19937 is not thread-safe + static std::mutex rng_mutex; + + // Static rng and generators are used because the overhead of constant seeding is expensive + // We rely on the default non-arg constructor of basic_random_generator to provide a random seed. + // We use a separate rng object for cases where we want to control the basic_random_generator + // initial seed by calling SeedGenerator from unit tests and other special cases. +-static boost::mt19937 rng; +-static boost::uuids::basic_random_generator randomGenerator; ++static std::mt19937 rng; ++static boost::uuids::basic_random_generator randomGenerator; + + // These don't have the same performance penalty, but we might as well be consistent + static boost::uuids::string_generator stringGenerator; +@@ -235,15 +235,7 @@ + + size_t KIID::Hash() const + { +- size_t hash = 0; +- +- // Note: this is NOT little-endian/big-endian safe, but as long as it's just used +- // at runtime it won't matter. +- +- for( int i = 0; i < 4; ++i ) +- boost::hash_combine( hash, reinterpret_cast( m_uuid.data )[i] ); +- +- return hash; ++ return boost::uuids::hash_value(m_uuid); + } + + +@@ -300,7 +292,7 @@ + void KIID::SeedGenerator( unsigned int aSeed ) + { + rng.seed( aSeed ); +- randomGenerator = boost::uuids::basic_random_generator( rng ); ++ randomGenerator = boost::uuids::basic_random_generator( rng ); + } + +