doing magic with package dependencies (?)
Will Partain <[email protected]> Wed, 18 Jul 2001 20:56:27 +0100
| Newsgroups | gmane.comp.sysutils.ark.devel |
|---|---|
| Message-ID | <[email protected]> |
(This message is the second of a two-parter; in the first
part, I commented that we might like to compile packages
with very explicit dependencies, e.g.
gcc -I/.-ark-deploy/zlib--1.1.3/include \
-I/.-ark-deploy/libpng--1.0.9/include \
-L/.-ark-deploy/zlib--1.1.3/lib \
-L/.-ark-deploy/libpng--1.0.9/lib ...
)
Now, it would be More Than a Little Tedious to spell out all
such dependencies... However, note that we already say
things like...
<configure>
<param name="configure_args">--gung-ho --with-database=berkdb --with-jpeg --with-png --with-xpm --without-mule --without-dragndrop --without-cde --without-ldap</param>
<constraint><dependency type="normal" name="db" /></constraint>
<constraint><dependency type="normal" name="jpeg" /></constraint>
<constraint><dependency type="normal" name="libpng" /></constraint>
<constraint><dependency type="normal" name="xpm" /></constraint>
</configure>
Those <dependency .../> constraints already specify the
dependencies! -- all we need to do is have them magically
turn into -I... and -L... flags :-)
So, howzabout:
* The ARK engine "remembers" dependent packages that it
bumps into while satisfying <constraint>s ...
* The engine provides a (Python) interface that lets us
query this information
* It's then a simple matter to write
<param name="DEP_INCS"> !dependentPkgs(format='-I') </param>
<param name="DEP_LIBS"> !dependentPkgs(format='-L') </param>
<param name="CFLAGS"> -O2 @param:DEP_INCS@ @param:DEP_LIBS@ </param>
* The package state will then record the exact dependencies
(in its records of the values of DEP_INCS and DEP_LIBS).
(If we wanted to be more explicit about it, we could do
something like
touch /d/ark-state/package/zlib--1.1.3/depends:xemacs--21.4.4
)
Any other {weird thoughts,alarm bells} occur to you all?
Will