summaryrefslogtreecommitdiff
path: root/nongnu/packages/cad.scm
blob: c896a5f9adf8fc2f8d5c92257b6be6a58bb6315b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
;;; Copyright © 2021-2022 Petr Hodina <phodina@protonmail.com>
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

(define-module (nongnu packages cad)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bootstrap)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cups)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gstreamer)
  #:use-module (gnu packages libusb)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages nss)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages xorg)
  #:use-module (guix download)
  #:use-module (nonguix build-system binary)
  #:use-module ((nonguix licenses) #:prefix license:))

(define-public lightburn
  (package
    (name "lightburn")
    (version "1.2.01")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/LightBurnSoftware/deployment/"
                    "releases/download/" version
                    "/LightBurn-Linux64-v" version ".7z"))
              (sha256
               (base32
                "1yqxkf0izcfz05wrxh9xpmm7qi5wd5f1w9d2kni2wbzs531nr22p"))))
    (build-system binary-build-system)
    (arguments
     `(#:strip-binaries? #f ;TODO: For some reason it fails validate-runpath
       ;; phase if enbaled
       #:install-plan
       `(("LightBurn" "bin/LightBurn") ("LightBurn.png" "Lightburn.png")
         ("qt.conf" "qt.conf")
         ("languages" "languages")
         ("plugins" "plugins")
         ("translations" "translations"))
       #:phases
       (modify-phases %standard-phases
         (replace 'unpack
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((source (assoc-ref inputs "source")))
               (invoke "7z" "x" source)
               (chdir "LightBurn")
               (delete-file-recursively "lib"))))
         (replace 'patchelf
           (lambda* (#:key inputs outputs patchelf-plan #:allow-other-keys)
             (let* ((lightburn "LightBurn")
			        (plugins (list
                                 "audio/libqtaudio_alsa.so"
                                 "audio/libqtmedia_pulse.so"
                                 "bearer/libqconnmanbearer.so"
                                 "bearer/libqgenericbearer.so"
                                 "bearer/libqnmbearer.so"
                                 "imageformats/libqgif.so"
                                 "imageformats/libqicns.so"
                                 "imageformats/libqico.so"
                                 "imageformats/libqjpeg.so"
                                 "imageformats/libqtga.so"
                                 "imageformats/libqtiff.so"
                                 "imageformats/libqwbmp.so"
                                 "imageformats/libqwebp.so"
                                 "mediaservice/libgstaudiodecoder.so"
                                 "mediaservice/libgstcamerabin.so"
                                 "mediaservice/libgstmediacapture.so"
                                 "mediaservice/libgstmediaplayer.so"
                                 (string-append
                                 "platforminputcontexts"
                                 "/libcomposeplatforminputcontextplugin.so")
                                 (string-append
                                 "platforminputcontexts"
                                 "/libibusplatforminputcontextplugin.so")
                                 "platforms/libqxcb.so"
                                 "printsupport/libcupsprintersupport.so"
                                 "xcbglintegrations/libqxcb-egl-integration.so"
                                                  "xcbglintegrations/libqxcb-glx-integration.so"))
                    (libc (assoc-ref inputs "libc"))
                    (nss (assoc-ref inputs "nss"))
                    (rpath (string-append (apply string-append
                                                 (map (lambda (pkg)
                                                        (string-append (assoc-ref
                                                                        inputs
                                                                        pkg)
                                                         "/lib:"))
                                                      '("alsa-lib"
                                                        "cups-minimal"
                                                        "fontconfig-minimal"
                                                        "freetype"
                                                        "gcc"
                                                        "glib"
                                                        "gst-plugins-base"
                                                        "gstreamer"
                                                        "libusb"
                                                        "libx11"
                                                        "libxcb"
                                                        "libxext"
                                                        "libxi"
                                                        "libxrender"
                                                        "mesa"
                                                        "nspr"
                                                        "openlibm"
                                                        "pulseaudio"
                                                        "qtbase"
                                                        "qtserialport"
                                                        "qtmultimedia"
                                                        "zlib"))) nss
                                          "/lib/nss:"))
                    (ld-so (string-append libc
                                          ,(glibc-dynamic-linker))))
               (invoke "patchelf" "--set-rpath" rpath lightburn)
               (invoke "patchelf" "--set-interpreter" ld-so lightburn)
               (map (lambda (x)
                      (invoke "patchelf" "--set-rpath" rpath
                              (string-append "plugins/" x))) plugins)))))))
    (supported-systems '("x86_64-linux"))
    (native-inputs (list p7zip
                         patchelf))
    (inputs (list alsa-lib
                  cups-minimal
                  fontconfig
                  `(,gcc "lib")
                  glib
                  gst-plugins-base
                  gstreamer
                  libusb
                  libx11
                  libxcb
                  libxext
                  libxi
                  libxrender
                  nspr
                  nss
                  mesa
                  openlibm
                  pulseaudio
                  qtbase-5
                  qtserialport
                  qtmultimedia-5
                  zlib))
    (synopsis "Layout, editing, and control software for your laser cutter")
    (description
     "This package provides layout, editing, and control software
for your laser cutter.  Following features are supported:
@enumerate
@item Import artwork from formats such as AI, PDF, SVG, DXF, PLT, PNG, JPG, GIF
, BMP
@item arrange, edit, and even create new vector shapes within the editor
@item apply production settings such as like power, speed, number of passes,
cut order, etc.
@item send the result directly to your laser cutter
@end enumerate")
    (home-page "https://lightburnsoftware.com/")
    (license (license:nonfree "https://lightburnsoftware.com/pages/how-the-lightburn-license-works"))))