[pacman-dev] My first splitted package

Allan McRae allan at archlinux.org
Sat Jan 17 07:26:09 EST 2009


Pierre Schmitz wrote:
> Hi pacman-devs,
>
> I have just installed Allan's makepkg-git package and played with the 
> splitting feature. I think its quite elegant and will make packaging a lot 
> easier and cleaner.
>
> I have two general questions (so far)
> 1) Are dependencies and makedependencies of sub-packages are treated by 
> makepkg in any way? If yes there might be a problem if the sub-packages depend 
> on each other.
>   

makepkg does nothing with the depends/makedepends in the package_*() 
functions.  It only checks the depends/makedepends at the top of the 
pkgbuild are installed.  I see you put everything in makedepends which 
is what I will suggest in the documentation.

> 2) Is it possible to use build_pkg1 etc.? That's not very improtant as one 
> could abuse the package functions for such a use case.
>   

Not it is not.  I am of the opinion the two build functions means two 
PKGBUILDs.  I am yet to be convinced otherwise.


> So, let's have a look at a real world example. I have chosen phonon for this. 
> Its quite small but its really useful to split it into three parts. Optdepends 
> do not work here because phonon detects its backends at runtime; and if those 
> are linked against something we have not installed we'll have a problem.
>
> The following PKGBUILD works fine and the resulting packages are valid and 
> functional. I am not sure if this is the best way to use splitting; so 
> comments are welcome. One problem is that phonon and its backends depend on 
> each other. the backends are linked against phonon and if you use phonon 
> you'll have to install at least one backend.
>
> Long story short; here it is:
>
> <snip>
>   

That PKGBUILD looks good to me.  The only comment I have is that if 
someone does a "pacman -S phonon" they are going to get 
phonon-backend-gstreamer installed by default as this will be the first 
detected provider of phonon-backend.  So people are going to want to do 
"pacman -S phonon-backend-foo" which will work because of the dependency 
cycle in there. 

I really do not know how to handle this better.  Maybe a post install 
message for phonon saying a backend is needed.  I am sure there is 
another package like that in one of the repos but cannot remember what 
it is...

Allan





More information about the pacman-dev mailing list