1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2017 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages flex)
29 #:use-module (gnu packages gl)
30 #:use-module (gnu packages qt))
38 (uri (string-append "http://bricxcc.sourceforge.net/nqc/release/"
39 "nqc-" version ".tgz"))
42 "0rp7pzr8xrdxpv75c2mi8zszzz2ypli4vvzxiic7mbrryrafdmdz"))))
43 (build-system gnu-build-system)
48 '(#:tests? #f ;no tests
49 #:make-flags (list (string-append "PREFIX=" %output))
50 #:phases (modify-phases %standard-phases
52 (add-before 'build 'rm-generated
53 ;; Regenerating compiler/lexer.cpp avoids an 'undefined
54 ;; reference to `isatty(int)'' error.
57 '("compiler/lexer.cpp"
58 "compiler/parse.cpp"))
60 (add-after 'unpack 'deal-with-tarbomb
64 (home-page "http://bricxcc.sourceforge.net/nqc/")
65 (synopsis "C-like language for Lego's MINDSTORMS")
67 "Not Quite C (NQC) is a simple language for programming several Lego
68 MINDSTORMS products. The preprocessor and control structures of NQC are very
69 similar to C. NQC is not a general purpose language -- there are many
70 restrictions that stem from limitations of the standard RCX firmware.")
71 (license license:mpl1.0)))
79 (uri (string-append "https://github.com/leozide/leocad/"
80 "archive/v" version ".tar.gz"))
81 (file-name (string-append name "-" version ".tar.gz"))
84 "189wj221fn08bnsfwy8050bxkjgjwinkn19qdcvb6c2ry2lnfra9"))))
85 (build-system gnu-build-system)
87 `(("qttools" ,qttools))) ; for lrelease
95 (modify-phases %standard-phases
97 (lambda* (#:key outputs inputs #:allow-other-keys)
98 (let ((out (assoc-ref outputs "out")))
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")
106 (add-after 'configure 'reset-resource-timestamps
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"))
117 (set-file-time file st)))
118 (find-files "." "leocad_.*\\.qm")))
120 (home-page "https://www.leocad.org")
121 (synopsis "Create virtual Lego models")
123 "LeoCAD is a program for creating virtual LEGO models. It has an
124 intuitive interface, designed to allow new users to start creating new models
125 without having to spend too much time learning the application. LeoCAD is
126 fully compatible with the LDraw Standard and related tools.")
127 (license license:gpl2+)))