diff mbox series

[bug#70880,7/8] gnu: Add prusa-wxwidgets.

Message ID d2803cabcda81abae01a97c4c28edb04fa938be9.1715450052.git.poptsov.artyom@gmail.com
State New
Headers show
Series gnu: prusa-slicer: Update to 2.7.4. | expand

Commit Message

Artyom V. Poptsov May 11, 2024, 5:58 p.m. UTC
* gnu/packages/engineering.scm (prusa-wxwidgets): New variable.

Co-authored-by: Nikita Domnitskii <nikita@domnitskii.me>
Change-Id: I9043c2acc95986275ee24d9c5d944e5fe2702e99
---
 gnu/packages/engineering.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Comments

Maxim Cournoyer June 24, 2024, 3:28 a.m. UTC | #1
Hi,

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

> * gnu/packages/engineering.scm (prusa-wxwidgets): New variable.
>
> Co-authored-by: Nikita Domnitskii <nikita@domnitskii.me>
> Change-Id: I9043c2acc95986275ee24d9c5d944e5fe2702e99
> ---
>  gnu/packages/engineering.scm | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
> index b1776484b5..08ff06fa94 100644
> --- a/gnu/packages/engineering.scm
> +++ b/gnu/packages/engineering.scm
> @@ -3798,6 +3798,33 @@ (define-public prusa-libbgcode
>         "Prusa Block & Binary G-code reader/writer/converter.")
>        (license license:agpl3))))
>  
> +(define-public prusa-wxwidgets
> +  ;; There is no tag/release, all patches are in separate branch.
> +  (let ((commit "78aa2dc0ea7ce99dc19adc1140f74c3e2e3f3a26"))
> +    (package
> +      (inherit wxwidgets)

Due to not being delayed, inherit fields should only be used with values
defined in the same module.  So you should move prusa-wxwidgets to where
wxwidgets comes from.  See (info '(guix) Cyclic Module Dependencies').

> +      (name "prusa-wxwidgets")
> +      (version "3.2.0")
> +      (home-page "https://github.com/prusa3d/wxWidgets")
> +      (source
> +       (origin
> +         (inherit (package-source wxwidgets))
> +         (method git-fetch)
> +         (uri
> +          (git-reference
> +           (url home-page)
> +           (commit commit)
> +           (recursive? #t)))

Recursive checkouts often mean bundled libraries are pulled and built as
part of the same package, which should be avoided in Guix if the build
system has supports for it.  For this reason, we always leave a comment
explaining why it's needed.

> +         (file-name (git-file-name name version))
> +         (patches (search-patches "prusa-wxwidgets-makefile-fix.patch"))
> +         (sha256
> +          (base32
> +           "02nd07c23xbclnf1jjfbv6r5vqjb80gsdy2l559c5qzgdcvfd2xd"))))
> +      (arguments
> +       (substitute-keyword-arguments (package-arguments wxwidgets)
> +         ((#:configure-flags flags)

Is this done to match upstream configuration?   Perhaps add a comment.

> +          #~(cons "--disable-glcanvasegl" #$flags)))))))
> +
>  (define-public prusa-slicer
>    (package
>      (name "prusa-slicer")

Could you please send a v2?
Maxim Cournoyer June 24, 2024, 3:30 a.m. UTC | #2
Hi,

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

> * gnu/packages/engineering.scm (prusa-wxwidgets): New variable.
>
> Co-authored-by: Nikita Domnitskii <nikita@domnitskii.me>
> Change-Id: I9043c2acc95986275ee24d9c5d944e5fe2702e99
> ---
>  gnu/packages/engineering.scm | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
> index b1776484b5..08ff06fa94 100644
> --- a/gnu/packages/engineering.scm
> +++ b/gnu/packages/engineering.scm
> @@ -3798,6 +3798,33 @@ (define-public prusa-libbgcode
>         "Prusa Block & Binary G-code reader/writer/converter.")
>        (license license:agpl3))))
>  
> +(define-public prusa-wxwidgets
> +  ;; There is no tag/release, all patches are in separate branch.
> +  (let ((commit "78aa2dc0ea7ce99dc19adc1140f74c3e2e3f3a26"))
> +    (package
> +      (inherit wxwidgets)
> +      (name "prusa-wxwidgets")
> +      (version "3.2.0")
> +      (home-page "https://github.com/prusa3d/wxWidgets")
> +      (source
> +       (origin
> +         (inherit (package-source wxwidgets))
> +         (method git-fetch)
> +         (uri
> +          (git-reference
> +           (url home-page)
> +           (commit commit)
> +           (recursive? #t)))
> +         (file-name (git-file-name name version))
> +         (patches (search-patches
> "prusa-wxwidgets-makefile-fix.patch"))

Another thing: patches should be registered within the gnu/local.mk
file, so as to be included in the 'make dist' archive.
diff mbox series

Patch

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index b1776484b5..08ff06fa94 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3798,6 +3798,33 @@  (define-public prusa-libbgcode
        "Prusa Block & Binary G-code reader/writer/converter.")
       (license license:agpl3))))
 
+(define-public prusa-wxwidgets
+  ;; There is no tag/release, all patches are in separate branch.
+  (let ((commit "78aa2dc0ea7ce99dc19adc1140f74c3e2e3f3a26"))
+    (package
+      (inherit wxwidgets)
+      (name "prusa-wxwidgets")
+      (version "3.2.0")
+      (home-page "https://github.com/prusa3d/wxWidgets")
+      (source
+       (origin
+         (inherit (package-source wxwidgets))
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url home-page)
+           (commit commit)
+           (recursive? #t)))
+         (file-name (git-file-name name version))
+         (patches (search-patches "prusa-wxwidgets-makefile-fix.patch"))
+         (sha256
+          (base32
+           "02nd07c23xbclnf1jjfbv6r5vqjb80gsdy2l559c5qzgdcvfd2xd"))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments wxwidgets)
+         ((#:configure-flags flags)
+          #~(cons "--disable-glcanvasegl" #$flags)))))))
+
 (define-public prusa-slicer
   (package
     (name "prusa-slicer")