lego.scm 5.2 KB

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