[bug#70880,v2,6/8] gnu: Add prusa-libbgcode.

Message ID 2cdedc4189efac291f16e099b91605a8f8f4aca9.1719853592.git.poptsov.artyom@gmail.com
State New
Headers
Series [bug#70880,v2,1/8] gnu: cgal: Update to 5.6.1. |

Commit Message

Artyom V. Poptsov July 1, 2024, 5:07 p.m. UTC
* gnu/packages/engineering.scm (prusa-libbgcode): New variable.

Change-Id: I1f18c399d0fe36987c613ce4c0c3845c803beb45
---
 gnu/packages/engineering.scm | 46 ++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
  

Comments

Maxim Cournoyer July 10, 2024, 2:30 a.m. UTC | #1
Hi,

"Artyom V. Poptsov" <poptsov.artyom@gmail.com> writes:

> * gnu/packages/engineering.scm (prusa-libbgcode): New variable.
>
> Change-Id: I1f18c399d0fe36987c613ce4c0c3845c803beb45
> ---
>  gnu/packages/engineering.scm | 46 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
> index 7f29e2c365..de4b4a5825 100644
> --- a/gnu/packages/engineering.scm
> +++ b/gnu/packages/engineering.scm
> @@ -3753,6 +3753,52 @@ (define-public libigl
>  visualization, matrix manipulation.")
>      (license (list license:gpl3 license:mpl2.0))))
>  
> +(define-public prusa-libbgcode

Sorry for missing that in my first review: there should be an
explanatory comment here mentioning which commit to use and why (e.g.:
"Use the latest commit since there are no proper releases nor tags.")

> +  (let ((commit "8ae75bd0eea622f0e34cae311b3bd065b55eae9b")
> +        (revision "0"))
> +    (package
> +      (name "prusa-libbgcode")
> +      (version (git-version "0.0.0" revision commit))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/prusa3d/libbgcode")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256 (base32 "0fjx2ijz9zqpqs486lcrrrhqvmfzrpb8j6v57l0jiynavwv3kznw"))))
> +      (native-inputs (list catch2))
> +      (propagated-inputs
> +       (list zlib boost heatshrink))

Nitpick: when there are few inputs (< 5), it's OK to list them inline if
it fits the 80 columns rule, like:

  (propagated-inputs (list zlib boost heatshrink))

I think this is what 'guix style' would do.

> +      (build-system cmake-build-system)
> +      (home-page "https://github.com/prusa3d/libbgcode")
> +      (synopsis "Prusa Block and Binary G-code reader/writer/converter")
> +      (description
> +       "Binary G-code is a new standard for encoding and compressing ASCII G-code
> +files.  G-code files are easy to read and interpret, but their downside is that the
> +data is not saved efficiently, and the file size is often very large.  Compression of
> +the file is problematic because the printers usually run on limited hardware and they
> +may not have enough memory and/or CPU power to decompress it.
> +
> +Block and Binary G-Code is a new G-code file format featuring the following
> +improvements over the legacy G-code:
> +@itemize
> +@item Block structure with distinct blocks for metadata vs. G-code.
> +@item Faster navigation.
> +@item Coding and compression for smaller file size.
> +@item Checksum for data validity.
> +@item Extensibility through new (custom) blocks.  For example, a file signature block
> +may be welcome by corporate customers.
> +@end itemize
> +
> +The binary G-code format is flexible and the encoding and compression of individual
> +blocks is variable.  @code{libbgcode} library contains the routines to convert ASCII
                       ^ The @code{libgcode} ...
                       
> +G-codes to binary and vice versa.  The library is written in C++ and the repository
> +includes bindings for Python.")

It looks like this package does not provide the Python bindings, so it
may be best to drop that part of the last sentence mentioning their
existence, as it would be misleading for Guix users.
  
Artyom V. Poptsov July 13, 2024, 9:41 a.m. UTC | #2
> Sorry for missing that in my first review: there should be an
> explanatory comment here mentioning which commit to use and why (e.g.:
> "Use the latest commit since there are no proper releases nor tags.")
> [...]
> Nitpick: when there are few inputs (< 5), it's OK to list them inline if
> it fits the 80 columns rule, like:
>
>   (propagated-inputs (list zlib boost heatshrink))
>
> I think this is what 'guix style' would do.
> [...]
> It looks like this package does not provide the Python bindings, so it
> may be best to drop that part of the last sentence mentioning their
> existence, as it would be misleading for Guix users.

Fixed.

- avp
  

Patch

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 7f29e2c365..de4b4a5825 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3753,6 +3753,52 @@  (define-public libigl
 visualization, matrix manipulation.")
     (license (list license:gpl3 license:mpl2.0))))
 
+(define-public prusa-libbgcode
+  (let ((commit "8ae75bd0eea622f0e34cae311b3bd065b55eae9b")
+        (revision "0"))
+    (package
+      (name "prusa-libbgcode")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/prusa3d/libbgcode")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256 (base32 "0fjx2ijz9zqpqs486lcrrrhqvmfzrpb8j6v57l0jiynavwv3kznw"))))
+      (native-inputs (list catch2))
+      (propagated-inputs
+       (list zlib boost heatshrink))
+      (build-system cmake-build-system)
+      (home-page "https://github.com/prusa3d/libbgcode")
+      (synopsis "Prusa Block and Binary G-code reader/writer/converter")
+      (description
+       "Binary G-code is a new standard for encoding and compressing ASCII G-code
+files.  G-code files are easy to read and interpret, but their downside is that the
+data is not saved efficiently, and the file size is often very large.  Compression of
+the file is problematic because the printers usually run on limited hardware and they
+may not have enough memory and/or CPU power to decompress it.
+
+Block and Binary G-Code is a new G-code file format featuring the following
+improvements over the legacy G-code:
+@itemize
+@item Block structure with distinct blocks for metadata vs. G-code.
+@item Faster navigation.
+@item Coding and compression for smaller file size.
+@item Checksum for data validity.
+@item Extensibility through new (custom) blocks.  For example, a file signature block
+may be welcome by corporate customers.
+@end itemize
+
+The binary G-code format is flexible and the encoding and compression of individual
+blocks is variable.  @code{libbgcode} library contains the routines to convert ASCII
+G-codes to binary and vice versa.  The library is written in C++ and the repository
+includes bindings for Python.")
+      ;; See
+      ;; <https://github.com/prusa3d/libbgcode/blob/main/pyproject.toml>
+      (license license:agpl3+))))
+
 (define-public prusa-slicer
   (package
     (name "prusa-slicer")