diff mbox series

[bug#56354] gnu: engineering: Add candle.

Message ID 877d4mqu3n.fsf@gmail.com
State Accepted
Headers show
Series [bug#56354] gnu: engineering: Add candle. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Artyom V. Poptsov July 9, 2022, 1:43 p.m. UTC
Hello Jean Pierre De Jesus DIAZ,

I almost overlooked your message from debbugs as it wasn't delivered to
my mailbox.  Thanks for the patch review!

> Can be changed to use G-Expressions:

Done.

> >+                  (add-after 'fix-sources 'fix-application-settings-path
> Doesn't depend on 'fix-sources, so it's fine to add after 'unpack.

Done.

> It may also be a good idea to set `QMAKE_CC' variable for cross-compilation,
> like:
>
> `(invoke "qmake" (string-append "QMAKE_CC=" #$(cc-for-target)))'

Done.

But I wasn't able to run cross-compilation with the command you
provided:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build --keep-failed --target=aarch64-linux-gnu candle
guix build: error: gnu/packages/freedesktop.scm:1921:2: perl-file-mimeinfo@0.29: build system `perl' does not support cross builds
--8<---------------cut here---------------end--------------->8---

It seems to me from the message that the issue is not in the candle
package itself.

> >+                  (add-after 'configure 'fix-makefile
> >+                    (lambda _
> >+                      (substitute* "Makefile"
> >+                        (("-pipe -Z7") "-pipe")
> >+                        (("LFLAGS.*=.*DEBUG .*OPT:REF -Wl,-O1")
> >+                         "LFLAGS        = -Wl,-O1"))))
>
> Could this instead be replaced on the `candle.pro' file?

I fixed it by using the latest commit from the 'master' branch instead
of 1.2b tag.

Please find the updated patch attached.
Thanks,

- Artyom
diff mbox series

Patch

From 3830792f316287de22fa62b2adff6aeb2b94a160 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Thu, 23 Jun 2022 23:02:40 +0300
Subject: [PATCH] gnu: engineering: Add candle.

* gnu/packages/engineering.scm (candle): New variable.
---
 gnu/packages/engineering.scm | 63 ++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index fe8ab13298..a3445343fc 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3688,3 +3688,66 @@  (define-public xschem
 netlists from the drawn schematic, allowing the simulation of the circuit.")
       (home-page "https://xschem.sourceforge.io/stefan/index.html")
       (license license:gpl2+))))
+
+(define-public candle
+  ;; The latest tagged version 1.2b fails on the build stage due to
+  ;; non-supported g++ flags so we need to use the latest commit from the
+  ;; 'master' branch in the repository.
+  (let ((commit   "3f763bcde1195e23ba119a5b3c70d7c889881019")
+        (revision "1"))
+    (package
+      (name "candle")
+      (version (git-version "1.2b" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/Denvi/Candle")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "08rqhl6a5a8s67a8yl16944zgcsnnb08xfv4klzyqwlvaqgfp783"))))
+      (build-system gnu-build-system)
+      (native-inputs (list qttools))
+      (inputs (list qtbase-5 qtserialport))
+      (arguments
+       (list #:tests? #f                      ; no tests.
+             #:phases #~(modify-phases %standard-phases
+                          (add-after 'unpack 'fix-sources
+                            (lambda _
+                              (substitute* (find-files "." ".*\\.h")
+                                (("const char\\* what\\(\\) const override")
+                                 "const char* what() const noexcept override"))))
+                          (add-after 'unpack 'fix-application-settings-path
+                            (lambda _
+                              (substitute* "src/frmmain.cpp"
+                                (("qApp->applicationDirPath\\(\\) \\+ \"\\/settings\\.ini\"")
+                                 "QDir::homePath() + \"/.config/candle.ini\""))))
+                          (replace 'configure
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let ((out (assoc-ref outputs "out")))
+                                (chdir "src")
+                                (invoke "qmake"
+                                        (string-append "QMAKE_CC="
+                                                       #$(cc-for-target))))))
+                          (replace 'install
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let ((out (assoc-ref outputs "out")))
+                                (install-file "Candle"
+                                              (string-append out "/bin"))))))))
+      (home-page "https://github.com/Denvi/Candle")
+      (synopsis "GRBL controller with G-Code visualizer")
+      (description
+       "GRBL controller application with G-Code visualizer written in Qt.
+
+Supported functions:
+
+@itemize
+@item Controlling GRBL-based cnc-machine via console commands, buttons on
+form, numpad.
+@item Monitoring CNC-machine state.
+@item Loading, editing, saving and sending of G-code files to CNC-machine.
+@item Visualizing G-code files.
+@end itemize")
+      (license license:gpl3))))
+
-- 
2.34.1