Date: Sun, 08 Jun 2014 00:04:56 +0200 From: olli hauer <ohauer@gmx.de> To: freebsd-ports@freebsd.org Cc: Dirk Jagdmann <doj@cubic.org> Subject: Re: how to support STAGEDIR with GNU autoconf Message-ID: <53938C88.8060703@gmx.de> In-Reply-To: <53937912.3050604@cubic.org> References: <53937912.3050604@cubic.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53938C88.8060703>