summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Pisemsky <evgeny@pisemsky.com>2022-02-11 19:55:13 +0300
committerLudovic Courtès <ludo@gnu.org>2022-03-06 22:49:47 +0100
commitb16e17f34c8803ac8510cfbc6f5d766e1e564939 (patch)
tree047b54d1df9b6fc4649f74bb00dfefc47743fa8a
parent8b426eb15585965f6dc950b29c6c76a87014b723 (diff)
downloadguix-patches-b16e17f34c8803ac8510cfbc6f5d766e1e564939.tar
guix-patches-b16e17f34c8803ac8510cfbc6f5d766e1e564939.tar.gz
gnu: Add python-stltools.
* gnu/packages/python-xyz.scm (python-stltools): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/packages/python-xyz.scm47
1 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d3d7b7160d..8b51bfb3d1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -116,6 +116,7 @@
;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022 Aleksandr Vityazev <avityazev@posteo.org>
+;;; Copyright © 2022 Evgeny Pisemsky <evgeny@pisemsky.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29034,3 +29035,49 @@ async I/O support.")
used by type-checking tools like mypy, PyCharm, pytype etc. to check code that
uses ujson.")
(license license:asl2.0)))
+
+(define-public python-stltools
+ (package
+ (name "python-stltools")
+ (version "2022.01.20")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rsmith-nl/stltools")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1k6dhszza4lpy46qffaqx5zr70ikfqqysbacy7zabnrvz09fd4rs"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:use-setuptools? #f
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'build)
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((moddir (string-append (site-packages inputs outputs) "/stltools"))
+ (bindir (string-append (assoc-ref outputs "out") "/bin")))
+ (copy-recursively "stltools" moddir)
+ (mkdir-p bindir)
+ (for-each
+ (lambda (script)
+ (let ((source (string-append script ".py"))
+ (target (string-append bindir "/" script)))
+ (copy-file source target)
+ (chmod target #o555)))
+ '("stl2pov" "stl2ps" "stl2pdf" "stlinfo")))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "py.test" "-v")))))))
+ (propagated-inputs (list python-pycairo))
+ (native-inputs (list python-pytest))
+ (home-page "https://github.com/rsmith-nl/stltools")
+ (synopsis "Python modules and scripts for handling STL files")
+ (description "This package consists of Python modules and scripts for
+manipulating stereolithography (STL) files. It can convert STL files into
+POV-ray meshes, PDF and PostScript. The Python modules allow for reading and
+writing STL files. It supports both the text and binary forms of STL.")
+ (license license:expat)))