* [gentoo-commits] repo/gentoo:master commit in: media-gfx/netgen/files/, media-gfx/netgen/
@ 2024-11-25 2:40 Sam James
0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-11-25 2:40 UTC (permalink / raw
To: gentoo-commits
commit: a7b9d39fa7b80783e7b7e47bf7ec67a296765a5d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 25 02:39:51 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 25 02:39:51 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7b9d39f
media-gfx/netgen: fix opencascade-7.8.0 compat
Closes: https://bugs.gentoo.org/930171
Thanks-to: Michael Tulupov
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/netgen-6.2.2302-opencascade-7.8.0.patch | 147 +++++++++++++++++++++
media-gfx/netgen/netgen-6.2.2302.ebuild | 1 +
2 files changed, 148 insertions(+)
diff --git a/media-gfx/netgen/files/netgen-6.2.2302-opencascade-7.8.0.patch b/media-gfx/netgen/files/netgen-6.2.2302-opencascade-7.8.0.patch
new file mode 100644
index 000000000000..0c5664edd6bb
--- /dev/null
+++ b/media-gfx/netgen/files/netgen-6.2.2302-opencascade-7.8.0.patch
@@ -0,0 +1,147 @@
+https://bugs.gentoo.org/930171
+https://github.com/NGSolve/netgen/issues/170
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -372,25 +372,20 @@ if (USE_OCC)
+ TKGeomAlgo
+ TKGeomBase
+ TKHLR
+- TKIGES
+ TKLCAF
+ TKMath
+ TKMesh
+ TKOffset
+ TKPrim
+- TKSTEP
+- TKSTEP209
+- TKSTEPAttr
+- TKSTEPBase
+- TKSTL
++ TKDESTL
+ TKService
+ TKShHealing
+ TKTopAlgo
+ TKV3d
+ TKVCAF
+ TKXCAF
+- TKXDEIGES
+- TKXDESTEP
++ TKDEIGES
++ TKDESTEP
+ TKXSBase
+ TKernel
+ )
+--- a/libsrc/occ/Partition_Loop3d.hxx
++++ b/libsrc/occ/Partition_Loop3d.hxx
+@@ -10,27 +10,16 @@
+ #ifndef _Partition_Loop3d_HeaderFile
+ #define _Partition_Loop3d_HeaderFile
+
+-#ifndef _TopTools_ListOfShape_HeaderFile
+-#include <TopTools_ListOfShape.hxx>
+-#endif
+-#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
+-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+-#endif
+-#ifndef _Standard_Boolean_HeaderFile
++#include <Standard_Version.hxx>
+ #include <Standard_Boolean.hxx>
+-#endif
+-#ifndef _Standard_Real_HeaderFile
+ #include <Standard_Real.hxx>
+-#endif
+-#ifndef _Standard_Version_HeaderFile
+-#include <Standard_Version.hxx>
+-#endif
++#include <TopTools_ListOfShape.hxx>
++#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+
+-#if OCC_VERSION_HEX < 0x070000
++#if OCC_VERSION_HEX < 0x070000 || OCC_VERSION_HEX > 0x070799
+ #else
+ #include <TopTools_ShapeMapHasher.hxx>
+ #include <TopTools_OrientedShapeMapHasher.hxx>
+- #include <TopTools_MapOfOrientedShape.hxx>
+ #endif
+
+ class TopoDS_Shape;
+@@ -38,6 +27,8 @@ class TopoDS_Shape;
+ #if OCC_VERSION_HEX < 0x070000
+ class TopTools_ListOfShape;
+ class TopTools_MapOfOrientedShape;
++#else
++#include <TopTools_MapOfOrientedShape.hxx>
+ #endif
+
+ class TopoDS_Edge;
+--- a/libsrc/occ/occ_edge.cpp
++++ b/libsrc/occ/occ_edge.cpp
+@@ -55,7 +55,11 @@ namespace netgen
+
+ size_t OCCEdge::GetHash() const
+ {
++#if OCC_VERSION_HEX < 0x070800
+ return edge.HashCode(std::numeric_limits<Standard_Integer>::max());
++#else
++ return std::hash<TopoDS_Shape>{}(edge);
++#endif
+ }
+
+ void OCCEdge::ProjectPoint(Point<3>& p, EdgePointGeomInfo* gi) const
+--- a/libsrc/occ/occ_face.cpp
++++ b/libsrc/occ/occ_face.cpp
+@@ -32,7 +32,11 @@ namespace netgen
+
+ size_t OCCFace::GetHash() const
+ {
++#if OCC_VERSION_HEX < 0x070800
+ return face.HashCode(std::numeric_limits<Standard_Integer>::max());
++#else
++ return std::hash<TopoDS_Shape>{}(face);
++#endif
+ }
+
+ Point<3> OCCFace::GetCenter() const
+--- a/libsrc/occ/occ_solid.hpp
++++ b/libsrc/occ/occ_solid.hpp
+@@ -16,8 +16,11 @@ namespace netgen
+ OCCSolid(TopoDS_Shape dshape)
+ : solid(TopoDS::Solid(dshape))
+ { }
+-
++#if OCC_VERSION_HEX < 0x070800
+ size_t GetHash() const override { return solid.HashCode(std::numeric_limits<Standard_Integer>::max()); }
++#else
++ size_t GetHash() const override { return std::hash<TopoDS_Solid>{}(solid); }
++#endif
+ };
+ }
+
+--- a/libsrc/occ/occ_vertex.cpp
++++ b/libsrc/occ/occ_vertex.cpp
+@@ -19,6 +19,10 @@ namespace netgen
+
+ size_t OCCVertex::GetHash() const
+ {
++#if OCC_VERSION_HEX < 0x070800
+ return vertex.HashCode(std::numeric_limits<Standard_Integer>::max());
++#else
++ return std::hash<TopoDS_Shape>{}(vertex);
++#endif
+ }
+ }
+--- a/libsrc/occ/occgeom.cpp
++++ b/libsrc/occ/occgeom.cpp
+@@ -1625,8 +1625,12 @@
+
+ // enumerate shapes and archive only integers
+ auto my_hash = [](const TopoDS_Shape & key) {
++#if OCC_VERSION_HEX < 0x070800
+ auto occ_hash = key.HashCode(1<<31UL);
+ return std::hash<decltype(occ_hash)>()(occ_hash);
++#else
++ return std::hash<TopoDS_Shape>{}(key);
++#endif
+ };
+ TopTools_IndexedMapOfShape shape_map;
+ Array<TopoDS_Shape> shape_list;
diff --git a/media-gfx/netgen/netgen-6.2.2302.ebuild b/media-gfx/netgen/netgen-6.2.2302.ebuild
index 5a86024f6f64..5b3aa9d3d837 100644
--- a/media-gfx/netgen/netgen-6.2.2302.ebuild
+++ b/media-gfx/netgen/netgen-6.2.2302.ebuild
@@ -74,6 +74,7 @@ PATCHES=(
"${FILESDIR}/${PN}-6.2.2204-disable-python-tests.patch"
"${FILESDIR}/${PN}-6.2.2301-find-libjpeg-turbo-library.patch"
"${FILESDIR}/${PN}-6.2.2301-fix-nullptr-deref-in-archive.patch"
+ "${FILESDIR}/${PN}-6.2.2302-opencascade-7.8.0.patch"
)
pkg_setup() {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-gfx/netgen/files/, media-gfx/netgen/
@ 2025-01-05 20:35 Sam James
0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-01-05 20:35 UTC (permalink / raw
To: gentoo-commits
commit: ce8f479f9c17840d0a8be94b8c90ef4cdb3b2922
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Sat Jun 8 13:00:18 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 5 20:33:25 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce8f479f
media-gfx/netgen: add 6.2.2406
Closes: https://bugs.gentoo.org/911179
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
media-gfx/netgen/Manifest | 1 +
.../netgen/files/netgen-6.2.2406-encoding_h.patch | 121 ++++++++++++++
...etgen-6.2.2406-find-libjpeg-turbo-library.patch | 29 ++++
.../netgen-6.2.2406-link-against-ffmpeg.patch | 17 ++
media-gfx/netgen/netgen-6.2.2406.ebuild | 180 +++++++++++++++++++++
5 files changed, 348 insertions(+)
diff --git a/media-gfx/netgen/Manifest b/media-gfx/netgen/Manifest
index f0b39cad7c0f..e686d01f85c8 100644
--- a/media-gfx/netgen/Manifest
+++ b/media-gfx/netgen/Manifest
@@ -1 +1,2 @@
DIST netgen-6.2.2302.tar.gz 3398683 BLAKE2B 7cf4626ee8163898864af0346cf2c4fa73dcca3ac2068d67f80b05ee926024b36552b33013c2ef8f74026ab942ae08c0628af0ce0c0dac2d004ba26e18bf4619 SHA512 da6e8e43d73af6b7bfae2e3c771d46e34601ff481c251924673f7330bae032a743fb9d5ff2792855e91ed5addb4d22fd4bf9cd7a9dcfb53f476e22a30f1eedb3
+DIST netgen-6.2.2406.tar.gz 3452436 BLAKE2B 4cb42f20e7627a98e54a9f2e6da5d1b4af174fa7e33c6f72a731b4879c3e4324b20016f1980d2ceb50976fedc2b001a0824e2edd03b03c434c49baa947ded126 SHA512 262e57dca39519c797ea58b32eb886d523926aa48979b31df0c61839f9db09eea76346d3519742b7173a78a80335c16960860772646edd20f365dab1e1a6bed8
diff --git a/media-gfx/netgen/files/netgen-6.2.2406-encoding_h.patch b/media-gfx/netgen/files/netgen-6.2.2406-encoding_h.patch
new file mode 100644
index 000000000000..9d9288412efb
--- /dev/null
+++ b/media-gfx/netgen/files/netgen-6.2.2406-encoding_h.patch
@@ -0,0 +1,121 @@
+From 8504832e746b1581d5b51be7f04f24826440255f Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Thu, 6 Jun 2024 15:59:51 +0200
+Subject: [PATCH 1/2] use std namespace prefix
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+---
+ ng/encoding.hpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/ng/encoding.hpp b/ng/encoding.hpp
+index 9ea2ffb..498431c 100644
+--- a/ng/encoding.hpp
++++ b/ng/encoding.hpp
+@@ -16,6 +16,8 @@ extern "C" {
+ #include <libswresample/swresample.h>
+ }
+
++#include <iostream>
++
+ constexpr int BITRATE = 50000000;
+
+ class Mpeg {
+@@ -55,6 +57,8 @@ class Mpeg {
+ int height;
+ bool IsStarted() { return is_started; }
+ int AddFrame() {
++ using std::cerr;
++ using std::endl;
+ int ret;
+ int got_packet = 0;
+ AVPacket pkt = { 0 };
+@@ -113,7 +117,9 @@ class Mpeg {
+ return 0;
+ }
+
+- int Start(string filename) {
++ int Start(std::string filename) {
++ using std::cerr;
++ using std::endl;
+ AVCodec *video_codec;
+ if(is_started) {
+ cerr << "Stream already started" << endl;
+--
+2.45.2
+
+
+From 2e52e913603745670cfc5c4a461845a6fb22e118 Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Thu, 6 Jun 2024 16:00:40 +0200
+Subject: [PATCH 2/2] av_init_packet is deprecated
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+---
+ ng/encoding.hpp | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/ng/encoding.hpp b/ng/encoding.hpp
+index 498431c..97b9e6a 100644
+--- a/ng/encoding.hpp
++++ b/ng/encoding.hpp
+@@ -61,7 +61,6 @@ class Mpeg {
+ using std::endl;
+ int ret;
+ int got_packet = 0;
+- AVPacket pkt = { 0 };
+
+ glReadPixels (0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, rgb_buffer);
+ av_image_fill_arrays(rgb_frame->data, rgb_frame->linesize, rgb_buffer, AV_PIX_FMT_RGB24, width, height, 1);
+@@ -77,8 +76,6 @@ class Mpeg {
+ sws_scale(sws_ctx, flipped_data, flipped_stride, 0, enc->height, frame->data, frame->linesize);
+
+
+- av_init_packet(&pkt);
+-
+ got_packet = 0;
+ ret = avcodec_send_frame(enc, frame);
+ if (ret < 0)
+@@ -87,28 +84,35 @@ class Mpeg {
+ return(1);
+ }
+
+- ret = avcodec_receive_packet(enc, &pkt);
++ AVPacket* pkt = av_packet_alloc();
++ ret = avcodec_receive_packet(enc, pkt);
+ if (!ret)
+ got_packet = 1;
+ if (ret == AVERROR(EAGAIN))
++ {
++ av_packet_free(&pkt);
+ return 0;
++ }
+
+ if (ret < 0) {
+ cerr << "Error encoding video frame: " << endl;
++ av_packet_free(&pkt);
+ return 1;
+ }
+
+ if (got_packet) {
+ /* rescale output packet timestamp values from codec to stream timebase */
+- av_packet_rescale_ts(&pkt, enc->time_base, st->time_base);
+- pkt.stream_index = st->index;
++ av_packet_rescale_ts(pkt, enc->time_base, st->time_base);
++ pkt->stream_index = st->index;
+
+ /* Write the compressed frame to the media file. */
+- ret = av_interleaved_write_frame(oc, &pkt);
++ ret = av_interleaved_write_frame(oc, pkt);
+ } else {
+ ret = 0;
+ }
+
++ av_packet_free(&pkt);
++
+ if (ret < 0) {
+ cerr << "Error while writing video frame: " << endl;
+ return(1);
+--
+2.45.2
+
diff --git a/media-gfx/netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch b/media-gfx/netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch
new file mode 100644
index 000000000000..ef58deb5261c
--- /dev/null
+++ b/media-gfx/netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch
@@ -0,0 +1,29 @@
+From 49507f7708d72b25fd5e350f7f6b30aa80a50cb4 Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Thu, 6 Jun 2024 15:40:10 +0200
+Subject: [PATCH] [PATCH] find libjpeg-turbo library
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+---
+ nglib/CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/nglib/CMakeLists.txt b/nglib/CMakeLists.txt
+index b1036ea..78340b6 100644
+--- a/nglib/CMakeLists.txt
++++ b/nglib/CMakeLists.txt
+@@ -11,6 +11,11 @@ if(EMSCRIPTEN)
+ target_include_directories(nglib PUBLIC $<TARGET_PROPERTY:ngcore,INTERFACE_INCLUDE_DIRECTORIES>)
+ else(EMSCRIPTEN)
+ target_link_libraries(nglib PUBLIC ngcore)
++ if(TARGET JPEG::JPEG)
++ get_target_property(JPEG_LIBRARIES JPEG::JPEG IMPORTED_LOCATION_RELEASE)
++ else()
++ set(JPEG_LIBRARIES ${JPEG_LIBRARY_RELEASE})
++ endif()
+ target_link_libraries( nglib PRIVATE ${MPI_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns )
+ endif(EMSCRIPTEN)
+
+--
+2.45.2
+
diff --git a/media-gfx/netgen/files/netgen-6.2.2406-link-against-ffmpeg.patch b/media-gfx/netgen/files/netgen-6.2.2406-link-against-ffmpeg.patch
new file mode 100644
index 000000000000..c609e06fe94b
--- /dev/null
+++ b/media-gfx/netgen/files/netgen-6.2.2406-link-against-ffmpeg.patch
@@ -0,0 +1,17 @@
+From 69d9c2da29adc9b7a209e78aae950d9834683f58 Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl-gentoo@posteo.net>
+Date: Mon, 31 Oct 2022 13:07:05 +0100
+Subject: [PATCH] link against ffmpeg
+
+Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
+--- a/ng/CMakeLists.txt
++++ b/ng/CMakeLists.txt
+@@ -28,7 +28,7 @@ if(USE_GUI)
+ if(APPLE)
+ set_target_properties(netgen PROPERTIES OUTPUT_NAME netgen)
+ endif(APPLE)
+- target_link_libraries( netgen ${Python3_LIBRARIES} ${TCL_LIBRARY} ${TK_LIBRARY})
++ target_link_libraries( netgen ${Python3_LIBRARIES} ${TCL_LIBRARY} ${TK_LIBRARY} ${FFMPEG_LIBRARIES})
+ endif(NOT BUILD_FOR_CONDA)
+
+ install(TARGETS nggui ${NG_INSTALL_DIR})
diff --git a/media-gfx/netgen/netgen-6.2.2406.ebuild b/media-gfx/netgen/netgen-6.2.2406.ebuild
new file mode 100644
index 000000000000..b12748d38fb9
--- /dev/null
+++ b/media-gfx/netgen/netgen-6.2.2406.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+inherit cmake desktop python-single-r1 xdg
+
+DESCRIPTION="Automatic 3d tetrahedral mesh generator"
+HOMEPAGE="https://ngsolve.org/ https://github.com/NGSolve/netgen"
+SRC_URI="https://github.com/NGSolve/netgen/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ffmpeg gui jpeg mpi +opencascade python test"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+ ffmpeg? ( gui )
+ jpeg? ( gui )
+ python? ( gui )
+"
+
+DEPEND="
+ sys-libs/zlib
+ ffmpeg? ( media-video/ffmpeg:= )
+ gui? (
+ dev-lang/tcl:0/8.6
+ dev-lang/tk:0/8.6
+ media-libs/glu
+ media-libs/libglvnd[X]
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libxcb:=
+ )
+ jpeg? ( media-libs/libjpeg-turbo:0= )
+ mpi? (
+ sci-libs/metis
+ virtual/mpi
+ )
+ opencascade? ( sci-libs/opencascade:= )
+ python? (
+ ${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ dev-python/pybind11[${PYTHON_USEDEP}]
+ '
+ )
+ mpi? (
+ $(python_gen_cond_dep 'dev-python/mpi4py[${PYTHON_USEDEP}]' )
+ )
+ )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ sys-apps/lsb-release
+ virtual/pkgconfig
+ gui? ( virtual/imagemagick-tools[png] )
+ test? (
+ <dev-cpp/catch-3:0
+ python? ( $(python_gen_cond_dep '
+ dev-python/pytest-check[${PYTHON_USEDEP}]
+ ') )
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-6.2.2204-find-Tk-include-directories.patch"
+ "${FILESDIR}/${PN}-6.2.2406-link-against-ffmpeg.patch"
+ "${FILESDIR}/${PN}-6.2.2204-use-system-catch.patch"
+ "${FILESDIR}/${PN}-6.2.2406-find-libjpeg-turbo-library.patch"
+ "${FILESDIR}/${PN}-6.2.2301-fix-nullptr-deref-in-archive.patch"
+ "${FILESDIR}/${PN}-6.2.2406-encoding_h.patch"
+)
+
+pkg_setup() {
+ if use python; then
+ python-single-r1_pkg_setup
+
+ # NOTE This calls find_package(Python3) without specifying Interpreter in COMPONENTS.
+ # Python3_FIND_UNVERSIONED_NAMES=FIRST is thus never checked and we search the highest python version first.
+ pushd "${T}/${EPYTHON}/bin" > /dev/null || die
+ cp "python-config" "${EPYTHON}-config" || die
+ chmod +x "${EPYTHON}-config" || die
+ popd > /dev/null || die
+ fi
+}
+
+src_prepare() {
+ # # NOTE: need to manually check and update this string on version bumps!
+ # # git describe --tags --match "v[0-9]*" --long --dirty
+ # cat <<- EOF > "${S}/version.txt" || die
+ # v${PV}-0-08eec44
+ # EOF
+
+ rm external_dependencies -r || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ # currently not working in a sandbox, expects netgen to be installed
+ # see https://github.com/NGSolve/netgen/issues/132
+ -DBUILD_STUB_FILES=OFF
+ -DENABLE_UNIT_TESTS=$(usex test)
+ -DINSTALL_PROFILES=OFF
+ -DNG_INSTALL_DIR_CMAKE="$(get_libdir)/cmake/${PN}"
+ -DNG_INSTALL_DIR_INCLUDE="include/${PN}"
+ -DNG_INSTALL_DIR_LIB="$(get_libdir)"
+ -DUSE_CCACHE=OFF
+ # doesn't build with this version
+ -DUSE_CGNS=OFF
+ -DUSE_GUI=$(usex gui)
+ -DUSE_INTERNAL_TCL=OFF
+ -DUSE_JPEG=$(usex jpeg)
+ -DUSE_MPEG=$(usex ffmpeg)
+ # respect users -march= choice
+ -DUSE_NATIVE_ARCH=OFF
+ -DUSE_MPI=$(usex mpi)
+ -DUSE_OCC=$(usex opencascade)
+ -DUSE_PYTHON="$(usex python)"
+ -DUSE_SUPERBUILD=OFF
+ -DNETGEN_VERSION_GIT="v${PV}"
+ )
+ # no need to set this, if we only build the library
+ if use gui; then
+ mycmakeargs+=( -DTK_INCLUDE_PATH="/usr/$(get_libdir)/tk8.6/include" )
+ fi
+ if use python; then
+ mycmakeargs+=(
+ -DPREFER_SYSTEM_PYBIND11=ON
+ # # needed, so the value gets passed to NetgenConfig.cmake instead of ${T}/pythonX.Y
+ # -DPYTHON_EXECUTABLE="${PYTHON}"
+ )
+ fi
+ if use mpi && use python; then
+ mycmakeargs+=( -DUSE_MPI4PY=ON )
+ else
+ mycmakeargs+=( -DUSE_MPI4PY=OFF )
+ fi
+ cmake_src_configure
+}
+
+src_test() {
+ DESTDIR="${T}" cmake_build install
+
+ export PYTHONPATH="${T}/$(python_get_sitedir):${T}/usr/$(get_libdir):${BUILD_DIR}/libsrc/core"
+
+ CMAKE_SKIP_TESTS=(
+ '^unit_symboltable$'
+ '^pytest$' # SEGFAULT
+ )
+ cmake_src_test
+}
+
+src_install() {
+ cmake_src_install
+ use python && python_optimize
+
+ local NETGENDIR="/usr/share/${PN}"
+ echo -e "NETGENDIR=${NETGENDIR}" > ./99netgen || die
+ doenvd 99netgen
+
+ if use gui; then
+ mv "${ED}"/usr/bin/{*.tcl,*.ocf} "${ED}${NETGENDIR}" || die
+
+ convert -deconstruct "${S}/windows/${PN}.ico" netgen.png || die
+ newicon -s 32 "${S}"/${PN}-2.png ${PN}.png
+ newicon -s 16 "${S}"/${PN}-3.png ${PN}.png
+ make_desktop_entry ${PN} "Netgen" netgen Graphics
+ fi
+
+ mv "${ED}"/usr/share/${PN}/doc/ng4.pdf "${ED}"/usr/share/doc/${PF} || die
+ dosym -r /usr/share/doc/${PF}/ng4.pdf /usr/share/${PN}/doc/ng4.pdf
+
+ use python || rm -r "${ED}${NETGENDIR}"/py_tutorials || die
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-gfx/netgen/files/, media-gfx/netgen/
@ 2025-01-06 1:00 Sam James
0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-01-06 1:00 UTC (permalink / raw
To: gentoo-commits
commit: 47564dfaf7761b2344096c0201ff33cbb7b2b078
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Mon Jan 6 00:52:19 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 6 00:59:01 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47564dfa
media-gfx/netgen: #947567
Closes: https://bugs.gentoo.org/947567
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch | 6 +++---
media-gfx/netgen/netgen-6.2.2406.ebuild | 8 ++++++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/media-gfx/netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch b/media-gfx/netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch
index ef58deb5261c..17bf2ad95f61 100644
--- a/media-gfx/netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch
+++ b/media-gfx/netgen/files/netgen-6.2.2406-find-libjpeg-turbo-library.patch
@@ -12,8 +12,8 @@ diff --git a/nglib/CMakeLists.txt b/nglib/CMakeLists.txt
index b1036ea..78340b6 100644
--- a/nglib/CMakeLists.txt
+++ b/nglib/CMakeLists.txt
-@@ -11,6 +11,11 @@ if(EMSCRIPTEN)
- target_include_directories(nglib PUBLIC $<TARGET_PROPERTY:ngcore,INTERFACE_INCLUDE_DIRECTORIES>)
+@@ -13,6 +13,11 @@ if(EMSCRIPTEN)
+ target_link_libraries(nglib PRIVATE ${ZLIB_LIBRARIES} $<BUILD_INTERFACE:$<TARGET_PROPERTY:occ_libs,INTERFACE_LINK_LIBRARIES>>)
else(EMSCRIPTEN)
target_link_libraries(nglib PUBLIC ngcore)
+ if(TARGET JPEG::JPEG)
@@ -21,7 +21,7 @@ index b1036ea..78340b6 100644
+ else()
+ set(JPEG_LIBRARIES ${JPEG_LIBRARY_RELEASE})
+ endif()
- target_link_libraries( nglib PRIVATE ${MPI_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns )
+ target_link_libraries( nglib PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns )
endif(EMSCRIPTEN)
--
diff --git a/media-gfx/netgen/netgen-6.2.2406.ebuild b/media-gfx/netgen/netgen-6.2.2406.ebuild
index b12748d38fb9..35c30b24ff1d 100644
--- a/media-gfx/netgen/netgen-6.2.2406.ebuild
+++ b/media-gfx/netgen/netgen-6.2.2406.ebuild
@@ -4,7 +4,7 @@
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
-inherit cmake desktop python-single-r1 xdg
+inherit cmake desktop flag-o-matic python-single-r1 xdg
DESCRIPTION="Automatic 3d tetrahedral mesh generator"
HOMEPAGE="https://ngsolve.org/ https://github.com/NGSolve/netgen"
@@ -101,6 +101,8 @@ src_prepare() {
}
src_configure() {
+ filter-lto
+
local mycmakeargs=(
# currently not working in a sandbox, expects netgen to be installed
# see https://github.com/NGSolve/netgen/issues/132
@@ -147,7 +149,9 @@ src_configure() {
src_test() {
DESTDIR="${T}" cmake_build install
- export PYTHONPATH="${T}/$(python_get_sitedir):${T}/usr/$(get_libdir):${BUILD_DIR}/libsrc/core"
+ if use python; then
+ export PYTHONPATH="${T}/$(python_get_sitedir):${T}/usr/$(get_libdir):${BUILD_DIR}/libsrc/core"
+ fi
CMAKE_SKIP_TESTS=(
'^unit_symboltable$'
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-gfx/netgen/files/, media-gfx/netgen/
@ 2025-02-09 21:08 Alexey Shvetsov
0 siblings, 0 replies; 5+ messages in thread
From: Alexey Shvetsov @ 2025-02-09 21:08 UTC (permalink / raw
To: gentoo-commits
commit: 9358f8742ad37afb081cf1120df9cd92c4fc7759
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 9 21:07:20 2025 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Sun Feb 9 21:08:14 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9358f874
media-gfx/netgen: Fix build with jpeg
Closes: https://bugs.gentoo.org/947728
Signed-off-by: Alexey Shvetsov <alexxy <AT> gentoo.org>
.../files/netgen-6.2.2406-link-against-jpeg.patch | 30 ++++++++++++++++++++++
media-gfx/netgen/netgen-6.2.2406.ebuild | 1 +
2 files changed, 31 insertions(+)
diff --git a/media-gfx/netgen/files/netgen-6.2.2406-link-against-jpeg.patch b/media-gfx/netgen/files/netgen-6.2.2406-link-against-jpeg.patch
new file mode 100644
index 000000000000..0460a1a6fefe
--- /dev/null
+++ b/media-gfx/netgen/files/netgen-6.2.2406-link-against-jpeg.patch
@@ -0,0 +1,30 @@
+From 3d82bf88360b9d032671a72a31cd9c351bf674f8 Mon Sep 17 00:00:00 2001
+From: Alexey Shvetsov <alexxy@gentoo.org>
+Date: Sun, 9 Feb 2025 23:56:10 +0300
+Subject: [PATCH] Patch to fix build with jpeg enabled
+
+Issue #210
+Bug https://bugs.gentoo.org/947728
+
+Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9c54e30e..deb77192 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -432,6 +432,9 @@ if (USE_JPEG)
+ find_package(JPEG REQUIRED)
+ add_definitions(-DJPEGLIB)
+ include_directories(${JPEG_INCLUDE_DIR})
++ if(USE_GUI)
++ target_link_libraries(nggui INTERFACE ${JPEG_LIBRARIES})
++ endif(USE_GUI)
+ endif (USE_JPEG)
+
+ #######################################################################
+--
+2.48.1
+
diff --git a/media-gfx/netgen/netgen-6.2.2406.ebuild b/media-gfx/netgen/netgen-6.2.2406.ebuild
index 35c30b24ff1d..32925744f381 100644
--- a/media-gfx/netgen/netgen-6.2.2406.ebuild
+++ b/media-gfx/netgen/netgen-6.2.2406.ebuild
@@ -73,6 +73,7 @@ PATCHES=(
"${FILESDIR}/${PN}-6.2.2406-find-libjpeg-turbo-library.patch"
"${FILESDIR}/${PN}-6.2.2301-fix-nullptr-deref-in-archive.patch"
"${FILESDIR}/${PN}-6.2.2406-encoding_h.patch"
+ "${FILESDIR}/${PN}-6.2.2406-link-against-jpeg.patch"
)
pkg_setup() {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-gfx/netgen/files/, media-gfx/netgen/
@ 2025-08-01 8:10 Sam James
0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2025-08-01 8:10 UTC (permalink / raw
To: gentoo-commits
commit: a35f40615be53b528af4afd438c943ded78a45ba
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri Jul 18 10:50:35 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 1 08:08:06 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a35f4061
media-gfx/netgen: backport PR202 crashfix
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43083
Signed-off-by: Sam James <sam <AT> gentoo.org>
media-gfx/netgen/files/netgen-PR202-std_map.patch | 137 ++++++++++++++++++++++
media-gfx/netgen/netgen-6.2.2406-r1.ebuild | 1 +
media-gfx/netgen/netgen-6.2.2501-r1.ebuild | 1 +
3 files changed, 139 insertions(+)
diff --git a/media-gfx/netgen/files/netgen-PR202-std_map.patch b/media-gfx/netgen/files/netgen-PR202-std_map.patch
new file mode 100644
index 000000000000..d3d5e814131a
--- /dev/null
+++ b/media-gfx/netgen/files/netgen-PR202-std_map.patch
@@ -0,0 +1,137 @@
+From 78782dcd5365ec4aee54262373f12986e674f4b5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
+Date: Thu, 19 Dec 2024 01:28:35 +0100
+Subject: [PATCH] Fix static initialization order for UserFormatRegister map
+
+A std::map is in an invalid state when just zero-initialized, and needs
+to be initialized by its constructor. As this initilization may be done
+after the first call to Register, a crash will typically happen.
+
+To fix this wrap all accesses to the map with a Meyers Singleton. Also
+remove the extra Array - most accesses are using the key, and the few
+format list iterations all sort the result afterwards anyway.
+
+Fixes #201.
+---
+ libsrc/interface/writeuser.cpp | 31 +++++++++++++++++++++++++------
+ libsrc/interface/writeuser.hpp | 25 ++++++++-----------------
+ libsrc/meshing/python_mesh.cpp | 4 +++-
+ 3 files changed, 36 insertions(+), 24 deletions(-)
+https://github.com/NGSolve/netgen/pull/202
+
+ diff --git a/libsrc/interface/writeuser.cpp b/libsrc/interface/writeuser.cpp
+index bfab7fbbf..637af7d36 100644
+--- a/libsrc/interface/writeuser.cpp
++++ b/libsrc/interface/writeuser.cpp
+@@ -16,19 +16,38 @@
+
+ namespace netgen
+ {
+- extern MeshingParameters mparam;
++ std::map<std::string, UserFormatRegister::UserFormatEntry>& UserFormatRegister::getFormats()
++ {
++ static std::map<std::string, UserFormatRegister::UserFormatEntry> formats = {};
++ return formats;
++ }
+
+- Array<UserFormatRegister::UserFormatEntry> UserFormatRegister::entries;
+- std::map<string, int> UserFormatRegister::format_to_entry_index;
++ void UserFormatRegister::Register(UserFormatRegister::UserFormatEntry && entry)
++ {
++ getFormats()[entry.format] = std::move(entry);
++ }
++
++ const bool UserFormatRegister::HaveFormat(string format)
++ {
++ const auto formats = getFormats();
++ return formats.find(format) != formats.end();
++ }
++
++ const UserFormatRegister::UserFormatEntry & UserFormatRegister::Get(string format)
++ {
++ return getFormats()[format];
++ }
++
++ extern MeshingParameters mparam;
+
+ void RegisterUserFormats (NgArray<const char*> & names,
+ NgArray<const char*> & extensions)
+
+ {
+- for (const auto & entry : UserFormatRegister::entries)
++ for (const auto & entry : UserFormatRegister::getFormats())
+ {
+- names.Append (entry.format.c_str());
+- extensions.Append (entry.extensions[0].c_str());
++ names.Append (entry.second.format.c_str());
++ extensions.Append (entry.second.extensions[0].c_str());
+ }
+ }
+
+diff --git a/libsrc/interface/writeuser.hpp b/libsrc/interface/writeuser.hpp
+index 99dc21e03..3d9a4e3af 100644
+--- a/libsrc/interface/writeuser.hpp
++++ b/libsrc/interface/writeuser.hpp
+@@ -28,32 +28,23 @@ struct UserFormatRegister {
+ optional<FRead> read;
+ optional<FWrite> write;
+ };
+- DLL_HEADER static Array<UserFormatEntry> entries;
+- DLL_HEADER static std::map<string, int> format_to_entry_index;
++ static void Register(UserFormatEntry && entry);
+
+- static void Register(UserFormatEntry && entry) {
+- format_to_entry_index[entry.format] = entries.Size();
+- entries.Append( std::move(entry) );
+- }
+-
+- static const bool HaveFormat(string format) {
+- return format_to_entry_index.count(format) > 0;
+- }
+- static const UserFormatEntry & Get(string format) {
+- return entries[format_to_entry_index[format]];
+- }
++ static const bool HaveFormat(string format);
++ DLL_HEADER static const UserFormatEntry & Get(string format);
+
+ template<typename TFunc>
+ static void IterateFormats(TFunc func, bool need_read=false, bool need_write=false) {
+ Array<string> import_formats;
+- for(const auto & e: entries)
+- if((!need_read || e.read) && (!need_write || e.write))
+- import_formats.Append(e.format);
++ for(const auto & e: getFormats())
++ if((!need_read || e.second.read) && (!need_write || e.second.write))
++ import_formats.Append(e.second.format);
+ QuickSort(import_formats);
+ for(auto format : import_formats)
+- func(entries[format_to_entry_index[format]]);
++ func(Get(format));
+ }
+
++ DLL_HEADER static std::map<std::string, UserFormatEntry>& getFormats();
+ };
+
+ struct RegisterUserFormat {
+diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp
+index a771ba187..bbd9488a4 100644
+--- a/libsrc/meshing/python_mesh.cpp
++++ b/libsrc/meshing/python_mesh.cpp
+@@ -700,7 +700,8 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
+
+ string export_docu = "Export mesh to other file format. Supported formats are:\n";
+ Array<string> export_formats;
+- for(auto & e : UserFormatRegister::entries)
++ for(auto & kv : UserFormatRegister::getFormats()) {
++ const auto e = kv.second;
+ if(e.write) {
+ string s = '\t'+e.format+"\t("+e.extensions[0];
+ for(auto & ext : e.extensions.Range(1, e.extensions.Size()))
+@@ -708,6 +709,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
+ s += ")\n";
+ export_formats.Append(s);
+ }
++ }
+ QuickSort(export_formats);
+ for(const auto & s : export_formats)
+ export_docu += s;
diff --git a/media-gfx/netgen/netgen-6.2.2406-r1.ebuild b/media-gfx/netgen/netgen-6.2.2406-r1.ebuild
index 0aec458d700c..cc1c82741dbd 100644
--- a/media-gfx/netgen/netgen-6.2.2406-r1.ebuild
+++ b/media-gfx/netgen/netgen-6.2.2406-r1.ebuild
@@ -74,6 +74,7 @@ PATCHES=(
"${FILESDIR}/${PN}-6.2.2301-fix-nullptr-deref-in-archive.patch"
"${FILESDIR}/${PN}-6.2.2406-encoding_h.patch"
"${FILESDIR}/${PN}-6.2.2406-link-against-jpeg.patch"
+ "${FILESDIR}/${PN}-PR202-std_map.patch"
)
pkg_setup() {
diff --git a/media-gfx/netgen/netgen-6.2.2501-r1.ebuild b/media-gfx/netgen/netgen-6.2.2501-r1.ebuild
index 839921c4d9be..ab8c1f529bef 100644
--- a/media-gfx/netgen/netgen-6.2.2501-r1.ebuild
+++ b/media-gfx/netgen/netgen-6.2.2501-r1.ebuild
@@ -73,6 +73,7 @@ PATCHES=(
# "${FILESDIR}/${PN}-6.2.2406-find-libjpeg-turbo-library.patch"
"${FILESDIR}/${PN}-6.2.2301-fix-nullptr-deref-in-archive.patch"
"${FILESDIR}/${PN}-6.2.2406-encoding_h.patch"
+ "${FILESDIR}/${PN}-PR202-std_map.patch"
)
pkg_setup() {
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-01 8:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-06 1:00 [gentoo-commits] repo/gentoo:master commit in: media-gfx/netgen/files/, media-gfx/netgen/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2025-08-01 8:10 Sam James
2025-02-09 21:08 Alexey Shvetsov
2025-01-05 20:35 Sam James
2024-11-25 2:40 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox