You are not logged in.

#1 2011-05-11 18:14:15

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,849

devtools - how to decide makedepends / depends

An aur package i maintained for a long time has now been adopted in community, and i noticed it had gotten some extra dependencies.
the TU that adopted it, told me the added dependencies had been detected by building in a clean chroot and pointed me to the devtools package.

I've looked into it, and understand the advantages.

When you build a package with makepkg, it doesn't matter that much if you put a dependency X in makedepends or in depends.
in both cases X will still be present when running.

Buidling in a chroot however is different : only packages in depends will be present after the package has been installed by the user.

namcap can ofc help with determining run-time dependencies, but it's not perfect.

suggestions how to determine whether to put a package in makedepends or in depends ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 2011-05-23 06:03:01

vadmium
Member
Registered: 2010-11-02
Posts: 63

Re: devtools - how to decide makedepends / depends

I guess if nobody has documented what a packages needs its dependencies for (building or running), you just have to look at how each of the dependency is used. I’m no Arch linux official voice but I’d say something like

  • Put packages that are needed at run time in depends. Examples would be shared libraries and modules, interpreters used by the program (Shell, Python), daemons and services.

  • Put packages that are only needed at compile time in makedepends only. I think the rule with the AUR is that member packages of the base-devel group (Gnu Make, GCC, Patch, etc) do not have to be included, and are often left out. Examples would be compilers, assemblers, interpreters used for building, library headers and static “archive” libraries.

  • With Arch, many shared library packages are technically both makedepends (for the header files and linker resolving symbols) as well as runtime depends but these are only added to depends.

Recently I noticed the “makepkg --rmdeps” option which sounds like it might help detect mandatory makedepend in the future; however I haven’t bumped into a package that tests this out yet. If there was a neat way to have this option turned on by default I would do that.

Taking a peek an existing packages of the same software project can often help, for example a Debian package.

Offline

#3 2011-05-23 11:47:01

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,849

Re: devtools - how to decide makedepends / depends

vadmium wrote:

With Arch, many shared library packages are technically both makedepends (for the header files and linker resolving symbols) as well as runtime depends but these are only added to depends.

Those are the tricky ones, as they are usually detected during compiletime.
Thanks for sharing your thoughts.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2011-05-23 12:39:32

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: devtools - how to decide makedepends / depends

vadmium wrote:

Recently I noticed the “makepkg --rmdeps” option which sounds like it might help detect mandatory makedepend in the future; however I haven’t bumped into a package that tests this out yet. If there was a neat way to have this option turned on by default I would do that.

makepkg's -r flag is just the mirror to its -s flag. Furthermore, it doesn't make sense to use -r without -s.

I agree with the rest of your analysis, except to say that makedepends should never include members of base-devel group.

Offline

Board footer

Powered by FluxBB