Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Oct 2000 18:34:21 -0700 (PDT)
From:      asami@freebsd.org (Satoshi Asami)
To:        ports@freebsd.org
Cc:        obrien@freebsd.org
Subject:   *_WRKSRC
Message-ID:  <200010100134.e9A1YLV98774@silvia.hip.berkeley.edu>

next in thread | raw e-mail | index | archive | help
What do people think about the following (submitted by DavidO,
reworked slightly by me).  Basically it adds PATCH_WRKSRC,
BUILD_WRKSRC and INSTALL_WRKSRC alongside CONFIGURE_WRKSRC to deal
with oddball ports that want different directories.

It also extends the use of CONFIGURE_WRKSRC to include all
configure-related actions.  I don't think this breaks anything but I'm
not sure.  It does seem like this way is cleaner though.

I'm not sure if patch-libtool should use PATCH_WRKSRC or
CONFIGURE_WRKSRC. :)

Satoshi
-------
Index: bsd.port.mk
===================================================================
RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.355
diff -u -r1.355 bsd.port.mk
--- bsd.port.mk	2000/10/08 11:43:54	1.355
+++ bsd.port.mk	2000/10/10 01:28:35
@@ -384,6 +394,7 @@
 #				  The patches specified by this variable will be
 #				  applied after the normal distribution patches but
 #				  before those in ${PATCHDIR}.
+# PATCH_WRKSRC  - Directory to apply patches in (default: ${WRKSRC}).
 #
 # For configure:
 #
@@ -409,6 +420,7 @@
 # For build and install:
 #
 # ALL_TARGET	- Default target for sub-make in build stage (default: all).
+# BUILD_WRKSRC  - Directory to do build in (default: ${WRKSRC}).
 # MAKE_ENV		- Additional environment vars passed to sub-make in build
 #				  and install stages (default: see below).
 # MAKE_ARGS		- Any extra arguments to sub-make in build and install
@@ -418,6 +430,7 @@
 #
 # INSTALL_TARGET - Default target for sub-make in install stage 
 # 				  (default: install).
+# INSTALL_WRKSRC - Directory to install from (default: ${WRKSRC}).
 # NO_MTREE		- If set, will not invoke mtree from bsd.port.mk from
 #				  the "install" target.
 # MTREE_FILE	- The name of the mtree file (default: /etc/mtree/BSD.x11.dist
@@ -704,6 +717,11 @@
 WRKSRC?=		${WRKDIR}/${DISTNAME}
 .endif
 
+PATCH_WRKSRC?=	${WRKSRC}
+CONFIGURE_WRKSRC?=	${WRKSRC}
+BUILD_WRKSRC?=	${WRKSRC}
+INSTALL_WRKSRC?=${WRKSRC}
+
 PLIST_SUB+=	OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
 
 CONFIGURE_ENV+=	PORTOBJFORMAT=${PORTOBJFORMAT}
@@ -933,12 +957,12 @@
 PATCH_DIST_STRIP?=	-p0
 .if defined(PATCH_DEBUG)
 PATCH_DEBUG_TMP=	yes
-PATCH_ARGS?=	-d ${WRKSRC} -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?=	-d ${WRKSRC} -E ${PATCH_DIST_STRIP}
+PATCH_ARGS?=	-d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
+PATCH_DIST_ARGS?=	-d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
 .else
 PATCH_DEBUG_TMP=	no
-PATCH_ARGS?=	-d ${WRKSRC} --forward --quiet -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?=	-d ${WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
+PATCH_ARGS?=	-d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
+PATCH_DIST_ARGS?=	-d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
 .endif
 .if defined(BATCH)
 PATCH_ARGS+=		--batch
@@ -1250,7 +1277,6 @@
 .undef HAS_CONFIGURE
 .endif
 
-CONFIGURE_WRKSRC?=	${WRKSRC}
 CONFIGURE_SCRIPT?=	configure
 CONFIGURE_TARGET?=	${MACHINE_ARCH}--freebsd${OSREL}
 CONFIGURE_LOG?=		config.log
@@ -1784,10 +1811,10 @@
 .if !target(do-configure)
 do-configure:
 .if defined(USE_AUTOMAKE)
-	@(cd ${WRKSRC} && ${AUTOMAKE})
+	@(cd ${CONFIGURE_WRKSRC} && ${AUTOMAKE})
 .endif
 .if defined(USE_AUTOCONF)
-	@(cd ${WRKSRC} && ${AUTOCONF})
+	@(cd ${CONFIGURE_WRKSRC} && ${AUTOCONF})
 .endif
 	@if [ -f ${SCRIPTDIR}/configure ]; then \
 		cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
@@ -1814,7 +1841,7 @@
 		${PERL5} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
 .endif
 .if defined(USE_IMAKE)
-	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${XMKMF})
+	@(cd ${CONFIGURE_WRKSRC}; ${SETENV} ${MAKE_ENV} ${XMKMF})
 .endif
 .endif
 
@@ -1823,9 +1850,9 @@
 .if !target(do-build)
 do-build:
 .if defined(USE_GMAKE)
-	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .else
-	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
 .endif
 .endif
 
@@ -1834,14 +1861,14 @@
 .if !target(do-install)
 do-install:
 .if defined(USE_GMAKE)
-	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
+	@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
 .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
-	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
+	@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
 .endif
 .else defined(USE_GMAKE)
-	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
+	@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
 .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
-	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
+	@(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man)
 .endif
 .endif
 .endif
@@ -2186,7 +2221,7 @@
 		 exit 1); \
 	  fi; \
 	 LIBTOOLDIR=`${WHICH} ${LIBTOOL} | ${SED} -e 's^/bin/libtool^/share/libtool^'` || ${LOCALBASE}/share/libtool; \
-	 cd ${WRKSRC}; \
+	 cd ${PATCH_WRKSRC}; \
 	 for file in ${LIBTOOLFILES}; do \
 		${CP} $$file $$file.tmp; \
 		${SED} -e "s^\$$ac_aux_dir/ltconfig^$${LIBTOOLDIR}/ltconfig^g" \


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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