From owner-freebsd-ports@FreeBSD.ORG Sat Jun 7 22:05:05 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00B7052A for ; Sat, 7 Jun 2014 22:05:04 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7365C2714 for ; Sat, 7 Jun 2014 22:05:04 +0000 (UTC) Received: from [192.168.0.100] ([87.139.233.65]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0M5uLh-1WZGUD0DVZ-00xuOP; Sun, 08 Jun 2014 00:04:48 +0200 Message-ID: <53938C88.8060703@gmx.de> Date: Sun, 08 Jun 2014 00:04:56 +0200 From: olli hauer User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Re: how to support STAGEDIR with GNU autoconf References: <53937912.3050604@cubic.org> In-Reply-To: <53937912.3050604@cubic.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:aVy/gwFIjLplvenoYRTC/xQu5XvEXKQMAosNnYeyI6AXuG75X9W upL6yhtg3rzu/BtSotTy7YBIBIWy2NWoRQlhqvm9M7uVaX7+41b+g1KXoLu91nXiZmAJr+c sC4LHLZjylZx1dC1B0ldI/Ed0kTreWX9LMORnJU3ZNXqmKRsw9oyADayasM9EqXruuTEVbb mpa60X6aXuLg/LLXaje7g== Cc: Dirk Jagdmann X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 22:05:05 -0000 On 2014-06-07 22:41, Dirk Jagdmann wrote: > I'm looking at changing the devel/quilt port to support stageing. I've read the manual and know that there will be a variable STAGEDIR defined somewhere. But where exactly? It seems it is defined in the environment of the FreeBSD ports Makefile, but it is not available as a unix shell environment variable of the sub processes during the autoconf and build. > > My first attempt was to use the STAGEDIR variable in the Makefiles of the quilt program and prepend it to the PREFIX typically used by GNU autoconf style builds. But when building/stageing this port, this variable is defined to nothing. I see this, because the install than install into something like > > //usr/local/bin/ > > Notice the double slash at the start, this shows me that STAGEDIR was undefined (or the empty string). > > Next I tried in the ports Makefile to do something like: > > CONFIGURE_ARGS=--prefix=$(STAGEDIR)/usr/local > > But this also does not work, because the FreeBSD ports will add it's own --prefix with /usr/local/ again when running configure. Looking at the config.log here's how the ports system called the configure script: > > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. > > It was created by quilt configure 0.63, which was > generated by GNU Autoconf 2.69. Invocation command line was > > $ ./configure --with-sed=/usr/local/bin/gsed --without-getopt --with-patch=/usr/local/bin/gpatch --prefix=/usr/ports/devel/q\ > uilt/work/stage/usr/local --without-rpmbuild --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=am\ > d64-portbld-freebsd10.0 > ... > > As you can see, the ports system appends it's default GNU autoconf options *after* mine and thus overrides my --prefix. > > Question: what are the best practices to make GNU autoconf ports support staging? > There is a line NO_STAGE in the port, remove it and try to fire a build as *unprivileged* user. With good luck the Makefile in the source of this port uses $(DESTDIR) so everything goes well. If this is not the case there are some ways to enable stage support, e.g - create do-install: target in the port Makefile and write place instructions here - change the install instructions in the source Makefile '$(INSTALL) foo $(PREFIX)/bin' -> '$(INSTALL) foo $(DESTDIR)$(PREFIX)/bin' Do not overwrite! > CONFIGURE_ARGS=--prefix=$(STAGEDIR)/usr/local else binaries and possible scripts are searching later in the wrong place for libs ... -- olli