[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

elm: dealing with multiple versions of packages

From: Robert Vollmert
Subject: elm: dealing with multiple versions of packages
Date: Thu, 11 Jul 2019 09:31:53 +0200


I’m trying to figure out how to package elm apps nicely. There are:

- elm apps, which typically result in some compiled elm code as *.js
files, and which depend on a number of elm “packages” by precise
- elm packages, libraries of elm source; as usual, these come in
various versions. I’d package these as pure source bundles, so their
individual dependency information won’t be reflected in Guix, that
will be left to apps.

My question now is how to deal with multiple versions of the same
elm package, e.g “elm/browser”. My own app I’m trying to package
depends on “elm/browser” 1.0.1, while e.g. the elm reactor which
is distributed with elm depends on 1.0.0. (To start with, I’d
rather not get into the business of rewriting specified dependencies
to point to the latest compatible version, so both apps should
depend on different guix packages.)

I’ve thought of some ways of encoding this, but am unsure of what
would fit well (and how similar situations are solved elsewhere
in Guix).

1. multiple independent top level definitions, perhaps inherited, e.g.

(define-public elm-browser-1.0.0
  (package …))

(define-public elm-browser-1.0.1
  (package (inherit elm-browser-1.0.0) …))

2. extract the version-specific part to data, and define a function
mapping version to package, along the lines of

(define-public (elm-browser version)
  (define versions
    ‘((“1.0.0” . "1zlmx672glg7fdgkvh5jm47y85pv7pdfr5mkhg6x7ar6k000vyka”)
      (“1.0.1” . “1l0qdbczw91kzz8sx5d5zwz9x662bspy7p21dsr3f2rigxiix2as”)))
    (name “elm-browser”)
    (version version)
    (source (… (assoc-ref versions version)))))

3. as a variant of 2., define a top-level association list mapping version
to package definition

4. don’t define global packages at all, but inline them into the app


reply via email to

[Prev in Thread] Current Thread [Next in Thread]