some placeholder stuff for the revolving door and shop
[mudsync.git] / guix.scm
1 ;;; mudsync --- Live hackable MUDs in Guile
2 ;;; Copyright (C) 2016 Jan Nieuwenhuizen <janneke@gnu.org>
3 ;;; Copyright (C) 2017 Christopher Allan Webber <cwebber@dustycloud.org>
4 ;;;
5 ;;; This program is free software: you can redistribute it and/or modify
6 ;;; it under the terms of the GNU General Public License as published by
7 ;;; the Free Software Foundation, either version 3 of the License, or
8 ;;; (at your option) any later version.
9 ;;;
10 ;;; This program is distributed in the hope that it will be useful,
11 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ;;; GNU General Public License for more details.
14 ;;; 
15 ;;; You should have received a copy of the GNU General Public License
16 ;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 ;;; Commentary:
19 ;;
20 ;; GNU Guix development package.  To build and install, run:
21 ;;
22 ;;   guix package -f guix.scm
23 ;;
24 ;; To build it, but not install it, run:
25 ;;
26 ;;   guix build -f guix.scm
27 ;;
28 ;; To use as the basis for a development environment, run:
29 ;;
30 ;;   guix environment -l guix.scm
31 ;;
32 ;;; Code:
33
34 (use-modules (srfi srfi-1)
35              (srfi srfi-26)
36              (ice-9 popen)
37              (ice-9 match)
38              (ice-9 rdelim)
39              (guix download)
40              (guix packages)
41              (guix licenses)
42              (guix gexp)
43              (guix git-download)
44              (guix build-system gnu)
45              ((guix build utils) #:select (with-directory-excursion))
46              (gnu packages)
47              (gnu packages autotools)
48              (gnu packages guile)
49              (gnu packages pkg-config)
50              (gnu packages texinfo))
51
52 (define %source-dir (dirname (current-filename)))
53
54 (define guile-without-select-bug
55   (package
56    (inherit guile-next)
57    (version (package-version guile-next))
58    (source (origin
59               (method url-fetch)
60               (uri (string-append "ftp://alpha.gnu.org/gnu/guile/guile-"
61                                   version ".tar.xz"))
62               (sha256
63                (base32
64                 "0r9y4hw17dlxahik4zsccfb2f3p2a07wqndfm251bgmam9hln6gi"))
65               (modules '((guix build utils)))
66
67               ;; Remove the pre-built object files.  Instead, build everything
68               ;; from source, at the expense of significantly longer build
69               ;; times (almost 3 hours on a 4-core Intel i5).
70               (snippet '(for-each delete-file
71                                   (find-files "prebuilt" "\\.go$")))
72
73               ;; Here's what we're adding
74               (patches (list (string-append %source-dir
75                                             "/build-aux/patch-guile-fix-live-repl.patch")))))))
76
77 (define guile-8sync-latest
78   (package
79     (inherit guile-8sync)
80     (version "git")
81     (source
82      (origin
83        (method git-fetch)
84        (uri (git-reference
85              (url "git://git.savannah.gnu.org/8sync.git")
86              (commit "dfde2119df2a0adb86ec4921f95ef2c15692a593")))
87        (sha256
88         (base32
89          "086smlch92n6z5xng0la9l9g6m145klw1c8222cgj32qhyarbkpk"))))
90     (arguments
91      `(#:phases (modify-phases %standard-phases
92                   (add-before 'configure 'bootstrap
93                               (lambda _
94                                 (zero? (system* "./bootstrap.sh")))))))))
95
96 (package
97   (name "guile-mudsync")
98   (version "git")
99   (source (local-file %source-dir
100                       #:recursive? #t
101                       #:select? (git-predicate %source-dir)))
102   (build-system gnu-build-system)
103   (native-inputs `(("autoconf" ,autoconf)
104                    ("automake" ,automake)
105                    ("guile" ,guile-without-select-bug)
106                    ("guile-8sync" ,guile-8sync-latest)
107                    ("guile-irregex" ,guile2.2-irregex)
108                    ("pkg-config" ,pkg-config)
109                    ("texinfo" ,texinfo)))
110   (arguments
111    `(#:phases (modify-phases %standard-phases
112                 (add-before 'configure 'bootstrap
113                             (lambda _
114                               (zero? (system* "./bootstrap.sh"))))
115                 (add-before 'configure 'setenv
116                             (lambda _
117                               (setenv "GUILE_AUTO_COMPILE" "0"))))))
118   (home-page "https://notabug.org/cwebber/mudsync/")
119   (synopsis "Live hackable MUD system")
120   (description
121    "Mudsync is a live hackable MUD system built on top of GNU 8sync.")
122   (license gpl3+))