From aff3bf8cbf35e90afbcfdedd8909d6e9469532d0 Mon Sep 17 00:00:00 2001 From: Jakub Dlugosz Date: Fri, 31 Oct 2025 13:16:43 +0100 Subject: Add supernote-tool package and apply it to user config --- src/jd/packages/python.scm | 170 ++++++++++++++++++++++++++++++++++++++++++ src/jd/packages/supernote.scm | 48 ++++++++++++ src/jd/user.scm | 11 ++- 3 files changed, 225 insertions(+), 4 deletions(-) create mode 100644 src/jd/packages/python.scm create mode 100644 src/jd/packages/supernote.scm diff --git a/src/jd/packages/python.scm b/src/jd/packages/python.scm new file mode 100644 index 0000000..659a5ba --- /dev/null +++ b/src/jd/packages/python.scm @@ -0,0 +1,170 @@ +(define-module (jd packages python) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gtk) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages xml) + + #:use-module (guix build-system pyproject) + #:use-module (guix build-system python) + + #:use-module (guix git-download) + #:use-module (guix hg-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public python-svgwrite + (package + (name "python-svgwrite") + (version "1.4.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mozman/svgwrite") + (commit "cd10a7ed1982de77ba85ff4556e154187d7f14bc"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "14nvgsdhndpsgqlcp1vbmczd7rfyiddhjav2xja0a0rx2472psxq")))) + (build-system python-build-system) + (arguments + (list + #:tests? #f)) + (home-page "https://github.com/mozman/svgwrite") + (synopsis "Library to create SVG drawings using Python") + (description + "Svgwrite is a pure-Python library for creating Scalable Vector Graphics (SVG) +files. It provides an object-oriented interface to build SVG drawings programmatically +without external dependencies. The library supports shapes, paths, gradients, and +style definitions compliant with the SVG 1.1 specification.") + (license license:expat))) + +(define-public python-rlpycairo + (package + (name "python-rlpycairo") + (version "0.4.0") + (source + (origin + (method hg-fetch) + (uri (hg-reference + (url "https://hg.reportlab.com/hg-public/rlPyCairo") + (changeset "a3e9ae26d82d"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0c8px1538zwdr9hjhscv6y6k8mzlrr247f2jbsdjm4qfijchlc7n")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f)) ; brak zestawu testów + (propagated-inputs + (list python-pycairo + python-freetype-py + python-reportlab)) + (native-inputs + (list python-setuptools + python-wheel)) + (home-page "https://hg.reportlab.com/hg-public/rlPyCairo") + (synopsis "Cairo rendering plugin backend for ReportLab") + (description + "rlPyCairo is a ReportLab plugin that provides a Cairo-based rendering +backend for the @code{reportlab.graphics.renderPM} module. It enables the +use of the PyCairo library for high-quality vector and raster rendering and +extends ReportLab's graphical output capabilities.") + (license license:bsd-3))) + +(define-public python-svglib + (package + (name "python-svglib") + (version "1.6.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/deeplook/svglib") + (commit "1f41cc64b9b56b0868d775cdeaee0c5413abbb41"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1qpn4gxfvzb326rwjz0xrrgz7r51pm1cw5xmzwjndhm6mxjbxayq")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f)) + (propagated-inputs + (list python-cssselect2 + python-lxml + python-reportlab + python-rlpycairo + python-tinycss2)) + (native-inputs + (list python-hatchling)) + (home-page "https://github.com/deeplook/svglib") + (synopsis "Pure-Python library for reading and converting SVG") + (description + "SVGLib is a pure-Python library for parsing and converting SVG (Scalable Vector Graphics) +files into PDF and other vector formats. It relies on ReportLab for PDF generation +and supports modern CSS and XML standards. It can be used both as a library and via +its command-line tool @code{svg2pdf}.") + (license license:lgpl3+))) + +(define-public python-reportlab + (package + (name "python-reportlab") + (version "4.4.0") + (source + (origin + (method hg-fetch) + (uri (hg-reference + (url "https://hg.reportlab.com/hg-public/reportlab") + (changeset "7635eaecb27d"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0pmgms62khyjka3gj9y1f33vmlqgyzz1d4wlq3ysksdgxpn6hmcf")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f)) + (propagated-inputs + (list python-pillow + python-charset-normalizer)) + (native-inputs + (list python-setuptools + python-wheel)) + (home-page "https://www.reportlab.com/") + (synopsis "Toolkit for generating PDFs and vector graphics in Python") + (description + "The ReportLab Toolkit is a mature, open-source library for generating +PDF documents and vector graphics directly from Python code. It provides +high-level APIs for document layout, charts, barcodes, and graphics +composition, used in both open source and commercial applications.") + (license license:bsd-3))) + +(define-public python-potracer + (package + (name "python-potracer") + (version "0.0.4") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tatarize/potrace") + (commit "769eadc85ab2ae6c3334686eaab0296fdfdf6abc"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0g5q2klz2r5spidzhk70y2jkg10yic2ka7j5ygks1sp6nrnhac9v")))) + (build-system pyproject-build-system) + (propagated-inputs + (list python-numpy)) + (native-inputs (list python-setuptools)) + (arguments + (list + #:tests? #f)) + (home-page "https://github.com/tatarize/potrace") + (synopsis "Python bindings for Potrace vectorization library") + (description + "Potracer is a Python wrapper for the Potrace vectorization library, +allowing conversion of bitmap images into scalable vector graphics. +It provides Pythonic access to path tracing and curve fitting +functionalities from the original Potrace project.") + (license license:gpl2+))) diff --git a/src/jd/packages/supernote.scm b/src/jd/packages/supernote.scm new file mode 100644 index 0000000..921d0d1 --- /dev/null +++ b/src/jd/packages/supernote.scm @@ -0,0 +1,48 @@ +(define-module (jd packages supernote) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-xyz) + + #:use-module (guix build-system pyproject) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + + #:use-module (jd packages python)) + +(define-public supernote-tool + (package + (name "supernote-tool") + (version "0.6.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jya-dev/supernote-tool") + (commit "73166ca4fbe23a50e188c212f7f1a8d30ce1ce66"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1mzq6s8lwq3qnq3sbp2hwxkcy07j5izjf309wfx38g7ssd3b8mwd")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f)) + (propagated-inputs + (list + python-colour + python-fusepy + python-numpy + python-pillow + python-potracer + python-pypng + python-reportlab + python-svglib + python-svgwrite)) + (native-inputs + (list python-hatchling)) + (home-page "https://github.com/jya-dev/supernote-tool") + (synopsis "An unofficial converter library for Ratta Supernote") + (description + "Supernotelib is an unofficial converter and utility library for Ratta Supernote +devices, supporting conversion of note files, vector tracing, and export to +standard formats like PDF and SVG.") + (license license:asl2.0))) diff --git a/src/jd/user.scm b/src/jd/user.scm index aff2b99..8f2ec7e 100644 --- a/src/jd/user.scm +++ b/src/jd/user.scm @@ -28,6 +28,7 @@ #:use-module (jd features nextcloud) #:use-module (jd features shepherd) #:use-module (jd features state) + #:use-module (jd packages supernote) #:use-module (nongnu packages linux) #:use-module (nongnu system linux-initrd) @@ -429,9 +430,11 @@ (list (@ (gnu packages tree-sitter) tree-sitter-clojure) (@ (gnu packages tree-sitter) tree-sitter-html)) - (strings->packages - "figlet" - "calibre" + (append + (list supernote-tool) + (strings->packages + "figlet" + "calibre" "libnotify" @@ -462,7 +465,7 @@ "texlive-collection-fontsrecommended" "texlive-collection-pictures" "texlive-collection-latexextra" - "texlive-dvipng")))))) + "texlive-dvipng"))))))) (define-public (feature-nonfree-kernel) -- cgit v1.2.3