Idea for Mk/Uses snippet

Kimmo Paasiala kpaasial at gmail.com
Thu Aug 1 14:24:59 UTC 2013


On Thu, Aug 1, 2013 at 2:59 PM, Kimmo Paasiala <kpaasial at gmail.com> wrote:
> On Thu, Aug 1, 2013 at 2:03 PM, Kimmo Paasiala <kpaasial at gmail.com> wrote:
>> There are quite a few ports that require system sources to be present
>> at /usr/src.
>>
>> Would it make sense to create Mk/Uses snippet (for example named as
>> Mk/Uses/system-sources) that checks for let's say /usr/src/Makefile
>> and throws an error if the file is not present?
>>
>> A port that requires the system sources to be present (for example
>> sysutils/lsof) could then just say:
>>
>> USES= ... system-sources ..
>>
>> What do you think?
>>
>> -Kimmo
>
> Something as simple as this:
>
> .if !defined(_INCLUDE_USES_SYSTEM_SOURCES_MK)
> _INCLUDE_USES_SYSTEM_SOURCES_MK= yes
>
>
> .if !exists(${SRC_BASE}/Makefile)
> IGNORE= This port requires the system sources installed at ${SRC_BASE}
> .endif
>
> .endif
>
> Is there still a need to check for kernel sources separately? I would
> imagine that everyone checks out the whole src tree now.
>
> -Kimmo

Ok, I hadn't read the porter's handbook before I wrote the above and
the handbook suggests that kernel sources should be checked as:

.if !exists(${SRC_BASE}/sys/Makefile)
IGNORE=	requires kernel sources to be installed
.endif

Do ports actually depend on the full system sources or is it just the
kernel sources part under ${SRC_BASE}/sys ?

If it's only the kernelt this could still be turned into
Mk/Uses/kernel-sources.mk snippet to avoid repeating the above for
every port that needs the kernel sources.

-Kimmo


More information about the freebsd-ports mailing list