diff --git a/expressions/build123d.nix b/expressions/build123d.nix new file mode 100644 index 0000000..f6ff013 --- /dev/null +++ b/expressions/build123d.nix @@ -0,0 +1,57 @@ +{ + buildPythonPackage, + fetchFromGitHub, + # Buildtime dependencies + git, + pytestCheckHook, + setuptools-scm, + # Runtime dependencies + anytree, + ezdxf, + ipython, + numpy, + ocp, + ocpsvg, + py-lib3mf, + scipy, + svgpathtools, + trianglesolver, + vtk, +}: let + pname = "build123d"; + # TODO: current version is 0.5.0 but it requires lib3mf version 2.3.1 nix + # currently has 2.2.0 packaged. Either need to package updated version + # ourself our wait for upstream + version = "0.4.0"; + src = fetchFromGitHub { + owner = "gumyr"; + repo = pname; + rev = "v${version}"; + deepClone = true; + hash = "sha256-+G+sjbRH8HbO8Gt6QRRjVQiwUNKTiqnGJdvjtTRFVgA="; + }; +in + buildPythonPackage { + inherit src pname version; + format = "pyproject"; + + nativeBuildInputs = [ + git + pytestCheckHook + setuptools-scm + ]; + + propagatedBuildInputs = [ + anytree + ezdxf + ipython + numpy + ocp + ocpsvg + py-lib3mf + scipy + svgpathtools + trianglesolver + vtk + ]; + } diff --git a/expressions/py-overrides.nix b/expressions/py-overrides.nix index 0788bf1..8083bf0 100644 --- a/expressions/py-overrides.nix +++ b/expressions/py-overrides.nix @@ -49,4 +49,6 @@ py-lib3mf = self.callPackage ./py-lib3mf.nix {}; trianglesolver = self.callPackage ./trianglesolver.nix {}; + + build123d = self.callPackage ./build123d.nix {}; } diff --git a/flake.nix b/flake.nix index a38ff91..c568b9f 100644 --- a/flake.nix +++ b/flake.nix @@ -74,7 +74,7 @@ cq-warehouse = python.pkgs.callPackage ./expressions/cq-warehouse.nix { }; in rec { packages = { - inherit (python.pkgs) cadquery; + inherit (python.pkgs) cadquery build123d; inherit cq-kit cq-warehouse; cq-editor = pkgs.libsForQt5.callPackage ./expressions/cq-editor.nix {