gnu: Remove ".git" from "https://github/…/….git".
[jackhill/guix/guix.git] / gnu / packages / lego.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2017, 2019 Eric Bavier <bavier@posteo.net>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
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 git-download)
24 #:use-module (guix packages)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages bison)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages flex)
30 #:use-module (gnu packages gl)
31 #:use-module (gnu packages qt))
32
33 (define-public nqc
34 (package
35 (name "nqc")
36 (version "3.1.r6")
37 (source (origin
38 (method url-fetch)
39 (uri (string-append "http://bricxcc.sourceforge.net/nqc/release/"
40 "nqc-" version ".tgz"))
41 (sha256
42 (base32
43 "0rp7pzr8xrdxpv75c2mi8zszzz2ypli4vvzxiic7mbrryrafdmdz"))))
44 (build-system gnu-build-system)
45 (native-inputs
46 `(("bison" ,bison)
47 ("flex" ,flex)))
48 (arguments
49 '(#:tests? #f ;no tests
50 #:make-flags (list (string-append "PREFIX=" %output))
51 #:phases (modify-phases %standard-phases
52 (delete 'configure)
53 (add-before 'build 'rm-generated
54 ;; Regenerating compiler/lexer.cpp avoids an 'undefined
55 ;; reference to `isatty(int)'' error.
56 (lambda _
57 (for-each delete-file
58 '("compiler/lexer.cpp"
59 "compiler/parse.cpp"))
60 #t))
61 (add-after 'unpack 'deal-with-tarbomb
62 (lambda _
63 (chdir "..") ;tarbomb
64 #t)))))
65 (home-page "http://bricxcc.sourceforge.net/nqc/")
66 (synopsis "C-like language for Lego's MINDSTORMS")
67 (description
68 "Not Quite C (NQC) is a simple language for programming several Lego
69 MINDSTORMS products. The preprocessor and control structures of NQC are very
70 similar to C. NQC is not a general purpose language -- there are many
71 restrictions that stem from limitations of the standard RCX firmware.")
72 (license license:mpl1.0)))
73
74 (define-public leocad
75 (package
76 (name "leocad")
77 (version "19.07.1")
78 (source (origin
79 (method git-fetch)
80 (uri (git-reference
81 (url "https://github.com/leozide/leocad")
82 (commit (string-append "v" version))))
83 (file-name (git-file-name name version))
84 (sha256
85 (base32
86 "02kv1m18g6s4dady9jv4sjivfkrp192bmdw2a3d9lzlp60zks0p2"))))
87 (build-system gnu-build-system)
88 (native-inputs
89 `(("qttools" ,qttools))) ; for lrelease
90 (inputs
91 `(("mesa" ,mesa)
92 ("qtbase" ,qtbase)
93 ("zlib" ,zlib)))
94 (arguments
95 '(#:tests? #f
96 #:phases
97 (modify-phases %standard-phases
98 (replace 'configure
99 (lambda* (#:key outputs inputs #:allow-other-keys)
100 (let ((out (assoc-ref outputs "out")))
101 (invoke "qmake"
102 (string-append "INSTALL_PREFIX=" out)
103 ;; Otherwise looks for lrelease-qt4.
104 "QMAKE_LRELEASE=lrelease"
105 ;; Don't pester users about updates.
106 "DISABLE_UPDATE_CHECK=1")
107 #t)))
108 (add-after 'configure 'reset-resource-timestamps
109 (lambda _
110 ;; The contents of build/release/.qrc/qrc_leocad.cpp generated by
111 ;; qt's rcc tool depends on the timestamps in resources/*, in
112 ;; particular the leocad_*.qm files that are created by qmake
113 ;; above. So reset those timestamps for a reproducible build.
114 (with-directory-excursion "resources"
115 (for-each (lambda (file)
116 (let* ((base (basename file ".qm"))
117 (src (string-append base ".ts"))
118 (st (stat src)))
119 (set-file-time file st)))
120 (find-files "." "leocad_.*\\.qm")))
121 #t)))))
122 (home-page "https://www.leocad.org")
123 (synopsis "Create virtual Lego models")
124 (description
125 "LeoCAD is a program for creating virtual LEGO models. It has an
126 intuitive interface, designed to allow new users to start creating new models
127 without having to spend too much time learning the application. LeoCAD is
128 fully compatible with the LDraw Standard and related tools.")
129 (license license:gpl2+)))