diff options
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | Makefile.am | 25 | ||||
-rw-r--r-- | assets/CREDITS | 131 | ||||
-rw-r--r-- | assets/images/cabbage.png | bin | 0 -> 1407 bytes | |||
-rw-r--r-- | assets/images/sunflower.png | bin | 0 -> 1199 bytes | |||
-rwxr-xr-x | bootstrap | 3 | ||||
-rw-r--r-- | community-garden.scm | 362 | ||||
-rw-r--r-- | community-garden/dummy.scm | 1 | ||||
-rw-r--r-- | configure.ac | 17 | ||||
-rw-r--r-- | guix.scm | 209 | ||||
-rw-r--r-- | pre-inst-env.in | 10 |
11 files changed, 767 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fe8a487 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +/Makefile +/Makefile.in +/aclocal.m4 +/autom4te.cache/ +/build-aux/ +/config.log +/config.status +/configure +/pre-inst-env diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..a571bce --- /dev/null +++ b/Makefile.am @@ -0,0 +1,25 @@ +GOBJECTS = $(SOURCES:%.scm=%.go) + +nobase_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES) +nobase_go_DATA = $(GOBJECTS) + +# Make sure source files are installed first, so that the mtime of +# installed compiled files is greater than that of installed source +# files. See +# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html> +# for details. +guile_install_go_files = install-nobase_goDATA +$(guile_install_go_files): install-nobase_modDATA + +CLEANFILES = $(GOBJECTS) +EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES) +GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat +SUFFIXES = .scm .go +.scm.go: + $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<" + +moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION) +godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache + +SOURCES = \ + community-garden.scm diff --git a/assets/CREDITS b/assets/CREDITS new file mode 100644 index 0000000..97f89b8 --- /dev/null +++ b/assets/CREDITS @@ -0,0 +1,131 @@ +# Asset Credits + +## images/cabbage.png + +"[LPC] Crops" by bluecarrot16, Daniel Eddeland (daneeklu), Joshua Taylor, Richard Kettering (Jetrel). Commissioned by castelonia. License CC-BY-SA 3.0+ or GPL 3.0+. https://opengameart.org/content/lpc-crops + +BASED ON: + +[LPC] Farming tilesets, magic animations and UI elements +DE = Daniel Eddeland +CC-BY-SA 3.0 / GPL 3.0 +https://opengameart.org/content/rpg-item-set + +Fruit and Veggie Inventory +JT = Joshua Taylor +CC-BY-SA 3.0 / GPL 3.0 +https://opengameart.org/content/fruit-and-veggie-inventory + +RPG item set +RK = Richard Kettering (Jetrel) +CC0 +https://opengameart.org/content/rpg-item-set + +## images/sunflower.png + +https://opengameart.org/content/lpc-flowers-plants-fungi-wood + +"[LPC] Flowers / Plants / Fungi / Wood," by bluecarrot16, Guido Bos, Ivan Voirol (Silver IV), SpiderDave, William.Thompsonj, Yar, Stephen Challener and the Open Surge team (http://opensnc.sourceforge.net), Gaurav Munjal, Johann Charlot, Casper Nilsson, Jetrel, Zabin, Hyptosis, Surt, Lanea Zimmerman, George Bailey, ansimuz, Buch, and the Open Pixel Project contributors (OpenPixelProject.com). +CC-BY-SA 3.0. + +Based on: + +[LPC] Guido Bos entries cut up +Guido Bos +CC-BY-SA 3.0 / GPL 3.0 +https://opengameart.org/content/lpc-guido-bos-entries-cut-up + +Basic map 32x32 by Silver IV +Ivan Voirol (Silver IV) +CC-BY 3.0 / GPL 3.0 / GPL 2.0 +https://opengameart.org/content/basic-map-32x32-by-silver-iv + +Flowers +SpiderDave +CC0 +https://opengameart.org/content/flowers + +[LPC] Leaf Recolor +William.Thompsonj +CC-BY-SA 3.0 / GPL 3.0 +https://opengameart.org/content/lpc-leaf-recolor + +Isometric 64x64 Outside Tileset +Yar +CC-BY 3.0 +https://opengameart.org/content/isometric-64x64-outside-tileset + +32x32 (and 16x16) RPG Tiles--Forest and some Interior Tiles +Stephen Challener and the Open Surge team (http://opensnc.sourceforge.net)commissioned by Gaurav Munjal +CC-BY 3.0 +https://opengameart.org/content/32x32-and-16x16-rpg-tiles-forest-and-some-interior-tiles + +Lots of Hyptosis' tiles organized! +Hyptosis +CC-BY 3.0 +https://opengameart.org/content/lots-of-hyptosis-tiles-organized + +Generic Platformer Tiles +surt +CC0 +http://opengameart.org/content/generic-platformer-tiles + +old frogatto tile art +Guido Bos +CC0 +https://opengameart.org/content/old-frogatto-tile-art + +LPC: Interior Castle Tiles +Lanea Zimmerman +CC-BY-3.0 / GPL 3.0 +http://opengameart.org/content/lpc-interior-castle-tiles + +RPG item set +Jetrel +CC0 +https://opengameart.org/content/rpg-item-set + +Shoot'em up graphic kit +Johann Charlot +CC-BY-SA 3.0 / GPL 3.0 +https://opengameart.org/content/shootem-up-graphic-kit + +LPC C.Nilsson +Casper Nilsson +CC-BY-SA 3.0 / GPL 3.0 +https://opengameart.org/content/lpc-cnilsson + +Lots of trees and plants from OGA (DB32) tilesets pack 1 +Jetrel, Zabin, Hyptosis, Surt +CC0 +https://opengameart.org/content/lots-of-trees-and-plants-from-oga-db32-tilesets-pack-1 + +Trees & Bushes +ansimuz +CC0 +https://opengameart.org/content/trees-bushes + +Outdoor tiles, again +Buch <https://opengameart.org/users/buch> +CC-BY 2.0 +https://opengameart.org/content/outdoor-tiles-again + +16x16 Game Assets +George Bailey +CC-BY 4.0 +https://opengameart.org/content/16x16-game-assets + +Tuxemon tileset +Buch +CC-BY-SA 3.0 +https://opengameart.org/content/tuxemon-tileset + +Orthographic outdoor tiles +Buch +CC0 +https://opengameart.org/content/orthographic-outdoor-tiles + +OPP2017 - Jungle and temple set +OpenPixelProject.com +CC0 +https://opengameart.org/content/opp2017-jungle-and-temple-set diff --git a/assets/images/cabbage.png b/assets/images/cabbage.png Binary files differnew file mode 100644 index 0000000..e01b67b --- /dev/null +++ b/assets/images/cabbage.png diff --git a/assets/images/sunflower.png b/assets/images/sunflower.png Binary files differnew file mode 100644 index 0000000..18634ed --- /dev/null +++ b/assets/images/sunflower.png diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..e756b42 --- /dev/null +++ b/bootstrap @@ -0,0 +1,3 @@ +#! /bin/sh + +autoreconf -vif diff --git a/community-garden.scm b/community-garden.scm new file mode 100644 index 0000000..f0429c9 --- /dev/null +++ b/community-garden.scm @@ -0,0 +1,362 @@ +(setenv "CATBIRD_DEV_MODE" "1") + +(use-modules (catbird) + (catbird asset) + (catbird camera) + (catbird kernel) + (catbird node) + (catbird node-2d) + (catbird region) + ((catbird scene) #:select (<scene>)) + (chickadee config) + (chickadee graphics color) + (chickadee graphics path) + (chickadee graphics text) + (chickadee graphics texture) + (chickadee math vector) + (chickadee scripting) + (goblins) + (goblins actor-lib cell) + (goblins actor-lib methods) + (goblins utils simple-sealers) + (goblins vrun) + (ice-9 atomic) + (ice-9 match) + (oop goops) + (srfi srfi-1) + (srfi srfi-9) + (srfi srfi-43)) + +(define garden-vat (spawn-vat)) +(define catbird-vat (spawn-vat)) +(define alice-vat (spawn-vat)) +(define-vat-run garden-run garden-vat) +(define-vat-run catbird-run catbird-vat) +(define-vat-run alice-run alice-vat) + +(define-record-type <plant> + (make-plant name char) + plant? + (name plant-name) + (char plant-char)) + +(define sunflower (make-plant "Sunflower" #\S)) +(define cabbage (make-plant "Cabbage" #\C)) +(define winter-squash (make-plant "Winter Squash" #\W)) + +(define (list-replace lst i o) + (let loop ((j 0) + (lst lst)) + (match lst + ((head . rest) + (if (= i j) + (cons o rest) + (cons head (loop (+ j 1) rest))))))) + +(define (make-empty-row width) + (make-list width #f)) + +(define (make-empty-bed width height) + (list-tabulate height + (lambda (_i) + (make-empty-row width)))) + +(define (bed-ref bed x y) + (list-ref (list-ref bed y) x)) + +(define (bed-set bed x y o) + (list-replace bed y (list-replace (list-ref bed y) x o))) + +(define-record-type <garden-bed> + (%make-garden-bed width height tiles) + garden-bed? + (width garden-bed-width) + (height garden-bed-height) + (tiles garden-bed-tiles)) + +(define (make-garden-bed width height) + (%make-garden-bed width height (make-empty-bed width height))) + +(define (bounds-check garden x y) + (unless (and (>= x 0) + (>= y 0) + (< x (garden-bed-width garden)) + (< y (garden-bed-height garden))) + (error "garden tile out of bounds" x y))) + +(define (garden-bed-ref garden x y) + (bounds-check garden x y) + (bed-ref (garden-bed-tiles garden) x y)) + +(define (garden-bed-set garden x y o) + (bounds-check garden x y) + (%make-garden-bed (garden-bed-width garden) + (garden-bed-height garden) + (bed-set (garden-bed-tiles garden) x y o))) + +(define (display-garden-bed garden) + (for-each (lambda (row) + (for-each (lambda (tile) + (display + (if (plant? tile) + (plant-char tile) + ".")) + (display " ")) + row) + (newline)) + (garden-bed-tiles garden))) + +(define (^botanist bcom) + (define-values (seal-plant unseal-plant approved-plant?) + (make-sealer-triplet)) + (methods + ((approve-plant plant) + (seal-plant plant)) + ((check-plant plant) + (if (approved-plant? plant) + (unseal-plant plant) + (error "plant is not allowed" plant))))) + +(define (^garden-guard bcom botanist) + (methods + ((check-plant plant) + ($ botanist 'check-plant plant)))) + +(define (^garden bcom name garden-bed garden-guard) + (define (ensure-empty x y) + (when (garden-bed-ref garden-bed x y) + (error "tile already has something planted in it" x y))) + (methods + ((get-name) name) + ((get-bed) garden-bed) + ((plant x y sealed-plant) + (ensure-empty x y) + (let* ((plant ($ garden-guard 'check-plant sealed-plant)) + (new-bed (garden-bed-set garden-bed x y plant))) + (bcom (^garden bcom name new-bed garden-guard)))) + ((dig-up x y) + (let ((new-bed (garden-bed-set garden-bed x y #f))) + (bcom (^garden bcom name new-bed garden-guard)))))) + +(define (^visitor bcom name garden) + (methods + ((get-name) name) + ((get-garden-name) + (<- garden 'get-name)) + ((inspect-garden) + (<- garden 'get-bed)))) + +(define (^gardener bcom name garden) + (methods + ((get-name) name) + ((get-garden-name) + (<- garden 'get-name)) + ((inspect-garden) + (<- garden 'get-bed)) + ((plant x y plant) + (<- garden 'plant x y plant)) + ((dig-up x y) + (<- garden 'dig-up x y)))) + +(define the-botanist (garden-run (spawn ^botanist))) +(define the-garden-guard (garden-run (spawn ^garden-guard the-botanist))) +(define sunflower/approved + (garden-run ($ the-botanist 'approve-plant sunflower))) +(define cabbage/approved + (garden-run ($ the-botanist 'approve-plant cabbage))) +(define our-garden + (garden-run + (spawn ^garden + "Spritely Institute Community Garden" + (make-garden-bed 8 8) + the-garden-guard))) + +(define alice (alice-run (spawn ^gardener "Alice" our-garden))) +(alice-run ($ alice 'plant 1 1 sunflower/approved)) +(alice-run ($ alice 'plant 2 1 sunflower/approved)) +(alice-run ($ alice 'plant 1 2 sunflower/approved)) +(alice-run ($ alice 'plant 2 2 sunflower/approved)) +(alice-run ($ alice 'plant 5 1 cabbage/approved)) +(alice-run ($ alice 'plant 6 1 cabbage/approved)) +(alice-run ($ alice 'plant 5 2 cabbage/approved)) +(alice-run ($ alice 'plant 6 2 cabbage/approved)) + + +(define catbird-visitor (catbird-run (spawn ^visitor "Catbird UI" our-garden))) +(define catbird-garden-bed (make-atomic-box #f)) +(define catbird-garden-name (make-atomic-box #f)) +(catbird-run + (on ($ catbird-visitor 'get-garden-name) + (lambda (name) + (atomic-box-set! catbird-garden-name name)))) +(catbird-run + (on ($ catbird-visitor 'inspect-garden) + (lambda (garden-bed) + (atomic-box-set! catbird-garden-bed garden-bed)))) + +(define %window-width 1024) +(define %window-height 768) +(define %tile-width 64.0) +(define %tile-height 64.0) +(define font-file (scope-datadir "fonts/Inconsolata-Regular.otf")) +(define-asset (title-font (f font-file)) + (load-font f 24)) +(define-asset (plant-tile-font (f font-file)) + (load-font f 32)) +(define-asset (sunflower-texture (f "assets/images/sunflower.png")) + (load-image f)) +(define-asset (cabbage-texture (f "assets/images/cabbage.png")) + (load-image f)) + +(define-class <garden-view> (<node-2d>) + (vat #:getter vat #:init-keyword #:vat) + (visitor #:getter visitor #:init-keyword #:visitor) + (name-box #:getter name-box #:init-keyword #:name-box) + (garden-bed-box #:getter garden-bed-box #:init-keyword #:garden-bed-box) + (prev-garden #:accessor prev-garden #:init-value #f) + (tiles #:accessor tiles #:init-value #())) + +(define (make-garden-view) + (make <garden-view> + #:rank 1 + #:vat catbird-vat + #:visitor catbird-visitor + #:name-box catbird-garden-name + #:garden-bed-box catbird-garden-bed)) + +(define-method (garden-bed (garden <garden-view>)) + (atomic-box-ref (garden-bed-box garden))) + +(define-method (garden-name (garden <garden-view>)) + (atomic-box-ref (name-box garden))) + +(define-method (on-boot (garden <garden-view>)) + (define title + (make <label> + #:name 'name + #:text (garden-name garden) + #:font title-font + #:position (vec2 32.0 (- %window-height 72.0)))) + (define tile-container + (make <node-2d> + #:name 'tile-container)) + (set! (width garden) %window-width) + (set! (height garden) %window-height) + (attach-to garden title tile-container) + (center-horizontal-in-parent title) + (refresh-garden garden) + (run-script garden + (forever + (sleep 1.0) + (catbird-run + (on ($ catbird-visitor 'inspect-garden) + (lambda (garden-bed) + (atomic-box-set! catbird-garden-bed garden-bed))))))) + +(define (for-each-tile proc tiles) + (vector-for-each + (lambda (y row) + (vector-for-each + (lambda (x tile) + (proc x y tile)) + row)) + tiles)) + +(define-method (tile-ref (garden <garden-view>) x y) + (vector-ref (vector-ref (tiles garden) y) x)) + +(define-method (rebuild-tiles (garden <garden-view>)) + (let ((g (garden-bed garden)) + (container (& garden tile-container))) + (for-each-tile + (lambda (x y tile) + (detach tile)) + (tiles garden)) + (set! (tiles garden) + (vector-unfold + (lambda (y) + (vector-unfold + (lambda (x) + (let* ((painter (with-style ((fill-color db32-rope) + (stroke-color db32-oiled-cedar)) + (fill-and-stroke + (rectangle (vec2 0.0 0.0) + %tile-width + %tile-height)))) + (canvas (make <canvas> + #:painter painter))) + (attach-to container canvas) + (attach-to canvas + (make <sprite> + #:name 'sprite + #:texture null-texture)) + canvas)) + (garden-bed-width g))) + (garden-bed-height g))) + (for-each-tile + (lambda (x y tile) + (if (= y 0) + (set! (position-y tile) (* %tile-height (- (garden-bed-height g) 1))) + (place-below (tile-ref garden x (- y 1)) tile)) + (unless (= x 0) + (place-right (tile-ref garden (- x 1) y) tile))) + (tiles garden)) + (set! (width container) (* (garden-bed-width g) %tile-width)) + (set! (height container) (* (garden-bed-height g) %tile-height)) + (center-in-parent container))) + +(define-method (on-change (sprite <sprite>) slot-name old new) + (case slot-name + ((texture) + (let ((new (artifact (->asset new)))) + (set! (width sprite) (texture-width new)) + (set! (height sprite) (texture-height new)))))) + +(define-method (refresh-garden (garden <garden-view>)) + (let ((g (garden-bed garden)) + (prev-g (prev-garden garden))) + (unless (eq? g prev-g) + (unless (and prev-g + (= (garden-bed-width g) (garden-bed-width prev-g)) + (= (garden-bed-height g) (garden-bed-height prev-g))) + (rebuild-tiles garden)) + (for-each-tile + (lambda (x y tile) + (let ((plant (garden-bed-ref g x y)) + (sprite (& tile sprite))) + (set! (texture sprite) + (if plant + (match (plant-name plant) + ("Cabbage" cabbage-texture) + ("Sunflower" sunflower-texture) + (_ null-texture)) + null-texture)) + (center-in-parent sprite))) + (tiles garden)) + (set! (prev-garden garden) g)))) + +(define-method (update (garden <garden-view>) dt) + (refresh-garden garden)) + +(run-catbird + (lambda () + (let ((region (create-full-region #:name 'main)) + (scene (make <scene> #:name 'scratch))) + (replace-scene region scene) + (set! (camera region) + (make <camera-2d> + #:width %window-width + #:height %window-height)) + (attach-to scene + (make <canvas> + #:name 'background + #:painter + (with-style ((fill-color db32-elf-green)) + (fill + (rectangle (vec2 0.0 0.0) + %window-width + %window-height))))) + (attach-to scene (make-garden-view)))) + #:title "Community Garden" + #:width %window-width + #:height %window-height) diff --git a/community-garden/dummy.scm b/community-garden/dummy.scm new file mode 100644 index 0000000..b8ed6ad --- /dev/null +++ b/community-garden/dummy.scm @@ -0,0 +1 @@ +;; This is just here to satisfy autotools. diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..c2b17c8 --- /dev/null +++ b/configure.ac @@ -0,0 +1,17 @@ +AC_INIT(community-garden, 0.1.0) +AC_CONFIG_SRCDIR(community-garden) +AC_CONFIG_AUX_DIR([build-aux]) +AM_INIT_AUTOMAKE([color-tests -Wall -Wno-portability foreign]) +AM_SILENT_RULES([yes]) + +AC_PATH_PROG([GUILE], [guile]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) + +GUILE_PKG([3.0]) +GUILE_PROGS + +GUILE_MODULE_REQUIRED([catbird]) +GUILE_MODULE_REQUIRED([goblins]) + +AC_OUTPUT diff --git a/guix.scm b/guix.scm new file mode 100644 index 0000000..c404ab2 --- /dev/null +++ b/guix.scm @@ -0,0 +1,209 @@ +;;; Commentary: +;; +;; Development environment for GNU Guix. +;; +;; To setup a development environment and build, run: +;; +;; guix shell +;; ./bootstrap +;; ./configure +;; make -j${nproc} +;; +;; To build the development snapshot, run: +;; +;; guix build -f guix.scm +;; +;; To install the development snapshot, run: +;; +;; guix install -f guix.scm +;; +;;; Code: +(use-modules (ice-9 match) + (srfi srfi-1) + (guix build-system gnu) + (guix download) + (guix gexp) + (guix git-download) + ((guix licenses) #:prefix license:) + (guix packages) + (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 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 "4047c0d0a92eae8a7394b4caa479d0cb6dd9017c")) + (package + (name "chickadee") + (version (string-append "0.8.0-1." (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.dthompson.us/chickadee.git") + (commit commit))) + (sha256 + (base32 + "14aa9bkwrsfl8i81zd0fzn0xryyhn8ac16hwdzx40p5az86nq7k6")))) + (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 "0cbe11133c71cd853a3653a848edcf62a9d8b6b1")) + (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 + "09nf9yjyfpznvrsiwd7zr94c9hl8ncwzr56qxg0qbcq8yd6kmpj4")))) + (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+)))) + +(define guile-goblins + (package + (inherit guile-goblins) + (name "guile-goblins") + (version "0.9") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.com/spritely/guile-goblins.git") + (commit "43ab238443aca53ed8c935a9d2d2bf309416af5d"))) + (file-name (string-append name "-" version)) + (sha256 + (base32 + "196pkmi0qmxjwfmfs039mk3vwz7n8g52r1ykfbfa9lvlsqgq8dni")))))) + +(define %source-dir (dirname (current-filename))) + +(package + (name "community-garden") + (version "0.1.0") + (source (local-file %source-dir + #:recursive? #t + #:select? (git-predicate %source-dir))) + (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 catbird guile-goblins)) + (synopsis "Spritely Goblins demo program") + (description "Spritely Goblins demo program") + (home-page "https://spritely.institute") + (license license:asl2.0)) diff --git a/pre-inst-env.in b/pre-inst-env.in new file mode 100644 index 0000000..881f142 --- /dev/null +++ b/pre-inst-env.in @@ -0,0 +1,10 @@ +#!/bin/sh + +abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd`" +abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`" + +export GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" +export GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH" +export PATH="$abs_top_builddir/scripts:$PATH" + +exec "$@" |