pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk add a BUILD_DEPENDS on devel/patch if no suitable p...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/de36305103e0
branches:  trunk
changeset: 462733:de36305103e0
user:      grant <grant%pkgsrc.org@localhost>
date:      Sat Oct 11 05:09:39 2003 +0000

description:
add a BUILD_DEPENDS on devel/patch if no suitable patch(1) is
available.

fixes my PR pkg/18380, with hints from jschauma.

diffstat:

 mk/bsd.pkg.mk    |  20 +++++++++++++++++++-
 mk/defs.IRIX.mk  |  17 ++++++++++++++++-
 mk/defs.SunOS.mk |  10 ++++------
 3 files changed, 39 insertions(+), 8 deletions(-)

diffs (106 lines):

diff -r ece065b01686 -r de36305103e0 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sat Oct 11 04:26:10 2003 +0000
+++ b/mk/bsd.pkg.mk     Sat Oct 11 05:09:39 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1294 2003/10/11 03:43:14 grant Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1295 2003/10/11 05:09:39 grant Exp $
 #
 # This file is in the public domain.
 #
@@ -460,6 +460,24 @@
 
 TOUCH_FLAGS?=          -f
 
+# determine if we need GNU patch from pkgsrc.
+_NEED_PATCH!=          if [ -d ${PATCHDIR} ]; then \
+                               if [ "`${ECHO} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
+                                       ${ECHO} YES; \
+                               else \
+                                       ${ECHO} NO; \
+                               fi \
+                       else \
+                               ${ECHO} NO; \
+                       fi
+.if defined(PATCHFILES)
+_NEED_PATCH=           YES
+.endif
+
+.if ${_NEED_PATCH} == "YES" && !exists(${PATCH:C|-.*||}) && empty(PKGPATH:Mdevel/patch)
+BUILD_DEPENDS+=                patch>=2.2:../../devel/patch
+.endif
+
 PATCH_STRIP?=          -p0
 PATCH_DIST_STRIP?=     -p0
 .if defined(PATCH_DEBUG) || defined(PKG_VERBOSE)
diff -r ece065b01686 -r de36305103e0 mk/defs.IRIX.mk
--- a/mk/defs.IRIX.mk   Sat Oct 11 04:26:10 2003 +0000
+++ b/mk/defs.IRIX.mk   Sat Oct 11 05:09:39 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.IRIX.mk,v 1.34 2003/09/23 07:26:23 grant Exp $
+# $NetBSD: defs.IRIX.mk,v 1.35 2003/10/11 05:09:39 grant Exp $
 #
 # Variable definitions for the IRIX operating system.
 
@@ -53,7 +53,17 @@
 MTREE?=                ${LOCALBASE}/bin/mtree
 MV?=           /sbin/mv
 NICE?=         /sbin/nice
+.if exists(${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch)
+PATCH?=                ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch
+.else
+PATCHV!=       /usr/sbin/patch -v 2>&1 | ${CUT} -d" " -f3
+.  if ${PATCHV} == "2.1"
+_OPSYS_GPATCH_REQD=    YES
+PATCH=         ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch
+.  else
 PATCH?=                /usr/sbin/patch -b
+.  endif # PATCHV
+.endif
 PAX?=          ${LOCALBASE}/bin/pax
 PERL5?=                ${LOCALBASE}/bin/perl
 PKGLOCALEDIR?= share
@@ -121,7 +131,12 @@
 _OPSYS_PERL_REQD=                      # no base version of perl required
 _OPSYS_PTHREAD_AUTO=   no              # -lpthread needed for pthreads
 _OPSYS_RPATH_NAME=     -rpath,         # name of symbol in rpath directive to linker 
+if defined(_OPSYS_GPATCH_REQD) && ${_OPSYS_GPATCH_REQD} == "YES"
+_PATCH_CAN_BACKUP=      yes            # patch(1) can make backups
+_PATCH_BACKUP_ARG=      -b -V simple -z # switch to patch(1) for backup suffix
+.else
 _PATCH_CAN_BACKUP=     no              # native patch(1) can make backups
+.endif
 _PREFORMATTED_MAN_DIR= man             # directory where catman pages are
 _USE_GNU_GETTEXT=      no              # Don't use GNU gettext
 _USE_RPATH=            yes             # add rpath to LDFLAGS
diff -r ece065b01686 -r de36305103e0 mk/defs.SunOS.mk
--- a/mk/defs.SunOS.mk  Sat Oct 11 04:26:10 2003 +0000
+++ b/mk/defs.SunOS.mk  Sat Oct 11 05:09:39 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: defs.SunOS.mk,v 1.70 2003/10/11 02:44:17 grant Exp $
+# $NetBSD: defs.SunOS.mk,v 1.71 2003/10/11 05:09:39 grant Exp $
 #
 # Variable definitions for the SunOS/Solaris operating system.
 
@@ -55,11 +55,9 @@
 MV?=           /usr/bin/mv
 NICE?=         /usr/xpg4/bin/nice
 .if exists(/usr/bin/gpatch)
-PATCH?=                /usr/bin/gpatch -b
-.elif exists(${LOCALBASE}/bin/gpatch)
-PATCH?=                ${LOCALBASE}/bin/gpatch -b
+PATCH?=                /usr/bin/gpatch
 .else
-PATCH?=                ${LOCALBASE}/bin/patch -b
+PATCH?=                ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch
 .endif
 .if exists(${LOCALBASE}/bin/pax)
 PAX?=          ${LOCALBASE}/bin/pax
@@ -131,7 +129,7 @@
 _OPSYS_PTHREAD_AUTO=   no              # -lpthread needed for pthreads
 _OPSYS_RPATH_NAME=     -R              # name of symbol in rpath directive to linker 
 _PATCH_CAN_BACKUP=     yes             # native patch(1) can make backups
-_PATCH_BACKUP_ARG=     -V simple -z    # switch to patch(1) for backup suffix
+_PATCH_BACKUP_ARG=     -b -V simple -z # switch to patch(1) for backup suffix
 _PREFORMATTED_MAN_DIR= man             # directory where catman pages are
 _USE_GNU_GETTEXT=      yes             # Use GNU gettext
 _USE_RPATH=            yes             # add rpath to LDFLAGS



Home | Main Index | Thread Index | Old Index