lego.scm 5.3 KB

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