Skip to content

Commit

Permalink
inkscape-extensions.inkstitch: init at 3.1.0 (#358993)
Browse files Browse the repository at this point in the history
* pyembroidery: init at 1.5.1-unstable-2024-06-06

* inkscape-extensions.inkstitch: init at 3.1.0
  • Loading branch information
pluiedev authored Dec 10, 2024
1 parent 027b293 commit 7413ed0
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/applications/graphics/inkscape/extensions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
mkdir -p $out/share/inkscape/extensions
cp ${inkcut}/share/inkscape/extensions/* $out/share/inkscape/extensions
'');
inkstitch = callPackage ./extensions/inkstitch { };
silhouette = callPackage ./extensions/silhouette { };
textext = callPackage ./extensions/textext {
pdflatex = texlive.combined.scheme-basic;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
lib,
python3,
fetchFromGitHub,
gettext,
}:
let
version = "3.1.0";
in
python3.pkgs.buildPythonApplication {
pname = "inkstitch";
inherit version;
pyproject = false; # Uses a Makefile (yikes)

src = fetchFromGitHub {
owner = "inkstitch";
repo = "inkstitch";
rev = "refs/tags/v${version}";
hash = "sha256-CGhJsDRhElgemNv2BXqZr6Vi5EyBArFak7Duz545ivY=";
};

nativeBuildInputs = [
gettext
];

dependencies =
with python3.pkgs;
[
pyembroidery
inkex
wxpython
networkx
shapely
lxml
appdirs
numpy
jinja2
requests
# Upstream wants colormath2 yet still refers to it as colormath. Curious.
colormath
flask
fonttools
trimesh
scipy
diskcache
flask-cors
]
# Inkstitch uses the builtin tomllib instead when Python >=3.11
++ lib.optional (pythonOlder "3.11") tomli;

makeFlags = [ "manual" ];

installPhase = ''
runHook preInstall
mkdir -p $out/share/inkscape/extensions
cp -a inx $out/share/inkscape/extensions/inkstitch
runHook postInstall
'';

nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];

meta = {
description = "Inkscape extension for machine embroidery design";
homepage = "https://inkstitch.org/";
license = with lib.licenses; [ gpl3Plus ];
maintainers = with lib.maintainers; [ pluiedev ];
};
}
54 changes: 54 additions & 0 deletions pkgs/development/python-modules/pyembroidery/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,

setuptools,
pytestCheckHook,
}:
let
pname = "pyembroidery";

# Mysteriously, the latest version published on PyPI has the version of 1.5.1,
# but the latest GitHub version stopped at 1.2.39. Further more Ink/Stitch requires the .exceptions
# module which is absent from the PyPI release.
# I guess this is *technically* the correct version name, but... yikes.
version = "1.5.1-unstable-2024-06-26";
in
buildPythonPackage {
inherit pname version;
pyproject = true;

src = fetchFromGitHub {
owner = "inkstitch";
repo = "pyembroidery";
rev = "b603b8d2b2bf91b5b0823a8a619562de5fd756e7";
hash = "sha256-cnWQ/ZScdXTFMLHdceyCLjgEkcwv3KuZHwXWlsYCcBA=";
};

build-system = [
setuptools
];

pythonImportsCheck = [
"pyembroidery"
];

nativeCheckInputs = [
pytestCheckHook
];

# Failed assertions.
# See https://github.com/inkstitch/pyembroidery/issues/108
disabledTests = [
"test_generic_write_gcode"
"test_jef_trims_commands"
];

meta = {
description = "Python library for the reading and writing of embroidery files";
homepage = "https://github.com/inkstitch/pyembroidery";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [ pluiedev ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10229,6 +10229,8 @@ self: super: with self; {

pybars3 = callPackage ../development/python-modules/pybars3 { };

pyembroidery = callPackage ../development/python-modules/pyembroidery { };

pymeta3 = callPackage ../development/python-modules/pymeta3 { };

pypemicro = callPackage ../development/python-modules/pypemicro { };
Expand Down

0 comments on commit 7413ed0

Please sign in to comment.