This seems like a great little howto. Should we perhaps have a teaching FAQ on ocaml.org and put bits of advice like this in there?
y On Dec 1, 2014 9:48 PM, "Louis Gesbert" <[email protected]> wrote: > On how to provide a set of libraries to install, the following is on its > way to the FAQ: > > > > « > > ### Easily provide a set of packages for students to install > > > > The easiest way is to create a package with your prerequisites as > `depends` and > > have them pin that. A quick way to host the file is to use a > > [Gist](https://gist.github.com). Create one with minimal contents and > listing > > your packages as dependencies -- the file name **has** to be `opam`: > > > > ``` > > opam-version: "1.2" > > name: "ocaml101" > > version: "0.1" > > maintainer: "Louis Gesbert <[email protected]>" > > depends: [ "menhir" { = "20140422" } > > "merlin" { >= "2" } > > "ocp-indent" > > "ocp-index" ] > > ``` > > > > Save that and get the `HTTPS clone URL`. All that is needed then is to run: > > > > ```shell > > $ opam pin add ocaml101 <HTTPS clone URL> > > ``` > > > > Furthermore, `opam update` will then pick up any modification you made to > the gist. > > » > > > > Cheers, > > Louis > > > > > > Le jeudi 27 novembre 2014, 18:23:40 Louis Gesbert a écrit : > > > Thanks for the feedback! > > > > > > > Things, I would love: > > > > - being able to give them a sort of meta-package requiring a set of > libraries > > > It's possible to define one within a repository. Or, more directly, it > should work to host an archive containing an `opam` file somewhere, and > then have them run `opam pin URL`. > > > I'll check if that works and document it somewhere (OPAM FAQ?) if that > turns out to be useful. > > > > > > > - perhaps some support to get access to the sources (perhaps it exists > but I haven’t seen it), sometimes I push them into looking at the code of > the libraries and they need to get it (or browse github). Why not also the > doc? > > > OPAM 1.2 added the `opam source <package>` command. Damn useful :) > > > > > > Hope that helps! > > > > > > > > > _______________________________________________ > > > Teaching mailing list > > > [email protected] > > > http://lists.ocaml.org/listinfo/teaching > > > > > > > _______________________________________________ > Teaching mailing list > [email protected] > http://lists.ocaml.org/listinfo/teaching > >
_______________________________________________ Teaching mailing list [email protected] http://lists.ocaml.org/listinfo/teaching
