From 5438b4758200f64a0a1d658444931aa05016bb37 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 19 Aug 2016 20:55:36 -0400 Subject: Add guile-sdl2 project page. --- haunt.scm | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 8 deletions(-) (limited to 'haunt.scm') diff --git a/haunt.scm b/haunt.scm index e32f853..2a089a5 100644 --- a/haunt.scm +++ b/haunt.scm @@ -14,11 +14,11 @@ ;;; along with this program. If not, see ;;; . -;; (define (add-to-load-path* directory) -;; (unless (member directory %load-path) -;; (add-to-load-path directory))) +(define (add-to-load-path* directory) + (unless (member directory %load-path) + (add-to-load-path directory))) -;; (add-to-load-path* "/home/dave/Code/guile-syntax-highlight") +(add-to-load-path* "/home/dave/Code/guile-syntax-highlight") (use-modules (haunt asset) (haunt builder blog) @@ -31,8 +31,8 @@ (haunt reader commonmark) (haunt site) (haunt utils) - ;; (syntax-highlight) - ;; (syntax-highlight scheme) + (syntax-highlight) + (syntax-highlight scheme) (sxml match) (sxml transform) (texinfo) @@ -183,6 +183,9 @@ free culture works available under the " ,%cc-by-sa-link " license.") `(pre (@ ,@attrs) ,(maybe-highlight-code source))))) +(define (highlight-scheme code) + `(pre ,(highlights->sxml (highlight lex-scheme code)))) + (define (static-page title file-name body) (lambda (site posts) (make-page file-name @@ -214,8 +217,7 @@ free culture works available under the " ,%cc-by-sa-link " license.") ,(anchor (string-append repo "-" version ".tar.gz") url) " — " - ,(anchor (string-append repo "-" version - ".tar.gz.asc") + ,(anchor "GPG signature" (string-append url ".asc")))))) releases)) (h2 "Requirements") @@ -319,6 +321,65 @@ functional, and reactive.") #:releases `(("0.1" ,(date 2015 11 12))))) +(define guile-sdl2-page + (project-page + #:name "Guile-SDL2" + #:file-name "guile-sdl2.html" + #:repo "guile-sdl2" + #:description + `((p "Guile-SDL2 provides " + ,(anchor "Guile Scheme" "https://gnu.org/s/guile") + " bindings for the " + ,(anchor "SDL2" "http://libsdl.org") + " C shared library. The bindings are written in pure Scheme +using Guile's foreign function interface.")) + #:usage + `((p "Guile-SDL2 provides modules in the " + (code "(sdl2 ...)") + " namespace, roughly organized how the SDL2 C header files are +organized. Low-level bindings are available in the" + (code "(sdl2 bindings ...)") + " namespace, bu these are not recommended for normal usage.") + (p "Additionally, SDL2 extension library bindings are available in the +following modules:") + (ul (li "SDL2_image: " (code "(sdl2 image)")) + (li "SDL2_mixer: " (code "(sdl2 mixer)")) + (li "SDL2_ttf: " (code "(sdl2 ttf)"))) + (p "Here is a short “hello, world” example program:") + ,(highlight-scheme + "(use-modules (sdl2) + (sdl2 render) + (sdl2 surface) + (sdl2 video)) + +(define (draw ren) + (let* ((surface (load-bmp \"hello.bmp\")) + (texture (surface->texture ren surface))) + (clear-renderer ren) + (render-copy ren texture) + (present-renderer ren) + (sleep 2))) + +(sdl-init) + +(call-with-window (make-window) + (lambda (window) + (call-with-renderer (make-renderer window) draw))) + +(sdl-quit)")) + #:requirements '("GNU Guile >= 2.0.9" + "SDL2 >= 2.0.0" + "SDL2_image >= 2.0.0" + "SDL2_mixer >= 2.0.0" + "SDL2_ttf >= 2.0.0" + "GNU Make" + "GNU pkg-config") + #:license "GNU LGPLv3+" + #:releases + `(("0.1.2" ,(date 2016 08 10)) + ("0.1.1" ,(date 2016 01 01)) + ("0.1.0" ,(date 2015 12 22))))) + (site #:title "dthompson" #:domain "dthompson.us" #:default-metadata @@ -331,6 +392,7 @@ functional, and reactive.") about-page projects-page sly-page + guile-sdl2-page (static-directory "css") (static-directory "fonts") (static-directory "images") -- cgit v1.2.3