Commit 485fd2c0 authored by qbisi's avatar qbisi
Browse files

python3Packages.gmsh: use python3Packages

parent f02df8c2
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -16,12 +16,11 @@
  xorg,
  opencascade-occt,
  llvmPackages,
  python ? null,
  python3Packages,
  enablePython ? false,
}:

assert (!blas.isILP64) && (!lapack.isILP64);
assert enablePython -> (python != null);

stdenv.mkDerivation rec {
  pname = "gmsh";
@@ -32,6 +31,14 @@ stdenv.mkDerivation rec {
    hash = "sha256-d5chRfQxcmAm1QWWpqRPs8HJXCElUhjWaVWAa4btvo0=";
  };

  nativeBuildInputs = [
    cmake
    gfortran
  ]
  ++ lib.optional (
    enablePython && stdenv.buildPlatform == stdenv.hostPlatform
  ) python3Packages.pythonImportsCheckHook;

  buildInputs = [
    blas
    lapack
@@ -54,8 +61,7 @@ stdenv.mkDerivation rec {
    xorg.libSM
    xorg.libICE
  ]
  ++ lib.optional stdenv.cc.isClang llvmPackages.openmp
  ++ lib.optional enablePython python;
  ++ lib.optional stdenv.cc.isClang llvmPackages.openmp;

  patches = [
    (fetchpatch {
@@ -76,18 +82,15 @@ stdenv.mkDerivation rec {
    "-DENABLE_OPENMP=ON"
  ];

  nativeBuildInputs = [
    cmake
    gfortran
  ];
  doCheck = true;

  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 = 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";
+1 −1
Original line number Diff line number Diff line
@@ -5885,7 +5885,7 @@ self: super: with self; {
  gmsh = toPythonModule (
    pkgs.gmsh.override {
      inherit (self) python;
      python3Packages = self;
      enablePython = true;
    }
  );