media-gfx/netgen: add 6.2.2605

Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1856
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Paul Zander
2026-09-15 16:35:00 +01:00
committed by Sam James
parent fec6cd11ac
commit 7e8c3f3cd7
2 changed files with 234 additions and 0 deletions
+1
View File
@@ -1,2 +1,3 @@
DIST netgen-6.2.2505.tar.gz 3332150 BLAKE2B 9f8baa8423c34ee68c2cb77da1918a38c23a34dd61059f912d0bfb832ea9778d3dfa206ac35d39e8bdaad415be40682c4f1b7313c4f1b7ed0b4670a9568bf2b3 SHA512 f5274f8b1642109fa79926ce1c761f7d312ed86fc35624884917b7e39937bf8501e40238c7e9a3c7fc6324bfdaa27910c59a927c954d49e8dfc62618704f857f
DIST netgen-6.2.2604.tar.gz 3308713 BLAKE2B 11643cf7d784b45a59e2a6e26dc95f2391140f58a140a2254e6d21fe7a711b8801e40d53b57a6c70cf188f7167ef431b237793e5d75f3c9c3c831d84aba6e0ca SHA512 2ddc416c235ba42c576e3b019d0a2ee49b0728fe56a1e57b0d230dab0abcd466bf11b0ac290cf449442b46749055978477018003f743700ae54b9f32a8094ca3
DIST netgen-6.2.2605.tar.gz 3336141 BLAKE2B 848c0e6d488bd3ac3fb36409700bde5d43020dea6decfd58b67a82fd82b64a0c40991b5cf088d7314439121e950e85c617386f24d9b88fe85d0d4b00636bef12 SHA512 73980c674155b3d13b3a37c2dd2530c03e2df0337401a1e055c3ec373e89cbddf2fb76e345071ef6ced4dc6e4b6d0eac13d6aef6d1f99cb905f61705ef6a46ff
+233
View File
@@ -0,0 +1,233 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{12..14} )
TCL_SLOT="8.6"
inherit cmake desktop python-single-r1 xdg flag-o-matic
DESCRIPTION="Automatic 3d tetrahedral mesh generator"
HOMEPAGE="https://ngsolve.org/ https://github.com/NGSolve/netgen"
if [[ ${PV} == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/NGSolve/netgen.git"
else
SRC_URI="
https://github.com/NGSolve/netgen/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="LGPL-2.1"
SLOT="0"
IUSE="ffmpeg gui jpeg mpi +opencascade python test"
RESTRICT="!test? ( test )"
REQUIRED_USE="
python? ( ${PYTHON_REQUIRED_USE} )
ffmpeg? ( gui )
jpeg? ( gui )
python? ( gui )
"
DEPEND="
virtual/zlib:=
ffmpeg? ( media-video/ffmpeg:= )
gui? (
dev-lang/tcl:0/${TCL_SLOT}
dev-lang/tk:0/${TCL_SLOT}
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/numpy[${PYTHON_USEDEP}]
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
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.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"
"${FILESDIR}/${PN}-PR206-catch2-v3.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 ls-remote --tags https://github.com/NGSolve/netgen.git refs/tags/v${PV} | cut -c-8
# git describe --tags --match "v[0-9]*" --long --dirty
# cat <<- EOF > "${S}/version.txt" || die
# v${PV}-0-gd1a9f7ee
# EOF
# 855214 needs git
sed \
-e '/-DBDIR=${CMAKE_CURRENT_BINARY_DIR}/a -DNETGEN_VERSION_GIT=${NETGEN_VERSION_GIT}' \
-i CMakeLists.txt || die
if use python; then
sed \
-e "s/Python3_EXECUTABLE/PYTHON_EXECUTABLE/" \
-i cmake/NetgenConfig.cmake.in || die
fi
rm -r external_dependencies || die
cmake_src_prepare
}
src_configure() {
# TODO BUG
# /var/tmp/paludis/media-gfx-netgen-6.2.2601/work/netgen-6.2.2601/libsrc/core/simd_sse.hpp:
# In member function ‘int64_t ngcore::SIMD<long int, 2>::Lo() const’:
# /var/tmp/paludis/media-gfx-netgen-6.2.2601/work/netgen-6.2.2601/libsrc/core/simd_sse.hpp:74:48:
# error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
# 74 | NETGEN_INLINE int64_t Lo() const { return ((int64_t*)(&data))[0]; }
append-cflags -fno-strict-aliasing
append-cxxflags -fno-strict-aliasing
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=no
-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
)
if [[ ${PV} != *9999* ]]; then
mycmakeargs+=(
-DNETGEN_VERSION_GIT="v${PV}-0-3ee489c7"
)
fi
# no need to set this, if we only build the library
if use gui; then
mycmakeargs+=(
-DTK_INCLUDE_PATH="${ESYSROOT}/usr/$(get_libdir)/tk${TCL_SLOT}/include"
)
fi
if use python; then
append-cppflags -DPYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF
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
if use python; then
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
local -x NETGENDIR="${T}/usr/bin"
local -x PYTHONPATH="${T}$(python_get_sitedir):${T}/usr/$(get_libdir):${BUILD_DIR}/libsrc/core"
fi
CMAKE_SKIP_TESTS=(
'^unit_symboltable$'
'^pytest$' # floating point errors
'^pytest-mpi$' # needs pytest-mpi
)
cmake_src_test
rm -r "${T}/usr" || die
}
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
}