From e4530e457e465243dae5b58eb8b7fa2e3951757d 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 | 62 ++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
@@ -3688,3 +3688,65 @@ (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
+ (package
+ (name "candle")
+ (version "1.2b")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Denvi/Candle")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1rinblzqg8xbi4zcyx6v3k7g2kdrgmwm7xwb6fryb8s0bd21jppv"))))
+ (build-system gnu-build-system)
+ (native-inputs (list qttools))
+ (inputs (list qtbase-5 qtserialport))
+ (arguments
+ `(#: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 'fix-sources '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"))))
+ (add-after 'configure 'fix-makefile
+ (lambda _
+ (substitute* "Makefile"
+ (("-pipe -Z7") "-pipe")
+ (("LFLAGS.*=.*DEBUG .*OPT:REF -Wl,-O1")
+ "LFLAGS = -Wl,-O1"))))
+ (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