| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu packages lego)
|
| 22 | #:use-module ((guix licenses) #:prefix license:)
|
| 23 | #:use-module (guix download)
|
| 24 | #:use-module (guix git-download)
|
| 25 | #:use-module (guix packages)
|
| 26 | #:use-module (guix build-system gnu)
|
| 27 | #:use-module (gnu packages)
|
| 28 | #:use-module (gnu packages bison)
|
| 29 | #:use-module (gnu packages compression)
|
| 30 | #:use-module (gnu packages compiler-tools)
|
| 31 | #:use-module (gnu packages gl)
|
| 32 | #:use-module (gnu packages qt))
|
| 33 |
|
| 34 | (define-public nqc
|
| 35 | (package
|
| 36 | (name "nqc")
|
| 37 | (version "3.1.r6")
|
| 38 | (source (origin
|
| 39 | |
| 40 | |
| 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)
|
| 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"))))))
|
| 67 | (arguments
|
| 68 | '(#:tests? #f |
| 69 | #:make-flags (list (string-append "PREFIX=" %output))
|
| 70 | #:phases
|
| 71 | (modify-phases %standard-phases
|
| 72 | (delete 'configure)
|
| 73 | (add-before 'build 'rm-generated
|
| 74 | |
| 75 | |
| 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 "..") |
| 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")))))))
|
| 92 | (home-page "https://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
|
| 96 | MINDSTORMS products. The preprocessor and control structures of NQC are very
|
| 97 | similar to C. NQC is not a general purpose language -- there are many
|
| 98 | restrictions that stem from limitations of the standard RCX firmware.")
|
| 99 | (license license:mpl1.0)))
|
| 100 |
|
| 101 | (define-public leocad
|
| 102 | (package
|
| 103 | (name "leocad")
|
| 104 | (version "23.03")
|
| 105 | (source (origin
|
| 106 | (method git-fetch)
|
| 107 | (uri (git-reference
|
| 108 | (url "https://github.com/leozide/leocad")
|
| 109 | (commit (string-append "v" version))))
|
| 110 | (file-name (git-file-name name version))
|
| 111 | (sha256
|
| 112 | (base32
|
| 113 | "0sihx2g06mxaahqdh361xfqf7fkzzyhlr58qlzyr4c8jd2pnd3r1"))))
|
| 114 | (build-system gnu-build-system)
|
| 115 | (native-inputs
|
| 116 | (list qttools-5)) |
| 117 | (inputs
|
| 118 | (list mesa qtbase-5 zlib))
|
| 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")))
|
| 126 | (invoke "qmake"
|
| 127 | (string-append "INSTALL_PREFIX=" out)
|
| 128 | |
| 129 | "QMAKE_LRELEASE=lrelease"
|
| 130 | |
| 131 | "DISABLE_UPDATE_CHECK=1")
|
| 132 | #t)))
|
| 133 | (add-after 'configure 'reset-resource-timestamps
|
| 134 | (lambda _
|
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 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)))
|
| 145 | (find-files "." "leocad_.*\\.qm")))
|
| 146 | #t)))))
|
| 147 | (home-page "https://www.leocad.org")
|
| 148 | (synopsis "Create virtual Lego models")
|
| 149 | (description
|
| 150 | "LeoCAD is a program for creating virtual LEGO models. It has an
|
| 151 | intuitive interface, designed to allow new users to start creating new models
|
| 152 | without having to spend too much time learning the application. LeoCAD is
|
| 153 | fully compatible with the LDraw Standard and related tools.")
|
| 154 | (license license:gpl2+)))
|