all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* elm: dealing with multiple versions of packages
@ 2019-07-11  7:31 Robert Vollmert
  0 siblings, 0 replies; only message in thread
From: Robert Vollmert @ 2019-07-11  7:31 UTC (permalink / raw)
  To: guix-devel

Hi,

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
version.
- 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”)))
  (package
    (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
dependencies

Thanks,
Robert

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-11  7:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11  7:31 elm: dealing with multiple versions of packages Robert Vollmert

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.