aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Waibel <waebbl-gentoo@posteo.net>2022-10-31 15:35:10 +0100
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2022-11-15 13:01:33 +0100
commitf73f853373a42bd8b02c51c79651a847d0c34058 (patch)
tree1a792d051d4424575ce10a53e8f694e882c38250 /sci-mathematics
parentprofiles/updates: move sci-mathematics/netgen -> media-gfx/netgen (diff)
downloadsci-f73f853373a42bd8b02c51c79651a847d0c34058.tar.gz
sci-f73f853373a42bd8b02c51c79651a847d0c34058.tar.bz2
sci-f73f853373a42bd8b02c51c79651a847d0c34058.zip
sci-mathematics/netgen: add 6.2.2204
- OpenMP doesn't seem to be used, remove USE flag - dev-tcltk/tix doesn't seem to be used, remove dependency - dev-tcltk/togl is build internal and doesn't use a system togl installation - Stub generation from pybind11 doesn't currently work in a sandbox, see https://github.com/NGSolve/netgen/issues/126 - only depend on sci-libs/metis for USE=mpi Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net> Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'sci-mathematics')
-rw-r--r--sci-mathematics/netgen/Manifest1
-rw-r--r--sci-mathematics/netgen/files/netgen-6.2.2204-find-Tk-include-directories.patch21
-rw-r--r--sci-mathematics/netgen/files/netgen-6.2.2204-find-libjpeg-turbo-library.patch34
-rw-r--r--sci-mathematics/netgen/files/netgen-6.2.2204-link-against-ffmpeg.patch20
-rw-r--r--sci-mathematics/netgen/files/netgen-6.2.2204-use-external-pybind11.patch30
-rw-r--r--sci-mathematics/netgen/netgen-6.2.2204.ebuild137
6 files changed, 243 insertions, 0 deletions
diff --git a/sci-mathematics/netgen/Manifest b/sci-mathematics/netgen/Manifest
index 32cbc28b8..5a2cfb72a 100644
--- a/sci-mathematics/netgen/Manifest
+++ b/sci-mathematics/netgen/Manifest
@@ -1 +1,2 @@
DIST netgen-6.2.2105.tar.gz 3372181 BLAKE2B 73ce8aff6e73a6a0ab79b0511c6c32c41240b9b6a743b8132cf27565b3c9f68820ad8337a9e761a37b74ffd7623a0321495a31dd868986ab4b90ff0dde66e9a8 SHA512 ed2727b7779af1ba564b0a7d9cc52fad5d3dccd478dcb71a4a77c7b9768a17eedfb6bfc2555f839cf592a7fc4ded5057f0e649239582e3d366d37ccfd030f4e9
+DIST netgen-6.2.2204.tar.gz 3394806 BLAKE2B 2b99854cab0890662f1ab7ffee6fb444b60a28ba0bfe9970a89c80c0e4c930c40b8034f9c600ddd61c9b60f542d1cae758a8c220a1ba76949bf9f97fb2fe9020 SHA512 964c40753613c111b0372b0e403b19734cc0c559d1e7e45bbe6b452f4daba10c6bde8abaa5c9541c92b4bccff02d32ea6ba8e8e06ba64f11fec1733f2e374cbf
diff --git a/sci-mathematics/netgen/files/netgen-6.2.2204-find-Tk-include-directories.patch b/sci-mathematics/netgen/files/netgen-6.2.2204-find-Tk-include-directories.patch
new file mode 100644
index 000000000..cf7b9d31e
--- /dev/null
+++ b/sci-mathematics/netgen/files/netgen-6.2.2204-find-Tk-include-directories.patch
@@ -0,0 +1,21 @@
+From 53c45343f5a26841be10d930467e215da4a779f2 Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl-gentoo@posteo.net>
+Date: Sun, 30 Oct 2022 15:17:55 +0100
+Subject: [PATCH] find Tk include directories
+
+Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -270,6 +270,9 @@ if (USE_GUI)
+ endif(APPLE)
+ find_package(OpenGL REQUIRED)
+
++ include_directories(${TK_INCLUDE_PATH}/generic)
++ include_directories(${TK_INCLUDE_PATH}/unix)
++
+ target_compile_definitions(netgen_gui INTERFACE -DTCL -DOPENGL -DUSE_TOGL_2 -DUSE_TCL_STUBS -DUSE_TK_STUBS)
+ target_include_directories(netgen_gui INTERFACE ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH})
+ target_link_libraries(netgen_gui INTERFACE ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
+--
+2.38.1
+
diff --git a/sci-mathematics/netgen/files/netgen-6.2.2204-find-libjpeg-turbo-library.patch b/sci-mathematics/netgen/files/netgen-6.2.2204-find-libjpeg-turbo-library.patch
new file mode 100644
index 000000000..c45f5a4e4
--- /dev/null
+++ b/sci-mathematics/netgen/files/netgen-6.2.2204-find-libjpeg-turbo-library.patch
@@ -0,0 +1,34 @@
+From 39160b692fd051f2638f1a6e1df38eb616b6d6cb Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl-gentoo@posteo.net>
+Date: Sun, 30 Oct 2022 16:09:43 +0100
+Subject: [PATCH] find libjpeg-turbo library
+
+Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
+--- a/libsrc/visualization/CMakeLists.txt
++++ b/libsrc/visualization/CMakeLists.txt
+@@ -7,7 +7,7 @@ target_sources(nggui PRIVATE
+ vssolution.cpp
+ visualpkg.cpp
+ )
+-target_link_libraries( nggui PUBLIC "$<BUILD_INTERFACE:netgen_python>" ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} )
++target_link_libraries( nggui PUBLIC "$<BUILD_INTERFACE:netgen_python>" ${MPI_CXX_LIBRARIES} ${OPENGL_LIBRARIES} ${JPEG_LIBRARIES} )
+
+ install(FILES
+ meshdoc.hpp mvdraw.hpp visual_api.hpp
+--- a/nglib/CMakeLists.txt
++++ b/nglib/CMakeLists.txt
+@@ -7,6 +7,11 @@ endif(USE_OCC)
+
+ 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_LIBRARIES} netgen_cgns )
+
+ install(TARGETS nglib netgen_cgns ${NG_INSTALL_DIR})
+--
+2.38.1
+
diff --git a/sci-mathematics/netgen/files/netgen-6.2.2204-link-against-ffmpeg.patch b/sci-mathematics/netgen/files/netgen-6.2.2204-link-against-ffmpeg.patch
new file mode 100644
index 000000000..6f7a8bc3c
--- /dev/null
+++ b/sci-mathematics/netgen/files/netgen-6.2.2204-link-against-ffmpeg.patch
@@ -0,0 +1,20 @@
+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 ${PYTHON_LIBRARIES} ${TCL_LIBRARY} ${TK_LIBRARY})
++ target_link_libraries( netgen ${PYTHON_LIBRARIES} ${TCL_LIBRARY} ${TK_LIBRARY} ${FFMPEG_LIBRARIES})
+ endif(NOT BUILD_FOR_CONDA)
+
+ install(TARGETS nggui ${NG_INSTALL_DIR})
+--
+2.38.1
+
diff --git a/sci-mathematics/netgen/files/netgen-6.2.2204-use-external-pybind11.patch b/sci-mathematics/netgen/files/netgen-6.2.2204-use-external-pybind11.patch
new file mode 100644
index 000000000..ef11c8b08
--- /dev/null
+++ b/sci-mathematics/netgen/files/netgen-6.2.2204-use-external-pybind11.patch
@@ -0,0 +1,30 @@
+From c3c55fe646ad6934e429edd080aceae54260551c Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl-gentoo@posteo.net>
+Date: Sun, 30 Oct 2022 14:50:48 +0100
+Subject: [PATCH] use external pybind11
+
+Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -302,7 +302,7 @@ else()
+ endif()
+
+ if (USE_PYTHON)
+- add_subdirectory(external_dependencies/pybind11)
++ find_package(pybind11)
+ find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h HINTS ${PYTHON_INCLUDE_DIR})
+ if( PYBIND_INCLUDE_DIR )
+ message(STATUS "Found Pybind11: ${PYBIND_INCLUDE_DIR}")
+--- a/cmake/SuperBuild.cmake
++++ b/cmake/SuperBuild.cmake
+@@ -154,7 +154,6 @@ endif()
+ #######################################################################
+ if (USE_PYTHON)
+ find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include NO_DEFAULT_PATH)
+- set(NG_INSTALL_PYBIND ON)
+ if( NOT PYBIND_INCLUDE_DIR )
+ # if the pybind submodule is missing, try to initialize and update all submodules
+ execute_process(COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+--
+2.38.1
+
diff --git a/sci-mathematics/netgen/netgen-6.2.2204.ebuild b/sci-mathematics/netgen/netgen-6.2.2204.ebuild
new file mode 100644
index 000000000..06a2bf53f
--- /dev/null
+++ b/sci-mathematics/netgen/netgen-6.2.2204.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+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"
+
+SLOT="0"
+LICENSE="LGPL-2.1"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ffmpeg jpeg mpi opencascade python gui"
+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
+ virtual/opengl
+ 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
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-use-external-pybind11.patch"
+ "${FILESDIR}/${P}-find-Tk-include-directories.patch"
+ "${FILESDIR}/${P}-find-libjpeg-turbo-library.patch"
+ "${FILESDIR}/${P}-link-against-ffmpeg.patch"
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # NOTE: need to manually check and update this string on version bumps!
+ cat <<- EOF > "${S}/version.txt" || die
+ v${PV}-0-gde0d706e
+ EOF
+ 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
+ -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
+ )
+ # 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+=(
+ -DPYBIND_INCLUDE_DIR="/usr/lib/${EPYTHON}/site-packages/pybind11/include/"
+ -DNG_INSTALL_PYBIND=OFF
+ )
+ fi
+ if use mpi && use python; then
+ mycmakeargs+=( -DUSE_MPI4PY=ON )
+ else
+ mycmakeargs+=( -DUSE_MPI4PY=OFF )
+ fi
+ cmake_src_configure
+}
+
+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
+
+ doicon "${FILESDIR}"/${PN}.png
+ domenu "${FILESDIR}"/${PN}.desktop
+ 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
+}