opam-bundle, a new opam tool/plugin that generates inclusive .tar.gz archives from opam packages.
opam bundle <packages>
All dependencies are downloaded, and put in the tarball with their dependencies.
The generated bundle includes scripts to bootstrap OCaml, opam, depext, install the requested packages into the untarred directory, and put wrappers into a prefix of your choice. Just run
bundle-dir/compile.sh. Except for getting the depexts, when necessary, no internet access is required to install the tarball.
Additional options allow to choose the repositories, OCaml version, and to generate a self-extracting file besides the tar.gz.
Feedback is welcome at https://github.com/AltGr/opam-bundle/issues !
Future plans include generation of bundles including pinned packages and/or local switch setups. This may get integrated into opam.