Subject: tools.mk and TOOLS_REPLACE logic
To: None <tech-pkg@NetBSD.org>
From: Klaus Heinz <k.heinz.feb.fuenf@onlinehome.de>
List: tech-pkg
Date: 02/06/2005 00:40:44
--VMt1DrMGOVs3KQwf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

I am using pkgsrc on a fresh Solaris 10 system and again observed something
I asked some months ago (but forgot to followup):

Although PATCH is defined in mk/platform/SunOS.mk as /usr/bin/gpatch
and _TOOLS_REPLACE_OPSYS.patch includes SunOS-*-* (in mk/tools.mk)
pkgsrc still requires the package devel/patch.
The comments in tools.mk tell me that systems listed in
_TOOLS_REPLACE_OPSYS.patch do _not_ need devel/patch but this does not
work for me on Solaris 10.

As I understand the logic in tools.mk, for every tool in USE_GNU_TOOLS
which has _TOOLS_REPLACE.$tool=YES the variables _TOOLS_OVERRIDE.$tool and
_TOOLS_PROGNAME.$tool get set to some value but immediately after this,
_TOOLS_PROGNAME.$tool is set again to ${LOCALBASE}/bin/$tool and the
pkgsrc package for $tool is added to BUILD_DEPENDS.

Shouldn't _TOOLS_NEED_GNU.$tool be set to NO if _TOOLS_REPLACE.$tool is
YES? This is my understanding of "replacing a needed GNU tool with one
from the system that is similar to the GNU tool".

Using the attached patch let me build libtool-base without devel/patch.
If this is correct similar changes should be applied to the other tool
clauses.

ciao
     Klaus

--VMt1DrMGOVs3KQwf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="tools.diff"

Index: tools.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/tools.mk,v
retrieving revision 1.50
diff -u -r1.50 tools.mk
--- tools.mk	21 Jan 2005 02:23:34 -0000	1.50
+++ tools.mk	5 Feb 2005 23:37:48 -0000
@@ -304,6 +304,7 @@
 .if ${_TOOLS_REPLACE.patch} == "YES"
 _TOOLS_OVERRIDE.patch=	YES
 _TOOLS_PROGNAME.patch=	${PATCH}
+_TOOLS_NEED_GNU.patch=	NO
 .endif
 .if (${_TOOLS_NEED_GNU.patch} == "YES") && empty(PKGPATH:Mdevel/patch)
 BUILD_DEPENDS+=		patch>=2.2:../../devel/patch

--VMt1DrMGOVs3KQwf--