2019-07-15 09:47:14 -04:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
|
2022-05-18 14:10:48 -04:00
|
|
|
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
|
2019-07-15 09:47:14 -04:00
|
|
|
;;;
|
|
|
|
;;; 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 elm)
|
|
|
|
#:use-module (gnu packages)
|
|
|
|
#:use-module (gnu packages haskell)
|
|
|
|
#:use-module (gnu packages haskell-check)
|
|
|
|
#:use-module (gnu packages haskell-crypto)
|
|
|
|
#:use-module (gnu packages haskell-xyz)
|
|
|
|
#:use-module (gnu packages haskell-web)
|
|
|
|
#:use-module (guix build-system haskell)
|
2022-05-18 14:10:48 -04:00
|
|
|
#:use-module (guix gexp)
|
2019-07-15 09:47:14 -04:00
|
|
|
#:use-module (guix git-download)
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
|
|
|
#:use-module (guix packages))
|
|
|
|
|
2022-05-18 14:10:48 -04:00
|
|
|
;; The `elm` build usually calls out to itself via Template Haskell to compile
|
|
|
|
;; the `elm reactor` web app (which depends on additional Elm packages) and
|
|
|
|
;; embeds the static files into itself. The reactor isn't required to compile
|
|
|
|
;; Elm applications, so we want to skip it for the bootstrap package, but we
|
|
|
|
;; also want to be able to enable it once we can build it. We patch Elm to
|
|
|
|
;; instead look for the files on disk relative to the executable and to have
|
|
|
|
;; `elm reactor` exit with a useful error message if they aren't there.
|
|
|
|
(define %reactor-root-base
|
|
|
|
"share/elm/reactor-")
|
2019-07-15 09:47:14 -04:00
|
|
|
(define-public elm-compiler
|
|
|
|
(package
|
|
|
|
(name "elm-compiler")
|
2022-05-18 14:10:48 -04:00
|
|
|
(version "0.19.1")
|
2019-07-15 09:47:14 -04:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method git-fetch)
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/elm/compiler/")
|
|
|
|
(commit version)))
|
|
|
|
(sha256
|
2022-05-18 14:10:48 -04:00
|
|
|
(base32 "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w"))
|
2019-07-15 09:47:14 -04:00
|
|
|
(patches
|
2022-05-18 14:10:48 -04:00
|
|
|
(search-patches "elm-reactor-static-files.patch"))))
|
2019-07-15 09:47:14 -04:00
|
|
|
(build-system haskell-build-system)
|
2019-11-16 09:42:08 -05:00
|
|
|
(arguments
|
2022-05-18 14:10:48 -04:00
|
|
|
(list
|
|
|
|
#:configure-flags
|
|
|
|
#~(list (string-append "--ghc-option=-DGUIX_REACTOR_STATIC_REL_ROOT="
|
|
|
|
"\"../" #$%reactor-root-base
|
|
|
|
#$(package-version this-package)
|
|
|
|
"\""))
|
|
|
|
#:phases
|
|
|
|
#~(modify-phases %standard-phases
|
|
|
|
(add-before 'configure 'update-constraints
|
|
|
|
(lambda _
|
|
|
|
(substitute* "elm.cabal"
|
|
|
|
(("(ansi-terminal|containers|network|http-client|language-glsl)\\s+[^,]+" all dep)
|
|
|
|
dep)))))))
|
2019-07-15 09:47:14 -04:00
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
(list ghc-ansi-terminal
|
|
|
|
ghc-ansi-wl-pprint
|
|
|
|
ghc-edit-distance
|
2022-05-18 14:10:48 -04:00
|
|
|
ghc-filelock
|
2021-12-13 11:18:24 -05:00
|
|
|
ghc-http
|
|
|
|
ghc-http-client
|
|
|
|
ghc-http-client-tls
|
|
|
|
ghc-http-types
|
|
|
|
ghc-language-glsl
|
|
|
|
ghc-logict
|
|
|
|
ghc-network
|
|
|
|
ghc-raw-strings-qq
|
|
|
|
ghc-scientific
|
|
|
|
ghc-sha
|
|
|
|
ghc-snap-core
|
|
|
|
ghc-snap-server
|
|
|
|
ghc-unordered-containers
|
|
|
|
ghc-utf8-string
|
|
|
|
ghc-vector
|
|
|
|
ghc-zip-archive))
|
2019-07-15 09:47:14 -04:00
|
|
|
(home-page "https://elm-lang.org")
|
|
|
|
(synopsis "Programming language for Web applications")
|
|
|
|
(description
|
|
|
|
"This package provides Elm, a statically-typed functional programming
|
|
|
|
language for the browser. It includes commands for developers such as
|
|
|
|
@command{elm make} and @command{elm repl}.")
|
|
|
|
(license license:bsd-3)))
|