Update copyrights.
[8sync.git] / guix.scm
1 ;;; 8sync --- Asynchronous programming for Guile
2 ;;; Copyright (C) 2016 Jan Nieuwenhuizen <janneke@gnu.org>
3 ;;; Copyright (C) 2017 Christopher Allan Webber <cwebber@dustycloud.org>
4 ;;;
5 ;;; Also borrowing code from:
6 ;;; guile-sdl2 --- FFI bindings for SDL2
7 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
8 ;;;
9 ;;; This file is part of 8sync.
10 ;;; However, unlike most of 8sync, which is under the LGPLv3+, this
11 ;;; file in particular is licensed under GPLv3+.
12 ;;; Guix is also licensed under GPLv3+.
13 ;;;
14 ;;; This program is free software: you can redistribute it and/or modify
15 ;;; it under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation, either version 3 of the License, or
17 ;;; (at your option) any later version.
18 ;;;
19 ;;; This program is distributed in the hope that it will be useful,
20 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 ;;; GNU General Public License for more details.
23 ;;; 
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
26
27 ;;; Commentary:
28 ;;
29 ;; GNU Guix development package.  To build and install, run:
30 ;;
31 ;;   guix package -f guix.scm
32 ;;
33 ;; To build it, but not install it, run:
34 ;;
35 ;;   guix build -f guix.scm
36 ;;
37 ;; To use as the basis for a development environment, run:
38 ;;
39 ;;   guix environment -l guix.scm
40 ;;
41 ;;; Code:
42
43 (use-modules (srfi srfi-1)
44              (srfi srfi-26)
45              (ice-9 popen)
46              (ice-9 match)
47              (ice-9 rdelim)
48              (guix packages)
49              (guix licenses)
50              (guix gexp)
51              (guix git-download)
52              (guix build-system gnu)
53              ((guix build utils) #:select (with-directory-excursion))
54              (gnu packages)
55              (gnu packages autotools)
56              (gnu packages guile)
57              (gnu packages pkg-config)
58              (gnu packages texinfo))
59
60 (define %source-dir (dirname (current-filename)))
61
62 (define git-file?
63   (let* ((pipe (with-directory-excursion %source-dir
64                  (open-pipe* OPEN_READ "git" "ls-files")))
65          (files (let loop ((lines '()))
66                   (match (read-line pipe)
67                     ((? eof-object?)
68                      (reverse lines))
69                     (line
70                      (loop (cons line lines))))))
71          (status (close-pipe pipe)))
72     (lambda (file stat)
73       (match (stat:type stat)
74         ('directory #t)
75         ((or 'regular 'symlink)
76          (any (cut string-suffix? <> file) files))
77         (_ #f)))))
78
79 (package
80   (name "guile-8sync")
81   (version "git")
82   (source (local-file %source-dir #:recursive? #t #:select? git-file?))
83   (build-system gnu-build-system)
84   (native-inputs `(("autoconf" ,autoconf)
85                    ("automake" ,automake)
86                    ("guile" ,guile-next)
87                    ("pkg-config" ,pkg-config)
88                    ("texinfo" ,texinfo)))
89   (arguments
90    `(#:phases (modify-phases %standard-phases
91                 (add-before 'configure 'bootstrap
92                             (lambda _
93                               (zero? (system* "./bootstrap.sh"))))
94                 (add-before 'configure 'setenv
95                             (lambda _
96                               (setenv "GUILE_AUTO_COMPILE" "0"))))))
97   (home-page "https://gnu.org/s/8sync/")
98   (synopsis "Asynchronous actor model library for Guile")
99   (description
100    "GNU 8sync (pronounced \"eight-sync\") is an asynchronous programming
101 library for GNU Guile based on the actor model.")
102   (license lgpl3+))