unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 83a431d44381a84e5700dbff684ab2f470239e4d 5727 bytes (raw)
name: gnu/packages/miking.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2023 Liliana Marie Prikler <liliana.prikler@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages miking)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system dune)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages ocaml))

(define-public miking-boot
  (let ((commit "539bd577c85d521559f630f2dbe78d2a1c80a26d")
        (revision "1"))
    (package
     (name "miking-boot")
     (version (git-version "0.0.0" revision commit))
     (source (origin
              (method git-fetch)
              (uri (git-reference (url "https://github.com/miking-lang/miking")
                                  (commit commit)))
              (file-name (git-file-name "miking" version))
              (patches (search-patches
                        "miking-drop-acceleration.patch"
                        "miking-preserve-OCAMLPATH.patch"))
              (modules '((guix build utils)))
              (snippet
               #~(begin
                   (for-each delete-file-recursively
                             '("src/main/accelerate.mc"
                               "stdlib/cuda"
                               "stdlib/futhark"
                               "stdlib/pmexpr/build.mc"
                               "stdlib/pmexpr/classify.mc"
                               "stdlib/pmexpr/compile.mc"
                               "stdlib/pmexpr/wrapper.mc"
                               "test/examples/accelerate"))
                   (substitute* "test-files.mk"
                     (("special_dependencies_files \\+=.*" all)
                      (string-append all
                                     ;; requires Domain module, which is unbound
                                     "\t$(wildcard stdlib/multicore/*.mc) \\\n"
                                     ;; require external ocaml packages
                                     "\tstdlib/ext/async-ext.mc \\\n"
                                     "\tstdlib/ext/dist-ext.mc \\\n"
                                     "\tstdlib/ext/toml-ext.mc \\\n")))))
              (sha256
               (base32
                "1qg5w2pdsjfy03qcw8bj4nv9imyb361nws9vmr91xfbjv33m18sm"))))
     (build-system dune-build-system)
     (inputs (list ocaml-linenoise))
     (home-page "https://github.com/miking-lang/miking")
     (synopsis "Meta language system")
     (description "@acronym{Miking, Meta Viking} is a meta language system
for creating embedded domain-specific and general-purpose languages.")
     (license license:expat))))

(define-public miking
  (package/inherit
   miking-boot
   (name "miking")
   (build-system copy-build-system)
   (arguments
    (list #:install-plan #~`(("build/mi" "bin/")
                             ("stdlib" "lib/mcore"))
          #:phases
          #~(modify-phases %standard-phases
              (add-before 'install 'build
                (lambda _
                  (invoke "boot" "eval" "src/main/mi-lite.mc"
                          "--"
                          "0" "src/main/mi-lite.mc" "mi-lite")
                  (invoke "./mi-lite" "1" "src/main/mi.mc" "./mi")
                  (invoke "./mi" "compile" "src/main/mi.mc")
                  (mkdir "build")
                  (rename-file "mi" "build/mi")))
              (add-after 'build 'check
                (lambda* (#:key tests? #:allow-other-keys)
                  (when tests?
                    (for-each (compose
                               (lambda (file check)
                                 (invoke "make" "-f" file check))
                               (lambda (pair) (values (car pair) (cdr pair))))
                              '(("test-compile.mk" . "selected")
                                ("test-run.mk" . "selected")
                                ("test-tune.mk" . "all"))))))
              (add-after 'install 'wrap
                (lambda* (#:key inputs outputs #:allow-other-keys)
                  (wrap-program (string-append (assoc-ref outputs "out")
                                               "/bin/mi")
                     `("PATH" suffix
                       (,(dirname (search-input-file inputs "bin/dune"))
                        ,(dirname (search-input-file inputs "bin/ocaml"))
                        ,(dirname (search-input-file inputs "bin/which"))))
                     `("OCAMLPATH" suffix (,(getenv "OCAMLPATH")))))))))
   (inputs (list bash-minimal
                 dune
                 miking-boot
                 ocaml
                 ocaml-linenoise
                 which))
   (native-inputs (list dune
                        gnu-make
                        miking-boot
                        ocaml
                        ;; needed for tests
                        coreutils
                        which))))

debug log:

solving 83a431d443 ...
found 83a431d443 in https://yhetil.org/guix-patches/c225fb49f3b105f2426e5d312caf334788889051.1687022754.git.liliana.prikler@gmail.com/
found 7d65e98970 in https://yhetil.org/guix-patches/2e4aa0048428b0d2b08c46b03d8f21b54623e580.1687022754.git.liliana.prikler@gmail.com/

applying [1/2] https://yhetil.org/guix-patches/2e4aa0048428b0d2b08c46b03d8f21b54623e580.1687022754.git.liliana.prikler@gmail.com/
diff --git a/gnu/packages/miking.scm b/gnu/packages/miking.scm
new file mode 100644
index 0000000000..7d65e98970


applying [2/2] https://yhetil.org/guix-patches/c225fb49f3b105f2426e5d312caf334788889051.1687022754.git.liliana.prikler@gmail.com/
diff --git a/gnu/packages/miking.scm b/gnu/packages/miking.scm
index 7d65e98970..83a431d443 100644

Checking patch gnu/packages/miking.scm...
Applied patch gnu/packages/miking.scm cleanly.
Checking patch gnu/packages/miking.scm...
Applied patch gnu/packages/miking.scm cleanly.

index at:
100644 83a431d44381a84e5700dbff684ab2f470239e4d	gnu/packages/miking.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).