summaryrefslogtreecommitdiff
path: root/gnu/packages/python-xyz.scm
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2026-02-14 23:40:17 +0900
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2026-03-26 06:35:28 +0100
commitd1613d6383c8148d8d455e78d518804d932c553a (patch)
tree582e96d7cf22ea99832895065274825d7d97e254 /gnu/packages/python-xyz.scm
parent3d7123b1720d6ebb6a41fd7034e89b857cf9ccf1 (diff)
gnu: Add python-py010parser.
* gnu/packages/python-xyz.scm (python-py010parser): New variable. Change-Id: Idd4737ef9b19a4a8a56718673a06a78130dd9af6 Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu/packages/python-xyz.scm')
-rw-r--r--gnu/packages/python-xyz.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 06ad74a69c0..b224d7a6028 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -2235,6 +2235,51 @@ cache directory, to avoid modifying the host's environment, and further
activated using a set of environment variables.")
(license (list license:expat license:asl2.0))))
+(define-public python-py010parser
+ (package
+ (name "python-py010parser")
+ (version "0.1.18")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/d0c-s4vage/py010parser")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256 (base32 "0yiyal9vxrni2yy3f6fwpndxz4kih6pwm9ikgrmhx4nq0fkb68m3"))
+ (modules '((guix build utils)))
+ (snippet #~(begin
+ ;; Unbundle ply.
+ (substitute* "requirements.txt"
+ (("^six\\>.*") ""))
+ (substitute* "setup.py"
+ (("(packages += \\['py010parser').*\\]" all first)
+ (string-append first "]")))
+ (delete-file-recursively "py010parser/ply")
+ (substitute* (find-files "py010parser" "\\.py$")
+ ((" .*\\.ply\\>") " ply"))
+ ;; Avoid regenerating the lex table.
+ (substitute* '("py010parser/__init__.py"
+ "py010parser/c_parser.py")
+ (("(lex_optimize=)[A-Za-z]+(,)" all open close)
+ (string-append open "False" close)))
+ (substitute* '("py010parser/__init__.py"
+ "setup.py")
+ (("\\{\\{VERSION\\}\\}") #$version))
+ (substitute* "setup.cfg"
+ (("description-file") "description_file"))))))
+ (build-system pyproject-build-system)
+ (arguments (list #:test-backend #~'unittest
+ #:test-flags #~'("discover" "tests")))
+ (propagated-inputs (list python-regex python-ply))
+ (native-inputs (list python-setuptools))
+ (home-page "https://github.com/d0c-s4vage/py010parser")
+ (synopsis "Parser of 010 editor's template")
+ (description
+ "@code{py010parser} is a Python library for parsing templates
+for the Sweetscape 010 binary-format editor.")
+ (license license:bsd-3)))
+
(define-public python-pygls
(package
(name "python-pygls")