chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Packaging eggs


From: Christian Kellermann
Subject: Re: [Chicken-users] Packaging eggs
Date: Mon, 30 Aug 2010 21:07:36 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Jim!

* Jim Pryor <address@hidden> [100830 20:30]:
> 
> I'm an occasional user of Chicken. However, my Linux distro only has
> the main Chicken binary in its repositories, and no support for eggs. I
> strongly prefer using a single package manager (my distro's) for all
> my package-handling needs, rather than a different package manager for
> each of vim, Lua, OCaml, Chicken, Python, Haskell, Perl, and so on. So
> I'm looking to automate the extraction of metadata from the eggs' svn
> repo into our distro's package-building-script format.

Thanks for your dear interest in the chicken scheme system!
 
> Actually, I've already done that---about nine months ago--- and I'm now
> the maintainer of 200+ eggs in our Community package repository:
> 
> <http://aur.archlinux.org/packages.php?O=0&K=chicken-&do_Search=Go>

Wow, I am impressed! I guess this would be the most complete egg
collection packaged for any system chicken runs on! To be honest I
do think the idea of having your package manager for the distro to
rely on the packaging is a sexy one.

> The scripts I use to do this are a real ugly, ad-hoc, taped-together
> mess, but they get the job done.
> 
> The last time I updated these were around Chicken 4.2. I'm now trying to
> update all the packages. I'm testing whether the eggs build and install
> on my machine, using Chicken 4.5.0.

Since then Mario Goulart has packed up his egg testing script called
salmonella as a chicken egg itself.  See http://tests.call-cc.org
for the daily output of building and installing all of the chicken
eggs.

This egg also does help you in extracting the necessary meta
information as well as the dependency graph for each egg. I have
not been understanding the reason why you need or want to avoid
using chicken itself to get at the metadata. Could you elaborate
on your situation there?

Also chicken-install would get you all the files for free with the
-r flag (retrieval of files).

> Here's how a sample build script looks, for the check-errors egg.

Is this script part of a more general build architecture? I haven't
had a look at archlinux yet, so please forgive my ignorance on this
topic. I would like to learn about how these things work though.

>     # This is my manual unchunk-the-blob-that-henrietta-sends-me
>     # function. If there's an easier way to do this, please let me know.
>       cat "check-errors-${pkgver}.chunked" | while :; do
>               while read -r bar fname len; do
>                       [[ -n "$fname" ]] && break
>               done
>               [[ -z "$fname" ]] && break
>               fname="${fname:1:${#fname}-2}" # delete quotes around fname
>               if [[ "${fname: -1}" == / ]]; then
>                       mkdir -p "check-errors-${pkgver}/$fname" || return 1
>               else
>                       dd of="check-errors-${pkgver}/$fname" ibs="$len" 
> count=1 2>/dev/null || return 1
>               fi
>       done
>       cd "check-errors-${pkgver}"
>       cp ../check-errors-${pkgver}.html check-errors.html
>     
>       CHICKEN_INSTALL_PREFIX="${pkgdir}/usr" chicken-install -n
> }
> 
> package() {
>       cd "$srcdir/check-errors-${pkgver}"
>       chicken-install -p "${pkgdir}/usr"
> }
> 
> 
> My main questions for now concern the two invocations of check-install,
> one with the -n (-no-install) flag at the end of build(), and the other
> in package(). In both cases, they are operating on a .setup file in the
> current directory.
> 
> What is the proper way to invoke these? I don't understand why the
> CHICKEN_INSTALL_PREFIX should be needed at all for the first invocation,
> since no installing should take place. And indeed for many eggs it's not
> needed. However, many other eggs fail to build at this step complaining that
> (since chicken-install is here running with user privileges). they don't
> have permission to write to /usr/lib/chicken/5/something-or-other. As
> indeed they shouldn't. At no point during the building of these packages
> should anything be written to the machine's real /usr directory. That's
> where the eggs should think they'll end up, but it's our Linux distro's
> package manager that will (later) be installing the files there.

Well chicken-install needs a place to look up the installed eggs
as it does dependency checking. I guess this is why you need to
supply that location on the first call (even though -n is specified).
What chicken-install in later (development) snapshots does now is
inform you that there are dependencies that need to get installed
even though you install one particular egg with -n.

So I guess what you see is:

check-error needs setup-helper, chicken-install retrieves and builds
setup-helper, then tries to install that and fails, because the egg
repo path is not writable. Even though the check-error egg is not
supposed to get installed.

Maybe one solution would be to make that writable in the chroot
environment (do the build there completely) and then just tar up
the files specified in the egg's meta data.

Again, maybe the way salmonella does it gives you some hints.

I hope this did make some sense to you and I did not scare you away :)

You are more than welcome to ask further questions on this list,
we are happy to help!

Kind regards,

Christian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]