Subject: Re: mozilla horribly broken?
To: Tom Spindler <dogcow@babymeat.com>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 02/07/2006 10:22:19
Tom Spindler wrote:
> See PR/32763; I'm pretty sure it's due to the weird quoting changes.
> The following patch to www/firefox/Makefile.common makes things
> build/run again, if not perfectly (regchrome ain't installed).
> 
> RCS file: /cvsroot/pkgsrc/www/firefox/Makefile.common,v
> retrieving revision 1.6
> diff -u -w -p -r1.6 Makefile.common
> --- Makefile.common     6 Feb 2006 09:57:56 -0000       1.6
> +++ Makefile.common     7 Feb 2006 06:07:43 -0000
> @@ -63,11 +63,11 @@ CONFIGURE_ARGS+=    --enable-default-toolki
>  # NetBSD-*-m68k builds, but "regchrome" dumps core.
>  NOT_FOR_PLATFORM=      NetBSD-1.4.*-* NetBSD-*-m68k
>  
> -MAKE_ENV+=             MOZILLA_PKG_NAME=${MOZILLA:Q}
> +MAKE_ENV+=             MOZILLA_PKG_NAME=${MOZILLA}

Since ${MOZILLA} == "mozilla", this doesn't make any difference. The 
former variant is more correct, though.

>  MOZ_LIBDIR=            ${PREFIX}/lib/${MOZILLA}
> -MAKE_ENV+=             LIBRUNPATH=${MOZ_LIBDIR:Q}
> -CONFIGURE_ENV+=                LIBRUNPATH=${MOZ_LIBDIR:Q}
> +MAKE_ENV+=             LIBRUNPATH=${MOZ_LIBDIR}
> +CONFIGURE_ENV+=                LIBRUNPATH=${MOZ_LIBDIR}
>  LDFLAGS+=              ${COMPILER_RPATH_FLAG}${MOZ_LIBDIR}

What if ${MOZ_LIBDIR} contains spaces or other special characters? 
That's exactly what the :Q is for.

>  .if defined(BUILD_SVG)
> @@ -92,23 +92,23 @@ CONFIGURE_ARGS+=    --enable-xinerama
>  
>  # avoid creating a .mozilla directory in the users home
>  # directory
> -SCRIPTS_ENV+=          HOME="${WRKDIR:Q}"
> +SCRIPTS_ENV+=          HOME="${WRKDIR}"

This is a useful fix, although not completely correct. The canonical 
form would be SCRIPTS_ENV += HOME=${WRKDIR:Q}

> -PLIST_SUBST+=          MOZILLA=${MOZILLA:Q}
> -PLIST_SUBST+=          MOZILLA_BIN=${MOZILLA_BIN:Q}
> -FILES_SUBST+=          MOZILLA=${MOZILLA:Q}
> -FILES_SUBST+=          MOZILLA_BIN=${MOZILLA_BIN:Q}
> +PLIST_SUBST+=          MOZILLA=${MOZILLA}
> +PLIST_SUBST+=          MOZILLA_BIN=${MOZILLA_BIN}
> +FILES_SUBST+=          MOZILLA=${MOZILLA}
> +FILES_SUBST+=          MOZILLA_BIN=${MOZILLA_BIN}

These have no good effect, too.

>  .if ${OBJECT_FMT} == "ELF"
>  SO_SUFFIX=             so
> -SCRIPTS_ENV+=          MOZ_INSTALL_LIB="${INSTALL_PROGRAM:Q}"
> +SCRIPTS_ENV+=          MOZ_INSTALL_LIB="${INSTALL_PROGRAM}"
>  .elif ${OBJECT_FMT} == "Mach-O"
>  SO_SUFFIX=             dylib
> -SCRIPTS_ENV+=          MOZ_INSTALL_LIB="${INSTALL_LIB:Q}"
> +SCRIPTS_ENV+=          MOZ_INSTALL_LIB="${INSTALL_LIB}"
>  .else
>  SO_SUFFIX=             so.1.0
> -SCRIPTS_ENV+=          MOZ_INSTALL_LIB="${INSTALL_PROGRAM:Q}"
> +SCRIPTS_ENV+=          MOZ_INSTALL_LIB="${INSTALL_PROGRAM}"

See above, these should be ${INSTALL_PROGRAM:Q}.

I've committed a fix to www/firefox and www/mozilla.

Roland