pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang Use SUBST instead of manual seddery.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fce584ddb428
branches:  trunk
changeset: 349314:fce584ddb428
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sun Jul 03 19:15:02 2016 +0000

description:
Use SUBST instead of manual seddery.

diffstat:

 lang/smlnj/Makefile      |  55 ++++++++++++++++++++++++++++-------------------
 lang/smlnj11072/Makefile |  55 ++++++++++++++++++++++++++++-------------------
 2 files changed, 66 insertions(+), 44 deletions(-)

diffs (154 lines):

diff -r 2e9f597c2798 -r fce584ddb428 lang/smlnj/Makefile
--- a/lang/smlnj/Makefile       Sun Jul 03 19:13:22 2016 +0000
+++ b/lang/smlnj/Makefile       Sun Jul 03 19:15:02 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2016/07/03 19:08:22 dholland Exp $
+# $NetBSD: Makefile,v 1.28 2016/07/03 19:15:02 dholland Exp $
 #
 
 DISTNAME=      boot.${BOX}-unix
@@ -45,6 +45,7 @@
 SML_BINDIR=    ${SML_BASE}/bin
 SML_SCRIPTS=   _link-sml _run-sml _ml-build _ml-makedepend
 
+# note that this includes bsd.prefs.mk
 .include "../../lang/smlnj/Makefile.common"
 
 #
@@ -79,28 +80,38 @@
 post-patch:
        cd ${WRKDIR}/src && pax -rw runtime ${WRKDIR}/base/
 
-# resolve definition of SML_BASE, CFLAGS in patched files
+# Turn of nlffi on powerpc (I guess it doesn't work?)
+#
+# XXX: this switch doesn't work any more as the line in question doesn't
+# exist in the current version. Someone with a PPC build machine,
+# please check it out and either change it to match the file if still
+# needed, or get rid of it.
+.if ${MACHINE_ARCH} == "powerpc"
+SUBST_CLASSES+=                nlffi
+SUBST_STAGE.nlffi=     pre-configure
+SUBST_MESSAGE.nlffi=   Turning off nlffi
+SUBST_FILES.nlffi=     config/targets
+SUBST_SED.nlffi=       -e '/^request nlffi$$/d'
+.endif # powerpc
+
+# resolve definition of SML_BASE
+SUBST_CLASSES+=                smlbase
+SUBST_STAGE.smlbase=   pre-configure
+SUBST_MESSAGE.smlbase= Setting SML_BASE
+SUBST_FILES.smlbase=   ${SML_SCRIPTS:S/^/config\//}
+SUBST_VARS.smlbase=    SML_BASE
+
+# resolve definition of CFLAGS in patched files
+# (note that we need to do this in both src/runtime and base/runtime)
+SUBST_CLASSES+=                cflags
+SUBST_STAGE.cflags=    pre-configure
+SUBST_MESSAGE.cflags=  Setting CFLAGS
+SUBST_FILES.cflags=    src/runtime/objs/* base/runtime/objs/*
+SUBST_VARS.cflags=     CFLAGS
+
+# nothing here any more
 do-configure:
-       set -e;                                                 \
-       if [ ${MACHINE_ARCH} = "powerpc" ]; then                \
-               ${AWK} '(! /^request nlffi$$/) { print }'       \
-               < ${WRKDIR}/config/targets                      \
-               > ${WRKDIR}/temp;                               \
-               ${MV} ${WRKDIR}/temp ${WRKDIR}/config/targets;  \
-       fi
-       set -e;                                         \
-       cd ${WRKDIR}/config;                            \
-       for f in ${SML_SCRIPTS}; do                     \
-               ${CP} "$${f}" "$${f}.tmp";              \
-               ${SED} -e 's|@SML_BASE@|${SML_BASE}|g'  \
-                       < "$${f}.tmp" > "$${f}";        \
-       done;                                           \
-       cd ${WRKDIR}/src/runtime/objs;                  \
-       for f in *; do                                  \
-               ${CP} "$${f}" "$${f}.tmp";              \
-               ${SED} -e 's|@CFLAGS@|'${CFLAGS:Q}'|g'  \
-                       < "$${f}.tmp" > "$${f}";        \
-       done
+       ${DO_NADA}
 
 # The build target needs to run $WRKDIR/config/install.sh
 do-build:
diff -r 2e9f597c2798 -r fce584ddb428 lang/smlnj11072/Makefile
--- a/lang/smlnj11072/Makefile  Sun Jul 03 19:13:22 2016 +0000
+++ b/lang/smlnj11072/Makefile  Sun Jul 03 19:15:02 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2016/07/03 19:13:22 dholland Exp $
+# $NetBSD: Makefile,v 1.4 2016/07/03 19:15:02 dholland Exp $
 #
 
 DISTNAME=      boot.${BOX}-unix
@@ -44,6 +44,7 @@
 SML_BINDIR=    ${SML_BASE}/bin
 SML_SCRIPTS=   _link-sml _run-sml _ml-build _ml-makedepend
 
+# note that this includes bsd.prefs.mk
 .include "../../lang/smlnj/Makefile.common"
 
 #
@@ -78,28 +79,38 @@
 post-patch:
        cd ${WRKDIR}/src && pax -rw runtime ${WRKDIR}/base/
 
-# resolve definition of SML_BASE, CFLAGS in patched files
+# Turn of nlffi on powerpc (I guess it doesn't work?)
+#
+# XXX: this switch doesn't work any more as the line in question doesn't
+# exist in the current version. Someone with a PPC build machine,
+# please check it out and either change it to match the file if still
+# needed, or get rid of it.
+.if ${MACHINE_ARCH} == "powerpc"
+SUBST_CLASSES+=                nlffi
+SUBST_STAGE.nlffi=     pre-configure
+SUBST_MESSAGE.nlffi=   Turning off nlffi
+SUBST_FILES.nlffi=     config/targets
+SUBST_SED.nlffi=       -e '/^request nlffi$$/d'
+.endif # powerpc
+
+# resolve definition of SML_BASE
+SUBST_CLASSES+=                smlbase
+SUBST_STAGE.smlbase=   pre-configure
+SUBST_MESSAGE.smlbase= Setting SML_BASE
+SUBST_FILES.smlbase=   ${SML_SCRIPTS:S/^/config\//}
+SUBST_VARS.smlbase=    SML_BASE
+
+# resolve definition of CFLAGS in patched files
+# (note that we need to do this in both src/runtime and base/runtime)
+SUBST_CLASSES+=                cflags
+SUBST_STAGE.cflags=    pre-configure
+SUBST_MESSAGE.cflags=  Setting CFLAGS
+SUBST_FILES.cflags=    src/runtime/objs/* base/runtime/objs/*
+SUBST_VARS.cflags=     CFLAGS
+
+# nothing here any more
 do-configure:
-       set -e;                                                 \
-       if [ ${MACHINE_ARCH} = "powerpc" ]; then                \
-               ${AWK} '(! /^request nlffi$$/) { print }'       \
-               < ${WRKDIR}/config/targets                      \
-               > ${WRKDIR}/temp;                               \
-               ${MV} ${WRKDIR}/temp ${WRKDIR}/config/targets;  \
-       fi
-       set -e;                                         \
-       cd ${WRKDIR}/config;                            \
-       for f in ${SML_SCRIPTS}; do                     \
-               ${CP} "$${f}" "$${f}.tmp";              \
-               ${SED} -e 's|@SML_BASE@|${SML_BASE}|g'  \
-                       < "$${f}.tmp" > "$${f}";        \
-       done;                                           \
-       cd ${WRKDIR}/src/runtime/objs;                  \
-       for f in *; do                                  \
-               ${CP} "$${f}" "$${f}.tmp";              \
-               ${SED} -e 's|@CFLAGS@|'${CFLAGS:Q}'|g'  \
-                       < "$${f}.tmp" > "$${f}";        \
-       done
+       ${DO_NADA}
 
 # The build target needs to run $WRKDIR/config/install.sh
 do-build:



Home | Main Index | Thread Index | Old Index