- drop unneeded pcre build dependency - Ignore tolerance failures on riscv64 - update to version 6.2.2406 * no changelog provided - Update patch: * 0001-Include-filesystem-from-experimental-for-GCC-7.patch - Enable python tests on Tumbleweed (requires python-check). - Fix crash in boundarylayer tests, add * 0001-Fix-invalid-string-access-in-BoundaryLayerTool.patch - Amend patches for Leap 15.x * 0001-Include-filesystem-from-experimental-for-GCC-7.patch - Fix crash due to wrong initialization order, add * 0001-Fix-static-initialization-order-for-UserFormatRegist.patch - Remove erroneous dependency on the python module, add * 0001-Do-not-EXPORT-python-modules-as-CMake-targets.patch - update to version 6.2.2404 * no changelog provided - Rebase: * 0001-Include-filesystem-from-experimental-for-GCC-7.patch * 0001-Disable-backtrace-generation.patch - Add: * 0001-Fix-ODR-violation-for-struct-class-Line.patch * 0002-Add-missing-includes-for-std-string-std-cerr-fix-nam.patch - update to version 6.2.2301 * no changelog provided - Drop upstream patches: * 0001-Optionally-prefer-system-wide-pybind11.patch * 0001-Fix-use-of-unitialized-stlgeometry-member-in-constru.patch * 0001-Ignore-invalid-unknown-types-in-pybind11-docstrings.patch * 0001-fix-building-with-new-ffmpeg.patch - Add build _constraints - Don't write python bytecode during stubgen or test execution, make python bindings subpackage reproducible. - Use Catch2 < 3.0. Unfortunately Catch2 3.x is API incompatible with Catch2 2.x. - Add 0001-fix-building-with-new-ffmpeg.patch - update to version 6.2.2204 * no changelog provided - Split nggui library package, to avoid pulling in otherwise unneeded dependencies. - Limit dependencies to ffmpeg-4 variant and older, see upstream issue https://github.com/NGSolve/netgen/issues/112 - Generate python stubs, add 0001-Ignore-invalid-unknown-types-in-pybind11-docstrings.patch - update to version 6.2.2203 * no changelog provided - Drop obsolete/upstream patches: * 0001-Set-explicit-OBJECT-library-type-for-internal-togl.patch * 0001-Throw-in-case-enum-value-is-unhandled.patch * 0001-Throw-Exception-when-shape-has-invalid-type.patch * 0001-Fix-signedness-for-ARM-Neon-mask-type.patch - Add patches: * 0001-Link-nggui-to-FFMPEG-und-JPEG-libraries-when-needed.patch * 0001-Avoid-installation-of-Togl-static-library.patch * 0001-Fix-use-of-unitialized-stlgeometry-member-in-constru.patch * 0001-Include-filesystem-from-experimental-for-GCC-7.patch * 0001-Fix-netgen-executable-and-library-RUNPATHs.patch - Fix RUNPATH also for Leap/SLE 15.4, which now uses CMAKE_SKIP_INSTALL_RPATH=ON by default. - Fix RUNPATH on Leap 15.x - update to version 6.2.2105 * no changelog provided - Drop upstream 0001-Fix-GetTimeCounter-for-Aarch64-variants.patch - Add patches: * 0001-Optionally-prefer-system-wide-pybind11.patch * 0001-Throw-Exception-when-shape-has-invalid-type.patch * 0001-Fix-signedness-for-ARM-Neon-mask-type.patch - Exclude all 32bit archs, no longer supported upstream (fails to build). - update to version 6.2.2101 * no changelog provided - Properly split package: libraries (as required by e.g FreeCAD), python-bindings, examples and standalone GUI. - Drop upstream fix_build.patch - Replace 0001-Allow-compilation-on-archs-beyond-x86.patch with -DUSE_NATIVE_ARCH=OFF - Fix build: * Add 0001-Disable-backtrace-generation.patch, do not call "nm" or "addr2line" from library. * Add 0001-Set-explicit-OBJECT-library-type-for-internal-togl.patch * Add 0001-Throw-in-case-enum-value-is-unhandled.patch * Disable -Wl,--no-undefined, libs have circular dependencies * Add 0001-Fix-GetTimeCounter-for-Aarch64-variants.patch - Enable Catch2 unittests, add 0001-Optionally-use-system-provided-Catch2.patch - Fix build on ARM and PPC, only include immintrin.h when SSE is available - Correct License:, netgen has always been LGPL-2.1-only. - Package License file. - Remove boost BuildRequires:, it is not used at all. - Guard Requires: occt-devel in devel package with bcond, so it does not get pulled in if netgen is built without OpenCascade. - switch to gcc7 - Remove ldconfig calls since there are only dlopened plugins, no standard libraries. - Wrap description. - Use convenient %make_install, and run fdupes. - update to version 6.2.1810 obsoletes: allow_fine_curves.patch occ-pi-constant.patch do_stl_init.patch - switch to cmake, obsoletes AM_PROG_AR.patch - use obs_scm, obsoletes svnfetch.sh and netgen.sh - move include files into /usr/include/netgen/ - use -fno-strict-aliasing - add some extra header wrapper files missed by FreeCAD - switch to OpenCASCADE 7.2.0 - switch to OpenCASCADE 7.1.0 and newer boost - enable python for openSUSE Tumbleweed - Using source service to follow git master (pre-6.1) - use new oce instead of OpenCASCADE - enable openmpi - use fixes for rpath from Johannes Obermayer - Changed to upstream version - /usr/bin/netgen was a policy violation, -> /usr/lib/netgen - Pulling git snapshot 5.1-dev, as the official 5.0.0 release only compiles with _MSC_VER; Ng_stl_Init() missing otherwise - added full autoconf tooling to spec-file, sigh... - renamed /usr/bin/netgen.sh to /usr/bin/netgen - update to 5.0.0 * upstream changelog is empty - obsolete fully upstreamed occ-6.5.0 patch - patching ng/Makefile to find -lTogl1.7 - improved netgen.sh to allow parameters and preserve cwd. - allow_fine_curves.patch added, finer defaults, extended slider range - remove unneeded lam and lam-devel package requirement - new version 4.9.13 - added patch occ-6.5.0.patch taken from debian package - fixed compiling errors on gcc44 - new upstream version 4.9.11 - new upstream version OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=55
263 lines
8.3 KiB
RPMSpec
263 lines
8.3 KiB
RPMSpec
#
|
|
# spec file for package netgen
|
|
#
|
|
# Copyright (c) 2025 SUSE LLC and contributors
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%bcond_with openmpi
|
|
%bcond_without ffmpeg
|
|
%bcond_without opencascade
|
|
%if 0%{?suse_version} > 1500
|
|
%bcond_without pytest
|
|
%else
|
|
# pytest-check is not available
|
|
%bcond_with pytest
|
|
%endif
|
|
|
|
Name: netgen
|
|
Version: 6.2.2406
|
|
Release: 0
|
|
Summary: Automatic 3D tetrahedral mesh generator
|
|
License: LGPL-2.1-only
|
|
Group: Productivity/Graphics/CAD
|
|
URL: https://ngsolve.org/
|
|
Source0: https://github.com/NGSolve/netgen/archive/refs/tags/v%{version}.tar.gz#/netgen-%{version}.tar.gz
|
|
# PATCH-FIX-OPENSUSE
|
|
Patch1: 0001-Disable-backtrace-generation.patch
|
|
# PATCH-FIX-OPENSUSE -- Allow to disable download of Catch2
|
|
Patch4: 0001-Optionally-use-system-provided-Catch2.patch
|
|
# PATCH-FIX-UPSTREAM
|
|
Patch6: 0001-Link-nggui-to-FFMPEG-und-JPEG-libraries-when-needed.patch
|
|
# PATCH-FIX-UPSTREAM
|
|
Patch7: 0001-Avoid-installation-of-Togl-static-library.patch
|
|
# PATCH-FIX-OPENSUSE
|
|
Patch9: 0001-Include-filesystem-from-experimental-for-GCC-7.patch
|
|
# PATCH-FIX-UPSTREAM
|
|
Patch10: 0001-Fix-netgen-executable-and-library-RUNPATHs.patch
|
|
# PATCH-FIX-OPENSUSE
|
|
Patch11: 0001-Fix-ODR-violation-for-struct-class-Line.patch
|
|
# PATCH-FIX-OPENSUSE
|
|
Patch12: 0002-Add-missing-includes-for-std-string-std-cerr-fix-nam.patch
|
|
# PATCH-FIX-UPSTREAM -- https://github.com/NGSolve/netgen/issues/200
|
|
Patch13: 0001-Do-not-EXPORT-python-modules-as-CMake-targets.patch
|
|
# PATCH-FIX-UPSTREAM -- https://github.com/NGSolve/netgen/issues/201
|
|
Patch14: 0001-Fix-static-initialization-order-for-UserFormatRegist.patch
|
|
# PATCH-FIX-UPSTREAM -- https://github.com/NGSolve/netgen/issues/203
|
|
Patch15: 0001-Fix-invalid-string-access-in-BoundaryLayerTool.patch
|
|
%if %{with opencascade}
|
|
BuildRequires: occt-devel
|
|
BuildRequires: (pkgconfig(catch2) >= 2.13.4 with pkgconfig(catch2) < 3)
|
|
BuildRequires: pkgconfig(fontconfig)
|
|
BuildRequires: pkgconfig(xi)
|
|
%endif
|
|
BuildRequires: cmake
|
|
BuildRequires: fdupes
|
|
BuildRequires: gcc-c++ >= 7
|
|
BuildRequires: git-core
|
|
BuildRequires: libjpeg-devel
|
|
BuildRequires: python3-devel
|
|
BuildRequires: python3-numpy
|
|
BuildRequires: python3-pybind11-devel >= 2.7.0
|
|
BuildRequires: python3-pybind11-stubgen
|
|
%if %{with pytest}
|
|
BuildRequires: python3-pytest
|
|
BuildRequires: python3-pytest-check
|
|
%endif
|
|
BuildRequires: pkgconfig(gl)
|
|
BuildRequires: pkgconfig(glu)
|
|
BuildRequires: pkgconfig(icu-uc)
|
|
BuildRequires: pkgconfig(tcl)
|
|
BuildRequires: pkgconfig(tk)
|
|
BuildRequires: pkgconfig(x11)
|
|
BuildRequires: pkgconfig(xmu)
|
|
BuildRequires: pkgconfig(zlib)
|
|
%if %{with openmpi}
|
|
BuildRequires: metis-devel
|
|
BuildRequires: openmpi-devel
|
|
%endif
|
|
%if %{with ffmpeg}
|
|
BuildRequires: pkgconfig(libavcodec)
|
|
BuildRequires: pkgconfig(libavformat)
|
|
BuildRequires: pkgconfig(libavutil)
|
|
BuildRequires: pkgconfig(libswscale)
|
|
%endif
|
|
BuildRequires: xz
|
|
# x86 (32bit) is no longer supported upstream. Also exclude other 32 bit archs
|
|
ExcludeArch: %{ix86} %{arm} ppc
|
|
Recommends: %{name}-examples
|
|
|
|
%description
|
|
NETGEN is an automatic 3D tetrahedral mesh generator. It accepts
|
|
input from constructive solid geometry (CSG) or boundary
|
|
representation (BRep) from STL file format. The connection to a
|
|
geometry kernel allows the handling of IGES and STEP files. NETGEN
|
|
contains modules for mesh optimization and hierarchical mesh
|
|
refinement.
|
|
|
|
%package -n netgen-libs
|
|
Summary: NETGEN mesher libraries
|
|
Group: System/Libraries
|
|
Conflicts: %{name} < %{version}
|
|
Provides: %{name}:%{_libdir}/netgen/libngcore.so
|
|
|
|
%description -n netgen-libs
|
|
NETGEN mesh generator shared libraries.
|
|
|
|
%package -n netgen-gui-libs
|
|
Summary: NETGEN mesher library - GUI part
|
|
Group: System/Libraries
|
|
Conflicts: netgen-libs < 6.2.2204
|
|
Provides: %{name}:%{_libdir}/netgen/libnggui.so
|
|
|
|
%description -n netgen-gui-libs
|
|
GUI support for NETGEN mesh generator shared libraries.
|
|
|
|
%package devel
|
|
Summary: Development files for netgen
|
|
# Should not depend on the netgen binary, but the cmake config is broken
|
|
Group: Development/Libraries/C and C++
|
|
Requires: %{name} = %{version}
|
|
Requires: netgen-libs = %{version}
|
|
%if %{with opencascade}
|
|
Requires: occt-devel
|
|
%endif
|
|
|
|
%description devel
|
|
Development files for NETGEN.
|
|
|
|
%package examples
|
|
Summary: NETGEN examples
|
|
Group: Productivity/Graphics/CAD
|
|
Requires: %{name} = %{version}
|
|
Conflicts: %{name} < %{version}
|
|
Provides: %{name}:%{_datadir}/netgen/cube.geo
|
|
BuildArch: noarch
|
|
|
|
%description examples
|
|
Various example geometry data for NETGEN.
|
|
|
|
%package -n python3-%{name}
|
|
Summary: NETGEN python bindings
|
|
Group: Productivity/Graphics/CAD
|
|
Conflicts: %{name} < %{version}
|
|
Provides: %{name}:%{python3_sitearch}/netgen/libngpy.so
|
|
|
|
%description -n python3-%{name}
|
|
Python bindings for NETGEN.
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
%build
|
|
%global optflags %{optflags} -DPYBIND11_HAS_FILESYSTEM_IS_OPTIONAL=1
|
|
|
|
# Work around broken version detection
|
|
echo "v%{version}-0-0" > ./version.txt
|
|
|
|
# Do not error out on undefined symbols - there is a circular dependency
|
|
# between libvisual and libmesh ...
|
|
%cmake \
|
|
-DOpenGL_GL_PREFERENCE=GLVND \
|
|
-DUSE_SUPERBUILD=OFF \
|
|
-DCMAKE_SHARED_LINKER_FLAGS="-flto=auto -Wl,--as-needed -Wl,--warn-unresolved-symbols -Wl,-z,now" \
|
|
-DNG_INSTALL_DIR_INCLUDE=%{_includedir}/netgen \
|
|
-DNG_INSTALL_DIR_LIB=%{_libdir}/netgen \
|
|
-DCMAKE_SKIP_RPATH:BOOL=OFF \
|
|
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=OFF \
|
|
-DCMAKE_SKIP_BUILD_RPATH=ON \
|
|
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
|
|
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
|
|
-DENABLE_UNIT_TESTS=ON \
|
|
-DDOWNLOAD_DEPENDENCIES=OFF \
|
|
-DUSE_NATIVE_ARCH=OFF \
|
|
-DUSE_GUI=ON \
|
|
-DUSE_PYTHON=ON \
|
|
-DPREFER_SYSTEM_PYBIND11=ON \
|
|
-DBUILD_STUB_FILES=OFF \
|
|
-DNG_INSTALL_DIR_PYTHON=%{python3_sitearch} \
|
|
%if %{with openmpi}
|
|
-DUSE_MPI=ON \
|
|
%else
|
|
-DUSE_MPI=OFF \
|
|
%endif
|
|
-DUSE_OCC=%{?with_opencascade:ON}%{!?with_opencascade:OFF} \
|
|
-DUSE_JPEG=ON \
|
|
%if %{with ffmpeg}
|
|
-DUSE_MPEG=ON \
|
|
%else
|
|
-DUSE_MPEG=OFF \
|
|
%endif
|
|
..
|
|
|
|
%cmake_build
|
|
|
|
%install
|
|
# Stubgen imports the just created netgen bindings -- https://github.com/NGSolve/netgen/issues/132
|
|
export PYTHONPATH=%{buildroot}%{python3_sitearch}
|
|
# Avoid creating invalid bytecode fails via stubgen
|
|
export PYTHONDONTWRITEBYTECODE=1
|
|
%cmake_install
|
|
rm -Rf %{buildroot}%{_datadir}/%{name}/doc
|
|
# https://github.com/NGSolve/netgen/issues/126
|
|
find %{buildroot}%{_libdir}/ -iname \*.a -print -delete
|
|
# Remove private attributes from stubs
|
|
find %{buildroot}%{python3_sitearch} -iname \*.pyi -exec sed -i -e '/^_[^_].*=/ d' '{}' \;
|
|
|
|
%fdupes %{buildroot}/%{_prefix}
|
|
|
|
%check
|
|
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}/%{name}
|
|
# Test if the binary actually works
|
|
%{buildroot}/%{_bindir}/netgen -batchmode || true
|
|
%ctest --exclude-regex pytest
|
|
|
|
%if %{with pytest}
|
|
# run manually, to see progress/failures
|
|
# tolerance failures on aarch64 and ppc64le, see https://github.com/NGSolve/netgen/issues/167
|
|
%ifarch %{arm64} %{ppc64} riscv64
|
|
export PYTEST_ADDOPTS='-k "not (boxcyl.geo-mp11-5 or cylsphere.geo-mp58-4 or hinge.stl-mp93-5 or part1.stl-mp123-1 or part1.stl-mp126-4 or sculpture.geo-mp143-4 or sphereincube.geo-mp162-5 or twobricks.geo-mp195-2 or twocubes.geo-mp201-2)"'
|
|
%endif
|
|
export COLUMNS=120
|
|
(cd tests/pytest; %{python3_pytest_arch})
|
|
%endif
|
|
|
|
%files
|
|
%license LICENSE
|
|
%doc doc/*.pdf
|
|
%{_bindir}/*
|
|
|
|
%files examples
|
|
%{_datadir}/netgen
|
|
|
|
%files -n netgen-libs
|
|
%dir %{_libdir}/netgen
|
|
%{_libdir}/netgen/libngcore.so
|
|
%{_libdir}/netgen/libnglib.so
|
|
|
|
%files -n netgen-gui-libs
|
|
%{_libdir}/netgen/libnggui.so
|
|
|
|
%files -n python3-%{name}
|
|
%{python3_sitearch}/netgen
|
|
%{python3_sitearch}/pyngcore
|
|
%{python3_sitearch}/netgen_mesher-*.egg-info
|
|
|
|
%files devel
|
|
%dir %{_prefix}/lib/cmake
|
|
%{_includedir}/netgen
|
|
%{_prefix}/lib/cmake/netgen
|
|
|
|
%changelog
|