From stsp@stsp.name  Mon Oct 29 20:55:48 2007
Return-Path: <stsp@stsp.name>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A33516A418
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Oct 2007 20:55:48 +0000 (UTC)
	(envelope-from stsp@stsp.name)
Received: from fallback-mx.in-berlin.de (fallback-mx.in-berlin.de [192.109.42.17])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C2E513C48A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Oct 2007 20:55:47 +0000 (UTC)
	(envelope-from stsp@stsp.name)
Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8])
	by fallback-mx.in-berlin.de (8.14.1/8.13.6/Debian-1) with ESMTP id l9T06MYK002052
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Oct 2007 01:06:22 +0100
Received: from stsp.lan (stsp.in-vpn.de [217.197.85.96])
	(authenticated bits=128)
	by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id l9T06G9L006208
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Oct 2007 01:06:18 +0100
Received: from ted.stsp.lan (localhost [127.0.0.1])
	by stsp.lan (8.13.8/8.13.8) with ESMTP id l9T06Fxg034362
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Oct 2007 01:06:15 +0100 (CET)
	(envelope-from stsp@ted.stsp.lan)
Received: (from stsp@localhost)
	by ted.stsp.lan (8.13.8/8.13.8/Submit) id l9T06Erd034360;
	Mon, 29 Oct 2007 01:06:14 +0100 (CET)
	(envelope-from stsp)
Message-Id: <200710290006.l9T06Erd034360@ted.stsp.lan>
Date: Mon, 29 Oct 2007 01:06:14 +0100 (CET)
From: Stefan Sperling <stsp@stsp.name>
Reply-To: Stefan Sperling <stsp@stsp.name>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: devel/ncurses fails to build if WRKDIRPREFIX is set
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         117643
>Category:       ports
>Synopsis:       devel/ncurses fails to build if WRKDIRPREFIX is set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 29 21:00:04 UTC 2007
>Closed-Date:    Mon Mar 31 07:27:11 UTC 2008
>Last-Modified:  Mon Mar 31 07:30:06 UTC 2008
>Originator:     Stefan Sperling
>Release:        FreeBSD 6.2-RELEASE-p8 i386
>Organization:
>Environment:
System: FreeBSD ted.stsp.lan 6.2-RELEASE-p8 FreeBSD 6.2-RELEASE-p8 #0: Sun Oct 14 21:01:47 CEST 2007 stsp@ted.stsp.lan:/usr/obj/usr/src/sys/TED i386


	
>Description:

	Tyring to compile mutt with wide char support, I hit a problem
	building the devel/ncurses port.

	After running the configure script for devel/ncurses the first
	time, make failed complaining about not knowing how to run do-configure.

	The port's Makefile tries to run the configure script twice
	(each time with different options), the second time by calling
	the do-configure target again.
	It does the same for do-build and do-install.
	
	If WRKDIRPREFIX is set, it apparently tries to run these target
	inside the ncurses source tree, and not in the
	/usr/ports/devel/ncurses directory.

	This is obviously wrong.

	I have 'WRKDIRPREFIX=/usr/obj' in /etc/make.conf.

	
>How-To-Repeat:
	Set WRKDIRPREFIX=/usr/obj in /etc/make.conf, try to compile
	the đevel/ncurses port.
>Fix:

This patch fixes the problem for me:

Index: devel/ncurses/Makefile
===================================================================
RCS file: /usr/ncvs/ports/devel/ncurses/Makefile,v
retrieving revision 1.47
diff -u -u -r1.47 Makefile
--- devel/ncurses/Makefile	4 Aug 2007 11:40:47 -0000	1.47
+++ devel/ncurses/Makefile	28 Oct 2007 22:10:42 -0000
@@ -120,9 +120,10 @@
 
 post-configure:
 .if !defined(WITHOUT_WIDEC)
-	${MAKE} CONFIGURE_WRKSRC=${WIDEC_WRKSRC} \
+	(cd ${PORTSDIR}/${PKGORIGIN} && \
+	    ${MAKE} CONFIGURE_WRKSRC=${WIDEC_WRKSRC} \
 	    CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-widec" \
-	    do-configure
+	    do-configure)
 .endif
 .for d in test c++
 .if !defined(WITHOUT_WIDEC)
@@ -133,12 +134,14 @@
 
 post-build:
 .if !defined(WITHOUT_WIDEC)
-	${MAKE} BUILD_WRKSRC=${WIDEC_WRKSRC} do-build
+	(cd ${PORTSDIR}/${PKGORIGIN} && \
+	    ${MAKE} BUILD_WRKSRC=${WIDEC_WRKSRC} do-build)
 .endif
 
 post-install:
 .if !defined(WITHOUT_WIDEC)
-	${MAKE} INSTALL_WRKSRC=${WIDEC_WRKSRC} do-install
+	(cd ${PORTSDIR}/${PKGORIGIN} && \
+	    ${MAKE} INSTALL_WRKSRC=${WIDEC_WRKSRC} do-install)
 .endif
 
 .for i in ${EXAMPLES_TARGETS}
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->rafan 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Oct 30 04:30:59 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117643 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Tue Oct 30 06:27:24 UTC 2007 
State-Changed-Why:  
Fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117643 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/117643: commit references a PR
Date: Tue, 30 Oct 2007 13:47:41 +0000 (UTC)

 rafan       2007-10-30 06:27:08 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/ncurses        Makefile 
   Log:
   - Fix build/install when WRKDIRPREFIX is set
   
   PR:             ports/117643
   Reported by:    Stefan Sperling <stsp at stsp.name>
   
   Revision  Changes    Path
   1.48      +3 -3      ports/devel/ncurses/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/117643: commit references a PR
Date: Wed, 31 Oct 2007 07:30:30 +0000 (UTC)

 rafan       2007-10-31 02:18:25 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/ncurses-devel  Makefile 
   Log:
   - Fix build/install when WRKDIRPREFIX is set
   
   PR:             ports/117643
   Reported by:    Stefan Sperling <stsp at stsp.name> (for devel/ncurses)
   Approved by:    portmgr (marcus)
   
   Revision  Changes    Path
   1.64      +3 -3      ports/devel/ncurses-devel/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: Stefan Sperling <stsp@stsp.name>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/117643: devel/ncurses fails to build if WRKDIRPREFIX is
	set
Date: Sun, 30 Mar 2008 21:29:26 +0200

 --nFreZHaLTZJo0R7j
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Please re-open! This problem is still present.
 
 I just hit it again while recompiling all my ports
 after upgrading from 6.3 to 7.0.
 
 The patch that was applied differs from my patch:
 http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/ncurses/Makefile.diff?r1=
 =3D1.47;r2=3D1.48
 
 Using my original patch fixed it again for me.
 
 --=20
 stefan
 http://stsp.name                                         PGP Key: 0xF59D25F0
 
 --nFreZHaLTZJo0R7j
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (OpenBSD)
 
 iEYEARECAAYFAkfv6hUACgkQ5dMCc/WdJfCyNgCdEv2e29ZY7Utr5zAyCmBB2bTJ
 b8gAoL4w0BqU7vzGKaqQlxHsolv+Pyfx
 =X0T1
 -----END PGP SIGNATURE-----
 
 --nFreZHaLTZJo0R7j--
State-Changed-From-To: closed->open 
State-Changed-By: rafan 
State-Changed-When: Mon Mar 31 03:07:25 UTC 2008 
State-Changed-Why:  
Need to investigate why submitter's approach does not  
work for me.  

http://www.freebsd.org/cgi/query-pr.cgi?pr=117643 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Mon Mar 31 07:27:10 UTC 2008 
State-Changed-Why:  
Really fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117643 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/117643: commit references a PR
Date: Mon, 31 Mar 2008 07:26:16 +0000 (UTC)

 rafan       2008-03-31 07:26:11 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/ncurses        Makefile 
   Log:
   - Really fix build when WRKDIRPREFIX [1]
     I don't know why the current approach works in my previous test. Now
     really fix the build by changing to .CURDIR (where the port lives).
     Note that I use .CURDIR instead of PORTSDIR/PKGORIGIN as the port may
     live outside somewhere else.
   - Respect PORTEXAMPLES
   - Add trailing slash for destination directory
   
   PR:             ports/117643 [1]
   Submitted by:   Stefan Sperling <stsp at stsp.name> [1]
   
   Revision  Changes    Path
   1.49      +19 -13    ports/devel/ncurses/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/117643: commit references a PR
Date: Mon, 31 Mar 2008 07:26:52 +0000 (UTC)

 rafan       2008-03-31 07:26:48 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/ncurses-devel  Makefile distinfo 
   Log:
   - Update to 5.6 snapshot 20080329
   - Really fix build when WRKDIRPREFIX [1]
     I don't know why the current approach works in my previous test. Now
     really fix the build by changing to .CURDIR (where the port lives).
     Note that I use .CURDIR instead of PORTSDIR/PKGORIGIN as the port may
     live outside somewhere else.
   - Add trailing slash for destination directory
   
   PR:             ports/117643 [1]
   Submitted by:   Stefan Sperling <stsp at stsp.name> [1]
   
   Revision  Changes    Path
   1.75      +13 -10    ports/devel/ncurses-devel/Makefile
   1.40      +3 -0      ports/devel/ncurses-devel/distinfo
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
