summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip McGrath <philip@philipmcgrath.com>2022-05-18 14:11:10 -0400
committerLudovic Courtès <ludo@gnu.org>2022-05-22 01:07:55 +0200
commitb6c0f18dee39d0adb2b8e7019e3d7cc5be9f933d (patch)
treefb6b81565d15eabca3e26e004733feb39a9204eb
parentgnu: elm: Support 'elm reactor'. (diff)
downloadguix-b6c0f18dee39d0adb2b8e7019e3d7cc5be9f933d.tar.gz
guix-b6c0f18dee39d0adb2b8e7019e3d7cc5be9f933d.tar.bz2
guix-b6c0f18dee39d0adb2b8e7019e3d7cc5be9f933d.tar.xz
gnu: Add elm-todomvc.
* gnu/packages/elm.scm (elm-todomvc): New variable. * doc/guix.texi (Build Systems)[elm-build-system]: Mention it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--doc/guix.texi4
-rw-r--r--gnu/packages/elm.scm53
2 files changed, 55 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 27d0c69dad..9cdee15d55 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8748,7 +8748,7 @@ Elm @dfn{projects} which declare @code{@{ "type": "package" @}} in their
8748@file{elm.json} files. Using @code{elm-build-system} to build Elm 8748@file{elm.json} files. Using @code{elm-build-system} to build Elm
8749@dfn{applications} (which declare @code{@{ "type": "application" @}}) is 8749@dfn{applications} (which declare @code{@{ "type": "application" @}}) is
8750possible, but requires ad-hoc modifications to the build phases. For 8750possible, but requires ad-hoc modifications to the build phases. For
8751an example, see the definition of 8751examples, see the definitions of the @code{elm-todomvc} example application and
8752the @code{elm} package itself (because the front-end for the 8752the @code{elm} package itself (because the front-end for the
8753@samp{elm reactor} command is an Elm application). 8753@samp{elm reactor} command is an Elm application).
8754 8754
@@ -8757,7 +8757,7 @@ Elm supports multiple versions of a package coexisting simultaneously under
8757@env{ELM_HOME}, but this does not yet work well with @code{elm-build-system}. 8757@env{ELM_HOME}, but this does not yet work well with @code{elm-build-system}.
8758This limitation primarily affects Elm applications, because they specify 8758This limitation primarily affects Elm applications, because they specify
8759exact versions for their dependencies, whereas Elm packages specify supported 8759exact versions for their dependencies, whereas Elm packages specify supported
8760version ranges. As a workaround, you can use 8760version ranges. As a workaround, the example applications mentioned above use
8761the @code{patch-application-dependencies} procedure provided by 8761the @code{patch-application-dependencies} procedure provided by
8762@code{(guix build elm-build-system)} to rewrite their @file{elm.json} files to 8762@code{(guix build elm-build-system)} to rewrite their @file{elm.json} files to
8763refer to the package versions actually present in the build environment. 8763refer to the package versions actually present in the build environment.
diff --git a/gnu/packages/elm.scm b/gnu/packages/elm.scm
index d515d68e8f..9d3a58bcb5 100644
--- a/gnu/packages/elm.scm
+++ b/gnu/packages/elm.scm
@@ -487,3 +487,56 @@ you.")
487on the @code{marked} project, which focuses on speed.") 487on the @code{marked} project, which focuses on speed.")
488 (license license:bsd-3))) 488 (license license:bsd-3)))
489 489
490(define-public elm-todomvc
491 (let ((commit "f236e7e56941c7705aba6e42cb020ff515fe3290")
492 (revision "1"))
493 (package
494 (name "elm-todomvc")
495 (version (git-version "1" revision commit))
496 (source
497 (origin
498 (method git-fetch)
499 (uri (git-reference
500 (url "https://github.com/evancz/elm-todomvc")
501 (commit commit)))
502 (sha256
503 (base32 "0g37bglzshkf79s4n7aq9ib44h5qn8ng7n72sh2xslgd20h05nfw"))
504 (file-name (git-file-name name version))))
505 (inputs (list elm-browser elm-core elm-html elm-json))
506 (build-system elm-build-system)
507 (arguments
508 (list
509 #:modules
510 `((srfi srfi-26)
511 ,@%elm-default-modules)
512 #:phases
513 #~(modify-phases %standard-phases
514 (delete 'stage)
515 (replace 'configure
516 patch-application-dependencies)
517 (replace 'build
518 (lambda* (#:key native-inputs inputs #:allow-other-keys)
519 (invoke (search-input-file (or native-inputs inputs)
520 "/bin/elm")
521 "make"
522 "src/Main.elm"
523 "--output=elm.js")))
524 (replace 'install
525 (lambda args
526 (let* ((out-dir #$output)
527 (dest-dir
528 (string-append out-dir
529 "/share/"
530 (strip-store-file-name out-dir))))
531 (for-each (cut install-file <> dest-dir)
532 `("elm.js"
533 "index.html"
534 "style.css"
535 "README.md")))))
536 (delete 'validate-compiled))))
537 (home-page "https://github.com/evancz/elm-todomvc")
538 (synopsis "TodoMVC in Elm")
539 (description "This is the official Elm implementation of
540@url{https://todomvc.com,TodoMVC}, a simple to-do--list application used to
541compare front-end web frameworks.")
542 (license license:bsd-3))))