guix-more/more/packages/mercury.scm

mercury.scm

1
;;; GNU Guix --- Functional package management for GNU
2
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
3
;;;
4
;;; This file is part of GNU Guix.
5
;;;
6
;;; GNU Guix is free software; you can redistribute it and/or modify it
7
;;; under the terms of the GNU General Public License as published by
8
;;; the Free Software Foundation; either version 3 of the License, or (at
9
;;; your option) any later version.
10
;;;
11
;;; GNU Guix 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
14
;;; GNU General Public License for more details.
15
;;;
16
;;; You should have received a copy of the GNU General Public License
17
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
18
19
(define-module (more packages mercury)
20
  #:use-module ((guix licenses) #:prefix license:)
21
  #:use-module (gnu packages)
22
  #:use-module (guix packages)
23
  #:use-module (guix download)
24
  #:use-module (guix git-download)
25
  #:use-module (guix utils)
26
  #:use-module (guix build-system gnu)
27
  #:use-module (gnu packages bison)
28
  #:use-module (gnu packages flex)
29
  #:use-module (gnu packages glib))
30
31
(define-public mercury
32
  (package
33
    (name "mercury")
34
    (version "14.01.1")
35
    (source (origin
36
              (method url-fetch)
37
              (uri (string-append "http://dl.mercurylang.org/release/mercury-srcdist-"
38
                                  version ".tar.gz"))
39
              (sha256
40
               (base32
41
                "12z8qi3da8q50mcsjsy5bnr4ia6ny5lkxvzy01a3c9blgbgcpxwq"))))
42
    (build-system gnu-build-system)
43
    (arguments
44
     `(#:tests? #f; no test target
45
       #:phases
46
       (modify-phases %standard-phases
47
         (add-before 'configure 'fix-bin-sh
48
           (lambda _
49
             (substitute* '(;"library/io.m"
50
                            "scripts/Mmake.vars.in"
51
                            "bindist/bindist.Makefile.in"
52
                            "bindist/bindist.Makefile"
53
                            "boehm_gc/Makefile.dj"
54
                            "boehm_gc/Makefile.direct")
55
                            ;"library/io.c")
56
               (("/bin/sh") (which "sh")))
57
             (substitute* '("tools/cvdd" "tools/binary_step" "tools/bootcheck"
58
                            "tools/binary" "tools/unary" "tools/speedtest"
59
                            "tools/linear" "scripts/prepare_install_dir.in"
60
                            "Mmakefile")
61
               (("/bin/pwd") (which "pwd")))
62
             (setenv "CONFIG_SHELL" (which "sh"))
63
             #t)))))
64
    (native-inputs
65
     `(("bison" ,bison)
66
       ("flex" ,flex)))
67
    (home-page "https://www.mercurylang.org")
68
    (synopsis "Pure logic programming language")
69
    (description "Mercury is a pure logic programming language intended for
70
the creation of large, fast, reliable programs.  The syntax of Mercury is
71
based on the syntax of Prolog, but semantically the two languages are very
72
different due to Mercury's purity, its type, mode, determinism and module
73
systems.")
74
    (license license:lgpl2.0+)))
75