diff --git a/flake.nix b/flake.nix index 2c15142..9c936f7 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,7 @@ jlink = final.callPackage ./packages/jlink { }; zephyrPackages = final.callPackage ./packages/zephyr { }; - inherit (final.python3.pkgs) axicli; + inherit (final.python3.pkgs) axicli vpype; inkscape-extensions = prev.inkscape-extensions // { axidraw = final.callPackage ./packages/axidraw/inkscape.nix { }; @@ -54,6 +54,9 @@ pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ (pythonFinal: pythonPrev: { + pnoise = final.callPackage ./packages/pnoise { + python3 = pythonFinal; + }; vpype = final.callPackage ./packages/vpype { python3 = pythonFinal; }; } // (final.callPackage ./packages/axidraw/modules.nix { diff --git a/packages/pnoise/default.nix b/packages/pnoise/default.nix new file mode 100644 index 0000000..b3ca3dd --- /dev/null +++ b/packages/pnoise/default.nix @@ -0,0 +1,24 @@ +{ lib, python3, fetchFromGitHub }: + +python3.buildPythonPackage rec { + pname = "pnoise"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "plottertools"; + repo = "pnoise"; + rev = version; + hash = "sha256-JwWzLvgCNSLRs/ToZNFH6fN6VLEsQTmsgxxkugwjA9k="; + }; + + format = "setuptools"; + + propagatedBuildInputs = with python3; [ numpy ]; + + meta = with lib; { + description = "Vectorized port of Processing noise() function"; + homepage = "https://github.com/plottertools/pnoise"; + license = with licenses; [ lgpl21Only ]; + maintainers = with maintainers; [ artemist ]; + }; +} diff --git a/packages/vpype/default.nix b/packages/vpype/default.nix new file mode 100644 index 0000000..86492ae --- /dev/null +++ b/packages/vpype/default.nix @@ -0,0 +1,49 @@ +{ lib, python3, fetchFromGitHub, withViewer ? true }: + +python3.buildPythonPackage rec { + pname = "vpype"; + version = "1.14.0"; + + src = fetchFromGitHub { + owner = "abey79"; + repo = "vpype"; + rev = version; + hash = "sha256-jm6aUpi9Ek2To47W/H62jWlZT7zgV5Dduv18yoPrUkA="; + }; + + format = "pyproject"; + + nativeBuildInputs = with python3; [ poetry-core ]; + + propagatedBuildInputs = with python3; + ([ + asteval + cachetools + click + multiprocess + numpy + pnoise + pyphen + scipy + shapely + svgelements + svgwrite + tomli + ] ++ lib.optionals withViewer [ + glcontext + matplotlib + moderngl + pillow + pyside6 + ]); + + # No checks since they want OpenGL and a GUI + + meta = with lib; { + description = + "The Swiss-Army-knife command-line tool for plotter vector graphics"; + homepage = "https://vpype.readthedocs.io/en/latest/"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ artemist ]; + }; +}