gmsh: 3.13.1 -> 3.14.0 (#426043)

This commit is contained in:
Nick Cao
2025-07-27 13:10:46 -04:00
committed by GitHub
2 changed files with 51 additions and 34 deletions
+50 -33
View File
@@ -2,7 +2,8 @@
lib,
stdenv,
fetchurl,
fetchpatch,
makeDesktopItem,
copyDesktopItems,
cmake,
blas,
lapack,
@@ -16,22 +17,30 @@
xorg,
opencascade-occt,
llvmPackages,
python ? null,
python3Packages,
enablePython ? false,
}:
assert (!blas.isILP64) && (!lapack.isILP64);
assert enablePython -> (python != null);
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "gmsh";
version = "4.13.1";
version = "4.14.0";
src = fetchurl {
url = "https://gmsh.info/src/gmsh-${version}-source.tgz";
hash = "sha256-d5chRfQxcmAm1QWWpqRPs8HJXCElUhjWaVWAa4btvo0=";
url = "https://gmsh.info/src/gmsh-${finalAttrs.version}-source.tgz";
hash = "sha256-2019ogYumkNWqCCDITirmfl69jiL/rIVmaLq37C3aig=";
};
nativeBuildInputs = [
cmake
gfortran
]
++ lib.optional (
enablePython && stdenv.buildPlatform == stdenv.hostPlatform
) python3Packages.pythonImportsCheckHook
++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems;
buildInputs = [
blas
lapack
@@ -54,22 +63,7 @@ stdenv.mkDerivation rec {
xorg.libSM
xorg.libICE
]
++ lib.optional stdenv.cc.isClang llvmPackages.openmp
++ lib.optional enablePython python;
enableParallelBuilding = true;
patches = [
(fetchpatch {
url = "https://gitlab.onelab.info/gmsh/gmsh/-/commit/7d5094fb0a5245cb435afd3f3e8c35e2ecfe70fd.patch";
hash = "sha256-3atm1NGsMI4KEct2xakRG6EasRpF6YRI4raoVYxBV4g=";
})
];
postPatch = ''
substituteInPlace api/gmsh.py \
--replace-fail 'find_library("gmsh")' \"$out/lib/libgmsh${stdenv.hostPlatform.extensions.sharedLibrary}\"
'';
++ lib.optional stdenv.cc.isClang llvmPackages.openmp;
# N.B. the shared object is used by bindings
cmakeFlags = [
@@ -78,23 +72,46 @@ stdenv.mkDerivation rec {
"-DENABLE_OPENMP=ON"
];
nativeBuildInputs = [
cmake
gfortran
doCheck = true;
desktopItems = [
(makeDesktopItem {
name = "gmsh";
exec = "gmsh";
comment = finalAttrs.meta.description;
desktopName = "Gmsh";
genericName = "3D Mesh Generator";
categories = [
"Science"
"Math"
];
icon = "gmsh";
})
];
postFixup = lib.optionalString enablePython ''
mkdir -p $out/lib/python${python.pythonVersion}/site-packages
mv $out/lib/gmsh.py $out/lib/python${python.pythonVersion}/site-packages
mv $out/lib/*.dist-info $out/lib/python${python.pythonVersion}/site-packages
'';
postInstall =
let
logo = fetchurl {
url = "https://salsa.debian.org/science-team/gmsh/-/raw/d2d8b4e3488c7b0f51879f809f624b537b4bd28f/debian/gmsh.svg";
hash = "sha256-p69Cju3bn1ShWmESOSOmJj0x3IYDGI9oD25SFTh2GLo=";
};
in
lib.optionalString stdenv.hostPlatform.isLinux ''
install -Dm644 ${logo} $out/share/icons/hicolor/scalable/apps/gmsh.svg
''
+ lib.optionalString enablePython ''
mkdir -p $out/${python3Packages.python.sitePackages}
mv $out/lib/gmsh.py $out/${python3Packages.python.sitePackages}
mv $out/lib/*.dist-info $out/${python3Packages.python.sitePackages}
'';
doCheck = true;
pythonImportsCheck = [ "gmsh" ];
meta = {
description = "Three-dimensional finite element mesh generator";
mainProgram = "gmsh";
homepage = "https://gmsh.info/";
changelog = "https://gitlab.onelab.info/gmsh/gmsh/-/releases/gmsh_${lib.concatStringsSep "_" (lib.versions.splitVersion finalAttrs.version)}#changelog";
license = lib.licenses.gpl2Plus;
};
}
})
+1 -1
View File
@@ -5897,7 +5897,7 @@ self: super: with self; {
gmsh = toPythonModule (
pkgs.gmsh.override {
inherit (self) python;
python3Packages = self;
enablePython = true;
}
);