Paste number 346142: miniadapton

Paste number 346142: miniadapton
Pasted by: Cato
When:2 years, 3 months ago
Share:Tweet this! | http://paste.lisp.org/+7F32
Channel:None
Paste contents:
Raw Source | XML | Display As
(define-public guile-miniadapton
  (package
    (name "guile-miniadapton")
    (version "master")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/fisherdj/miniAdapton")
                    (commit "1b5749422304567c96ac5367f2221dda9eff5880")))
            (file-name (string-append name "-" version "-checkout"))
            (sha256
             (base32
              "09q51zkw2fypad5xixskfzw2cjhjgs5cswdp3i7cpp651rb3zndh"))))
  (build-system gnu-build-system)
  (arguments
   `(#:modules
     ((guix build utils)
      (ice-9 match)
      (ice-9 popen)
      (ice-9 rdelim)
      (guix build gnu-build-system))
     #:phases
     (modify-phases %standard-phases
       (delete 'configure)
       (delete 'build)
       (delete 'check)
       (replace 'install
                (lambda* (#:key inputs outputs #:allow-other-keys)
                  (let* ((out (assoc-ref outputs "out"))
                         (effective (read-line
                                     (open-pipe* OPEN_READ
                                                 "guile" "-c"
                                                 "(display (effective-version))")))
                         (zero? (system* "tree"))
                         (module-dir (string-append out "/share/guile/site/"
                                                    effective))
                         (source (assoc-ref inputs "source"))
                         (scm-files '("include.scm"
                                      "microadapton.scm"
                                      "microadapton-impl.scm"
                                      "microadapton-types.scm"
                                      "memoization.scm"
                                      "memoization-impl.scm"
                                      "miniadapton.scm"
                                      "miniadapton-impl.scm"
                                      "set.scm"
                                      "set-impl.scm"))
                         (guild (string-append (assoc-ref %build-inputs "guile")
                                               "/bin/guild")))
                    ;; Make installation directories.
                    ;;(mkdir-p (string-append module-dir "source"))
                    ;; Compile .scm files and install.
                    (setenv "GUILE_AUTO_COMPILE" "0")
                    (for-each (lambda (file)
                                (let* ((dest-file (string-append
                                                 module-dir "/"
                                                 file))
                                       (go-file (match (string-split file #\.)
                                                  ((base _)
                                                   (string-append module-dir "/" base ".go")))))   
                                  
                                  ;; Install source module.
                                  (copy-file file
                                             dest-file)
                                  ;; Install compiled module.
                                  (unless (zero? (system* guild "compile"
                                                          "-L" (getcwd)
                                                          "-o" go-file
                                                          file))
                                    (error (format #f "Failed to compile ~s to ~s!"
                                                   file dest-file)))))
                              scm-files)
                    #t))))))
  (inputs
   `(("guile" ,guile-2.2)))
  (native-inputs
   `(("tree" ,tree)))
  (home-page "https://github.com/fisherdj/miniAdapton")
  (synopsis "a minimal implementation of incremental computation 
in (Guile) Scheme")
  (description
   "a complete Scheme implementation of
miniAdapton, which implements the core functionality of the
Adapton system for incremental computation (also  known
as self-adjusting computation). 
Like Adapton, miniAdapton allows programmers to safely combine 
mutation and memoization. 
miniAdapton is built on top of an even simpler system,
microAdapton.
Both miniAdapton and microAdapton
are designed to be easy to understand, extend, and port to
host languages other than Scheme.")
  (license license:expat)))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.