ports structure and improvement suggestions
Fernan Aguero
fernan at iib.unsam.edu.ar
Thu May 11 22:46:47 UTC 2006
+----[ Florent Thoumie <flz at xbsd.org> (10.May.2006 06:01):
|
| On Tue, 2006-05-09 at 21:39 -0300, Fernan Aguero wrote:
|
| > Florent,
| >
| > thanks now for a fast turnaround :)
| >
| > unfortunately, this doesn't work.
| >
| > For all ports above it works, except for x11/xterm.
| >
| > The problem seems to be the space within the quoted value:
| > the following works:
| > x11/xterm: CONFIGURE_ARGS='--enable-me'
| > but this doesn't:
| > x11/xterm: CONFIGURE_ARGS='--enable-me --and-me'
|
| True, refetch the script and replace make.conf lines with these:
|
| .if ${.CURDIR:N/usr/ports/*}==""
| _MKCONF!=mkconf
| .for i in ${_MKCONF:S/|/ /g}
| ${i:S/%/ /g}
| .endfor
| .endif
|
+----]
Florent, sorry for the delay in replying. Your fixes helped,
but there's something strange going on here ... in some
cases the first argument of CONFIGURE_ARGS gets truncated.
This is not related to your
make.conf/mkconf/ports.conf trick, but to something else ...
however this only happens when the values come from
/etc/make.conf ... maybe this message doesn't belong in this
thread anymore and I should be sending a PR about it.
However, what happens is so weird that I'm still thinking
about it ... details follow (sorry for the long post).
Fernan
Setup:
o latest mkconf (echo ${_line#*:} | tr ' ' '%')
o ports.conf
category/port: WITH_XYZ="1"
category/port: WITH_XYZ="1"|WITH_ABC="1"
x11/xterm: CONFIGURE_ARGS="--enable-256-color --enable-tcap-query"
o /etc/make.conf with variable substitution as above
( ${_MKCONF:S/|/ /g}, ${i:S/%/ /g})
The tests:
# pwd
/usr/ports/x11/xterm
# mkconf
CONFIGURE_ARGS="--enable-256-color%--enable-tcap-query"
# make clean
===> Cleaning for ...
===> Cleaning for ..
...
[works!]
# make configure
===> Configuring for xterm-213
configure: error: invalid feature name: 256-color --enable-tcap-query
===> Script "configure" failed unexpectedly.
So the '--enable-256-color' got somehow truncated ...
I added a post-extract target to x11/xterm:
post-extract:
@${ECHO_CMD} ${CONFIGURE_ARGS}
and now when I run 'make clean && make configure' again, it's
clear that CONFIGURE_ARGS contains the expected:
===> Extracting for xterm-213
=> MD5 Checksum OK for xterm-213.tgz.
=> SHA256 Checksum OK for xterm-213.tgz.
--enable-256-color --enable-tcap-query --enable-wide-chars
--enable-luit --with-utempter --enable-narrowproto
--x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include
--prefix=/usr/X11R6 --build=i386-portbld-freebsd6.0
that is: the values set in make.conf and those added by the
port. So clearly, there's no 256-color feature being passed
to configure, but the correct '--enable-256-color'
So, who's truncating the feature name? Clearly it's not
mkconf nor your variable substitutions taking place in
/etc/make.conf ...
However, if I comment out all code for this hack from
/etc/make.conf and run this on the command line on
x11/xterm:
make configure CONFIGURE_ARGS+="--enable-256-color --enable-tcap-query"
configure goes along happily (--enable-256-color is not being
truncated) and correctly echoes:
checking if you want 256 colors... yes
But if I add this line alone to /etc/make.conf
CONFIGURE_ARGS="--enable-256-color --disable-bold-color --enable-tcap-query"
truncation happens again.
So this makes a compelling case for something weird going on
with /etc/make.conf (just so you can see there's nothing
weird with mine, it's here:
http://genoma.unsam.edu.ar/~fernan/freebsd/make.conf)
It's also difficult to get an idea of how/why things are
being truncated. What is sure is that only the first arg in
CONFIGURE_ARGS gets truncated. But, the truncation doesn't
occur in these cases (lines from ports.conf):
x11/xterm: CONFIGURE_ARGS="-V"
x11/xterm: CONFIGURE_ARGS="--version"
x11/xterm: CONFIGURE_ARGS="-h"
x11/xterm: CONFIGURE_ARGS="--help"
x11/xterm: CONFIGURE_ARGS="--with-pcre"
x11/xterm: CONFIGURE_ARGS="--enable-256-color"
while in these cases configure fails, but the arg is not
truncated:
x11/xterm: CONFIGURE_ARGS="-V --enable-256-color"
x11/xterm: CONFIGURE_ARGS="--version --enable-256-color"
x11/xterm: CONFIGURE_ARGS="-h --enable-256-color"
x11/xterm: CONFIGURE_ARGS="--help --enable-256-color"
x11/xterm: CONFIGURE_ARGS="--yada-yada --enable-256-color"
and in these cases, configure fails and the arg IS
truncated:
x11/xterm: CONFIGURE_ARGS="--with-pcre --enable-256-color"
gets truncated to 'pcre --enable-256-color'
x11/xterm: CONFIGURE_ARGS="--enable-256-color --enable-tcap-query"
gets truncated to '256-color --enable-tcap-query'
(but why didn't --yada-yada get truncated? seems like only
--enable-x and --disable-x are truncated, but only if they
are the first configure arg, and if they're followed by
something else).
Finally, it happens with other ports also:
math/gnuplot: CONFIGURE_ARGS="--enable-datastrings --enable-histograms"
will truncate '--enable-datastrings' to 'datastrings'
[modified math/gnuplot to do CONFIGURE_ARGS+= instead of CONFIGURE_ARGS=]
Strange brew ... anyone has a clue?
Fernan
PS: this is on FreeBSD-6.0p6 (latest cvsup was yesterday, so
/usr/ports/Mk is up to date)
my make.conf and ports.conf files
http://genoma.unsam.edu.ar/~fernan/freebsd/make.conf
http://genoma.unsam.edu.ar/~fernan/freebsd/ports.conf
More information about the freebsd-ports
mailing list