commit:     430efe1166a93e1acf87c1980142052339f1ac5a
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 13 14:18:03 2022 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Thu Jan 13 14:18:03 2022 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=430efe11

sci-mathematics/netgen: add version 6.2.2105

Bug: https://github.com/NGSolve/netgen/issues/72
Bug: https://github.com/NGSolve/netgen/issues/77
Closes: https://bugs.gentoo.org/155424
Closes: https://bugs.gentoo.org/756214
Package-Manager: Portage-3.0.30, Repoman-3.0.3
RepoMan-Options: --force
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 .../netgen/files/netgen-6.2.2105-find-tk.patch     |  35 +++++++
 sci-mathematics/netgen/metadata.xml                |   2 +-
 sci-mathematics/netgen/netgen-6.2.2105.ebuild      | 102 +++++++++++++++++++++
 3 files changed, 138 insertions(+), 1 deletion(-)

diff --git a/sci-mathematics/netgen/files/netgen-6.2.2105-find-tk.patch 
b/sci-mathematics/netgen/files/netgen-6.2.2105-find-tk.patch
new file mode 100644
index 000000000..c638d83a7
--- /dev/null
+++ b/sci-mathematics/netgen/files/netgen-6.2.2105-find-tk.patch
@@ -0,0 +1,35 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index dcc24af..24f444e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -246,7 +246,8 @@ if (USE_GUI)
+ 
+     add_definitions(-DTCL -DOPENGL -DUSE_TOGL_2)
+     include_directories(${TCL_INCLUDE_PATH})
+-    include_directories(${TK_INCLUDE_PATH})
++    include_directories(${TK_INCLUDE_PATH}/generic)
++    include_directories(${TK_INCLUDE_PATH}/unix)
+     set(LIBTOGL togl)
+ 
+     if(WIN32)
+@@ -268,7 +269,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}")
+diff --git a/cmake/SuperBuild.cmake b/cmake/SuperBuild.cmake
+index c24b631..2354a09 100644
+--- a/cmake/SuperBuild.cmake
++++ b/cmake/SuperBuild.cmake
+@@ -39,7 +39,6 @@ endif(NOT WIN32)
+ #######################################################################
+ 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})

diff --git a/sci-mathematics/netgen/metadata.xml 
b/sci-mathematics/netgen/metadata.xml
index a2cd926a4..cb94caeca 100644
--- a/sci-mathematics/netgen/metadata.xml
+++ b/sci-mathematics/netgen/metadata.xml
@@ -9,6 +9,6 @@
                <flag name="opencascade"> Enable OpenCASCADE support</flag>
        </use>
        <upstream>
-               <remote-id type="sourceforge">netgen-mesher</remote-id>
+               <remote-id type="github">NGSolve/netgen</remote-id>
        </upstream>
 </pkgmetadata>

diff --git a/sci-mathematics/netgen/netgen-6.2.2105.ebuild 
b/sci-mathematics/netgen/netgen-6.2.2105.ebuild
new file mode 100644
index 000000000..ba602adf6
--- /dev/null
+++ b/sci-mathematics/netgen/netgen-6.2.2105.ebuild
@@ -0,0 +1,102 @@
+# 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 openmp python +gui"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="
+       dev-lang/tcl:0/8.6
+       dev-lang/tk:0/8.6
+       dev-tcltk/tix
+       dev-tcltk/togl:0
+       gui? (
+               virtual/opengl
+               x11-libs/libX11
+               x11-libs/libXmu
+       )
+       python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       dev-python/pybind11[${PYTHON_USEDEP}]
+                       dev-python/pybind11-stubgen[${PYTHON_USEDEP}]
+                       '
+               )
+               mpi? (
+                       $(python_gen_cond_dep 
'dev-python/mpi4py[${PYTHON_USEDEP}]' )
+               )
+       )
+       opencascade? ( sci-libs/opencascade:* )
+       ffmpeg? ( media-video/ffmpeg )
+       jpeg? ( virtual/jpeg:0= )
+       mpi? ( virtual/mpi sci-libs/parmetis opencascade? ( sci-libs/hdf5[mpi] 
) )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="dev-vcs/git"
+
+PATCHES=( "${FILESDIR}/${P}-find-tk.patch" )
+
+src_prepare() {
+       # https://github.com/NGSolve/netgen/issues/72
+       git init -q || die
+       git config --global user.email "[email protected]" || die
+       git config --global user.name "Your Name" || die
+       git add . || die
+       git commit -qm 'init' || die
+       git tag "${PV}" || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+        local mycmakeargs=(
+               -DUSE_MPI="$(usex mpi)"
+               -DUSE_JPEG="$(usex jpeg)"
+               -DUSE_MPEG="$(usex ffmpeg)"
+               -DUSE_GUI="$(usex gui)"
+               -DUSE_OCC="$(usex opencascade)"
+               -DUSE_PYTHON="$(usex python)"
+               -DTK_INCLUDE_PATH="/usr/$(get_libdir)/tk8.6/include"
+               -DNG_INSTALL_DIR_LIB="$(get_libdir)"
+               -DINSTALL_PROFILES=ON
+               -DUSE_INTERNAL_TCL=OFF
+       )
+       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
+       local NETGENDIR="/usr/share/netgen"
+
+       echo -e "NETGENDIR=${NETGENDIR} \nLDPATH=/usr/$(get_libdir)/Togl2.0" > 
./99netgen
+       doenvd 99netgen
+
+       mv "${D}"/usr/bin/{*.tcl,*.ocf} "${D}${NETGENDIR}" || die
+
+       # Install icon and .desktop for menu entry
+       doicon "${FILESDIR}"/${PN}.png
+       domenu "${FILESDIR}"/${PN}.desktop
+}

Reply via email to