235 lines
8.4 KiB
Scheme
235 lines
8.4 KiB
Scheme
(use-modules
|
|
(srfi srfi-1)
|
|
(guix packages)
|
|
((guix licenses) #:prefix license:)
|
|
(guix git-download)
|
|
(guix build-system gnu)
|
|
(guix gexp)
|
|
(guix utils)
|
|
(gnu packages)
|
|
(gnu packages audio)
|
|
(gnu packages autotools)
|
|
(gnu packages fontutils)
|
|
(gnu packages gl)
|
|
(gnu packages guile)
|
|
(gnu packages guile-xyz)
|
|
(gnu packages image)
|
|
(gnu packages maths)
|
|
(gnu packages mp3)
|
|
(gnu packages pkg-config)
|
|
(gnu packages readline)
|
|
(gnu packages sdl)
|
|
(gnu packages texinfo)
|
|
(gnu packages xiph))
|
|
|
|
(define (keep-file? file stat)
|
|
(not (any (lambda (my-string)
|
|
(string-contains file my-string))
|
|
(list ".git" ".dir-locals.el" "guix.scm"))))
|
|
|
|
(define target-guile guile-3.0-latest)
|
|
|
|
(define guile3.0-opengl
|
|
(package
|
|
(inherit guile-opengl)
|
|
(inputs
|
|
(modify-inputs (package-inputs guile-opengl)
|
|
(replace "guile" target-guile)))
|
|
(native-inputs
|
|
(modify-inputs (package-native-inputs guile-opengl)
|
|
(append autoconf automake)))
|
|
(arguments
|
|
(substitute-keyword-arguments (package-arguments guile-opengl)
|
|
((#:phases phases)
|
|
`(modify-phases ,phases
|
|
(delete 'patch-makefile)
|
|
(add-before 'bootstrap 'patch-configure.ac
|
|
(lambda _
|
|
;; The Guile version check doesn't work for the 3.0
|
|
;; pre-release, so just remove it.
|
|
(substitute* "configure.ac"
|
|
(("GUILE_PKG\\(\\[2.2 2.0\\]\\)") ""))
|
|
(substitute* "Makefile.am"
|
|
(("\\$\\(GUILE_EFFECTIVE_VERSION\\)") "3.0")
|
|
(("ccache") "site-ccache"))
|
|
#t))
|
|
(replace 'bootstrap
|
|
(lambda _
|
|
(invoke "autoreconf" "-vfi")))))))))
|
|
|
|
(define guile-sdl2
|
|
(let ((commit "e9a7f5e748719ce5b6ccd08ff91861b578034ea6"))
|
|
(package
|
|
(name "guile-sdl2")
|
|
(version (string-append "0.7.0-1." (string-take commit 7)))
|
|
(source (origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://git.dthompson.us/guile-sdl2.git")
|
|
(commit commit)))
|
|
(sha256
|
|
(base32
|
|
"0ay7mcar8zs0j5rihwlzi0l46vgg9i93piip4v8a3dzwjx3myr7v"))))
|
|
(build-system gnu-build-system)
|
|
(arguments
|
|
'(#:make-flags '("GUILE_AUTO_COMPILE=0")
|
|
#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'bootstrap
|
|
(lambda _
|
|
(invoke "sh" "bootstrap"))))))
|
|
(native-inputs (list autoconf automake pkg-config texinfo))
|
|
(inputs (list target-guile sdl2))
|
|
(synopsis "Guile bindings for SDL2")
|
|
(description "Guile-sdl2 provides pure Guile Scheme bindings to the
|
|
SDL2 C shared library via the foreign function interface.")
|
|
(home-page "https://git.dthompson.us/guile-sdl2.git")
|
|
(license license:lgpl3+))))
|
|
|
|
(define chickadee
|
|
(let ((commit "1759fa0a056f99a61867c393708c210b37af712f"))
|
|
(package
|
|
(name "chickadee")
|
|
(version (string-append "0.10.0." (string-take commit 7)))
|
|
(source (origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://git.dthompson.us/chickadee.git")
|
|
(commit commit)))
|
|
(sha256
|
|
(base32
|
|
"1vik96bm3qp9hjlhxh4p7cjsdqf1by8i1cd023wvk8dr6anrnfld"))))
|
|
(build-system gnu-build-system)
|
|
(arguments
|
|
'(#:make-flags '("GUILE_AUTO_COMPILE=0")
|
|
#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'bootstrap
|
|
(lambda _
|
|
(invoke "sh" "bootstrap"))))))
|
|
(native-inputs (list autoconf automake pkg-config texinfo))
|
|
(inputs (list freetype
|
|
libjpeg-turbo
|
|
libpng
|
|
libvorbis
|
|
mpg123
|
|
openal
|
|
readline
|
|
target-guile))
|
|
(propagated-inputs (list guile3.0-opengl guile-sdl2))
|
|
(synopsis "Game development toolkit for Guile Scheme")
|
|
(description "Chickadee is a game development toolkit for Guile
|
|
Scheme. It contains all of the basic components needed to develop
|
|
2D/3D video games.")
|
|
(home-page "https://dthompson.us/projects/chickadee.html")
|
|
(license license:gpl3+))))
|
|
|
|
(define catbird
|
|
(let ((commit "fa6a85b92f818f1e0139a33ca4110acc97f8d4f2"))
|
|
(package
|
|
(name "catbird")
|
|
(version (string-append "0.1.0-1." (string-take commit 7)))
|
|
(source (origin
|
|
(method git-fetch)
|
|
(uri (git-reference
|
|
(url "https://git.dthompson.us/catbird.git")
|
|
(commit commit)))
|
|
(sha256
|
|
(base32
|
|
"0jhsf1idrq433x4l10yfzkmd68k5y1ypsfzqpmh1rv6clczxyszf"))))
|
|
(build-system gnu-build-system)
|
|
(arguments
|
|
'(#:make-flags '("GUILE_AUTO_COMPILE=0")
|
|
#:phases
|
|
(modify-phases %standard-phases
|
|
(add-after 'unpack 'bootstrap
|
|
(lambda _
|
|
(invoke "sh" "bootstrap"))))))
|
|
(native-inputs (list autoconf automake pkg-config texinfo))
|
|
(inputs (list target-guile))
|
|
(propagated-inputs (list chickadee guile-sdl2))
|
|
(synopsis "Game engine for Scheme programmers")
|
|
(description "Catbird is a game engine written in Guile Scheme.")
|
|
(home-page "https://dthompson.us/projects/chickadee.html")
|
|
(license license:gpl3+))))
|
|
|
|
(package
|
|
(name "gib-gab-gob")
|
|
(version "0.2")
|
|
(source (local-file (dirname (current-filename))
|
|
#:recursive? #t
|
|
#:select? keep-file?))
|
|
(build-system gnu-build-system)
|
|
(arguments
|
|
`(#:modules
|
|
((ice-9 match)
|
|
(ice-9 ftw)
|
|
,@%gnu-build-system-modules)
|
|
#:phases
|
|
(modify-phases
|
|
%standard-phases
|
|
(add-after
|
|
'install
|
|
'hall-wrap-binaries
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
(let* ((compiled-dir
|
|
(lambda (out version)
|
|
(string-append
|
|
out
|
|
"/lib/guile/"
|
|
version
|
|
"/site-ccache")))
|
|
(uncompiled-dir
|
|
(lambda (out version)
|
|
(string-append
|
|
out
|
|
"/share/guile/site"
|
|
(if (string-null? version) "" "/")
|
|
version)))
|
|
(dep-path
|
|
(lambda (env modules path)
|
|
(list env
|
|
":"
|
|
'prefix
|
|
(cons modules
|
|
(map (lambda (input)
|
|
(string-append
|
|
(assoc-ref inputs input)
|
|
path))
|
|
,''("guile-goblins" "chickadee" "catbird"))))))
|
|
(out (assoc-ref outputs "out"))
|
|
(bin (string-append out "/bin/"))
|
|
(site (uncompiled-dir out "")))
|
|
(match (scandir site)
|
|
(("." ".." version)
|
|
(for-each
|
|
(lambda (file)
|
|
(wrap-program
|
|
(string-append bin file)
|
|
(dep-path
|
|
"GUILE_LOAD_PATH"
|
|
(uncompiled-dir out version)
|
|
(uncompiled-dir "" version))
|
|
(dep-path
|
|
"GUILE_LOAD_COMPILED_PATH"
|
|
(compiled-dir out version)
|
|
(compiled-dir "" version))))
|
|
,''("make-joiner" "make-initiator"))
|
|
#t))))))))
|
|
(native-inputs
|
|
`(("autoconf" ,autoconf)
|
|
("automake" ,automake)
|
|
("pkg-config" ,pkg-config)
|
|
("texinfo" ,texinfo)))
|
|
(inputs `(("guile" ,guile-3.0)))
|
|
(propagated-inputs
|
|
`(("guile-goblins" ,guile-goblins)
|
|
("chickadee" ,chickadee)
|
|
("catbird" ,catbird)))
|
|
(synopsis
|
|
"Rock Paper Scissors and Tic Tac Toe in Goblins!")
|
|
(description
|
|
"This project demonstrates both Rock Paper Scissors and Tic Tac Toe in Goblins!")
|
|
(home-page "https://solarpunk.moe")
|
|
(license license:gpl3+))
|