Re: Update Hombrew install instructions on the web site

Anders F Björklund <[email protected]>
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <[email protected]>
Thomas Leonard wrote:

>> pparently, to get 0install included as a bottle in homebrew
>> we need to also include all the OPAM dependencies explicitly:
>> (wonder if you can get opam to do this, with a small helper ?
>> i.e. output all the URLs and SHAs, for the required +opam.tar.gz)
>> 
>> https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md#specifying-gems-python-modules-go-projects-etc-as-dependencies
>> 
>> https://github.com/Homebrew/homebrew/blob/master/Library/Formula/opam.rb
> 
> This might be quite easy, actually. You can clone the opam repository
> (which just has the metadata) and then add it as a local repository to
> opam. e.g.
> 
> git clone https://github.com/ocaml/opam-repository
> opam remote add my-copy opam-repository
> 
> Then it will get the URLs and MD5 (!) hashes from that. If you can't
> use opam, the data you need is in the "url" files. e.g.
> 
> $ cat opam-repository/packages/lwt/lwt.2.4.7/url
> archive: "https://github.com/ocsigen/lwt/archive/2.4.7.tar.gz"
> checksum: "c837ccc92a08b71a86a83d96c55e986f"
> 
> Of course, you'll want to delete all the unused packages and
> versions... not sure if there's an easy way to do that.

I thought those were the upstream distfiles, and not the opam packaging ?
So I was looking at the +opam.tar.gz in the opam "archives" directory.

But are you saying that we don't need those, in order to build 0install ?
(I can see how the opam build doesn't use any opam modules to build itself)

The old formula used some horrible hacks, instead of the homebrew "resources":

https://github.com/afb/homebrew/blob/zero-install/Library/Formula/zeroinstall.rb

    ENV["OPAMCURL"] = opamcurl
    ENV["OPAMROOT"] = "opamroot"
    ENV["OPAMYES"] = "1"
    ENV["OPAMVERBOSE"] = "1"
    system "opam init --no-setup"
    system "opam install #{modules}"
    system "opam config exec make"

I was hoping for something simple, that could replaced the unversioned lines:

  depends_on "yojson" => :ocaml
  depends_on "xmlm" => :ocaml
  depends_on "ounit" => :ocaml
  depends_on "react" => :ocaml
  depends_on "lwt" => :ocaml
  depends_on "extlib" => :ocaml
  depends_on "ocurl" => :ocaml
  depends_on "lablgtk" => :ocaml if build.with? "gui"
  depends_on "sha" => :ocaml

Here is one example, for Python: https://github.com/tdsmith/homebrew-pypi-poet


The idea is to make the 0install build self-contained, including opam libraries.
Preferably it could run without the user having to mess with their home dir...

It's easier when the packaging system handles everything, but brew doesn't do that.
(And in that case, it is probably easier to "opam install 0install" than all this.)


What we want is just enough so that the brew test bot can build "bottles" for us:
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Bottles.md

And depending on unversioned modules isn't accepted, so they need to be versioned.
Not that I know if (and how) you can get opam to install from local archives only ?


The alternative is just deleting the Homebrew formula, like we did previously. :-(
Or host the formula (GitHub) and bottle (Bintray) ourselves, like a PPA or something.

Just thinking it would be "nice to have" a script that could bundle everything needed:

=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫 
[default] Downloading https://opam.ocaml.org/archives/biniou.1.0.9+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/cppo.1.1.2+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/easy-format.1.0.2+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/extlib.1.6.1+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/lablgtk.2.18.3+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/lwt.2.4.5+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/obus.1.1.6+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/ocamlfind.1.5.5+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/ocurl.0.7.5+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/ounit.2.0.0+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/react.1.2.0+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/sha.1.9+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/type_conv.112.01.02+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/xmlm.1.2.0+opam.tar.gz
[default] Downloading https://opam.ocaml.org/archives/yojson.1.2.1+opam.tar.gz

And then you could just run that at release-time, and provide a "batteries included" ?


I'll run some experiments, see if it's enough with those archives in a local OPAMROOT.

If so, it should be simple enough to just loop over all the resources (like opam.rb).

--anders


------------------------------------------------------------------------------
_______________________________________________
Zero-install-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/zero-install-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.