Gettext update broke port - need help with fix

Joe Marcus Clarke marcus at marcuscom.com
Fri Aug 29 20:51:03 PDT 2003


On Fri, 2003-08-29 at 20:31, Simon Barner wrote:
> Hi,
> 
> I saw that the new version of `gettext' (0.12.1) that is used by the ports
> collection broke the www/aria port:
> 
> http://bento.freebsd.org/errorlogs/i386-4-latest/aria-1.0.0.log
> 
> The reason for this is that some of the port's source files contain C++
> comments with non-ascii characters. These where ignored by the old
> version of `xgettext' (0.11.5) but the new one needs an extra
> command-line option (--from-source) in order to cope with those files.
> 
> Since this problem might happen in more than a few ports, a clean
> solution is needed imo (one could of course add patches for each and
> every troublesome comment, but I think we don't want that).

It happens in three (not counting xmms which has already been patched):

www/aria
japanese/ebview
math/oleo


> 
> Passing that command-line option to the new version of `xgettext' looks
> like a good approach. I was able to extract its version number with the
> following command (I am sure there is a simpler solution, but well. I
> found that one :-)
> 
> xgettext -V | awk 'NR == 1 { gsub (/\./, "", $4); \
>                    gsub (/^0*/, "", $4); print $4}'
> 				   
> This yields 115 for the old 'xgettext' and 121 for the new one.
> 
> What I would like to do is to pass the result of that command into a
> variable (with back-ticks, i.e. XGETTEXT_VER=`xgettext ...`) and compare
> that variable _numerically_ as in
> 
> ------->
> 
> XGETTEXT_VER=`xgettext -V | awk 'NR == 1 { gsub (/\./, "", $$4);
>                                  gsub (/^0*/, "", $$4); print $$4}'`

Use XGETTEXT_VER!= instead.  You should also add things like
${LOCALBASE}, and use ${AWK} where appropriate.

Joe

> 
> .include <bsd.port.pre.mk>
>  
> .if ${XGETTEXT_VER} > 115
> MAKE_ENV+=      -DXGETTEXT_FLAGS=" --from-code "
> .endif
>  
> foo: 
>         @echo ${MAKE_ENV}
> 
> <-------
> 
> But unfortunately, XGETTEXT_VER is always interpreted as a string:
> 
> make foo
> "Makefile", line 37: warning: String comparison operator should be either
>                      == or !=
> "Makefile", line 37: Malformed conditional (${XGETTEXT_VER} < 115)
> Unterminated {} clause ""
> "Makefile", line 37: Error in archive specification: ""
> "Makefile", line 39: if-less endif
> "Makefile", line 39: Need an operator
> make: fatal errors encountered -- cannot continue
> 
> I searched the archives, but I still don't know how to handle this...
> Please help :-)
> 
> Regards,
>  Simon
-- 
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20030829/76565c84/attachment.bin


More information about the freebsd-ports mailing list