Re: Use 0compile to link against native binary for lib

Anders F Björklund <[email protected]>
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <[email protected]>
Björn Pollex wrote:
> This has the same effect. I am confused by this, I don’t have MacPorts 
> installed, so I though using the MacPorts distribution support would 
> be incorrect. I don’t even know if package-implementations are even 
> the right approach here?
>
> What I am trying to accomplish is to statically link against native 
> zlib on platforms where it is available, and install it on platforms 
> where it isn’t. On Mac OS X it is available, I don’t need any package 
> manager to install it, unless I’d need a different version. On Windows 
> I’d have to install zlib. How would I express this in a feed file?
>
> Thanks for you help, and apologies if I seem to be slow to grasp this.

Zero Install doesn't have so much to interface with, when it comes to 
the "base" installation. The distribution integration is supposed to 
come from a package manager, which means that not everything is 
available through it on systems like FreeBSD or Mac OS X.

We hacked some of the basics like java, python and gnupg into the system 
distribution itself. It is divided into "Darwin", which was the main OS 
and "Mac OS X" that included Carbon framework. That distinction is 
pretty much dead, these days. It's just "OS X" left...

https://github.com/0install/0install/blob/master/ocaml/zeroinstall/distro_impls.ml#L403

Then you had add-on packages available through MacPorts (port) or Fink 
(i.e. apt-get). You could always provide the software yourself in a 
(relocatable) tarball, and let Zero Install handle use that instead of 
packages. Worked on every platform (you provided).

When it came to basics like zlib, one had two options. Package it 
separately, or just ignore it and treat it as "always installed" 
(meaning that the user would have to provide it manually). I have done 
both, but it's a lot of effort to include "everything" (and source).

Here is one example, I'm not sure if it still works but it did once:
http://afb.users.sourceforge.net/zero-install/interfaces/gnupg.xml

But when it came to larger installations, like gtk+, that approach 
didn't really scale... So when you didn't have any packages available, 
like was the case on the Mac (sadly enough), it was pretty much going 
back to the basics and back to scripting it.

So that is how the supporting packages like GnuPG.pkg and PyGTK.pkg were 
done. And also the reason why they are seldom updated... It's *much* 
better to have everything divided into small packages - with 
dependencies between them.

Simple enough to compose larger installables from those small things, 
when needed ? So the pkg packages were assembled from a bunch of tgz 
archives, to make it easier for the end user (without a package manager 
to handle it all).

Like I mentioned earlier, one should probably start over with OS X 10.9+ 
and x86_64. Homebrew *explicitly* does not want to deal with 
fine-grained dependencies or with things already included with the OS, 
so that's not really usable for this.

It all depends on what your higher-level use case or the end goal is ?

I think in the end it comes down to what software is made available...

--anders

> On 11 Jul 2015, at 05:55, Thomas Leonard <[email protected] 
> <mailto:[email protected]>> wrote:
>>
>> On 11 July 2015 at 00:51, Björn Pollex <[email protected] 
>> <mailto:[email protected]>> wrote:
>>> Hi all,
>>>
>>> I am trying to build an application using 0compile, and have 0compile
>>> provision all the static libraries that application links against. 
>>> Currently
>>> I’m trying to make it use the native zlib on Mac OS X. I am really 
>>> stabbing
>>> around in the dark here, as the documentation on these things seems 
>>> a bit
>>> sparse to me. Here is my current approach:
>>>
>>> I’ve created a local feed file zlib.xml with the following contents:
>>>
>>> <?xml version="1.0"?>
>>> <interface
>>> xmlns="http://zero-install.sourceforge.net/2004/injector/interface">
>>>  <name>zlib</name>
>>>  <summary>Compression library</summary>
>>>  <package-implementation distributions="Mac" package="zlib"/>
>>> </interface>
>>
>> According tohttp://0install.net/distribution-integration.htmlthe
>> distribution name should be "MacPorts" here.
>>
>>> In my programs local feed I refer to this as follows, from within the
>>> <command name=“compile”> element:
>>>
>>>      <requires
>>> interface="/Users/bjoern/Documents/Programming/feeds/zlib.xml">
>>> <environment name="FOO" insert="" mode="prepend" />
>>>      </requires>
>>>
>>> The binding is really just for experimentation. This setup does not 
>>> work,
>>> 0compile reports this:
>>>
>>> Can't find all required implementations:
>>> - 
>>> /Users/bjoern/Documents/Programming/cpp/my-application/my-application.xml
>>> -> 0.1-pre (.)
>>> - /Users/bjoern/Documents/Programming/feeds/zlib.xml -> (problem)
>>>    No known implementations at all
>>>
>>> I’m guessing that I’ve misunderstood the purpose of using
>>> distributions=“Mac”. How can I make 0compile detect my native version of
>>> zlib?

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
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.