summaryrefslogtreecommitdiff
path: root/textproc/gsed
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2003-07-09 08:07:09 +0000
committergrant <grant@pkgsrc.org>2003-07-09 08:07:09 +0000
commitd1407ba302e609d4786515ba85429805ee0b922d (patch)
treeb7ae64e58b877e9795b7e6e58141a00a26a33d72 /textproc/gsed
parent89fb03deaff392efb4d0a67aad579ec1410e3152 (diff)
downloadpkgsrc-d1407ba302e609d4786515ba85429805ee0b922d.tar.gz
enhancements to gracefully handle packages which require a non-broken
sed, or perhaps GNU sed. packges should define USE_GNU_SED if GNU sed is really required, otherwise we provide ${SED} in the buildlink/bin dir, unless the sed provided on a given platform is known to be severely broken. [one could argue Solaris' xpg4 sed falls in the "broken" category, but for almost all intents and purposes, it is acceptable - define USE_GNU_SED if a package still fails.] XXX IRIX is currently listed in _INCOMPAT_SED - this should be removed if sed on IRIX is known to be good.
Diffstat (limited to 'textproc/gsed')
-rw-r--r--textproc/gsed/buildlink2.mk46
1 files changed, 38 insertions, 8 deletions
diff --git a/textproc/gsed/buildlink2.mk b/textproc/gsed/buildlink2.mk
index edd5eb2d3de..467ce17c6ae 100644
--- a/textproc/gsed/buildlink2.mk
+++ b/textproc/gsed/buildlink2.mk
@@ -1,26 +1,56 @@
-# $NetBSD: buildlink2.mk,v 1.1 2003/04/16 12:52:35 jmc Exp $
+# $NetBSD: buildlink2.mk,v 1.2 2003/07/09 08:07:09 grant Exp $
.if !defined(GSED_BUILDLINK2_MK)
GSED_BUILDLINK2_MK= # defined
-BUILDLINK_PACKAGES+= gsed
+.include "../../mk/bsd.prefs.mk"
+
BUILDLINK_DEPENDS.gsed?= gsed>=3.02
BUILDLINK_PKGSRCDIR.gsed?= ../../textproc/gsed
-BUILDLINK_DEPMETHOD.gsed= build
-EVAL_PREFIX+= BUILDLINK_PREFIX.gsed=gsed
+#
+# Some packages may really need GNU sed, but most just demand a
+# working sed.
+#
+
+.if defined(USE_GNU_SED)
+_NEED_GNU_SED= YES
+.else
+_NEED_GNU_SED= NO
+
+# Not sure about IRIX, mark it incompatible for now
+_INCOMPAT_SED= IRIX-*-*
+
+INCOMPAT_SED?= # empty
+. for _pattern_ in ${_INCOMPAT_SED} ${INCOMPAT_SED}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_NEED_GNU_SED= YES
+. endif
+. endfor
+
+.endif
+
+.if ${_NEED_GNU_SED} == "YES"
+BUILDLINK_DEPMETHOD.gsed?= build
+BUILDLINK_PACKAGES+= gsed
BUILDLINK_PREFIX.gsed_DEFAULT= ${LOCALBASE}
BUILDLINK_FILES.gsed= bin/${GNU_PROGRAM_PREFIX}sed
+EVAL_PREFIX+= BUILDLINK_PREFIX.gsed=gsed
+.endif
BUILDLINK_TARGETS+= gsed-buildlink gsed-buildlink-bin
gsed-buildlink: _BUILDLINK_USE
gsed-buildlink-bin:
+.if ${_NEED_GNU_SED} == "YES"
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/sed ] && \
+ ${LN} -fs ${GNU_PROGRAM_PREFIX}sed ${BUILDLINK_DIR}/bin/sed
+.else
${_PKG_SILENT}${_PKG_DEBUG} \
- cd ${BUILDLINK_DIR}/bin; \
- if [ ! -f sed ]; then \
- ${LN} -fs ${GNU_PROGRAM_PREFIX}sed sed ; \
- fi
+ [ ! -f ${BUILDLINK_DIR}/bin/sed ] && \
+ ${LN} -fs ${SED} ${BUILDLINK_DIR}/bin/sed
+.endif
.endif # GSED_BUILDLINK2_MK