Re: Update Hombrew install instructions on the web site

Thomas Leonard <[email protected]>
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <CAG4opy8ORLR3S48j0XXqURE385CUWUFHjBkVMfpx2b=DoZbfQw@mail.gmail.com>
On 1 August 2015 at 13:57, Anders F Björklund <[email protected]> wrote:
> 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 ?

Any extra files needed will be included in the opam-repository
checkout. The "opam" file says how to build the package. Ideally, you
want to let opam do the actual build.

> 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 ?

There's an '$OPAMFETCH' variable that is used when it wants to
download something. Probably you could just put the archives in the
right place for it manually.

Do we need to bundle the archives in the package, or just their URLs?

If we need everything, we could just do the build, delete the
binaries, and archive up whatever remained in the .opam directory.

> 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



-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

------------------------------------------------------------------------------
_______________________________________________
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.