[aur-general] PKGBUILD: depends vs. makedepends and namcap warning

Lukas Böger dev at lboeger.de
Mon Jul 11 09:28:25 UTC 2016


On 11.07.2016 10:38, Baptiste Jonglez wrote:
> On Mon, Jul 11, 2016 at 10:18:32AM +0200, Lukas Böger wrote:
>> Dear AUR list,
>>
>> simple question about dependencies in PKGBUILDs:
>>
>> Package A provides some header files and build scripts. Package B
>> provides additional headers, and their usage only work out if A's
>> headers are in place. Additionaly, package B can only be compiled using
>> A's build scripts.
>>
>> 1) Is it correct to have package A in B's depends AND makedepends arrays?
> 
> In general, no.  If you need a dependency both at compile time and at
> runtime, you should put it in depends only.
> 
>> 2) Am I supposed to ignore namcap's warning 'Dependency included and not
>> neede' because it doesn't take header dependencies into account?
> 
> It seems similar to this situation: https://bugs.archlinux.org/task/48277
> 
> Basically, your package B looks like a library.  B should only makedepends
> on A, and any package depending on B should also makedepends on A.
> 
> The rationale is that header files and build scripts are not needed to run
> a program, so they should not be installed as dependencies.  They should
> only be installed as makedepends, for every package that needs them (even
> indirectly).
> 
> One such example is boost:
> 
>   https://www.archlinux.org/packages/extra/x86_64/boost/
> 
> Baptiste
> 

Ok, thanks for the quick reply, that makes sense! And you're right,
these packages are libraries.

Next question: should compiler requirements be part of a PKGBUILD? In
this case, when compiling with gcc, version >=4.9 is necessary.

Adding it to makedepends seems like a reasonable check - on the other
hand, someone who prefers clang won't have any interest in dealing with
gcc versions enforced by the PKGBUILD.

Lukas


More information about the aur-general mailing list