···
···
url = "${patchSource}/include_stdlib.patch";
hash = "sha256-W+NgGBuy/UmzVbPTSqR8FRUlyN/9dl9l9e9rxKklmIc=";
70
-
url = "${patchSource}/fix-version.patch";
71
-
hash = "sha256-CT98Wq3UufB81z/jYLiH9nXvt+QzoZ7210OeuFXCfmc=";
# when generating python stub file utilizing system python pybind11_stubgen module
# cmake need to inherit pythonpath
78
-
substituteInPlace python/CMakeLists.txt \
79
-
--replace-fail ''\'''${CMAKE_INSTALL_PREFIX}/''${NG_INSTALL_DIR_PYTHON}' \
80
-
''\'''${CMAKE_INSTALL_PREFIX}/''${NG_INSTALL_DIR_PYTHON}:$ENV{PYTHONPATH}'
78
+
sed -i '/-DBDIR=''\'''${CMAKE_CURRENT_BINARY_DIR}/a\
79
+
-DNETGEN_VERSION_GIT=''\'''${NETGEN_VERSION_GIT}
82
+
substituteInPlace python/CMakeLists.txt \
83
+
--replace-fail ''\'''${CMAKE_INSTALL_PREFIX}/''${NG_INSTALL_DIR_PYTHON}' \
84
+
''\'''${CMAKE_INSTALL_PREFIX}/''${NG_INSTALL_DIR_PYTHON}:$ENV{PYTHONPATH}'
86
+
substituteInPlace ng/ng.tcl ng/onetcl.cpp \
87
+
--replace-fail "libnggui" "$out/lib/libnggui"
82
-
substituteInPlace ng/ng.tcl ng/onetcl.cpp \
83
-
--replace-fail "libnggui" "$out/lib/libnggui"
89
+
substituteInPlace ng/Togl2.1/CMakeLists.txt \
90
+
--replace-fail "/usr/bin/gcc" "$CC"
92
+
+ lib.optionalString (!stdenv.hostPlatform.isx86_64) ''
93
+
# mesh generation differs on x86_64 and aarch64 platform
94
+
# test_tutorials will fail on aarch64 platform
95
+
rm tests/pytest/test_tutorials.py
python3Packages.pybind11-stubgen
103
+
] ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems;
···
(lib.cmakeFeature "NETGEN_VERSION_GIT" "v${finalAttrs.version}-0")
127
+
(lib.cmakeFeature "NG_INSTALL_DIR_BIN" "bin")
128
+
(lib.cmakeFeature "NG_INSTALL_DIR_LIB" "lib")
129
+
(lib.cmakeFeature "NG_INSTALL_DIR_CMAKE" "lib/cmake/${finalAttrs.pname}")
130
+
(lib.cmakeFeature "NG_INSTALL_DIR_PYTHON" python3Packages.python.sitePackages)
131
+
(lib.cmakeFeature "NG_INSTALL_DIR_RES" "share")
132
+
(lib.cmakeFeature "NG_INSTALL_DIR_INCLUDE" "include")
(lib.cmakeFeature "CMAKE_CXX_FLAGS" archFlags)
(lib.cmakeBool "USE_MPI" true)
(lib.cmakeBool "USE_MPI4PY" true)
···
(lib.cmakeBool "ENABLE_UNIT_TESTS" finalAttrs.finalPackage.doInstallCheck)
127
-
# mesh generation differs on x86_64 and aarch64 platform
128
-
# tests will fail on aarch64 platform
129
-
doInstallCheck = stdenv.hostPlatform.isx86_64;
146
+
__darwinAllowLocalNetworking = true;
152
+
comment = finalAttrs.meta.description;
153
+
desktopName = "Netgen Mesh Generator";
154
+
genericName = "3D Mesh Generator";
155
+
categories = [ "Science" ];
161
+
lib.optionalString stdenv.hostPlatform.isDarwin ''
162
+
rm $out/bin/{Netgen1,startup.sh}
163
+
mkdir -p $out/Applications/${finalAttrs.pname}.app/Contents/{MacOS,Resouces}
164
+
substituteInPlace $out/Info.plist --replace-fail "Netgen1" "netgen"
165
+
mv $out/Info.plist $out/Applications/${finalAttrs.pname}.app/Contents
166
+
mv $out/Netgen.icns $out/Applications/${finalAttrs.pname}.app/Contents/Resouces
167
+
ln -s $out/bin/netgen $out/Applications/${finalAttrs.pname}.app/Contents/MacOS/netgen
169
+
+ lib.optionalString stdenv.hostPlatform.isLinux ''
170
+
# Extract pngs from the Apple icon image and create
171
+
# the missing ones from the 512x512 image.
172
+
icns2png --extract ../netgen.icns
173
+
for size in 16 24 32 48 64 128 256 512; do
174
+
mkdir -pv $out/share/icons/hicolor/"$size"x"$size"/apps
175
+
if [ -e netgen_"$size"x"$size"x32.png ]
177
+
mv netgen_"$size"x"$size"x32.png $out/share/icons/hicolor/"$size"x"$size"/apps/netgen.png
179
+
convert -resize "$size"x"$size" netgen_512x512x32.png $out/share/icons/hicolor/"$size"x"$size"/apps/netgen.png
184
+
doInstallCheck = true;
export PYTHONPATH=$out/${python3Packages.python.sitePackages}:$PYTHONPATH
···
python3Packages.pytest-check
python3Packages.pytest-mpi
197
+
python3Packages.pythonImportsCheckHook
201
+
pythonImportsCheck = [ "netgen" ];
inherit avxSupport avx2Support avx512Support;
···
homepage = "https://ngsolve.org";
209
+
downloadPage = "https://github.com/NGSolve/netgen";
description = "Atomatic 3d tetrahedral mesh generator";
license = with lib.licenses; [
···
219
+
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ qbisi ];