guix.scm 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. ;; SuperTux
  2. ;; Copyright (C) 2019 Ingo Ruhnke <grumbel@gmail.com>
  3. ;;
  4. ;; This program is free software: you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;;
  9. ;; This program is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. (use-modules (ice-9 popen)
  17. (ice-9 rdelim)
  18. (guix build utils)
  19. (guix build-system cmake)
  20. (guix build-system gnu)
  21. (guix download)
  22. (guix git-download)
  23. (guix gexp)
  24. ((guix licenses) #:prefix license:)
  25. (guix packages)
  26. (gnu packages audio)
  27. ((gnu packages base) #:prefix base:)
  28. (gnu packages autotools)
  29. (gnu packages boost)
  30. (gnu packages curl)
  31. (gnu packages fontutils)
  32. (gnu packages fribidi)
  33. (gnu packages game-development)
  34. (gnu packages gcc)
  35. (gnu packages gl)
  36. (gnu packages gtk)
  37. (gnu packages pkg-config)
  38. (gnu packages python)
  39. (gnu packages sdl)
  40. (gnu packages squirrel)
  41. (gnu packages version-control)
  42. (gnu packages xiph))
  43. (define %source-dir (dirname (current-filename)))
  44. (define (source-predicate . dirs)
  45. (let ((preds (map (lambda (p)
  46. (git-predicate (string-append %source-dir p)))
  47. dirs)))
  48. (lambda (file stat)
  49. (let loop ((f (car preds))
  50. (rest (cdr preds)))
  51. (if (f file stat)
  52. #t
  53. (if (not (nil? rest))
  54. (loop (car rest) (cdr rest))
  55. #f))))))
  56. (define current-commit
  57. (with-directory-excursion %source-dir
  58. (let* ((port (open-input-pipe "git describe --tags"))
  59. (output (read-line port)))
  60. (close-pipe port)
  61. (string-trim-right output #\newline))))
  62. (define-public raqm
  63. (package
  64. (name "raqm")
  65. (version "0.7.0")
  66. (source
  67. (origin
  68. (method git-fetch)
  69. (uri (git-reference
  70. (url "https://github.com/HOST-Oman/libraqm")
  71. (commit (string-append "v" version))))
  72. (file-name (git-file-name name version))
  73. (sha256
  74. (base32
  75. "0byxvrfb7g6wiykbzrfrvrcf178yjrfvix83bmxsvrdnyh7jqvfx"))))
  76. (build-system gnu-build-system)
  77. (arguments
  78. '(#:tests? #f)) ; needs python and stuff
  79. (native-inputs
  80. `(("autoconf" ,autoconf)
  81. ("automake" ,automake)
  82. ("libtool" ,libtool)
  83. ("pkg-config" ,pkg-config)
  84. ; ("python" ,python)
  85. ))
  86. (inputs
  87. `(("which" ,base:which)
  88. ("gtk-doc" ,gtk-doc)
  89. ("freetype" ,freetype)))
  90. (propagated-inputs
  91. `(("harfbuzz" ,harfbuzz)
  92. ("fribidi" ,fribidi)))
  93. (synopsis "A library for complex text layout")
  94. (description "Raqm is a small library that encapsulates the logic
  95. for complex text layout and provides a convenient API.
  96. It currently provides bidirectional text support (using FriBiDi),
  97. shaping (using HarfBuzz), and proper script itemization. As a result,
  98. Raqm can support most writing systems covered by Unicode.")
  99. (home-page "https://github.com/HOST-Oman/libraqm")
  100. (license license:x11)))
  101. (define-public supertux
  102. (package
  103. (name "supertux")
  104. (version current-commit)
  105. (source (local-file %source-dir
  106. #:recursive? #t
  107. #:select? (source-predicate
  108. ""
  109. "/external/findlocale"
  110. "/external/physfs"
  111. "/external/SDL_ttf"
  112. "/external/squirrel"
  113. "/external/googletest"
  114. "/external/obstack"
  115. "/external/SDL_SavePNG"
  116. "/external/sexp-cpp"
  117. "/external/tinygettext")))
  118. (arguments
  119. `(#:tests? #f
  120. #:configure-flags '("-DINSTALL_SUBDIR_BIN=bin"
  121. "-DUSE_SYSTEM_PHYSFS=ON")
  122. #:phases
  123. (modify-phases %standard-phases
  124. (add-after 'unpack 'set-version-number
  125. (lambda _
  126. (substitute* "version.cmake.in"
  127. (("\\$\\{MAJOR_VERSION_GIT\\}") ,"0")
  128. (("\\$\\{MINOR_VERSION_GIT\\}") ,"6")
  129. (("\\$\\{PATCH_VERSION_GIT\\}") ,"0")
  130. (("\\$\\{TWEAK_VERSION_GIT\\}") ,"")
  131. (("\\$\\{VERSION_STRING_GIT\\}") ,current-commit))
  132. (copy-file "version.cmake.in" "version.cmake")
  133. #t)))))
  134. (build-system cmake-build-system)
  135. (native-inputs
  136. `(;("git" ,git)
  137. ("pkg-config" ,pkg-config)
  138. ("python" ,python)))
  139. (inputs
  140. `(("sdl2" ,sdl2)
  141. ("sdl2-image" ,sdl2-image)
  142. ("sdl2-mixer" ,sdl2-mixer)
  143. ("openal" ,openal)
  144. ("mesa" ,mesa)
  145. ("glew" ,glew)
  146. ("libvorbis" ,libvorbis)
  147. ("libogg" ,libogg)
  148. ("physfs" ,physfs)
  149. ("curl" ,curl)
  150. ("boost" ,boost)
  151. ("freetype" ,freetype)
  152. ("raqm" ,raqm)
  153. ("squirrel" ,squirrel)))
  154. (synopsis "2D platformer game")
  155. (description "SuperTux is a free classic 2D jump'n run sidescroller game
  156. in a style similar to the original Super Mario games covered under
  157. the GNU GPL.")
  158. (home-page "https://supertux.org/")
  159. (license license:gpl3+)))
  160. supertux
  161. ;; EOF ;;