game-development.scm 109 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 Tomáš Čech <sleep_walker@suse.cz>
  3. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2015, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
  5. ;;; Copyright © 2015, 2018 Alex Kost <alezost@gmail.com>
  6. ;;; Copyright © 2015, 2016, 2017 David Thompson <davet@gnu.org>
  7. ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  8. ;;; Copyright © 2016, 2017, 2020 Kei Kebreau <kkebreau@posteo.net>
  9. ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
  10. ;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
  11. ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  12. ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
  13. ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
  14. ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
  15. ;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
  16. ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
  17. ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
  18. ;;; Copyright © 2019, 2020, 2021 Leo Prikler <leo.prikler@student.tugraz.at>
  19. ;;; Copyright © 2019 Jethro Cao <jethrocao@gmail.com>
  20. ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  21. ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
  22. ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
  23. ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
  24. ;;; Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
  25. ;;;
  26. ;;; This file is part of GNU Guix.
  27. ;;;
  28. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  29. ;;; under the terms of the GNU General Public License as published by
  30. ;;; the Free Software Foundation; either version 3 of the License, or (at
  31. ;;; your option) any later version.
  32. ;;;
  33. ;;; GNU Guix is distributed in the hope that it will be useful, but
  34. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  35. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  36. ;;; GNU General Public License for more details.
  37. ;;;
  38. ;;; You should have received a copy of the GNU General Public License
  39. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  40. (define-module (gnu packages game-development)
  41. #:use-module (srfi srfi-1)
  42. #:use-module (ice-9 match)
  43. #:use-module ((guix licenses) #:prefix license:)
  44. #:use-module (guix packages)
  45. #:use-module (guix download)
  46. #:use-module (guix git-download)
  47. #:use-module (guix svn-download)
  48. #:use-module (guix utils)
  49. #:use-module (guix build-system cmake)
  50. #:use-module (guix build-system gnu)
  51. #:use-module (guix build-system python)
  52. #:use-module (guix build-system scons)
  53. #:use-module (gnu packages)
  54. #:use-module (gnu packages audio)
  55. #:use-module (gnu packages autotools)
  56. #:use-module (gnu packages base)
  57. #:use-module (gnu packages boost)
  58. #:use-module (gnu packages compression)
  59. #:use-module (gnu packages check)
  60. #:use-module (gnu packages curl)
  61. #:use-module (gnu packages documentation)
  62. #:use-module (gnu packages fltk)
  63. #:use-module (gnu packages fonts)
  64. #:use-module (gnu packages fontutils)
  65. #:use-module (gnu packages freedesktop)
  66. #:use-module (gnu packages fribidi)
  67. #:use-module (gnu packages dbm)
  68. #:use-module (gnu packages gcc)
  69. #:use-module (gnu packages gettext)
  70. #:use-module (gnu packages gl)
  71. #:use-module (gnu packages glib)
  72. #:use-module (gnu packages gnome)
  73. #:use-module (gnu packages gnunet)
  74. #:use-module (gnu packages graphics)
  75. #:use-module (gnu packages graphviz)
  76. #:use-module (gnu packages gtk)
  77. #:use-module (gnu packages guile)
  78. #:use-module (gnu packages image)
  79. #:use-module (gnu packages linux)
  80. #:use-module (gnu packages lua)
  81. #:use-module (gnu packages m4)
  82. #:use-module (gnu packages mono)
  83. #:use-module (gnu packages mp3)
  84. #:use-module (gnu packages multiprecision)
  85. #:use-module (gnu packages music)
  86. #:use-module (gnu packages ncurses)
  87. #:use-module (gnu packages pcre)
  88. #:use-module (gnu packages pkg-config)
  89. #:use-module (gnu packages pulseaudio)
  90. #:use-module (gnu packages python)
  91. #:use-module (gnu packages python-xyz)
  92. #:use-module (gnu packages qt)
  93. #:use-module (gnu packages sdl)
  94. #:use-module (gnu packages sphinx)
  95. #:use-module (gnu packages stb)
  96. #:use-module (gnu packages texinfo)
  97. #:use-module (gnu packages textutils)
  98. #:use-module (gnu packages tls)
  99. #:use-module (gnu packages video)
  100. #:use-module (gnu packages web)
  101. #:use-module (gnu packages xdisorg)
  102. #:use-module (gnu packages xiph)
  103. #:use-module (gnu packages xml)
  104. #:use-module (gnu packages xorg))
  105. (define-public bullet
  106. (package
  107. (name "bullet")
  108. (version "2.89")
  109. (source (origin
  110. (method git-fetch)
  111. (uri (git-reference
  112. (url "https://github.com/bulletphysics/bullet3/")
  113. (commit version)))
  114. (file-name (git-file-name name version))
  115. (sha256
  116. (base32
  117. "10ncf2z474jnv7p5lv01ak2mk2hib3rj5rz1zr8v2v5pnciqbijl"))
  118. (modules '((guix build utils)))
  119. (snippet
  120. '(begin
  121. (for-each delete-file (find-files "build3" "premake*"))
  122. (with-directory-excursion "examples/ThirdPartyLibs"
  123. (for-each delete-file-recursively
  124. '("Gwen" "clsocket" "enet" "glad" "imgui"
  125. "lua-5.2.3" "midi" "minizip" "openvr"
  126. "optionalX11" "serial" "zlib")))
  127. ;; These need files from ThirdPartyLibs.
  128. (substitute* "Extras/CMakeLists.txt"
  129. (("BulletRobotics") ""))
  130. ;; Tests fail on linking, cannot find -lBussIK.
  131. (substitute* "test/CMakeLists.txt"
  132. ((" InverseDynamics")
  133. "../examples/ThirdPartyLibs/BussIK InverseDynamics"))
  134. ; (("SharedMemory") ""))
  135. #t))))
  136. (build-system cmake-build-system)
  137. (arguments
  138. '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
  139. "-DBUILD_CPU_DEMOS=OFF"
  140. "-DBUILD_OPENGL3_DEMOS=OFF"
  141. "-DBUILD_BULLET2_DEMOS=OFF"
  142. (string-append "-DCMAKE_CXX_FLAGS=-fPIC "
  143. (or (getenv "CXXFLAGS") "")))
  144. #:phases
  145. (modify-phases %standard-phases
  146. (add-after 'unpack 'remove-failing-tests
  147. ;; These tests fail specifically after removing 3rd party code.
  148. (lambda _
  149. (substitute* "test/SharedMemory/CMakeLists.txt"
  150. (("ADD_TEST") "# ADD_TEST"))
  151. (substitute* "test/InverseDynamics/CMakeLists.txt"
  152. (("ADD_TEST\\(Test_BulletInverseForward")
  153. "# ADD_TEST(Test_BulletInverseForward"))
  154. #t)))))
  155. (inputs
  156. `(("glu" ,glu)
  157. ("libx11" ,libx11)
  158. ("mesa" ,mesa)))
  159. (home-page "https://pybullet.org/wordpress/")
  160. (synopsis "3D physics engine library")
  161. (description
  162. "Bullet is a physics engine library usable for collision detection. It
  163. is used in some video games and movies.")
  164. (license license:zlib)))
  165. (define-public deutex
  166. (package
  167. (name "deutex")
  168. (version "5.2.2")
  169. (source
  170. (origin
  171. (method url-fetch)
  172. (uri (string-append "https://github.com/Doom-Utils/deutex"
  173. "/releases/download/v" version "/"
  174. "deutex-" version ".tar.zst"))
  175. (sha256
  176. (base32 "0psb2za6ldrlak7s8pjvli98ij5yiwjx8j1ms2v7rj9yadx0xv8h"))))
  177. (build-system gnu-build-system)
  178. (inputs
  179. `(("libpng" ,libpng)))
  180. (native-inputs
  181. `(("asciidoc" ,asciidoc)
  182. ("pkg-config" ,pkg-config)
  183. ("zstd" ,zstd)))
  184. (home-page "https://github.com/Doom-Utils/deutex")
  185. (synopsis "WAD file composer for Doom and related games")
  186. (description
  187. "DeuTex is a wad composer for Doom, Heretic, Hexen and Strife. It can be
  188. used to extract the lumps of a wad and save them as individual files.
  189. Conversely, it can also build a wad from separate files. When extracting a
  190. lump to a file, it does not just copy the raw data, it converts it to an
  191. appropriate format (such as PPM for graphics, Sun audio for samples, etc.).
  192. Conversely, when it reads files for inclusion in pwads, it does the necessary
  193. conversions (for example, from PPM to Doom picture format). In addition,
  194. DeuTex has functions such as merging wads, etc.")
  195. (license license:gpl2+)))
  196. (define-public grfcodec
  197. (package
  198. (name "grfcodec")
  199. (version "6.0.6")
  200. (source
  201. (origin
  202. (method url-fetch)
  203. (uri (string-append "https://binaries.openttd.org/extra/"
  204. name "/" version "/" name "-" version
  205. "-source.tar.xz"))
  206. (sha256
  207. (base32 "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
  208. (build-system gnu-build-system)
  209. (arguments
  210. '(#:tests? #f ;no check target
  211. #:phases
  212. (modify-phases %standard-phases
  213. (delete 'configure) ;no configure script
  214. (replace 'install ;no install target
  215. (lambda* (#:key outputs #:allow-other-keys)
  216. (let* ((out (assoc-ref outputs "out"))
  217. (bin (string-append out "/bin"))
  218. (doc (string-append out "/share/doc"))
  219. (man (string-append out "/share/man/man1")))
  220. (for-each (lambda (file)
  221. (install-file file bin))
  222. '("grfcodec" "grfid" "grfstrip" "nforenum"))
  223. (install-file "COPYING" doc)
  224. (with-directory-excursion "docs"
  225. (for-each (lambda (file)
  226. (install-file (string-append file ".txt") doc))
  227. '("auto_correct" "commands" "grf" "grfcodec" "grftut"
  228. "readme" "readme.rpn"))
  229. (for-each (lambda (file)
  230. (install-file file man))
  231. (find-files "." "\\.1"))))
  232. #t)))))
  233. (inputs
  234. `(("boost" ,boost)
  235. ("libpng" ,libpng)
  236. ("zlib" ,zlib)))
  237. (synopsis "GRF development tools")
  238. (description
  239. "The @dfn{Graphics Resource File} (GRF) development tools are a set of
  240. tools for developing (New)GRFs. It includes a number of smaller programs, each
  241. with a specific task:
  242. @enumerate
  243. @item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
  244. @item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
  245. @item @code{grfstrip} strips all sprites from a GRF.
  246. @item @code{nforenum} checks NFO code for errors, making corrections when
  247. necessary.
  248. @end enumerate")
  249. (home-page "https://dev.openttdcoop.org/projects/grfcodec")
  250. ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
  251. ;; NFORenum is under the GPL2+.
  252. ;; The MD5 implementation contained in GRFID is under the zlib license.
  253. (license (list license:gpl2 license:gpl2+ license:zlib))))
  254. (define-public catcodec
  255. (package
  256. (name "catcodec")
  257. (version "1.0.5")
  258. (source
  259. (origin
  260. (method url-fetch)
  261. (uri (string-append "https://binaries.openttd.org/extra/catcodec/"
  262. version "/catcodec-" version "-source.tar.xz"))
  263. (sha256
  264. (base32 "1qg0c2i4p29sxj0q6qp2jynlrzm5pphz2xhcjqlxa69ycrnlxzs7"))))
  265. (build-system gnu-build-system)
  266. (arguments
  267. `(#:tests? #f ; no tests
  268. #:make-flags (list (string-append "prefix=" %output))
  269. #:phases (modify-phases %standard-phases
  270. (delete 'configure))))
  271. (home-page "https://dev.openttdcoop.org/projects/catcodec")
  272. (synopsis "Encode/decode OpenTTD sounds")
  273. (description "catcodec encodes and decodes sounds for OpenTTD. These
  274. sounds are not much more than some metadata (description and filename) and raw
  275. PCM data.")
  276. (license license:gpl2)))
  277. (define-public gzochi
  278. (package
  279. (name "gzochi")
  280. (version "0.13")
  281. (source (origin
  282. (method url-fetch)
  283. (uri (string-append "mirror://savannah/gzochi/gzochi-"
  284. version ".tar.gz"))
  285. (sha256
  286. (base32
  287. "1vcvf04qqzs3q8kaild2x7qvkwc6bwzfsisb78147b8z747j7hj0"))))
  288. (build-system gnu-build-system)
  289. (arguments
  290. '(#:phases (modify-phases %standard-phases
  291. (add-before 'build 'no-Werror
  292. (lambda _
  293. ;; Don't abort builds due to things like GLib
  294. ;; deprecation warnings.
  295. (substitute* (find-files "." "^Makefile\\.in$")
  296. (("-Werror") ""))
  297. #t)))))
  298. (native-inputs `(("pkgconfig" ,pkg-config)))
  299. (inputs `(("bdb" ,bdb)
  300. ("glib" ,glib)
  301. ("guile" ,guile-3.0)
  302. ("libmicrohttpd" ,libmicrohttpd)
  303. ("ncurses" ,ncurses)
  304. ("sdl" ,sdl)
  305. ("zlib" ,zlib)))
  306. (home-page "https://www.nongnu.org/gzochi/")
  307. (synopsis "Scalable middleware for multiplayer games")
  308. (description
  309. "gzochi is a framework for developing massively multiplayer online games.
  310. A server container provides services to deployed games, which are written in
  311. Guile Scheme, that abstract and simplify some of the most challenging and
  312. error-prone aspects of online game development: Concurrency, data persistence,
  313. and network communications. A very thin client library can be embedded to
  314. provide connectivity for client applications written in any language.")
  315. (license license:gpl3+)))
  316. (define-public nml
  317. (package
  318. (name "nml")
  319. (version "0.5.3")
  320. (source
  321. (origin
  322. (method url-fetch)
  323. (uri (pypi-uri "nml" version))
  324. (sha256
  325. (base32 "0l5pfs8q7jrl3xscqq7pnwh5h5d17fsyjy7xspkc73sa0ayjm9jx"))))
  326. (build-system python-build-system)
  327. ;; TODO: Fix test that fails with
  328. ;; "AttributeError: partially initialized module 'nml.nmlop' has no
  329. ;; attribute 'ADD' (most likely due to a circular import)"
  330. (arguments
  331. '(#:tests? #f))
  332. (propagated-inputs
  333. `(("python-pillow" ,python-pillow)
  334. ("python-ply" ,python-ply)))
  335. (home-page "https://github.com/OpenTTD/nml")
  336. (synopsis "NML compiler")
  337. (description
  338. "@dfn{NewGRF Meta Language} (NML) is a python-based compiler, capable of
  339. compiling NML files (along with their associated language, sound and graphic
  340. files) into @file{.grf} and/or @file{.nfo} files.")
  341. (license license:gpl2+)))
  342. (define-public python-sge
  343. (package
  344. (name "python-sge")
  345. (version "2.0.post0")
  346. (source
  347. (origin
  348. (method url-fetch)
  349. (uri (pypi-uri "sge" version))
  350. (sha256
  351. (base32
  352. "0s5d5qzlzfmqb10iyrqi62n36ll94d99xjaznp5ca6dz1b91qkvr"))))
  353. (build-system python-build-system)
  354. (propagated-inputs
  355. `(("python-pygame" ,python-pygame)
  356. ("python-uniseg" ,python-uniseg)))
  357. (home-page "https://python-sge.github.io/")
  358. (synopsis "2D game engine for Python")
  359. (description
  360. "The SGE Game Engine (\"SGE\", pronounced like \"Sage\") is a
  361. general-purpose 2D game engine. It takes care of several details for you so
  362. you can focus on the game itself. This makes more rapid game development
  363. possible, and it also makes the SGE easy to learn.")
  364. (license license:lgpl3+)))
  365. (define-public python-sge-pygame
  366. (deprecated-package "python-sge-pygame" python-sge))
  367. (define-public python-tmx
  368. (package
  369. (name "python-tmx")
  370. (version "1.10")
  371. (source
  372. (origin
  373. (method url-fetch)
  374. (uri (string-append "mirror://savannah/python-tmx/"
  375. (version-major+minor version) "/tmx-"
  376. version ".tar.gz"))
  377. (sha256
  378. (base32
  379. "073q0prg1nzlkga2b45vhscz374206qh4x68ccg00mxxwagn64z0"))))
  380. (build-system python-build-system)
  381. (propagated-inputs
  382. `(("python-six" ,python-six)))
  383. (home-page "http://python-tmx.nongnu.org")
  384. (synopsis "Python library for the @code{Tiled} TMX format")
  385. (description
  386. "Python TMX reads and writes the @code{Tiled} TMX format in a simple way.
  387. This is useful for map editors or generic level editors, and it's also useful
  388. for using a map editor or generic level editor like Tiled to edit your game's
  389. levels.")
  390. (license (list license:asl2.0
  391. ;; Documentation (only available in the source tarball) is
  392. ;; under the CC0 license.
  393. license:cc0))))
  394. (define-public python2-tmx
  395. (let ((python2-tmx (package-with-python2 python-tmx)))
  396. (package
  397. (inherit python2-tmx)
  398. (propagated-inputs
  399. `(("python2-pathlib" ,python2-pathlib)
  400. ,@(package-propagated-inputs python2-tmx))))))
  401. (define-public python-xsge
  402. (package
  403. (name "python-xsge")
  404. (version "2020.09.07")
  405. (source (origin
  406. (method url-fetch)
  407. (uri (string-append "https://github.com/python-sge/xsge"
  408. "/releases/download/v" version
  409. "/xsge-" version ".zip"))
  410. (sha256
  411. (base32
  412. "136xgy3f9vw636wxpqbha022avk0wyxw63mm3a2dvwhh90s716f9"))))
  413. (build-system python-build-system)
  414. (arguments
  415. '(#:phases
  416. (modify-phases %standard-phases
  417. ;; xSGE's setup.py script does not support one of the Python build
  418. ;; system's default flags, "--single-version-externally-managed".
  419. (replace 'install
  420. (lambda* (#:key outputs #:allow-other-keys)
  421. (invoke "python" "setup.py" "install"
  422. (string-append "--prefix=" (assoc-ref outputs "out"))
  423. "--root=/"))))
  424. #:tests? #f)) ; no check target
  425. (native-inputs
  426. `(("unzip" ,unzip)))
  427. (propagated-inputs
  428. `(("python-sge" ,python-sge)))
  429. (home-page "https://python-sge.github.io/")
  430. (synopsis "Extensions for the SGE Game Engine")
  431. (description
  432. "xSGE is a collection of modules that make doing certain tasks with the SGE
  433. Game Engine easier. In addition to SGE's conveniences, the user has access to a
  434. GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
  435. support.")
  436. (license license:gpl3+)))
  437. (define-public tiled
  438. (package
  439. (name "tiled")
  440. (version "1.5.0")
  441. (source (origin
  442. (method git-fetch)
  443. (uri (git-reference
  444. (url "https://github.com/bjorn/tiled")
  445. (commit (string-append "v" version))))
  446. (file-name (git-file-name name version))
  447. (sha256
  448. (base32
  449. "1prajkx1xpp3csa0xpkrn3c2cnzvmwzxgrqb9d3gqszp3sllr2dg"))))
  450. (build-system gnu-build-system)
  451. (inputs
  452. `(("qtbase" ,qtbase-5)
  453. ("qtdeclarative" ,qtdeclarative)
  454. ("qtsvg" ,qtsvg)
  455. ("zlib" ,zlib)))
  456. (native-inputs
  457. `(("qttools" ,qttools)))
  458. (arguments
  459. '(#:phases
  460. (modify-phases %standard-phases
  461. (replace 'configure
  462. (lambda* (#:key inputs outputs #:allow-other-keys)
  463. (substitute* "translations/translations.pro"
  464. (("LRELEASE =.*")
  465. (string-append "LRELEASE = "
  466. (assoc-ref inputs "qttools")
  467. "/bin/lrelease\n")))
  468. (let ((out (assoc-ref outputs "out")))
  469. (invoke "qmake"
  470. (string-append "PREFIX=" out))))))))
  471. (home-page "https://www.mapeditor.org/")
  472. (synopsis "Tile map editor")
  473. (description
  474. "Tiled is a general purpose tile map editor. It is meant to be used for
  475. editing maps of any tile-based game, be it an RPG, a platformer or a Breakout
  476. clone.")
  477. ;; As noted in 'COPYING', part of it is under GPLv2+, while the rest is
  478. ;; under BSD-2.
  479. (license license:gpl2+)))
  480. (define-public tsukundere
  481. (package
  482. (name "tsukundere")
  483. (version "0.3.2")
  484. (source (origin
  485. (method git-fetch)
  486. (uri (git-reference
  487. (url "https://gitlab.com/leoprikler/tsukundere")
  488. (commit version)))
  489. (file-name (git-file-name name version))
  490. (sha256
  491. (base32
  492. "05y3nj8vpn40hfr2y29p8pa9hhpzibhbvfzpm0dlphjh9crq3ii4"))))
  493. (build-system gnu-build-system)
  494. (arguments
  495. `(#:modules ((ice-9 match)
  496. (srfi srfi-1)
  497. ((guix build guile-build-system)
  498. #:select (target-guile-effective-version))
  499. ,@%gnu-build-system-modules)
  500. #:imported-modules ((guix build guile-build-system)
  501. ,@%gnu-build-system-modules)
  502. #:phases
  503. (modify-phases %standard-phases
  504. (add-after 'unpack 'patch-command
  505. (lambda* (#:key inputs outputs #:allow-other-keys)
  506. (let* ((scm (lambda (in)
  507. (string-append in "/share/guile/site/"
  508. (target-guile-effective-version))))
  509. (ccache (lambda (in)
  510. (string-append in "/lib/guile/"
  511. (target-guile-effective-version)
  512. "/site-ccache")))
  513. (pkgs
  514. (cons
  515. (assoc-ref outputs "out")
  516. (filter-map
  517. (match-lambda
  518. (("guile" . pkg) pkg)
  519. ((label . pkg)
  520. (and (string-prefix? "guile-" label) pkg)))
  521. inputs))))
  522. (substitute* "bin/tsukundere"
  523. (("exec guile (.*)" _ args)
  524. (string-append
  525. (format #f "export GUILE_LOAD_PATH=\"~@?\"~%"
  526. "~{~a~^:~}" (map scm pkgs))
  527. (format #f "export GUILE_LOAD_COMPILED_PATH=\"~@?\"~%"
  528. "~{~a~^:~}" (map ccache pkgs))
  529. "exec "
  530. (assoc-ref inputs "guile")
  531. "/bin/guile " args)))
  532. #t))))))
  533. (native-inputs
  534. `(("autoconf" ,autoconf)
  535. ("automake" ,automake)
  536. ("gettext" ,gettext-minimal)
  537. ("guile" ,guile-3.0)
  538. ("pkg-config" ,pkg-config)
  539. ("texinfo" ,texinfo)))
  540. (inputs
  541. `(("guile-sdl2" ,guile3.0-sdl2)
  542. ("guile" ,guile-3.0)))
  543. (home-page "https://gitlab.com/leoprikler/tsukundere")
  544. (synopsis "Visual novel engine")
  545. (description "Tsukundere is a game engine geared heavily towards the
  546. development of visual novels, written on top of Guile-SDL2. It is still
  547. experimental.")
  548. (license license:lgpl3+)))
  549. (define-public sfml
  550. (package
  551. (name "sfml")
  552. (version "2.5.1")
  553. (source (origin
  554. (method git-fetch)
  555. ;; Do not fetch the archives from
  556. ;; http://mirror0.sfml-dev.org/files/ because files there seem
  557. ;; to be changed in place.
  558. (uri (git-reference
  559. (url "https://github.com/SFML/SFML")
  560. (commit version)))
  561. (file-name (git-file-name name version))
  562. (sha256
  563. (base32
  564. "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay"))
  565. (modules '((guix build utils)))
  566. (snippet
  567. '(begin
  568. ;; Ensure system libraries are used.
  569. (delete-file-recursively "extlibs")
  570. #t))))
  571. (build-system cmake-build-system)
  572. (arguments
  573. '(#:configure-flags
  574. (list "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE"
  575. "-DSFML_OS_PKGCONFIG_DIR=lib/pkgconfig")
  576. #:tests? #f)) ; no tests
  577. (native-inputs
  578. `(("pkg-config" ,pkg-config)))
  579. (inputs
  580. `(("mesa" ,mesa)
  581. ("glew" ,glew)
  582. ("libx11" ,libx11)
  583. ("xcb-util-image" ,xcb-util-image)
  584. ("libxrandr" ,libxrandr)
  585. ("eudev" ,eudev)
  586. ("libjpeg" ,libjpeg-turbo)
  587. ("libsndfile" ,libsndfile)
  588. ("stb-image" ,stb-image)
  589. ("stb-image-write" ,stb-image-write)))
  590. (propagated-inputs
  591. ;; In Requires.private of pkg-config files.
  592. `(("flac" ,flac)
  593. ("freetype" ,freetype)
  594. ("libvorbis" ,libvorbis)
  595. ("openal" ,openal)))
  596. (home-page "https://www.sfml-dev.org")
  597. (synopsis "Simple and Fast Multimedia Library")
  598. (description
  599. "SFML provides a simple interface to the various computer components,
  600. to ease the development of games and multimedia applications. It is composed
  601. of five modules: system, window, graphics, audio and network.")
  602. (license license:zlib)))
  603. (define-public sfxr
  604. (package
  605. (name "sfxr")
  606. (version "1.2.1")
  607. (source (origin
  608. (method url-fetch)
  609. (uri (string-append "http://www.drpetter.se/files/sfxr-sdl-1.2.1.tar.gz"))
  610. (sha256
  611. (base32
  612. "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya"))))
  613. (build-system gnu-build-system)
  614. (arguments
  615. `(#:phases (modify-phases %standard-phases
  616. (delete 'configure) ; no configure script
  617. (add-before 'build 'patch-makefile
  618. (lambda* (#:key outputs #:allow-other-keys)
  619. (let ((out (assoc-ref outputs "out")))
  620. (substitute* "Makefile"
  621. (("\\$\\(DESTDIR\\)/usr") out))
  622. (substitute* "main.cpp"
  623. (("/usr/share")
  624. (string-append out "/share")))
  625. #t))))
  626. #:tests? #f)) ; no tests
  627. (native-inputs
  628. `(("pkg-config" ,pkg-config)
  629. ("desktop-file-utils" ,desktop-file-utils)))
  630. (inputs
  631. `(("sdl" ,sdl)
  632. ("gtk+" ,gtk+)))
  633. (synopsis "Simple sound effect generator")
  634. (description "Sfxr is a tool for quickly generating simple sound effects.
  635. Originally created for use in video game prototypes, it can generate random
  636. sounds from presets such as \"explosion\" or \"powerup\".")
  637. (home-page "http://www.drpetter.se/project_sfxr.html")
  638. (license license:expat)))
  639. (define-public surgescript
  640. (package
  641. (name "surgescript")
  642. (version "0.5.5")
  643. (source
  644. (origin
  645. (method git-fetch)
  646. (uri (git-reference
  647. (url "https://github.com/alemart/surgescript")
  648. (commit (string-append "v" version))))
  649. (file-name (git-file-name name version))
  650. (sha256
  651. (base32 "0xwd4g7n0b0rxkpbyshkzyl472h1y606ghyvf8gv034n3jz2g4jk"))))
  652. (build-system cmake-build-system)
  653. (arguments
  654. '(#:configure-flags
  655. (let ((share (string-append (assoc-ref %outputs "out") "/share")))
  656. (list "-DWANT_STATIC=NO"
  657. (string-append "-DICON_PATH=" share "/pixmaps")
  658. (string-append "-DMETAINFO_PATH=" share "/metainfo")))
  659. #:tests? #f))
  660. (home-page "https://docs.opensurge2d.org")
  661. (synopsis "Scripting language for games")
  662. (description "@code{SurgeScript} is a dynamically typed object-oriented
  663. scripting language designed for games. Each object is a state machine that
  664. can be customized by attaching other objects. The language supports automatic
  665. garbage collection and can be extended with plugins.")
  666. (license license:asl2.0)))
  667. (define-public physfs
  668. (package
  669. (name "physfs")
  670. (version "3.0.2")
  671. (source (origin
  672. (method url-fetch)
  673. (uri (string-append
  674. "https://icculus.org/physfs/downloads/physfs-"
  675. version ".tar.bz2"))
  676. (file-name (string-append name "-" version ".tar.gz"))
  677. (sha256
  678. (base32
  679. "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h"))))
  680. (build-system cmake-build-system)
  681. (arguments
  682. '(#:tests? #f ; no check target
  683. #:configure-flags '("-DPHYSFS_BUILD_STATIC=OFF")
  684. #:phases (modify-phases %standard-phases
  685. (add-after 'unpack 'patch-CMakeLists.txt
  686. (lambda _
  687. (substitute* "CMakeLists.txt"
  688. ;; XXX: For some reason CMakeLists.txt disables
  689. ;; RUNPATH manipulation when the compiler is GCC.
  690. (("CMAKE_COMPILER_IS_GNUCC") "FALSE"))
  691. #t)))))
  692. (inputs
  693. `(("zlib" ,zlib)))
  694. (native-inputs
  695. `(("doxygen" ,doxygen)))
  696. (home-page "https://icculus.org/physfs")
  697. (synopsis "File system abstraction library")
  698. (description
  699. "PhysicsFS is a library to provide abstract access to various archives.
  700. It is intended for use in video games. For security, no file writing done
  701. through the PhysicsFS API can leave a defined @emph{write directory}. For
  702. file reading, a @emph{search path} with archives and directories is defined,
  703. and it becomes a single, transparent hierarchical file system. So archive
  704. files can be accessed in the same way as you access files directly on a disk,
  705. and it makes it easy to ship a new archive that will override a previous
  706. archive on a per-file basis.")
  707. (license license:zlib)))
  708. (define-public love
  709. (package
  710. (name "love")
  711. (version "11.3")
  712. (source (origin
  713. (method url-fetch)
  714. (uri (string-append "https://bitbucket.org/rude/love/downloads/"
  715. "love-" version "-linux-src.tar.gz"))
  716. (sha256
  717. (base32
  718. "0m8lvlabmcchskx4qpzkdlsm44360f3j0q3vvvj2388cfnvhv7v4"))))
  719. (build-system gnu-build-system)
  720. (native-inputs
  721. `(("pkg-config" ,pkg-config)))
  722. (inputs
  723. `(("devil" ,devil)
  724. ("freetype" ,freetype)
  725. ("libmodplug" ,libmodplug)
  726. ("libtheora" ,libtheora)
  727. ("libvorbis" ,libvorbis)
  728. ("luajit" ,luajit)
  729. ("mesa" ,mesa)
  730. ("mpg123" ,mpg123)
  731. ("openal" ,openal)
  732. ("sdl2" ,sdl2)
  733. ("zlib" ,zlib)))
  734. (synopsis "2D game framework for Lua")
  735. (description "LÖVE is a framework for making 2D games in the Lua
  736. programming language.")
  737. (home-page "https://love2d.org/")
  738. (license license:zlib)))
  739. (define-public love-nuklear
  740. (let ((version "v2.6")
  741. (commit "fef4e00a602efb16c57ae962850b6e7a01f7a29a"))
  742. (package
  743. (name "love-nuklear")
  744. (version (git-version version "1" commit))
  745. (source (origin
  746. (method git-fetch)
  747. (uri (git-reference
  748. (url "https://github.com/keharriso/love-nuklear/")
  749. (commit commit)
  750. (recursive? #t)))
  751. ;; NOTE: the HEAD of the Nuklear git-submodule is at commit
  752. ;; "adc52d710fe3c87194b99f540c53e82eb75c2521" of Oct 1 2019
  753. (file-name (git-file-name name version))
  754. (sha256
  755. (base32
  756. "15qmy8mfwkxy2x9rmxs6f9cyvjvwwj6yf78bs863xmc56dmjzzbn"))))
  757. (build-system cmake-build-system)
  758. (arguments
  759. `(#:build-type "Release"
  760. #:tests? #f))
  761. (inputs
  762. `(("luajit" ,luajit)))
  763. (synopsis "Lightweight immediate mode GUI for LÖVE games")
  764. (description "LÖVE is a Lua framework for making 2D games. Nuklear
  765. is a minimal state immediate mode graphical user interface toolkit. This
  766. package is the Nuklear bindings for LÖVE created by Kevin Harrison.")
  767. (home-page "https://github.com/keharriso/love-nuklear/")
  768. (license license:expat))))
  769. (define-public allegro-4
  770. (package
  771. (name "allegro")
  772. (version "4.4.3")
  773. (source (origin
  774. (method url-fetch)
  775. (uri (string-append "https://github.com/liballeg/allegro5/"
  776. "releases/download/" version "/allegro-"
  777. version ".tar.gz"))
  778. (sha256
  779. (base32
  780. "1d5ws3ihvpa6f4qc6a6drq31pajw6bblxifr4kcxzqj9br1nw28y"))))
  781. (build-system cmake-build-system)
  782. (arguments
  783. '(#:phases
  784. (modify-phases %standard-phases
  785. (add-after 'unpack 'patch-build-system
  786. (lambda _
  787. ;; Build addons as shared libraries. Trying to set ADDON_LINKAGE
  788. ;; via a command line option doesn't work because it is
  789. ;; unconditionally clobbered in the build script.
  790. (substitute* '("CMakeLists.txt")
  791. (("ADDON_LINKAGE STATIC")
  792. "ADDON_LINKAGE SHARED"))
  793. #t)))))
  794. (inputs
  795. `(("glu" ,glu)
  796. ("libpng" ,libpng)
  797. ("libvorbis" ,libvorbis)
  798. ("mesa" ,mesa)
  799. ("zlib" ,zlib)))
  800. (synopsis "Game programming library")
  801. (description "Allegro is a library mainly aimed at video game and
  802. multimedia programming. It handles common, low-level tasks such as creating
  803. windows, accepting user input, loading data, drawing images, playing sounds,
  804. etc.")
  805. (home-page "https://liballeg.org")
  806. (license license:giftware)))
  807. (define-public allegro
  808. (package
  809. (name "allegro")
  810. (version "5.2.5.0")
  811. (source (origin
  812. (method url-fetch)
  813. (uri (string-append "https://github.com/liballeg/allegro5/releases"
  814. "/download/" version "/allegro-"
  815. version ".tar.gz"))
  816. (sha256
  817. (base32
  818. "06dpkfnac8w3pq36834nn2iij3ajz6prladqd0w92lq39aiqv5jr"))))
  819. (build-system cmake-build-system)
  820. (arguments `(#:tests? #f)) ; there are no tests
  821. (inputs
  822. ;; FIXME: Add the following optional inputs: xinput2, opensl, dumb
  823. `(("flac" ,flac)
  824. ("freetype" ,freetype)
  825. ("glu" ,glu)
  826. ("gtk" ,gtk+-2)
  827. ("libjpeg" ,libjpeg-turbo)
  828. ("libpng" ,libpng)
  829. ("libtheora" ,libtheora)
  830. ("libvorbis" ,libvorbis)
  831. ("libxcursor" ,libxcursor)
  832. ("libxinerama" ,libxinerama)
  833. ("libxrandr" ,libxrandr)
  834. ("mesa" ,mesa)
  835. ("openal" ,openal)
  836. ("physfs" ,physfs)
  837. ("zlib" ,zlib)))
  838. (native-inputs
  839. `(("pkg-config" ,pkg-config)))
  840. (synopsis "Game programming library")
  841. (description "Allegro is a library mainly aimed at video game and
  842. multimedia programming. It handles common, low-level tasks such as creating
  843. windows, accepting user input, loading data, drawing images, playing sounds,
  844. etc.")
  845. (home-page "https://liballeg.org")
  846. (license license:bsd-3)))
  847. (define-public allegro-5.0
  848. (package (inherit allegro)
  849. (name "allegro")
  850. (version "5.0.11")
  851. (source (origin
  852. (method url-fetch)
  853. (uri (string-append "https://github.com/liballeg/allegro5/releases"
  854. "/download/" version "/allegro-"
  855. (if (equal? "0" (string-take-right version 1))
  856. (string-drop-right version 2)
  857. version)
  858. ".tar.gz"))
  859. (patches (search-patches
  860. "allegro-mesa-18.2.5-and-later.patch"))
  861. (sha256
  862. (base32
  863. "0cd51qrh97jrr0xdmnivqgwljpmizg8pixsgvc4blqqlaz4i9zj9"))))))
  864. (define-public aseprite
  865. (package
  866. (name "aseprite")
  867. (version "1.1.7") ; After 1.1.7 the source is no longer distributed under the GPL.
  868. ;; TODO: Unbundle third party software.
  869. (source (origin
  870. (method url-fetch/zipbomb)
  871. (uri (string-append "https://github.com/aseprite/aseprite"
  872. "/releases/download/v" version
  873. "/Aseprite-v" version "-Source.zip"))
  874. (sha256
  875. (base32
  876. "1plss4i1lfxcznv9p0pip1bkhj7ipw7jlhsh5avd6dzw079l4nvv"))))
  877. (build-system cmake-build-system)
  878. (arguments
  879. '(#:configure-flags
  880. ;; Use shared libraries instead of building bundled source.
  881. (list "-DWITH_WEBP_SUPPORT=1"
  882. "-DUSE_SHARED_CURL=1"
  883. "-DUSE_SHARED_GIFLIB=1"
  884. "-DUSE_SHARED_JPEGLIB=1"
  885. "-DUSE_SHARED_ZLIB=1"
  886. "-DUSE_SHARED_LIBPNG=1"
  887. "-DUSE_SHARED_LIBLOADPNG=1"
  888. "-DUSE_SHARED_LIBWEBP=1"
  889. "-DUSE_SHARED_TINYXML=1"
  890. "-DUSE_SHARED_PIXMAN=1"
  891. "-DUSE_SHARED_FREETYPE=1"
  892. "-DUSE_SHARED_ALLEGRO4=1"
  893. "-DENABLE_UPDATER=0" ; no auto-updates
  894. (string-append "-DFREETYPE_INCLUDE_DIR="
  895. (assoc-ref %build-inputs "freetype")
  896. "/include/freetype2"))))
  897. (native-inputs
  898. `(("pkg-config" ,pkg-config)))
  899. ;; TODO: Use a patched Allegro 4 that supports window resizing. This
  900. ;; patched version is bundled with Aseprite, but the patches should be
  901. ;; extracted and applied on top of a standalone Allegro 4 package.
  902. (inputs
  903. `(("allegro" ,allegro-4)
  904. ("curl" ,curl)
  905. ("freetype" ,freetype)
  906. ("giflib" ,giflib)
  907. ("libjpeg" ,libjpeg-turbo)
  908. ("libpng" ,libpng)
  909. ("libwebp" ,libwebp)
  910. ("libx11" ,libx11)
  911. ("libxext" ,libxext)
  912. ("libxxf86vm" ,libxxf86vm)
  913. ("pixman" ,pixman)
  914. ("tinyxml" ,tinyxml)
  915. ("zlib" ,zlib)))
  916. (synopsis "Animated sprite editor and pixel art tool")
  917. (description "Aseprite is a tool for creating 2D pixel art for video
  918. games. In addition to basic pixel editing features, Aseprite can assist in
  919. the creation of animations, tiled graphics, texture atlases, and more.")
  920. (home-page "https://www.aseprite.org/")
  921. (license license:gpl2+)))
  922. (define-public qqwing
  923. (package
  924. (name "qqwing")
  925. (version "1.3.4")
  926. (source (origin
  927. (method url-fetch)
  928. (uri (string-append
  929. "https://qqwing.com/"
  930. name "-" version ".tar.gz"))
  931. (sha256
  932. (base32
  933. "0bw0papyqjg22z6irf36gs54y8236wa37b6gyn2h1spy65n76lqp"))))
  934. (build-system gnu-build-system)
  935. (native-inputs
  936. `(("pkg-config" ,pkg-config)))
  937. (home-page "https://qqwing.com/")
  938. (synopsis "Sudoku puzzle solver and generator")
  939. (description
  940. "QQWing is a Sudoku puzzle generator and solver.
  941. It offers the following features:
  942. @enumerate
  943. @item Can solve 1000 puzzles in 1 second and generate 1000 puzzles in 25 seconds.
  944. @item Uses logic. Uses as many solve techniques as possible when solving
  945. puzzles rather than guessing.
  946. @item Rates puzzles. Most generators don't give an indication of the difficulty
  947. of a Sudoku puzzle. QQwing does.
  948. @item Can print solve instructions for any puzzle.
  949. @item Customizable output style, including a CSV style that is easy to
  950. import into a database.
  951. @end enumerate")
  952. (license license:gpl2+)))
  953. (define-public quesoglc
  954. (package
  955. (name "quesoglc")
  956. (version "0.7.2")
  957. (source (origin
  958. (method url-fetch)
  959. (uri (string-append "mirror://sourceforge/" name "/" version "/"
  960. name "-" version "-free.tar.bz2"))
  961. (sha256
  962. (base32
  963. "08ddhywdy2qg17m592ng3yr0p1ih96irg8wg729g75hsxxq9ipks"))))
  964. (build-system gnu-build-system)
  965. (native-inputs `(("pkg-config" ,pkg-config)))
  966. (inputs `(("fontconfig" ,fontconfig)
  967. ("freeglute" ,freeglut)
  968. ("fribidi" ,fribidi)
  969. ("glew" ,glew)))
  970. (home-page "http://quesoglc.sourceforge.net")
  971. (synopsis "Implementation of the OpenGL Character Renderer (GLC)")
  972. (description
  973. "The OpenGL Character Renderer (GLC) is a state machine that provides
  974. OpenGL programs with character rendering services via an application programming
  975. interface (API).")
  976. (license (list license:expat license:lgpl2.1+))))
  977. (define-public python-pygame
  978. (package
  979. (name "python-pygame")
  980. (version "1.9.4")
  981. (source (origin
  982. (method url-fetch)
  983. (uri (pypi-uri "pygame" version))
  984. (sha256
  985. (base32
  986. "1dn0nb86jl7yr8709cncxdr0yrmviqakw7zx3g8jbbwrr60if3bh"))))
  987. (build-system python-build-system)
  988. (arguments
  989. `(#:tests? #f ; tests require pygame to be installed first
  990. #:phases
  991. (modify-phases %standard-phases
  992. ;; Set the paths to the dependencies manually because
  993. ;; the configure script does not allow passing them as
  994. ;; parameters. This also means we can skip the configure
  995. ;; phase.
  996. (add-before 'build 'set-library-paths
  997. (lambda* (#:key inputs outputs #:allow-other-keys)
  998. (let ((sdl-ref (assoc-ref inputs "sdl"))
  999. (font-ref (assoc-ref inputs "sdl-ttf"))
  1000. (image-ref (assoc-ref inputs "sdl-image"))
  1001. (mixer-ref (assoc-ref inputs "sdl-mixer"))
  1002. (smpeg-ref (assoc-ref inputs "libsmpeg"))
  1003. (png-ref (assoc-ref inputs "libpng"))
  1004. (jpeg-ref (assoc-ref inputs "libjpeg"))
  1005. (freetype-ref (assoc-ref inputs "freetype"))
  1006. (v4l-ref (assoc-ref inputs "v4l-utils"))
  1007. (out-ref (assoc-ref outputs "out")))
  1008. (substitute* "Setup.in"
  1009. (("SDL = -I/usr/include/SDL")
  1010. (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
  1011. (substitute* "Setup.in"
  1012. (("FONT = -lSDL_ttf")
  1013. (string-append "FONT = -I" font-ref "/include/SDL -L"
  1014. font-ref "/lib -lSDL_ttf")))
  1015. (substitute* "Setup.in"
  1016. (("IMAGE = -lSDL_image")
  1017. (string-append "IMAGE = -I" image-ref "/include/SDL -L"
  1018. image-ref "/lib -lSDL_image")))
  1019. (substitute* "Setup.in"
  1020. (("MIXER = -lSDL_mixer")
  1021. (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
  1022. mixer-ref "/lib -lSDL_mixer")))
  1023. (substitute* "Setup.in"
  1024. (("SMPEG = -lsmpeg")
  1025. (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
  1026. smpeg-ref "/lib -lsmpeg")))
  1027. (substitute* "Setup.in"
  1028. (("PNG = -lpng")
  1029. (string-append "PNG = -I" png-ref "/include -L"
  1030. png-ref "/lib -lpng")))
  1031. (substitute* "Setup.in"
  1032. (("JPEG = -ljpeg")
  1033. (string-append "JPEG = -I" jpeg-ref "/include -L"
  1034. jpeg-ref "/lib -ljpeg")))
  1035. (substitute* "Setup.in"
  1036. (("FREETYPE = -lfreetype")
  1037. (string-append "FREETYPE = -I" freetype-ref "/include/freetype2 -L"
  1038. freetype-ref "/lib -lfreetype")))
  1039. (substitute* "Setup.in"
  1040. (("^pypm") "#pypm"))
  1041. ;; Create a path to a header file provided by v4l-utils.
  1042. (system* "mkdir" "linux")
  1043. (system* "ln" "--symbolic"
  1044. (string-append v4l-ref "/include/libv4l1-videodev.h")
  1045. "linux/videodev.h")
  1046. (system* "ln" "--symbolic" "Setup.in" "Setup")))))))
  1047. (inputs
  1048. `(("freetype" ,freetype)
  1049. ("sdl" ,sdl)
  1050. ("sdl-image" ,sdl-image)
  1051. ("sdl-mixer" ,sdl-mixer)
  1052. ("sdl-ttf" ,sdl-ttf)
  1053. ("sdl-gfx" ,sdl-gfx)
  1054. ("libjpeg" ,libjpeg-turbo)
  1055. ("libpng" ,libpng)
  1056. ("libX11" ,libx11)
  1057. ("libsmpeg" ,libsmpeg)
  1058. ("portmidi" ,portmidi)
  1059. ("v4l-utils" ,v4l-utils)))
  1060. (home-page "https://www.pygame.org")
  1061. (synopsis "SDL wrapper for Python")
  1062. (description "Pygame is a set of Python modules designed for writing games.
  1063. Pygame adds functionality on top of the excellent SDL library. This allows you
  1064. to create fully featured games and multimedia programs in the python language.")
  1065. (license (list license:bsd-2
  1066. ;; python numeric license as listed by Debian looks like
  1067. ;; an Expat-style license with a warranty disclaimer for
  1068. ;; the U.S. government and the University of California.
  1069. license:expat
  1070. license:lgpl2.0+
  1071. license:lgpl2.1+
  1072. license:gpl3+
  1073. license:psfl
  1074. license:public-domain
  1075. license:lgpl2.1+))))
  1076. (define-public python2-pygame
  1077. (package-with-python2 python-pygame))
  1078. (define-public python-pygame-sdl2
  1079. (let ((real-version "2.1.0")
  1080. (renpy-version "7.4.8"))
  1081. (package
  1082. (inherit python-pygame)
  1083. (name "python-pygame-sdl2")
  1084. (version (string-append real-version "-for-renpy-" renpy-version))
  1085. (source
  1086. (origin
  1087. (method url-fetch)
  1088. (uri (string-append "https://www.renpy.org/dl/" renpy-version
  1089. "/pygame_sdl2-" version ".tar.gz"))
  1090. (sha256 (base32 "1yyqcg7khac17jif86vi2d4j9l8x2vfg4h5pasrwwsy0g8386zsm"))
  1091. (modules '((guix build utils)))
  1092. (snippet
  1093. '(begin
  1094. ;; drop generated sources
  1095. (delete-file-recursively "gen")
  1096. (delete-file-recursively "gen3")
  1097. (delete-file-recursively "gen-static")
  1098. #t))))
  1099. (build-system python-build-system)
  1100. (arguments
  1101. `(#:tests? #f ; tests require pygame to be installed first
  1102. #:phases
  1103. (modify-phases %standard-phases
  1104. (add-after 'set-paths 'set-sdl-vars
  1105. (lambda* (#:key inputs #:allow-other-keys)
  1106. (setenv "PYGAME_SDL2_CFLAGS"
  1107. (string-append "-I"
  1108. (assoc-ref inputs "sdl-union")
  1109. "/include/SDL2 -D_REENTRANT"))
  1110. (setenv "PYGAME_SDL2_LDFLAGS"
  1111. (string-append "-L"
  1112. (assoc-ref inputs "sdl-union")
  1113. "/lib -Wl,-rpath,"
  1114. (assoc-ref inputs "sdl-union")
  1115. "/lib -Wl,--enable-new-dtags -lSDL2"))
  1116. #t)))))
  1117. (inputs
  1118. `(("sdl-union"
  1119. ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))))
  1120. (native-inputs
  1121. `(("python-cython" ,python-cython)))
  1122. (home-page "https://www.renpy.org/")
  1123. (synopsis "Reimplementation of the Pygame API using SDL2")
  1124. (description "Pygame_SDL2 reimplements the Pygame API using SDL2,
  1125. staying close to the original, but also adding some SDL2-specific features.
  1126. While it aims to be used as a drop-in replacement, it appears to be
  1127. developed mainly for Ren'py.")
  1128. (license (list license:lgpl2.1 license:zlib)))))
  1129. (define-public python2-pygame-sdl2
  1130. (package-with-python2 python-pygame-sdl2))
  1131. (define-public python2-renpy
  1132. (package
  1133. (name "python2-renpy")
  1134. (version "7.4.8")
  1135. (source
  1136. (origin
  1137. (method url-fetch)
  1138. (uri (string-append "https://www.renpy.org/dl/" version
  1139. "/renpy-" version "-source.tar.bz2"))
  1140. (sha256 (base32 "1ml3gs87xxk1iflrg5ivffr4q8fi7d65l1cx462bvvpm1rs2sa8d"))
  1141. (modules '((guix build utils)))
  1142. (patches
  1143. (search-patches
  1144. "renpy-use-system-fribidi.patch"))
  1145. (snippet
  1146. '(with-directory-excursion "module"
  1147. ;; drop generated sources
  1148. (delete-file-recursively "gen")
  1149. ;; drop fribidi sources
  1150. (delete-file-recursively "fribidi-src")
  1151. #t))))
  1152. (build-system python-build-system)
  1153. (arguments
  1154. `(#:tests? #f ; Ren'py doesn't seem to package tests
  1155. #:python ,python-2
  1156. #:phases
  1157. (modify-phases %standard-phases
  1158. (add-after 'unpack 'fix-commands
  1159. (lambda* (#:key inputs #:allow-other-keys)
  1160. (substitute* "renpy/editor.py"
  1161. (("xdg-open")
  1162. (string-append (assoc-ref inputs "xdg-utils")
  1163. "/bin/xdg-open")))
  1164. #t))
  1165. (add-after 'unpack 'fix-include-paths
  1166. (lambda* (#:key inputs #:allow-other-keys)
  1167. (substitute* "module/setup.py"
  1168. (("/usr/include/fribidi")
  1169. (search-input-directory inputs "include/fribidi")))))
  1170. (add-after 'set-paths 'set-build-vars
  1171. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  1172. (setenv "RENPY_CYTHON"
  1173. (search-input-file (or native-inputs inputs)
  1174. "/bin/cython"))
  1175. (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))
  1176. #t))
  1177. (replace 'build
  1178. (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
  1179. ;; The "module" subdirectory contains a python (really cython)
  1180. ;; project, which is built using a script, that is thankfully
  1181. ;; named "setup.py".
  1182. (with-directory-excursion "module"
  1183. (apply (assoc-ref %standard-phases 'build) args))
  1184. ;; the above causes renpy.__init__ to be compiled but does not
  1185. ;; compile anything else, hence we do that here
  1186. (delete-file "renpy/__init__.pyc")
  1187. (invoke "python" "-m" "compileall" "renpy")
  1188. #t))
  1189. (replace 'install
  1190. (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
  1191. ;; Again, we have to wrap the module installation.
  1192. ;; Additionally, we want to install the python code
  1193. ;; (both source and compiled) in the same directory.
  1194. (let* ((out (assoc-ref outputs "out"))
  1195. (site (string-append "/lib/python"
  1196. (python-version
  1197. (assoc-ref inputs "python"))
  1198. "/site-packages")))
  1199. (with-directory-excursion "module"
  1200. (apply (assoc-ref %standard-phases 'install) args))
  1201. (copy-recursively "renpy"
  1202. (string-append out site "/renpy"))
  1203. (delete-file-recursively (string-append out site "/renpy/common")))
  1204. #t)))))
  1205. (inputs
  1206. `(("ffmpeg" ,ffmpeg)
  1207. ("freetype" ,freetype)
  1208. ("fribidi" ,fribidi)
  1209. ("glew" ,glew)
  1210. ("libpng" ,libpng)
  1211. ("sdl-union"
  1212. ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf)))
  1213. ("xdg-utils" ,xdg-utils)))
  1214. (propagated-inputs
  1215. `(("python2-future" ,python2-future)
  1216. ("python2-pygame" ,python2-pygame-sdl2)))
  1217. (native-inputs
  1218. `(("python2-cython" ,python2-cython)))
  1219. (home-page "https://www.renpy.org/")
  1220. (synopsis "Ren'py python module")
  1221. (description "This package contains the shared libraries and Python modules
  1222. of Ren'py. While functional, they are not meaningful on their own without
  1223. the launcher and common Ren'py code provided by the @code{renpy} package and
  1224. are only used to bootstrap it.")
  1225. (license license:expat)))
  1226. (define-public renpy
  1227. (package
  1228. (inherit python2-renpy)
  1229. (name "renpy")
  1230. (build-system python-build-system)
  1231. (arguments
  1232. `(#:tests? #f ; see python2-renpy
  1233. #:python ,python-2
  1234. #:modules ((srfi srfi-1)
  1235. (guix build python-build-system)
  1236. (guix build utils))
  1237. #:imported-modules ((srfi srfi-1) ,@%python-build-system-modules)
  1238. #:phases
  1239. (modify-phases %standard-phases
  1240. (add-after 'unpack 'fix-commands
  1241. (lambda* (#:key inputs outputs #:allow-other-keys)
  1242. (substitute* "launcher/game/choose_directory.rpy"
  1243. (("/usr/bin/python")
  1244. (string-append (assoc-ref inputs "python2")
  1245. "/bin/python2")))
  1246. (substitute* "launcher/game/front_page.rpy"
  1247. (("xdg-open")
  1248. (string-append (assoc-ref inputs "xdg-utils")
  1249. "/bin/xdg-open")))
  1250. (substitute* "launcher/game/project.rpy"
  1251. (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]")
  1252. (string-append "cmd = [ \"" (assoc-ref outputs "out")
  1253. "/bin/renpy\" ]"))
  1254. ;; Projects are still created in the usual style, so we need
  1255. ;; to adjust the path.
  1256. (("cmd.append\\(self.path\\)")
  1257. "cmd.append(self.path + \"/game\")"))
  1258. #t))
  1259. (add-after 'unpack 'drop-game-from-paths
  1260. (lambda _
  1261. (substitute* (list "launcher/game/gui7.rpy"
  1262. "launcher/game/gui7/images.py")
  1263. ((", \"game\",") ","))
  1264. #t))
  1265. (add-before 'build 'start-xserver
  1266. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  1267. (let ((xorg-server (assoc-ref (or native-inputs inputs)
  1268. "xorg-server")))
  1269. (setenv "HOME" (getcwd))
  1270. (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
  1271. (setenv "DISPLAY" ":1")
  1272. #t)))
  1273. (replace 'build
  1274. (lambda _
  1275. (invoke "python" "renpy.py" "launcher" "quit")
  1276. (invoke "python" "renpy.py" "the_question" "quit")
  1277. (invoke "python" "renpy.py" "tutorial" "quit")
  1278. #t))
  1279. (replace 'install
  1280. (lambda* (#:key inputs outputs #:allow-other-keys)
  1281. ;; Here we install our custom renpy program.
  1282. ;; After finishing this step, "out" will have the following:
  1283. ;; |-- bin/renpy
  1284. ;; `-- share/renpy ; i.e. path_to_renpy_base()
  1285. ;; |-- common
  1286. ;; `-- gui
  1287. ;;
  1288. ;; Note that common shares the source files that would be installed
  1289. ;; by python2-renpy (which are instead deleted from that package),
  1290. ;; but also contains their byte-compiled versions.
  1291. ;; On other systems, renpy_base would point to site-packages or
  1292. ;; even somewhere in /opt.
  1293. ;; The former approach is not as straightforward as it seems
  1294. ;; -- it causes renpy to load files twice for some weird reason --
  1295. ;; and the latter is impossible on Guix. Hence the detour through
  1296. ;; share/renpy and the custom renpy program.
  1297. ;;
  1298. ;; As a convention, other games should be installed as
  1299. ;; subdirectories of share/renpy in their respective outputs as
  1300. ;; well. This differs from the traditional layout, which is
  1301. ;; roughly the following:
  1302. ;; `-- Super Awesome Game
  1303. ;; |-- game ; <- the folder we actually want
  1304. ;; |-- lib ; compiled renpy module and dependencies
  1305. ;; |-- renpy ; yet another copy of Ren'py's code
  1306. ;; | |-- common ; the common folder from above
  1307. ;; | `-- ... ; Python code (source + compiled)
  1308. ;; |-- Super Awesome Game.py
  1309. ;; `-- Super Awesome Game.sh
  1310. (let* ((out (assoc-ref outputs "out"))
  1311. (bin/renpy (string-append out "/bin/renpy")))
  1312. (mkdir-p (string-append out "/bin"))
  1313. (copy-recursively "renpy/common"
  1314. (string-append out "/share/renpy/common"))
  1315. (copy-recursively "gui"
  1316. (string-append out "/share/renpy/gui"))
  1317. (call-with-output-file bin/renpy
  1318. (lambda (port)
  1319. (format port "#!~a/bin/python2~%"
  1320. (assoc-ref inputs "python2"))
  1321. (format port "
  1322. from __future__ import print_function
  1323. import os
  1324. import sys
  1325. import warnings
  1326. def path_to_common(renpy_base):
  1327. return renpy_base + \"/common\"
  1328. def path_to_saves(gamedir, save_directory=None):
  1329. import renpy # @UnresolvedImport
  1330. if save_directory is None:
  1331. save_directory = renpy.config.save_directory
  1332. save_directory = renpy.exports.fsencode(save_directory)
  1333. if not save_directory:
  1334. return gamedir + \"/saves\"
  1335. return os.path.expanduser(\"~~/.renpy/\" + save_directory)
  1336. def path_to_renpy_base():
  1337. return \"~a\"
  1338. def main():
  1339. renpy_base = path_to_renpy_base()
  1340. try:
  1341. import renpy.bootstrap
  1342. import renpy.arguments
  1343. except ImportError:
  1344. print(\"\"\"Could not import renpy.bootstrap.
  1345. Please ensure you decompressed Ren'Py correctly, preserving the directory
  1346. structure.\"\"\", file=sys.stderr)
  1347. raise
  1348. args = renpy.arguments.bootstrap()
  1349. if not args.basedir:
  1350. print(\"\"\"This Ren'py requires a basedir to launch.
  1351. The basedir is the directory, in which .rpy files live -- usually the 'game'
  1352. subdirectory of a game packaged by Ren'py.
  1353. If you want the Ren'py launcher, use renpy-launcher instead.\"\"\",
  1354. file=sys.stderr)
  1355. sys.exit()
  1356. renpy.bootstrap.bootstrap(renpy_base)
  1357. if __name__ == \"__main__\":
  1358. main()
  1359. "
  1360. (string-append out "/share/renpy"))))
  1361. (chmod bin/renpy #o755)
  1362. #t)))
  1363. (add-after 'install 'install-games
  1364. (lambda* (#:key outputs #:allow-other-keys)
  1365. (define renpy (assoc-ref outputs "out"))
  1366. ;; TODO: We should offer a renpy-build-system to make the
  1367. ;; installation of Ren'py games easier.
  1368. (define* (install-renpy-game #:key output game name (renpy renpy)
  1369. #:allow-other-keys)
  1370. (let* ((name (or name (basename game)))
  1371. (launcher (string-append output "/bin/renpy-" name))
  1372. (share (string-append output "/share/renpy/" name)))
  1373. (copy-recursively (string-append game "/game") share)
  1374. (mkdir-p (string-append output "/bin"))
  1375. (with-output-to-file launcher
  1376. (lambda ()
  1377. (format #t
  1378. "#!~a~%~a ~a \"$@\""
  1379. (which "bash")
  1380. (string-append renpy "/bin/renpy")
  1381. share)))
  1382. (chmod launcher #o755)))
  1383. (install-renpy-game #:output (assoc-ref outputs "out")
  1384. #:game "launcher")
  1385. (install-renpy-game #:output (assoc-ref outputs "the-question")
  1386. #:game "the_question"
  1387. #:name "the-question")
  1388. (install-renpy-game #:output (assoc-ref outputs "tutorial")
  1389. #:game "tutorial")
  1390. #t))
  1391. (replace 'wrap
  1392. (lambda* (#:key inputs outputs #:allow-other-keys)
  1393. (let ((out (assoc-ref outputs "out"))
  1394. (site (string-append "/lib/python"
  1395. (python-version
  1396. (assoc-ref inputs "python"))
  1397. "/site-packages")))
  1398. (wrap-program (string-append out "/bin/renpy")
  1399. `("GUIX_PYTHONPATH" =
  1400. (,@(delete-duplicates
  1401. (map
  1402. (lambda (store-path)
  1403. (string-append store-path site))
  1404. (cons (assoc-ref outputs "out")
  1405. (map cdr
  1406. (filter
  1407. (lambda (input)
  1408. (string-prefix? "python2" (car input)))
  1409. inputs))))))))
  1410. #t))))))
  1411. (inputs
  1412. `(("python2-renpy" ,python2-renpy)
  1413. ("python2-tkinter" ,python-2 "tk")
  1414. ("python2" ,python-2) ; for ‘fix-commands’ and ‘wrap’
  1415. ("xdg-utils" ,xdg-utils)))
  1416. (propagated-inputs '())
  1417. (native-inputs
  1418. `(("xorg-server" ,xorg-server-for-tests)))
  1419. (outputs
  1420. (list "out" "tutorial" "the-question"))
  1421. (home-page "https://www.renpy.org/")
  1422. (synopsis "Visual Novel Engine")
  1423. (description "Ren'Py is a visual novel engine that helps you use words,
  1424. images, and sounds to tell interactive stories that run on computers and
  1425. mobile devices. These can be both visual novels and life simulation games.
  1426. The easy to learn script language allows anyone to efficiently write large
  1427. visual novels, while its Python scripting is enough for complex simulation
  1428. games.")
  1429. (license license:expat)))
  1430. (define-public python-pyxel
  1431. (package
  1432. (name "python-pyxel")
  1433. (version "1.4.3")
  1434. (source
  1435. (origin
  1436. (method git-fetch)
  1437. (uri
  1438. (git-reference
  1439. (url "https://github.com/kitao/pyxel")
  1440. (commit (string-append "v" version))))
  1441. (file-name (git-file-name name version))
  1442. (sha256
  1443. (base32
  1444. "0bwsgb5yq5s479cnf046v379zsn5ybp5195kbfvzr9l11qbaicm9"))
  1445. (modules '((guix build utils)))
  1446. (snippet
  1447. '(begin
  1448. (delete-file-recursively "pyxel/core/bin")))))
  1449. (build-system python-build-system)
  1450. (arguments
  1451. `(#:tests? #f ; "Tests" are actually example programs that never halt.
  1452. #:phases
  1453. (modify-phases %standard-phases
  1454. (add-after 'unpack 'patch-build-files
  1455. (lambda* (#:key inputs #:allow-other-keys)
  1456. (substitute* "setup.py"
  1457. (("\"pyxel\\.core\\.bin\\.(.*)\"," all arch)
  1458. (if (string=? arch "linux")
  1459. all
  1460. "")))
  1461. (substitute* "pyxel/core/Makefile"
  1462. (("`sdl2-config")
  1463. (string-append "`sdl2-config --prefix="
  1464. (assoc-ref inputs "sdl2"))))))
  1465. (add-before 'build 'prebuild
  1466. (lambda _
  1467. (invoke "make" "-C" "pyxel/core"))))))
  1468. (inputs
  1469. `(("gifsicle" ,gifsicle)
  1470. ("sdl2" ,(sdl-union (list sdl2 sdl2-image)))))
  1471. (native-inputs
  1472. `(("gcc" ,gcc-10))) ; for std::filesystem
  1473. (home-page "https://github.com/kitao/pyxel")
  1474. (synopsis "Retro game engine for Python")
  1475. (description "Pyxel is a game engine inspired by retro gaming consoles.
  1476. It has a fixed 16-color palette, can hold up to 3 image banks and 8 tilemaps
  1477. (256x256 pixels each) and 4 sound channels with 64 definable sounds. It
  1478. also comes with a built-in image and sound editor.")
  1479. (license license:expat)))
  1480. (define-public grafx2
  1481. (package
  1482. (name "grafx2")
  1483. (version "2.4")
  1484. (source (origin
  1485. (method url-fetch)
  1486. ;; XXX: There is no URL that contains the version. :(
  1487. (uri "http://pulkomandy.tk/projects/GrafX2/downloads/21")
  1488. (sha256
  1489. (base32
  1490. "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q"))))
  1491. (build-system gnu-build-system)
  1492. (arguments
  1493. '(#:phases
  1494. (modify-phases %standard-phases
  1495. (delete 'configure) ; no configure script
  1496. (add-before 'build 'change-to-src-directory
  1497. (lambda _
  1498. (chdir "src")
  1499. #t)))
  1500. #:make-flags
  1501. ;; SDL header files are referenced without the preceeding "SDL/".
  1502. (list (string-append "CFLAGS=-I"
  1503. (assoc-ref %build-inputs "sdl-union")
  1504. "/include/SDL")
  1505. (string-append "prefix="
  1506. (assoc-ref %outputs "out")))
  1507. #:tests? #f)) ; no check target
  1508. (native-inputs
  1509. `(("pkg-config" ,pkg-config)))
  1510. (inputs
  1511. `(("libpng" ,libpng)
  1512. ("lua" ,lua-5.1)
  1513. ("sdl-union" ,(sdl-union (list sdl sdl-image sdl-ttf)))))
  1514. (synopsis "Bitmap paint program")
  1515. (description "GrafX2 is a bitmap paint program inspired by the Amiga
  1516. programs Deluxe Paint and Brilliance. Specializing in 256-color drawing, it
  1517. includes a very large number of tools and effects that make it particularly
  1518. suitable for pixel art, game graphics, and generally any detailed graphics
  1519. painted with a mouse.")
  1520. (home-page "http://pulkomandy.tk/projects/GrafX2")
  1521. (license license:gpl2))) ; GPLv2 only
  1522. (define-public ois
  1523. (package
  1524. (name "ois")
  1525. (version "1.5.1")
  1526. (source
  1527. (origin
  1528. (method git-fetch)
  1529. (uri (git-reference
  1530. (url "https://github.com/wgois/OIS")
  1531. (commit (string-append "v" version))))
  1532. (file-name (git-file-name name version))
  1533. (sha256
  1534. (base32 "0nkh0zrsbyv47c0i0vhdna3jsnvs69pb1svg75avxw6z7kwskgla"))))
  1535. (build-system cmake-build-system)
  1536. (arguments
  1537. `(#:tests? #f)) ; no test suite
  1538. (inputs
  1539. `(("libx11" ,libx11)))
  1540. (synopsis "Object Oriented Input System")
  1541. (description
  1542. "Cross Platform Object Oriented Input Lib System is a cross platform,
  1543. simple solution for using all kinds of Input Devices (Keyboards, Mice,
  1544. Joysticks, etc) and feedback devices (e.g. force feedback). Meant to be very
  1545. robust and compatible with many systems and operating systems.")
  1546. (home-page "https://github.com/wgois/OIS")
  1547. (license license:zlib)))
  1548. (define-public mygui
  1549. (package
  1550. (name "mygui")
  1551. (version "3.2.2")
  1552. (source
  1553. (origin
  1554. (method git-fetch)
  1555. (uri (git-reference
  1556. (url "https://github.com/MyGUI/mygui")
  1557. (commit (string-append "MyGUI" version))))
  1558. (file-name (git-file-name name version))
  1559. (sha256
  1560. (base32
  1561. "1wk7jmwm55rhlqqcyvqsxdmwvl70bysl9azh4kd9n57qlmgk3zmw"))))
  1562. (build-system cmake-build-system)
  1563. (arguments
  1564. '(#:tests? #f ; No test target
  1565. #:configure-flags
  1566. (list "-DMYGUI_INSTALL_DOCS=TRUE"
  1567. (string-append "-DOGRE_INCLUDE_DIR="
  1568. (assoc-ref %build-inputs "ogre")
  1569. "/include/OGRE")
  1570. ;; Demos and tools are Windows-specific:
  1571. ;; https://github.com/MyGUI/mygui/issues/24.
  1572. "-DMYGUI_BUILD_DEMOS=FALSE"
  1573. "-DMYGUI_BUILD_TOOLS=FALSE")))
  1574. (native-inputs
  1575. `(("boost" ,boost)
  1576. ("doxygen" ,doxygen)
  1577. ("pkg-config" ,pkg-config)))
  1578. (inputs
  1579. `(("font-dejavu" ,font-dejavu)
  1580. ("freetype" ,freetype)
  1581. ("graphviz" ,graphviz)
  1582. ("libx11" ,libx11)
  1583. ("ogre" ,ogre)
  1584. ("ois" ,ois)))
  1585. (synopsis "Fast, flexible and simple GUI")
  1586. (description
  1587. "MyGUI is a library for creating Graphical User Interfaces (GUIs) for games
  1588. and 3D applications. The main goals of mygui are: speed, flexibility and ease
  1589. of use.")
  1590. (home-page "http://mygui.info/")
  1591. (license license:expat)))
  1592. (define-public mygui-gl
  1593. ;; Closure size is reduced by some 800 MiB.
  1594. (package
  1595. (inherit mygui)
  1596. (name "mygui-gl")
  1597. (version "3.2.2")
  1598. (arguments
  1599. (substitute-keyword-arguments (package-arguments mygui)
  1600. ((#:configure-flags _)
  1601. `(cons* "-DMYGUI_RENDERSYSTEM=4" ; 3 is Ogre, 4 is OpenGL.
  1602. ;; We can't reuse the flags because of the mention to Ogre.
  1603. (list "-DMYGUI_INSTALL_DOCS=TRUE"
  1604. ;; Demos and tools are Windows-specific:
  1605. ;; https://github.com/MyGUI/mygui/issues/24.
  1606. "-DMYGUI_BUILD_DEMOS=FALSE"
  1607. "-DMYGUI_BUILD_TOOLS=FALSE")))))
  1608. (inputs
  1609. `(("mesa" ,mesa)
  1610. ("glu" ,glu)
  1611. ,@(fold alist-delete (package-inputs mygui)
  1612. '("ogre"))))
  1613. (synopsis "Fast, flexible and simple GUI (OpenGL backend)")))
  1614. (define-public openmw
  1615. (package
  1616. (name "openmw")
  1617. (version "0.46.0")
  1618. (source
  1619. (origin
  1620. (method git-fetch)
  1621. (uri (git-reference
  1622. (url "https://github.com/OpenMW/openmw")
  1623. (commit (string-append "openmw-" version))))
  1624. (file-name (git-file-name name version))
  1625. (sha256
  1626. (base32
  1627. "0rm32zsmxvr6b0jjihfj543skhicbw5kg6shjx312clhlm035w2x"))))
  1628. (build-system cmake-build-system)
  1629. (arguments
  1630. `(#:tests? #f ; No test target
  1631. #:configure-flags
  1632. (list "-DDESIRED_QT_VERSION=5")))
  1633. (native-inputs
  1634. `(("boost" ,boost)
  1635. ("doxygen" ,doxygen)
  1636. ("pkg-config" ,pkg-config)))
  1637. (inputs
  1638. `(("bullet" ,bullet)
  1639. ("ffmpeg" ,ffmpeg)
  1640. ("libxt" ,libxt)
  1641. ("mygui" ,mygui-gl) ; OpenMW does not need Ogre.
  1642. ("openal" ,openal)
  1643. ("openscenegraph" ,openmw-openscenegraph)
  1644. ("qtbase" ,qtbase-5)
  1645. ("sdl" ,sdl2)
  1646. ("unshield" ,unshield)))
  1647. (synopsis "Re-implementation of the RPG Morrowind engine")
  1648. (description
  1649. "OpenMW is a game engine which reimplements and extends the one that runs
  1650. the 2002 open-world RPG Morrowind. The engine comes with its own editor,
  1651. called OpenMW-CS which allows the user to edit or create their own original
  1652. games.")
  1653. (home-page "https://openmw.org")
  1654. (license license:gpl3)))
  1655. (define-public godot
  1656. (package
  1657. (name "godot")
  1658. (version "3.2.3")
  1659. (source (origin
  1660. (method git-fetch)
  1661. (uri (git-reference
  1662. (url "https://github.com/godotengine/godot")
  1663. (commit (string-append version "-stable"))))
  1664. (file-name (git-file-name name version))
  1665. (sha256
  1666. (base32
  1667. "19vrp5lhyvxbm6wjxzn28sn3i0s8j08ca7nani8l1nrhvlc8wi0v"))
  1668. (modules '((guix build utils)
  1669. (ice-9 ftw)
  1670. (srfi srfi-1)))
  1671. (snippet
  1672. '(begin
  1673. ;; Keep only those bundled files we have not (yet) replaced
  1674. ;; with Guix versions. Note that some of these may be
  1675. ;; modified; see "thirdparty/README.md".
  1676. (with-directory-excursion "thirdparty"
  1677. (let* ((preserved-files
  1678. '("README.md"
  1679. "assimp"
  1680. "certs"
  1681. "cvtt"
  1682. "enet"
  1683. "etc2comp"
  1684. "fonts"
  1685. "glad"
  1686. "jpeg-compressor"
  1687. "libsimplewebm"
  1688. "miniupnpc"
  1689. "minizip"
  1690. "misc"
  1691. "nanosvg"
  1692. "pvrtccompressor"
  1693. "recastnavigation"
  1694. "squish"
  1695. "tinyexr"
  1696. "vhacd"
  1697. "xatlas")))
  1698. (for-each delete-file-recursively
  1699. (lset-difference string=?
  1700. (scandir ".")
  1701. (cons* "." ".." preserved-files)))))
  1702. #t))))
  1703. (build-system scons-build-system)
  1704. (arguments
  1705. `(#:scons ,scons-python2
  1706. #:scons-flags (list "platform=x11" "target=release_debug"
  1707. ;; Avoid using many of the bundled libs.
  1708. ;; Note: These options can be found in the SConstruct file.
  1709. "builtin_bullet=no"
  1710. "builtin_freetype=no"
  1711. "builtin_glew=no"
  1712. "builtin_libmpdec=no"
  1713. "builtin_libogg=no"
  1714. "builtin_libpng=no"
  1715. "builtin_libtheora=no"
  1716. "builtin_libvorbis=no"
  1717. "builtin_libvpx=no"
  1718. "builtin_libwebp=no"
  1719. "builtin_mbedtls=no"
  1720. "builtin_opus=no"
  1721. "builtin_pcre2=no"
  1722. "builtin_wslay=no"
  1723. "builtin_zlib=no"
  1724. "builtin_zstd=no")
  1725. #:tests? #f ; There are no tests
  1726. #:phases
  1727. (modify-phases %standard-phases
  1728. (add-after 'unpack 'scons-use-env
  1729. (lambda _
  1730. ;; Scons does not use the environment variables by default,
  1731. ;; but this substitution makes it do so.
  1732. (substitute* "SConstruct"
  1733. (("env_base = Environment\\(tools=custom_tools\\)")
  1734. (string-append
  1735. "env_base = Environment(tools=custom_tools)\n"
  1736. "env_base = Environment(ENV=os.environ)")))
  1737. #t))
  1738. ;; Build headless tools, used for packaging games without depending on X.
  1739. (add-after 'build 'build-headless
  1740. (lambda* (#:key scons-flags #:allow-other-keys)
  1741. (apply invoke "scons"
  1742. `(,(string-append "-j" (number->string (parallel-job-count)))
  1743. "platform=server" ,@(delete "platform=x11" scons-flags)))))
  1744. (replace 'install
  1745. (lambda* (#:key inputs outputs #:allow-other-keys)
  1746. (let* ((out (assoc-ref outputs "out"))
  1747. (headless (assoc-ref outputs "headless"))
  1748. (zenity (assoc-ref inputs "zenity")))
  1749. ;; Strip build info from filenames.
  1750. (with-directory-excursion "bin"
  1751. (for-each
  1752. (lambda (file)
  1753. (let ((dest (car (string-split (basename file) #\.))))
  1754. (rename-file file dest)))
  1755. (find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
  1756. (install-file "godot" (string-append out "/bin"))
  1757. (install-file "godot_server" (string-append headless "/bin")))
  1758. ;; Tell the editor where to find zenity for OS.alert().
  1759. (wrap-program (string-append out "/bin/godot")
  1760. `("PATH" ":" prefix (,(string-append zenity "/bin")))))
  1761. #t))
  1762. (add-after 'install 'install-godot-desktop
  1763. (lambda* (#:key outputs #:allow-other-keys)
  1764. (let* ((out (assoc-ref outputs "out"))
  1765. (applications (string-append out "/share/applications"))
  1766. (icons (string-append out "/share/icons/hicolor")))
  1767. (mkdir-p applications)
  1768. (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
  1769. (string-append applications "/godot.desktop"))
  1770. (for-each (lambda (icon dest)
  1771. (mkdir-p (dirname dest))
  1772. (copy-file icon dest))
  1773. '("icon.png" "icon.svg")
  1774. `(,(string-append icons "/256x256/apps/godot.png")
  1775. ,(string-append icons "/scalable/apps/godot.svg"))))
  1776. #t)))))
  1777. (outputs '("out" "headless"))
  1778. (native-inputs `(("pkg-config" ,pkg-config)))
  1779. (inputs `(("alsa-lib" ,alsa-lib)
  1780. ("bullet" ,bullet)
  1781. ("freetype" ,freetype)
  1782. ("glew" ,glew)
  1783. ("glu" ,glu)
  1784. ("libtheora" ,libtheora)
  1785. ("libvorbis" ,libvorbis)
  1786. ("libvpx" ,libvpx)
  1787. ("libwebp" ,libwebp)
  1788. ("libx11" ,libx11)
  1789. ("libxcursor" ,libxcursor)
  1790. ("libxi" ,libxi)
  1791. ("libxinerama" ,libxinerama)
  1792. ("libxrandr" ,libxrandr)
  1793. ("mbedtls" ,mbedtls-apache)
  1794. ("mesa" ,mesa)
  1795. ("opusfile" ,opusfile)
  1796. ("pcre2" ,pcre2)
  1797. ("pulseaudio" ,pulseaudio)
  1798. ("wslay" ,wslay)
  1799. ("zenity" ,zenity)
  1800. ("zstd" ,zstd "lib")))
  1801. (home-page "https://godotengine.org/")
  1802. (synopsis "Advanced 2D and 3D game engine")
  1803. (description
  1804. "Godot is an advanced multi-platform game engine written in C++. If
  1805. features design tools such as a visual editor, can import 3D models and
  1806. provide high-quality 3D rendering, it contains an animation editor, and can be
  1807. scripted in a Python-like language.")
  1808. (license license:expat)))
  1809. (define-public entt
  1810. (package
  1811. (name "entt")
  1812. (version "3.7.1")
  1813. (source (origin
  1814. (method git-fetch)
  1815. (uri (git-reference
  1816. (url "https://github.com/skypjack/entt")
  1817. (commit (string-append "v" version))))
  1818. (file-name (git-file-name name version))
  1819. (sha256
  1820. (base32
  1821. "151jg3m262xwaywl2rqnc90yr6p48rhmgi5mxyv6bwqvmfli2m5p"))))
  1822. (build-system cmake-build-system)
  1823. (arguments
  1824. `(#:configure-flags (list "-DENTT_BUILD_TESTING=ON"
  1825. "-DENTT_FIND_GTEST_PACKAGE=ON"
  1826. "-DENTT_BUILD_DOCS=ON")
  1827. ;; Only tests are compiled, and they need assertions to work correctly.
  1828. #:build-type "Debug"))
  1829. (native-inputs
  1830. `(;; for testing
  1831. ("googletest" ,googletest)
  1832. ;; for documentation
  1833. ("doxygen" ,doxygen)
  1834. ("graphviz" ,graphviz)))
  1835. (synopsis "Entity component system")
  1836. (description "EnTT is a header-only library, containing (among other things)
  1837. @itemize
  1838. @item an entity component system based on sparse sets,
  1839. @item a configuration system using the monostate pattern,
  1840. @item a static reflection system,
  1841. @item and a cooperative scheduler.
  1842. @end itemize")
  1843. (home-page "https://github.com/skypjack/entt")
  1844. (license (list license:expat ; code
  1845. license:cc-by4.0)))) ; documentation
  1846. (define-public eureka
  1847. (package
  1848. (name "eureka")
  1849. (version "1.24")
  1850. (source (origin
  1851. (method url-fetch)
  1852. (uri (string-append "mirror://sourceforge/eureka-editor/Eureka/"
  1853. version "/eureka-"
  1854. ;; version without dots e.g 1.21 => 121
  1855. (string-join (string-split version #\.) "")
  1856. "-source.tar.gz"))
  1857. (sha256
  1858. (base32
  1859. "1x4idjniz9sma3j9ss6ni7fafmz22zs2jnpsqw4my9rsnmra5d9v"))))
  1860. (build-system gnu-build-system)
  1861. (arguments
  1862. '(#:tests? #f
  1863. #:make-flags
  1864. (let ((out (assoc-ref %outputs "out")))
  1865. (list (string-append "PREFIX=" out)))
  1866. #:phases
  1867. (modify-phases %standard-phases
  1868. (delete 'configure)
  1869. (add-before 'build 'prepare-install-directories
  1870. (lambda* (#:key outputs #:allow-other-keys)
  1871. (let ((out (assoc-ref outputs "out")))
  1872. (mkdir-p (string-append out "/bin"))
  1873. (mkdir-p (string-append out "/share"))
  1874. (with-fluids ((%default-port-encoding #f))
  1875. (substitute* "./src/main.cc"
  1876. (("/usr/local") out)))
  1877. (substitute* "Makefile"
  1878. (("-o root") ""))))))))
  1879. (inputs `(("mesa" ,mesa)
  1880. ("libxft" ,libxft)
  1881. ("libxinerama" ,libxinerama)
  1882. ("libfontconfig" ,fontconfig)
  1883. ("libjpeg" ,libjpeg-turbo)
  1884. ("libpng" ,libpng)
  1885. ("fltk" ,fltk)
  1886. ("zlib" ,zlib)))
  1887. (native-inputs `(("pkg-config" ,pkg-config)
  1888. ("xdg-utils" ,xdg-utils)))
  1889. (synopsis "Doom map editor")
  1890. (description "Eureka is a map editor for the classic DOOM games, and a few
  1891. related games such as Heretic and Hexen. It comes with a 3d preview mode and
  1892. a 2D editor view.")
  1893. (home-page "http://eureka-editor.sourceforge.net/")
  1894. (license license:gpl2+)))
  1895. (define-public guile-chickadee
  1896. (package
  1897. (name "guile-chickadee")
  1898. (version "0.7.0")
  1899. (source (origin
  1900. (method url-fetch)
  1901. (uri (string-append "https://files.dthompson.us/chickadee/"
  1902. "chickadee-" version ".tar.gz"))
  1903. (sha256
  1904. (base32
  1905. "199y4kc28va6klfs19h998sfh7vx9spnrvjw7p92i47q5a7jdcp6"))))
  1906. (build-system gnu-build-system)
  1907. (arguments
  1908. '(#:make-flags '("GUILE_AUTO_COMPILE=0")))
  1909. (propagated-inputs
  1910. `(("guile-opengl" ,guile3.0-opengl)
  1911. ("guile-sdl2" ,guile3.0-sdl2)))
  1912. (inputs
  1913. `(("freetype" ,freetype)
  1914. ("guile" ,guile-3.0)
  1915. ("libvorbis" ,libvorbis)
  1916. ("mpg123" ,mpg123)
  1917. ("openal" ,openal)))
  1918. (native-inputs
  1919. `(("pkg-config" ,pkg-config)
  1920. ("texinfo" ,texinfo)))
  1921. (home-page "https://dthompson.us/projects/chickadee.html")
  1922. (synopsis "Game development toolkit for Guile Scheme with SDL2 and OpenGL")
  1923. (description "Chickadee is a game development toolkit for Guile Scheme
  1924. built on top of SDL2 and OpenGL. Chickadee aims to provide all the features
  1925. that parenthetically inclined game developers need to make 2D (and eventually
  1926. 3D) games in Scheme, such as:
  1927. @enumerate
  1928. @item extensible, fixed-timestep game loop
  1929. @item OpenGL-based rendering engine
  1930. @item keyboard, mouse, controller input
  1931. @item REPL-driven development model
  1932. @end enumerate\n")
  1933. (license license:gpl3+)))
  1934. (define-public guile3.0-chickadee
  1935. (deprecated-package "guile3.0-chickadee" guile-chickadee))
  1936. (define-public bennu-game-development
  1937. (package
  1938. (name "bennu-game-development")
  1939. (version "353")
  1940. (source (origin
  1941. (method svn-fetch)
  1942. (uri (svn-reference
  1943. (url "http://svn.code.sf.net/p/bennugd/code")
  1944. (revision (string->number version))))
  1945. (file-name (string-append name "-" version))
  1946. (sha256
  1947. (base32
  1948. "1iri58ryk9lbqn585cbccnvrfkj8qxlbcsk8rpih40jhvs1j101l"))
  1949. (modules '((guix build utils)))
  1950. (snippet
  1951. '(begin
  1952. (delete-file-recursively "3rdparty") #t))))
  1953. (build-system gnu-build-system)
  1954. (arguments
  1955. '(#:phases
  1956. (modify-phases %standard-phases
  1957. (add-after 'unpack 'patch-configure-to-use-openssl
  1958. (lambda* (#:key outputs #:allow-other-keys)
  1959. (chdir "core")
  1960. (delete-file "configure")
  1961. (substitute* "configure.in"
  1962. (("i\\*86\\)")
  1963. "*)
  1964. COMMON_CFLAGS=\"$COMMON_CFLAGS -DUSE_OPENSSL\"
  1965. COMMON_LDFLAGS=\"$COMMON_LDFLAGS\"
  1966. LIBSSL=\"crypto\"
  1967. USE_OPENSSL=yes
  1968. ;;
  1969. i*86)"))
  1970. #t)))))
  1971. (inputs `(("openssl" ,openssl)
  1972. ("zlib" ,zlib)))
  1973. (native-inputs `(("pkg-config" ,pkg-config)
  1974. ("autoconf" ,autoconf)
  1975. ("automake" ,automake)
  1976. ("libtool" ,libtool)))
  1977. (synopsis "Programming language to create games")
  1978. (description "Bennu Game Development, also known as bennudg, is a
  1979. programming language tailored at game development. It is the successor of
  1980. Fenix.")
  1981. (home-page "https://sourceforge.net/projects/bennugd/")
  1982. (license license:zlib)))
  1983. (define-public bennu-game-development-modules
  1984. (package
  1985. (inherit bennu-game-development)
  1986. (name "bennu-game-development-modules")
  1987. (arguments
  1988. '(#:phases
  1989. (modify-phases %standard-phases
  1990. (add-after 'unpack 'patch-conflicting-definitions
  1991. (lambda _
  1992. (with-fluids ((%default-port-encoding #f))
  1993. (substitute* "core/include/fmath.h"
  1994. (("extern fixed fmul\\( int x, int y \\);") "")
  1995. (("extern fixed fdiv\\( int x, int y \\);") "")))
  1996. (chdir "modules"))))))
  1997. (inputs `(("zlib" ,zlib)
  1998. ("libpng" ,libpng)
  1999. ("openssl" ,openssl)
  2000. ("sdl-mixer" ,sdl-mixer)
  2001. ("bennu-game-development" ,bennu-game-development)))
  2002. (synopsis "Modules for the Bennu Game Development programming language")
  2003. (description "This package contains a collection of modules for the Bennu
  2004. Game Development programming language, from CD handling through SDL to
  2005. joystick support.")))
  2006. (define-public plib
  2007. (package
  2008. (name "plib")
  2009. (version "1.8.5")
  2010. (source (origin
  2011. (method url-fetch)
  2012. (uri (string-append "http://plib.sourceforge.net/dist/"
  2013. "plib-" version ".tar.gz"))
  2014. (sha256
  2015. (base32
  2016. "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8"))
  2017. (patches (search-patches "plib-CVE-2011-4620.patch"
  2018. "plib-CVE-2012-4552.patch"))))
  2019. (build-system gnu-build-system)
  2020. (inputs
  2021. `(("mesa" ,mesa)
  2022. ("libxi" ,libxi)
  2023. ("libxmu" ,libxmu)))
  2024. (native-inputs
  2025. `(("pkg-config" ,pkg-config)))
  2026. (home-page "http://plib.sourceforge.net/")
  2027. (synopsis "Suite of portable game libraries")
  2028. (description "PLIB is a set of libraries that will permit programmers to
  2029. write games and other realtime interactive applications that are 100% portable
  2030. across a wide range of hardware and operating systems. PLIB includes sound
  2031. effects, music, a complete 3D engine, font rendering, a simple Windowing
  2032. library, a game scripting language, a GUI, networking, 3D math library and a
  2033. collection of handy utility functions. All are 100% portable across nearly
  2034. all modern computing platforms. Each library component is fairly independent
  2035. of the others")
  2036. (license license:lgpl2.0+)))
  2037. (define-public ioquake3
  2038. ;; We follow master since it seems that there won't be releases after 1.3.6.
  2039. (let ((commit "95b9cab4d644fa3bf757cfff821cc4f7d76e38b0"))
  2040. (package
  2041. (name "ioquake3")
  2042. (version (git-version "1.3.6" "1" commit))
  2043. (source
  2044. (origin
  2045. (method git-fetch)
  2046. (uri (git-reference
  2047. (url "https://github.com/ioquake/ioq3")
  2048. (commit commit)))
  2049. (file-name (git-file-name name version))
  2050. (sha256
  2051. (base32
  2052. "1vflk028z9gccg5yfi5451y1k5wxjdh3qbhjf4x6r7w2pzlxh16z"))))
  2053. (build-system gnu-build-system)
  2054. (inputs
  2055. `(("sdl2" ,sdl2)
  2056. ("libjpeg" ,libjpeg-turbo)
  2057. ("openal" ,openal)
  2058. ("curl" ,curl)
  2059. ("opusfile" ,opusfile)
  2060. ("opus" ,opus)
  2061. ("libvorbis" ,libvorbis)
  2062. ("freetype" ,freetype)
  2063. ("libogg" ,libogg)))
  2064. (native-inputs
  2065. `(("which" ,which) ; Else SDL_version.h won't be found.
  2066. ("pkg-config" ,pkg-config)))
  2067. (arguments
  2068. '(#:tests? #f ; No tests.
  2069. #:make-flags '("CC=gcc"
  2070. "USE_INTERNAL_LIBS=0"
  2071. "USE_FREETYPE=1"
  2072. "USE_RENDERER_DLOPEN=0"
  2073. "USE_OPENAL_DLOPEN=0"
  2074. "USE_CURL_DLOPEN=0")
  2075. #:phases
  2076. (modify-phases %standard-phases
  2077. (delete 'configure)
  2078. (replace 'install
  2079. (lambda* (#:key outputs #:allow-other-keys)
  2080. (invoke "make" "copyfiles" "CC=gcc"
  2081. "USE_INTERNAL_LIBS=0"
  2082. (string-append "COPYDIR="
  2083. (assoc-ref outputs "out")
  2084. "/bin")))))))
  2085. (home-page "https://ioquake3.org/")
  2086. (synopsis "FPS game engine based on Quake 3")
  2087. (description "ioquake3 is a free software first person shooter engine
  2088. based on the Quake 3: Arena and Quake 3: Team Arena source code. Compared to
  2089. the original, ioquake3 has been cleaned up, bugs have been fixed and features
  2090. added. The permanent goal is to create the open source Quake 3 distribution
  2091. upon which people base their games, ports to new platforms, and other
  2092. projects.")
  2093. (license license:gpl2))))
  2094. (define-public instead
  2095. (package
  2096. (name "instead")
  2097. (version "3.3.5")
  2098. (build-system cmake-build-system)
  2099. (source
  2100. (origin
  2101. (method git-fetch)
  2102. (uri (git-reference
  2103. (url "https://github.com/instead-hub/instead")
  2104. (commit version)))
  2105. (file-name (git-file-name name version))
  2106. (sha256
  2107. (base32 "02j8cw623j51qmr4991i5hsbrzmnp0qfzds8m6nwwr15sjv3hv1g"))
  2108. (patches
  2109. (search-patches
  2110. "instead-use-games-path.patch"))
  2111. (modules '((guix build utils)))
  2112. (snippet
  2113. '(begin
  2114. (delete-file-recursively "src/zlib")))))
  2115. (arguments
  2116. '(#:configure-flags
  2117. (list (string-append
  2118. "-DLUA_INCLUDE_DIR="
  2119. (assoc-ref %build-inputs "luajit") "/include/luajit-2.1/")
  2120. "-DWITH_LUAJIT=1"
  2121. "-DWITH_GTK3=1")
  2122. #:tests? #f))
  2123. (inputs
  2124. `(("gtk+",gtk+)
  2125. ("lua" ,lua)
  2126. ("luajit" ,luajit)
  2127. ("pkg-config" ,pkg-config)
  2128. ("sdl2-images" ,sdl2-image)
  2129. ("sdl2-ttf" ,sdl2-ttf)
  2130. ("sdl2-mixer" ,sdl2-mixer)
  2131. ("zlib" ,zlib)))
  2132. (home-page "https://instead3.syscall.ru/")
  2133. (synopsis "Text adventure interpreter")
  2134. (description "The STEAD (Simple TExt ADventures) interpreter provides
  2135. functionality to play games that mix elements of visual novels, interactive
  2136. fiction and classic point-and-click adventures.")
  2137. (native-search-paths
  2138. (list (search-path-specification
  2139. (variable "INSTEAD_GAMES_PATH")
  2140. (separator #f) ;single entry
  2141. (files '("share/instead/games")))))
  2142. (license license:expat)))
  2143. (define-public openvr
  2144. (package
  2145. (name "openvr")
  2146. (version "1.8.19")
  2147. (home-page "https://github.com/ValveSoftware/openvr/")
  2148. (source
  2149. (origin
  2150. (method git-fetch)
  2151. (uri (git-reference
  2152. (url home-page)
  2153. (commit (string-append "v" version))))
  2154. (file-name (git-file-name name version))
  2155. (sha256
  2156. (base32 "1b8cppvw6ib0kvx0vjq7jsk3plg1vh171w8xr230vjn05381wp52"))))
  2157. (build-system cmake-build-system)
  2158. (arguments
  2159. ;; No tests.
  2160. '(#:tests? #f
  2161. #:configure-flags (list "-DBUILD_SHARED=1")))
  2162. (synopsis "Virtual reality software development kit")
  2163. (description "OpenVR is an API and runtime that allows access to VR
  2164. hardware from multiple vendors without requiring that applications have
  2165. specific knowledge of the hardware they are targeting.")
  2166. (license license:bsd-3)))
  2167. (define-public flatzebra
  2168. (package
  2169. (name "flatzebra")
  2170. (version "0.1.7")
  2171. (source
  2172. (origin
  2173. (method url-fetch)
  2174. (uri (string-append "http://perso.b2b2c.ca/~sarrazip/dev/"
  2175. "flatzebra-" version ".tar.gz"))
  2176. (sha256
  2177. (base32 "1x2dy41c8vrq62bn03b82fpmk7x4rzd7qqiwvq0mgcl5rmasc2c8"))))
  2178. (build-system gnu-build-system)
  2179. (arguments
  2180. `(#:phases
  2181. (modify-phases %standard-phases
  2182. (add-after 'unpack 'fix-sdl-config
  2183. (lambda* (#:key inputs #:allow-other-keys)
  2184. ;; XXX: sdl-config in sdl-union is a link to sdl-config from
  2185. ;; plain sdl package. As a consequence, the prefix is wrong.
  2186. ;; Force correct one with "--prefix" argument.
  2187. (let ((sdl-union (assoc-ref inputs "sdl")))
  2188. (setenv "SDL_CONFIG"
  2189. (string-append sdl-union
  2190. "/bin/sdl-config --prefix="
  2191. sdl-union)))
  2192. #t)))))
  2193. (native-inputs
  2194. `(("pkg-config" ,pkg-config)))
  2195. (inputs
  2196. `(("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer)))))
  2197. (home-page "http://perso.b2b2c.ca/~sarrazip/dev/burgerspace.html")
  2198. (synopsis "Generic game engine for 2D double-buffering animation")
  2199. (description
  2200. "Flatzebra is a simple, generic C++ game engine library supporting 2D
  2201. double-buffering.")
  2202. (license license:gpl2+)))
  2203. (define-public fna
  2204. (package
  2205. (name "fna")
  2206. (version "19.12.01")
  2207. (source
  2208. (origin
  2209. (method git-fetch)
  2210. (uri (git-reference
  2211. (url "https://github.com/FNA-XNA/FNA")
  2212. (commit version)))
  2213. (file-name (git-file-name name version))
  2214. (sha256
  2215. (base32 "1vdyi9hac24fqcs8kpj6yk36bf5rrl4dvlvdd9fc701fawcf6lrr"))))
  2216. (build-system gnu-build-system)
  2217. (arguments
  2218. '(#:tests? #f ; No tests.
  2219. #:phases
  2220. (modify-phases %standard-phases
  2221. (add-after 'unpack 'link-dep-src
  2222. (lambda* (#:key inputs #:allow-other-keys)
  2223. (let ((sdl2 (assoc-ref inputs "sdl2-cs-src"))
  2224. (mojoshader (assoc-ref inputs "mojoshader-src"))
  2225. (faudio (assoc-ref inputs "faudio-src"))
  2226. (theorafile (assoc-ref inputs "theorafile-src")))
  2227. (symlink (string-append sdl2 "/src") "lib/SDL2-CS/src")
  2228. (symlink (string-append mojoshader "/csharp") "lib/MojoShader/csharp")
  2229. (symlink (string-append faudio "/csharp") "lib/FAudio/csharp")
  2230. (symlink (string-append theorafile "/csharp") "lib/Theorafile/csharp"))))
  2231. (delete 'configure)
  2232. (replace 'build
  2233. (lambda _
  2234. (invoke "make" "release")))
  2235. (replace 'install
  2236. (lambda* (#:key outputs #:allow-other-keys)
  2237. (let ((out (assoc-ref outputs "out")))
  2238. (install-file "bin/Release/FNA.dll" (string-append out "/lib"))
  2239. #t))))))
  2240. (native-inputs
  2241. `(("mono" ,mono)))
  2242. (inputs `(("sdl2-cs-src" ,(package-source sdl2-cs))
  2243. ("mojoshader-src" ,(package-source mojoshader-cs))
  2244. ("faudio-src" ,(package-source faudio))
  2245. ("theorafile-src" ,(package-source theorafile))))
  2246. (home-page "https://fna-xna.github.io/")
  2247. (synopsis "Accuracy-focused XNA4 reimplementation")
  2248. (description "FNA is a Microsoft XNA Game Studio 4.0 reimplementation that
  2249. focuses solely on developing a fully accurate XNA4 runtime for the desktop.")
  2250. (license (list license:ms-pl ; FNA
  2251. license:lgpl2.1 ; LzxDecoder.cs
  2252. ;; Mono.Xna:
  2253. license:expat))))
  2254. (define-public libccd
  2255. (package
  2256. (name "libccd")
  2257. (version "2.1")
  2258. (source
  2259. (origin
  2260. (method git-fetch)
  2261. (uri (git-reference
  2262. (url "https://github.com/danfis/libccd")
  2263. (commit (string-append "v" version))))
  2264. (file-name (git-file-name name version))
  2265. (sha256
  2266. (base32 "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc"))))
  2267. (build-system cmake-build-system)
  2268. (arguments
  2269. `(#:configure-flags '("-DBUILD_DOCUMENTATION=ON"
  2270. "-DBUILD_TESTING=ON"
  2271. "-DENABLE_DOUBLE_PRECISION=ON")))
  2272. (native-inputs
  2273. `(("python-sphinx" ,python-sphinx)))
  2274. (home-page "https://github.com/danfis/libccd")
  2275. (synopsis "Library for collision detection between two convex shapes")
  2276. (description "@code{libccd} is library for a collision detection
  2277. between two convex shapes. @code{libccd} implements variation on
  2278. Gilbert–Johnson–Keerthi algorithm plus Expand Polytope Algorithm (EPA)
  2279. and also implements algorithm Minkowski Portal Refinement (MPR,
  2280. a.k.a. XenoCollide) as described in Game Programming Gems 7.")
  2281. (license license:expat)))
  2282. (define-public ode
  2283. (package
  2284. (name "ode")
  2285. (version "0.16.2")
  2286. (source
  2287. (origin
  2288. (method url-fetch)
  2289. (uri (string-append "https://bitbucket.org/odedevs/ode/downloads/"
  2290. "ode-" version ".tar.gz"))
  2291. (sha256
  2292. (base32 "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj"))
  2293. (modules '((guix build utils)))
  2294. (snippet
  2295. '(begin
  2296. (delete-file-recursively "libccd")
  2297. #t))))
  2298. (build-system cmake-build-system)
  2299. (arguments
  2300. `(#:configure-flags '("-DODE_WITH_LIBCCD_SYSTEM=ON")
  2301. #:phases
  2302. (modify-phases %standard-phases
  2303. (add-after 'unpack 'unbundle-libccd
  2304. (lambda _
  2305. (substitute* "CMakeLists.txt"
  2306. (("configure_file\\(libccd/.*") ""))
  2307. #t)))))
  2308. (inputs
  2309. `(("glu" ,glu)
  2310. ("libccd" ,libccd)
  2311. ("mesa" ,mesa)))
  2312. (home-page "https://www.ode.org/")
  2313. (synopsis "High performance library for simulating rigid body dynamics")
  2314. (description "ODE is a high performance library for simulating
  2315. rigid body dynamics. It is fully featured, stable, mature and
  2316. platform independent with an easy to use C/C++ API. It has advanced
  2317. joint types and integrated collision detection with friction. ODE is
  2318. useful for simulating vehicles, objects in virtual reality
  2319. environments and virtual creatures. It is currently used in many
  2320. computer games, 3D authoring tools and simulation tools.")
  2321. ;; Software is dual-licensed.
  2322. (license (list license:lgpl2.1+ license:expat))))
  2323. (define-public chipmunk
  2324. (package
  2325. (name "chipmunk")
  2326. (version "7.0.3")
  2327. (source
  2328. (origin
  2329. (method git-fetch)
  2330. (uri (git-reference
  2331. (url "https://github.com/slembcke/Chipmunk2D")
  2332. (commit (string-append "Chipmunk-" version))))
  2333. (file-name (git-file-name name version))
  2334. (sha256
  2335. (base32 "1qmkn01g06p3rnhmbyffmjns6wj5vhgf9cscigk3wzxcpwv1hyxb"))))
  2336. (build-system cmake-build-system)
  2337. (arguments
  2338. `(#:tests? #f ;no test
  2339. #:configure-flags '("-DBUILD_STATIC=OFF"
  2340. "-DBUILD_DEMOS=OFF")))
  2341. (inputs
  2342. `(("freeglut" ,freeglut)
  2343. ("libxmu" ,libxmu)
  2344. ("libxrandr" ,libxrandr)))
  2345. (home-page "https://chipmunk-physics.net/")
  2346. (synopsis "Fast and lightweight 2D game physics library")
  2347. (description "Chipmunk is a simple, lightweight, fast and portable 2D
  2348. rigid body physics library written in C.")
  2349. (license license:expat)))
  2350. (define-public box2d
  2351. (package
  2352. (name "box2d")
  2353. (version "2.4.1")
  2354. (source
  2355. (origin
  2356. (method git-fetch)
  2357. (uri (git-reference
  2358. (url "https://github.com/erincatto/box2d")
  2359. (commit (string-append "v" version))))
  2360. (file-name (git-file-name name version))
  2361. (sha256
  2362. (base32 "1ja9cahf3z9zzrdaqcw44lpjmqf2ir2g4chwz0iwqwlkckwhpgvh"))
  2363. (modules '((guix build utils)))
  2364. (snippet
  2365. '(begin
  2366. ;; Bundled code only used for the testbed.
  2367. (delete-file-recursively "extern")))))
  2368. (build-system cmake-build-system)
  2369. (arguments
  2370. `(#:test-target "unit_test"
  2371. #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
  2372. "-DBOX2D_BUILD_TESTBED=OFF")))
  2373. (inputs
  2374. `(("libx11" ,libx11)))
  2375. (home-page "https://box2d.org/")
  2376. (synopsis "2D physics engine for games")
  2377. (description "Box2D is a 2D rigid body simulation library for games.
  2378. Programmers can use it in their games to make objects move in realistic ways and
  2379. make the game world more interactive. From the game engine's point of view, a
  2380. physics engine is just a system for procedural animation.")
  2381. (license license:expat)))
  2382. (define-public libtcod
  2383. (package
  2384. (name "libtcod")
  2385. (version "1.15.1")
  2386. (source (origin
  2387. (method git-fetch)
  2388. (uri (git-reference
  2389. (url "https://github.com/libtcod/libtcod")
  2390. (commit version)))
  2391. (file-name (git-file-name name version))
  2392. (sha256
  2393. (base32
  2394. "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5"))
  2395. (modules '((guix build utils)))
  2396. (snippet '(begin
  2397. (delete-file-recursively "src/vendor/utf8proc")
  2398. (delete-file-recursively "src/vendor/zlib")
  2399. (delete-file "src/vendor/stb_truetype.h")
  2400. (delete-file "src/vendor/stb_sprintf.h")
  2401. (delete-file "src/vendor/lodepng.cpp")
  2402. (delete-file "src/vendor/lodepng.h")
  2403. (substitute* "buildsys/autotools/sources.am"
  2404. (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
  2405. (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
  2406. "../../src/vendor/stb.c")
  2407. (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
  2408. (substitute* "src/libtcod/sys_sdl_img_png.cpp"
  2409. (("\\.\\./vendor/") ""))
  2410. (substitute* '("src/libtcod/color/canvas.cpp"
  2411. "src/libtcod/sys_sdl_img_png.cpp"
  2412. "src/libtcod/tileset/truetype.cpp"
  2413. "src/libtcod/tileset/tilesheet.cpp")
  2414. (("\\.\\./\\.\\./vendor/") ""))
  2415. (substitute* "src/libtcod/console/printing.cpp"
  2416. (("\\.\\./\\.\\./vendor/utf8proc/") ""))
  2417. #t))))
  2418. (build-system gnu-build-system)
  2419. (arguments
  2420. `(#:configure-flags '("--with-gnu-ld"
  2421. "LIBS=-lutf8proc -llodepng")
  2422. #:phases
  2423. (modify-phases %standard-phases
  2424. (add-after 'unpack 'change-to-build-dir
  2425. (lambda _
  2426. (chdir "buildsys/autotools")
  2427. (patch-shebang "get_version.py")
  2428. #t)))))
  2429. (native-inputs
  2430. `(("autoconf" ,autoconf)
  2431. ("automake" ,automake)
  2432. ("libtool" ,libtool)
  2433. ("python" ,python)
  2434. ("pkg-config" ,pkg-config)
  2435. ("stb-sprintf" ,stb-sprintf)
  2436. ("stb-truetype" ,stb-truetype)))
  2437. (inputs
  2438. `(("lodepng" ,lodepng)
  2439. ("sdl2" ,sdl2)
  2440. ("utf8proc" ,utf8proc)
  2441. ("zlib" ,zlib)))
  2442. (home-page "https://github.com/libtcod/libtcod")
  2443. (synopsis "Library specifically designed for writing roguelikes")
  2444. (description
  2445. "libtcod is a fast, portable and uncomplicated API for roguelike
  2446. developers providing an advanced true color console, input, and lots of other
  2447. utilities frequently used in roguelikes.")
  2448. (license license:bsd-3)))
  2449. (define-public warsow-qfusion
  2450. ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated.
  2451. ;; The 2.5 beta as published on the homepage is commit
  2452. ;; c4de15df559410aff0ca6643724e24cddb0ecbbd
  2453. (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd"))
  2454. (package
  2455. (name "warsow-qfusion")
  2456. (version (git-version "2.5" "1" commit)) ; 2.5-beta
  2457. (source (origin
  2458. (method git-fetch)
  2459. (uri (git-reference
  2460. (url "https://github.com/Warsow/qfusion/")
  2461. (commit commit)
  2462. (recursive? #t)))
  2463. (file-name (git-file-name name version))
  2464. (sha256
  2465. (base32
  2466. "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g"))
  2467. ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
  2468. (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch"))
  2469. (modules '((guix build utils)))
  2470. (snippet '(begin
  2471. (delete-file-recursively "platforms")
  2472. (delete-file-recursively "debian")
  2473. (delete-file-recursively "libsrcs")
  2474. #t))))
  2475. (build-system cmake-build-system)
  2476. (arguments
  2477. `(#:tests? #f ; No tests.
  2478. #:configure-flags '("-DQFUSION_GAME=Warsow")
  2479. #:modules
  2480. ((guix build utils)
  2481. (guix build cmake-build-system)
  2482. (ice-9 match))
  2483. #:phases
  2484. (modify-phases %standard-phases
  2485. (add-after 'unpack 'change-to-build-dir
  2486. (lambda _
  2487. (chdir "source")
  2488. #t))
  2489. (add-after 'install 'really-install
  2490. (lambda* (#:key outputs system #:allow-other-keys)
  2491. (let ((arch (match system
  2492. ("x86_64-linux" "x86_64")
  2493. ("i686-linux" "i386")))
  2494. (out (assoc-ref outputs "out")))
  2495. (install-file (string-append "../source/build/basewsw/libgame_"
  2496. arch ".so")
  2497. (string-append out "/lib/"))
  2498. (install-file (string-append "../source/build/libui_" arch ".so")
  2499. (string-append out "/lib/"))
  2500. (for-each
  2501. (lambda (file)
  2502. (install-file file (string-append out "/bin/")))
  2503. (append (find-files "../source/build" "warsow")
  2504. (find-files "../source/build" "wsw_server."))))
  2505. #t)))))
  2506. (inputs
  2507. `(("alsa-lib" ,alsa-lib)
  2508. ("curl" ,curl)
  2509. ("freetype" ,freetype)
  2510. ("ffmpeg" ,ffmpeg)
  2511. ("libjpeg" ,libjpeg-turbo)
  2512. ("libogg" ,libogg)
  2513. ("libpng" ,libpng)
  2514. ("libtheora" ,libtheora)
  2515. ("libvorbis" ,libvorbis)
  2516. ("mesa" ,mesa)
  2517. ("openal" ,openal)
  2518. ("pulseaudio" ,pulseaudio)
  2519. ("qtbase" ,qtbase-5)
  2520. ("qtdeclarative" ,qtdeclarative)
  2521. ("sdl2" ,sdl2)
  2522. ("uuid.h" ,util-linux "lib")
  2523. ("zlib" ,zlib)))
  2524. (native-inputs
  2525. `(("pkg-config" ,pkg-config)))
  2526. (home-page "https://github.com/Warsow/qfusion")
  2527. (supported-systems '("i686-linux" "x86_64-linux"))
  2528. (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
  2529. (description
  2530. "This package contains the game engine of Warsow, a first-person
  2531. shooter video game. The engine is based on qfusion, the id Tech 2 derived
  2532. game engine. id Tech 2 is the engine originally behind Quake 2.")
  2533. (license license:gpl2+))))
  2534. (define-public dhewm3
  2535. (package
  2536. (name "dhewm3")
  2537. (version "1.5.1")
  2538. (source (origin
  2539. (method url-fetch)
  2540. (uri (string-append
  2541. "https://github.com/dhewm/dhewm3/releases/download/"
  2542. version "/dhewm3-" version "-src.tar.xz"))
  2543. (sha256
  2544. (base32
  2545. "0s2brx6wyljhjbpli97iy4lc4fqqsvdc09raz8njg0vgzcsiyrri"))))
  2546. (build-system cmake-build-system)
  2547. (arguments
  2548. `(#:tests? #f ; No tests.
  2549. #:phases
  2550. (modify-phases %standard-phases
  2551. (add-after 'unpack 'change-to-build-dir
  2552. (lambda _
  2553. (chdir "neo")
  2554. #t)))))
  2555. (inputs
  2556. `(("curl" ,curl)
  2557. ("libjpeg" ,libjpeg-turbo)
  2558. ("libogg" ,libogg)
  2559. ("libvorbis" ,libvorbis)
  2560. ("libx11" ,libx11)
  2561. ("openal" ,openal)
  2562. ("sdl2" ,sdl2)
  2563. ("zlib" ,zlib)))
  2564. (home-page "https://dhewm3.org/")
  2565. (synopsis "Port of the original Doom 3 engine")
  2566. (description
  2567. "@command{dhewm3} is a source port of the original Doom 3 engine (not
  2568. Doom 3: BFG Edition), also known as id Tech 4. Compared to the original
  2569. version of the Doom 3 engine, dhewm3 has many bugfixes, supports EAX-like
  2570. sound effects on all operating systems and hardware (via OpenAL Softs EFX
  2571. support), has much better support for widescreen resolutions and has 64bit
  2572. support.")
  2573. (license license:gpl3)))
  2574. (define-public tesseract-engine
  2575. (let ((svn-revision 2411))
  2576. (package
  2577. (name "tesseract-engine")
  2578. (version (string-append "20200615-" (number->string svn-revision)))
  2579. (source
  2580. (origin
  2581. (method svn-fetch)
  2582. (uri (svn-reference
  2583. (url "svn://svn.tuxfamily.org/svnroot/tesseract/main")
  2584. (revision svn-revision)))
  2585. (file-name (git-file-name name version))
  2586. (sha256
  2587. (base32 "1av9jhl2ivbl7wfszyhyna84llvh1z2d8khkmadm8d105addj10q"))
  2588. (modules '((guix build utils)))
  2589. (snippet
  2590. '(begin
  2591. (for-each delete-file-recursively
  2592. '("bin" "bin64"
  2593. ;; Remove "media" since some files such as
  2594. ;; media/sound/game/soundsnap/info.txt refer to a
  2595. ;; non-commercial license.
  2596. "media"
  2597. "server.bat"
  2598. "tesseract.bat"
  2599. "src/lib"
  2600. "src/lib64"))
  2601. #t))))
  2602. (build-system gnu-build-system)
  2603. (arguments
  2604. `(#:make-flags (list "CC=gcc")
  2605. #:tests? #f ; No tests.
  2606. #:phases
  2607. (modify-phases %standard-phases
  2608. (delete 'configure)
  2609. (add-after 'unpack 'cd-src
  2610. (lambda _ (chdir "src") #t))
  2611. (add-before 'build 'fix-env
  2612. (lambda* (#:key inputs #:allow-other-keys)
  2613. (setenv "CPATH"
  2614. (string-append
  2615. (search-input-directory inputs "include/SDL2")
  2616. ":" (or (getenv "CPATH") "")))))
  2617. (add-after 'install 'really-install
  2618. (lambda* (#:key outputs #:allow-other-keys)
  2619. (let* ((out (assoc-ref outputs "out"))
  2620. (share (string-append out "/share/tesseract"))
  2621. (bin (string-append out "/bin/tesseract"))
  2622. (client (string-append out "/bin/tesseract-client")))
  2623. (chdir "..") ; Back to root.
  2624. (for-each
  2625. (lambda (dir)
  2626. (mkdir-p (string-append share "/" dir))
  2627. (copy-recursively dir (string-append share "/" dir)))
  2628. '("config"))
  2629. (mkdir-p (string-append out "/bin/"))
  2630. (copy-file "bin_unix/native_client" client)
  2631. (copy-file "bin_unix/native_server"
  2632. (string-append out "/bin/tesseract-server"))
  2633. (call-with-output-file bin
  2634. (lambda (p)
  2635. (format p "#!~a
  2636. TESS_DATA=~a
  2637. TESS_BIN=~a
  2638. TESS_OPTIONS=\"-u$HOME/.tesseract\"
  2639. cd \"$TESS_DATA\"
  2640. exec \"$TESS_BIN\" \"$TESS_OPTIONS\" \"$@\""
  2641. (which "bash")
  2642. share
  2643. client)))
  2644. (chmod bin #o755)
  2645. (install-file "src/readme_tesseract.txt"
  2646. (string-append out "/share/licenses/tesseract/LICENSE")))
  2647. #t)))))
  2648. (inputs
  2649. `(("sdl2-union" ,(sdl-union (list sdl2 sdl2-mixer sdl2-image)))
  2650. ("zlib" ,zlib)
  2651. ("libpng" ,libpng)
  2652. ("libgl" ,mesa)))
  2653. (home-page "http://tesseract.gg/")
  2654. (synopsis "First-person shooter engine with map editing, instagib, DM and CTF")
  2655. (description "This package contains the game engine of Tesseract, a
  2656. first-person shooter focused on cooperative in-game map editing.
  2657. The engine is derived from @emph{Cube 2: Sauerbraten} technology but with
  2658. upgraded modern rendering techniques. The new rendering features include
  2659. fully dynamic omnidirectional shadows, global illumination, HDR lighting,
  2660. deferred shading, morphological / temporal / multisample anti-aliasing, and
  2661. much more.")
  2662. (license license:zlib))))