Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  3 Dec 2010 08:59:22 +0100 (CET)
From:      "Ganael LAPLANCHE" <ganael.laplanche@martymac.org>
To:        Ion-Mihai Tetcu <itetcu@FreeBSD.org>, "Ganael LAPLANCHE" <ganael.laplanche@martymac.org>
Cc:        FreeBSD Ports <ports@FreeBSD.org>, Mark Linimon <linimon@lonesome.com>, Ade Lovett <ade@FreeBSD.org>
Subject:   Re: Introducing USE_SRC and ONLY_FOR_*VER (was: CFR: patch to cleanup usage of SRC_BASE in various ports)
Message-ID:  <20101203073644.M60677@martymac.org>
In-Reply-To: <20101201103810.46a1be7a@it.buh.tecnik93.com>
References:  <20101130041323.GA17404@lonesome.com> <4CF51A1F.7030803@gmail.com> <20101130191906.GA28560@lonesome.com> <60D0FDFC-83B5-479D-97ED-922A6D31EF87@FreeBSD.org> <20101130211524.M4648@martymac.org> <20101201103810.46a1be7a@it.buh.tecnik93.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 1 Dec 2010 10:38:10 +0200, Ion-Mihai Tetcu wrote

Hi,

> > It would be interesting to provide something like :
> > 
> > USE_BASE= yes 
> > Which would do the following :
> >  => defines ${SRC_BASE}
> >  => checks for ${SRC_BASE}/sys/Makefile
> >  => provides a standard error msg if not found
> > 
> > or, if set to something other than yes :
> > 
> > USE_BASE= some/file/within/src_base
> >  => defines ${SRC_BASE}
> >  => check for ${SRC_BASE}/some/file/within/src_base
> >  => provides a standard error msg if not found
> > 
> > Thus, we would avoid having the same tests again and again, and be 
> > able to provide more "standard" messages...
> > 
> > What do you think ?
> 
> Yes. It would help tracking some errors on automated build systems.

Following this idea, here is a small patch that provides that
functionality :

http://people.freebsd.org/~martymac/patches/20101203-patch-bsd.kmod.mk.txt

It provides :
- USE_SRC : to be set to "yes" or a space-separated list of files to
check under ${SRC_BASE}
- SRC_BASE : by default /usr/src if ${USE_SRC} is set, can be overridden

A standard message is displayed if kernel sources are missing.

I've also found that the ports that check for presence of kernel sources
also often check for a specific version of FreeBSD, so the patch also
provides :

ONLY_FOR_MINVER / ONLY_FOR_MINVER_REASON : the minimal version of
FreeBSD required to build the port, and a given reason (if any)

ONLY_FOR_MAXVER / ONLY_FOR_MAXVER_REASON : the maximal version of
FreeBSD required to build the port, and a given reason (if any)

Those variables will help us avoid duplicating the same kind of checks
again and again in our ports tree.

Find here :

http://people.freebsd.org/~martymac/patches/20101203-patch-uhso-kmod.txt

an example that shows how those variables could be used
(comms/uhso-kmod). Note that in this example, a change of behaviour is
introduced : the port will now refuse to build if OSVERSION > 800500,
while it was only displaying a warning in the previous version. This
patch to hso-kmod is *not* to be committed, but just a showcase.

Comments welcome,
Best regards,

--
Ganael LAPLANCHE <ganael.laplanche@martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac@FreeBSD.org>, http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101203073644.M60677>