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