From f20e6ac2666e78da06e2b7aa7dcec312d9c6c14e Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Fri, 7 Nov 2025 11:18:16 +0800 Subject: [PATCH] python3Packages.pymeshlab: move to python modules Co-authored-by: Guilhem Saurel --- .../python-modules}/pymeshlab/default.nix | 31 ++++++++++--------- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) rename pkgs/{applications/graphics => development/python-modules}/pymeshlab/default.nix (80%) diff --git a/pkgs/applications/graphics/pymeshlab/default.nix b/pkgs/development/python-modules/pymeshlab/default.nix similarity index 80% rename from pkgs/applications/graphics/pymeshlab/default.nix rename to pkgs/development/python-modules/pymeshlab/default.nix index ec6edb230aff..a95ebb42bf3e 100644 --- a/pkgs/applications/graphics/pymeshlab/default.nix +++ b/pkgs/development/python-modules/pymeshlab/default.nix @@ -4,13 +4,16 @@ stdenv, fetchFromGitHub, fetchpatch, + buildPythonPackage, + python, # nativeBuildInputs cmake, - python3Packages, + pybind11, # propagatedBuildInputs meshlab, + numpy, # buildInputs libsForQt5, @@ -19,14 +22,18 @@ vcg, }: -stdenv.mkDerivation (finalAttrs: { - pname = "pymeshlab"; +let version = "2025.7"; +in +buildPythonPackage { + inherit version; + pname = "pymeshlab"; + pyproject = false; src = fetchFromGitHub { owner = "cnr-isti-vclab"; repo = "pymeshlab"; - tag = "v${finalAttrs.version}"; + tag = "v${version}"; hash = "sha256-LCR2/AyX9uVX4xhZareUL6YlpUsCFiGDMBB5nFp+H6k="; }; @@ -42,16 +49,12 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake - python3Packages.pybind11 - ]; - - nativeCheckInputs = [ - python3Packages.pythonImportsCheckHook + pybind11 ]; propagatedBuildInputs = [ meshlab - python3Packages.numpy + numpy ]; buildInputs = [ @@ -66,7 +69,7 @@ stdenv.mkDerivation (finalAttrs: { dontWrapQtApps = true; cmakeFlags = [ - "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/${python3Packages.python.sitePackages}/pymeshlab" + "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/${python.sitePackages}/pymeshlab" ]; # Get io & filter plugins from meshlab, to avoild render, decorate & edit ones @@ -80,7 +83,7 @@ stdenv.mkDerivation (finalAttrs: { pyPlugins = if stdenv.hostPlatform.isDarwin then "PlugIns" else "lib/plugins"; in '' - install -D -t $out/${python3Packages.python.sitePackages}/pymeshlab/${pyPlugins} \ + install -D -t $out/${python.sitePackages}/pymeshlab/${pyPlugins} \ ${meshlab}/${plugins}/libio_* \ ${meshlab}/${plugins}/libfilter_* ''; @@ -88,7 +91,7 @@ stdenv.mkDerivation (finalAttrs: { postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' patchelf \ --add-needed ${meshlab}/lib/meshlab/libmeshlab-common.so \ - $out/${python3Packages.python.sitePackages}/pymeshlab/pmeshlab.*.so + $out/${python.sitePackages}/pymeshlab/pmeshlab.*.so ''; pythonImportsCheck = [ "pymeshlab" ]; @@ -100,4 +103,4 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ nim65s ]; platforms = with lib.platforms; linux ++ darwin; }; -}) +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 41d43ab07135..f552855345f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13619,7 +13619,7 @@ self: super: with self; { pyment = callPackage ../development/python-modules/pyment { }; - pymeshlab = toPythonModule (pkgs.libsForQt5.callPackage ../applications/graphics/pymeshlab { }); + pymeshlab = callPackage ../development/python-modules/pymeshlab { }; pymeta3 = callPackage ../development/python-modules/pymeta3 { };