gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / lego.scm
CommitLineData
7ed01457 1;;; GNU Guix --- Functional package management for GNU
a7cdf124 2;;; Copyright © 2016, 2017, 2019 Eric Bavier <bavier@posteo.net>
96fb444e 3;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
de81a58f 4;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
7ed01457
EB
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages lego)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
a7cdf124 24 #:use-module (guix git-download)
7ed01457
EB
25 #:use-module (guix packages)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages bison)
68a29ab8
EB
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages flex)
31 #:use-module (gnu packages gl)
32 #:use-module (gnu packages qt))
7ed01457
EB
33
34(define-public nqc
35 (package
36 (name "nqc")
37 (version "3.1.r6")
38 (source (origin
96fb444e
TGR
39 ;; XXX Using url-fetch/tarbomb results in failure:
40 ;; Error: could not create compiler/rcx1_nqh.h
7ed01457
EB
41 (method url-fetch)
42 (uri (string-append "http://bricxcc.sourceforge.net/nqc/release/"
43 "nqc-" version ".tgz"))
44 (sha256
45 (base32
46 "0rp7pzr8xrdxpv75c2mi8zszzz2ypli4vvzxiic7mbrryrafdmdz"))))
47 (build-system gnu-build-system)
48 (native-inputs
49 `(("bison" ,bison)
96fb444e
TGR
50 ("flex" ,flex)
51 ("add-usb-tcp-support.patch"
52 ,(origin
53 (method url-fetch)
54 (uri (string-append "https://sourceforge.net/p/bricxcc/patches/"
55 "_discuss/thread/00b427dc/b84b/attachment/"
56 "nqc-01-Linux_usb_and_tcp.diff"))
57 (sha256
58 (base32 "0z5gx55ra1kamhhqxz08lvvwslfl36pbmwdd566rhmbgmyhlykbr"))))
59 ("debian-writable-swap-inst-len.patch"
60 ,(origin
61 (method url-fetch)
62 (uri (string-append "https://sources.debian.org/data/main/n/nqc/"
63 "3.1.r6-7/debian/patches/"
64 "writable-swap-inst-len.patch"))
65 (sha256
66 (base32 "1kr7j057aa5i0kxmlfpbfcsif5yq2lrmjw4sljn400ijaq4mys3v"))))))
7ed01457
EB
67 (arguments
68 '(#:tests? #f ;no tests
69 #:make-flags (list (string-append "PREFIX=" %output))
96fb444e
TGR
70 #:phases
71 (modify-phases %standard-phases
72 (delete 'configure)
73 (add-before 'build 'rm-generated
74 ;; Regenerating compiler/lexer.cpp avoids an 'undefined
75 ;; reference to `isatty(int)'' error.
76 (lambda _
77 (for-each delete-file
78 '("compiler/lexer.cpp"
79 "compiler/parse.cpp"))
80 #t))
81 (add-after 'unpack 'deal-with-tarbomb
82 (lambda _
83 (chdir "..") ;tarbomb
84 #t))
85 (add-after 'deal-with-tarbomb 'patch
86 (lambda* (#:key inputs #:allow-other-keys)
87 (for-each (lambda (patch)
88 (invoke "patch" "-Np1" "-i"
89 (assoc-ref inputs patch)))
90 (list "add-usb-tcp-support.patch"
91 "debian-writable-swap-inst-len.patch")))))))
7ed01457
EB
92 (home-page "http://bricxcc.sourceforge.net/nqc/")
93 (synopsis "C-like language for Lego's MINDSTORMS")
94 (description
95 "Not Quite C (NQC) is a simple language for programming several Lego
96MINDSTORMS products. The preprocessor and control structures of NQC are very
97similar to C. NQC is not a general purpose language -- there are many
98restrictions that stem from limitations of the standard RCX firmware.")
99 (license license:mpl1.0)))
68a29ab8
EB
100
101(define-public leocad
102 (package
103 (name "leocad")
de81a58f 104 (version "21.06")
68a29ab8 105 (source (origin
a7cdf124
EB
106 (method git-fetch)
107 (uri (git-reference
b0e7b699 108 (url "https://github.com/leozide/leocad")
a7cdf124
EB
109 (commit (string-append "v" version))))
110 (file-name (git-file-name name version))
68a29ab8
EB
111 (sha256
112 (base32
de81a58f 113 "1ifbxngkbmg6d8vv08amxbnfvlyjdwzykrjp98lbwvgb0b843ygq"))))
68a29ab8
EB
114 (build-system gnu-build-system)
115 (native-inputs
eef8e2ec 116 (list qttools-5)) ; for lrelease
68a29ab8 117 (inputs
8394619b 118 (list mesa qtbase-5 zlib))
68a29ab8
EB
119 (arguments
120 '(#:tests? #f
121 #:phases
122 (modify-phases %standard-phases
123 (replace 'configure
124 (lambda* (#:key outputs inputs #:allow-other-keys)
125 (let ((out (assoc-ref outputs "out")))
84775d65
TGR
126 (invoke "qmake"
127 (string-append "INSTALL_PREFIX=" out)
128 ;; Otherwise looks for lrelease-qt4.
129 "QMAKE_LRELEASE=lrelease"
130 ;; Don't pester users about updates.
131 "DISABLE_UPDATE_CHECK=1")
132 #t)))
68a29ab8
EB
133 (add-after 'configure 'reset-resource-timestamps
134 (lambda _
135 ;; The contents of build/release/.qrc/qrc_leocad.cpp generated by
136 ;; qt's rcc tool depends on the timestamps in resources/*, in
137 ;; particular the leocad_*.qm files that are created by qmake
138 ;; above. So reset those timestamps for a reproducible build.
139 (with-directory-excursion "resources"
140 (for-each (lambda (file)
141 (let* ((base (basename file ".qm"))
142 (src (string-append base ".ts"))
143 (st (stat src)))
144 (set-file-time file st)))
84775d65
TGR
145 (find-files "." "leocad_.*\\.qm")))
146 #t)))))
324f1927 147 (home-page "https://www.leocad.org")
68a29ab8
EB
148 (synopsis "Create virtual Lego models")
149 (description
150 "LeoCAD is a program for creating virtual LEGO models. It has an
151intuitive interface, designed to allow new users to start creating new models
152without having to spend too much time learning the application. LeoCAD is
153fully compatible with the LDraw Standard and related tools.")
154 (license license:gpl2+)))