ttf: Fix bytevector offsets in font-glyph-metrics.
[guile-sdl2.git] / guix.scm
1 ;;; guile-sdl2 --- FFI bindings for SDL2
2 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
3 ;;;
4 ;;; This file is part of guile-sdl2.
5 ;;;
6 ;;; Guile-sdl2 is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU Lesser General Public License as
8 ;;; published by the Free Software Foundation; either version 3 of the
9 ;;; License, or (at your option) any later version.
10 ;;;
11 ;;; Guile-sdl2 is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;;; General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with guile-sdl2. If not, see
18 ;;; <http://www.gnu.org/licenses/>.
19
20 ;;; Commentary:
21 ;;
22 ;; GNU Guix development package. To build and install, run:
23 ;;
24 ;; guix package -f guix.scm
25 ;;
26 ;; To use as the basis for a development environment, run:
27 ;;
28 ;; guix environment -l guix.scm
29 ;;
30 ;;; Code:
31
32 (use-modules (ice-9 match)
33 (ice-9 popen)
34 (ice-9 rdelim)
35 (srfi srfi-1)
36 (srfi srfi-26)
37 (guix gexp)
38 (guix packages)
39 (guix licenses)
40 (guix git-download)
41 (guix build-system gnu)
42 ((guix build utils) #:select (with-directory-excursion))
43 (gnu packages)
44 (gnu packages autotools)
45 (gnu packages guile)
46 (gnu packages pkg-config)
47 (gnu packages sdl)
48 (gnu packages texinfo))
49
50 (define %source-dir (dirname (current-filename)))
51
52 (define git-file?
53 (let* ((pipe (with-directory-excursion %source-dir
54 (open-pipe* OPEN_READ "git" "ls-files")))
55 (files (let loop ((lines '()))
56 (match (read-line pipe)
57 ((? eof-object?)
58 (reverse lines))
59 (line
60 (loop (cons line lines))))))
61 (status (close-pipe pipe)))
62 (lambda (file stat)
63 (match (stat:type stat)
64 ('directory #t)
65 ((or 'regular 'symlink)
66 (any (cut string-suffix? <> file) files))
67 (_ #f)))))
68
69 (package
70 (name "guile-sdl2")
71 (version "0.4.0")
72 (source (local-file %source-dir #:recursive? #t #:select? git-file?))
73 (build-system gnu-build-system)
74 (arguments
75 '(#:make-flags '("GUILE_AUTO_COMPILE=0")
76 #:phases
77 (modify-phases %standard-phases
78 (add-after 'unpack 'bootstrap
79 (lambda _ (zero? (system* "sh" "bootstrap")))))))
80 (native-inputs
81 `(("autoconf" ,autoconf)
82 ("automake" ,automake)
83 ("pkg-config" ,pkg-config)
84 ("texinfo" ,texinfo)))
85 (inputs
86 `(("guile" ,guile-3.0)
87 ("sdl2" ,sdl2)
88 ("sdl2-image" ,sdl2-image)
89 ("sdl2-mixer" ,sdl2-mixer)
90 ("sdl2-ttf" ,sdl2-ttf)))
91 (synopsis "Guile bindings for SDL2")
92 (description "Guile-sdl2 provides pure Guile Scheme bindings to the
93 SDL2 C shared library via the foreign function interface.")
94 (home-page "https://git.dthompson.us/guile-sdl2.git")
95 (license lgpl3+))