Subject: Malformed Conditional in Perl5 Make
To: NetBSD Port-i386 Users <port-i386@NetBSD.org>
From: Robert Zagarello <bzag0@yahoo.com>
List: port-i386
Date: 05/19/2005 10:54:53
I ran into a problem which I sent in to GNATS when I
tried to make kde3, which, to make a long story short,
requires perl5.  There is a bug in the
lang/perl5/buildlink3.mk.  My workaround was to use an
older version of this file (it wasn't more than a
month old).  I ran into this when I downloaded pkgsrc
last night while doing a fresh install of NetBSD V2. 
Note the workaround seems to be working (no errors
generated thus far) but I can't vouch for its usage !!
 If you use the workaround please remember that email
systems can wreak havoc on line endings and
wraparounds.

The screen output, "bad" file and workaround file
follow (search for "line 27" to find the error):
+++++++++++++++++++++++++++++++++++++++++++++++
Here is the screen output:
+++++++++++++++++++++++++++++++++++++++++++++++
-bash-3.00# cd /usr/pkgsrc/meta-pkgs/kde3
-bash-3.00# make
==== Checking for vulnerabilities in kde-3.4.0nb1
==== Extracting for kde-3.4.0nb1
==== Required package
kdeaccessibility-3.4.0{,nb[0-9]*}: NOT found
==== Verifying reinstall for
../../misc/kdeaccessibility3
==== Checking for vulnerabilities in
kdeaccessibility-3.4.0
=> Checksum SHA1 OK for
kdeaccessibility-3.4.0.tar.bz2.
=> Checksum RMD160 OK for
kdeaccessibility-3.4.0.tar.bz2.
==== Extracting for kdeaccessibility-3.4.0
==== Required installed package
{perl>=5.0,perl-thread>=5.0}: perl-5.8.6nb4 found
==== Required installed package
{perl>=5.0,perl-thread>=5.0}: perl-5.8.6nb4 found
==== Required installed package perl>=5.8.5nb6:
perl-5.8.6nb4 found
==== Required package kdebase>=3.4.0: NOT found
==== Verifying reinstall for ../../x11/kdebase3
==== Checking for vulnerabilities in kdebase-3.4.0nb3
=> Checksum SHA1 OK for kdebase-3.4.0.tar.bz2.
=> Checksum RMD160 OK for kdebase-3.4.0.tar.bz2.
=> Checksum SHA1 OK for Daemon.png.
=> Checksum RMD160 OK for Daemon.png.
=> Checksum SHA1 OK for Daemon.README.
=> Checksum RMD160 OK for Daemon.README.
=> Checksum SHA1 OK for NetBSD-flag.png.
=> Checksum RMD160 OK for NetBSD-flag.png.
==== Extracting for kdebase-3.4.0nb3
==== Required installed package
{perl>=5.0,perl-thread>=5.0}: perl-5.8.6nb4 found
==== Required installed package
{perl>=5.0,perl-thread>=5.0}: perl-5.8.6nb4 found
==== Required installed package perl>=5.8.5nb6:
perl-5.8.6nb4 found
==== Required installed package openldap>=2.2.18nb1:
openldap-2.2.20nb2 found
==== Required installed package libusb>=0.1.8nb2:
libusb-0.1.10a found
==== Required installed package cyrus-sasl>=2.1.17nb3:
cyrus-sasl-2.1.20nb1 found
==== Required package kdelibs>=3.4.0nb1: NOT found
==== Verifying reinstall for ../../x11/kdelibs3
==== Checking for vulnerabilities in kdelibs-3.4.0nb4
=> Checksum SHA1 OK for kdelibs-3.4.0.tar.bz2.
=> Checksum RMD160 OK for kdelibs-3.4.0.tar.bz2.
==== Extracting for kdelibs-3.4.0nb4
==== Required installed package
{perl>=5.0,perl-thread>=5.0}: perl-5.8.6nb4 found
==== Required installed package
{perl>=5.0,perl-thread>=5.0}: perl-5.8.6nb4 found
==== Required installed package perl>=5.8.5nb6:
perl-5.8.6nb4 found
==== Required installed package qt3-libs>=3.3.3nb4:
qt3-libs-3.3.4 found
==== Required installed package Xft2>=2.1.6nb1:
Xft2-2.1.6nb1 found
==== Required installed package fontconfig>=2.2.96nb1:
fontconfig-2.3.1nb1 found
==== Required installed package expat>=1.95.8nb2:
expat-1.95.8nb2 found
==== Required installed package glu>=6.0.1nb2:
glu-6.2.1 found
==== Required installed package MesaLib>=6.0.1nb1:
MesaLib-6.2.1 found
==== Required installed package mng>=1.0.8nb1:
mng-1.0.9 found
==== Required installed package lcms>=1.12nb2:
lcms-1.14 found
==== Required installed package png>=1.2.6nb1:
png-1.2.8 found
==== Required installed package freetype2>=2.1.9nb1:
freetype2-2.1.9nb1 found
==== Required installed package Xrandr>=1.0.2nb1:
Xrandr-1.0.2nb2 found
==== Required installed package xcursor>=1.1.1nb2:
xcursor-1.1.2 found
==== Required installed package Xrender>=0.8.4nb1:
Xrender-0.8.4nb1 found
==== Required installed package arts>=1.3.0nb1:
arts-1.4.0 found
==== Required installed package esound>=0.2.35nb1:
esound-0.2.35nb1 found
==== Required installed package libmad>=0.15.1bnb1:
libmad-0.15.1bnb1 found
==== Required installed package libvorbis>=1.1.0nb1:
libvorbis-1.1.0nb1 found
==== Required installed package glib2>=2.6.1:
glib2-2.6.4 found
==== Required installed package libogg>=1.1.2nb1:
libogg-1.1.2nb1 found
==== Required installed package
libaudiofile>=0.2.6nb1: libaudiofile-0.2.6nb1 found
==== Required installed package pcre>=5.0nb1:
pcre-5.0nb1 found
==== Required installed package openexr>=1.2.1:
openexr-1.2.2 found
==== Required installed package libart2>=2.3.16nb1:
libart2-2.3.17 found
==== Required installed package tiff>=3.7.2nb1:
tiff-3.7.2nb1 found
==== Required installed package jpeg>=6bnb2:
jpeg-6bnb3 found
==== Required installed package aspell>=0.60.2:
aspell-0.60.2 found
==== Required package libxslt>=1.1.10nb1: NOT found
==== Verifying reinstall for ../../textproc/libxslt
make:
"../../lang/perl5/../../lang/perl5/buildlink3.mk" line
27: Malformed conditional ((defined(USE_PERL5) &&
!empty(USE_PERL5:Mbuild)) || 
(defined(TOOLS_DEPMETHOD.perl) &&
!empty(TOOLS_DEPMETHOD.perl:MBUILD_DEPENDS)))
make:
"../../lang/perl5/../../lang/perl5/buildlink3.mk" line
50: if-less endif
make:
"../../lang/perl5/../../lang/perl5/buildlink3.mk" line
50: Need an operator
make: Fatal errors encountered -- cannot continue

make: stopped in /usr/pkgsrc/textproc/libxslt
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/x11/kdelibs3
*** Error code 1

ETC.

+++++++++++++++++++++++++++++++++++++++++++++++
Here is the FAILING lang/perl5/buildlink3.mk:
+++++++++++++++++++++++++++++++++++++++++++++++
# $NetBSD: buildlink3.mk,v 1.20 2005/05/18 22:42:07
jlam Exp $

BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH}+
PERL5_BUILDLINK3_MK:=	${PERL5_BUILDLINK3_MK}+

.include "../../mk/bsd.prefs.mk"

.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+=	perl
.endif

BUILDLINK_PACKAGES:=	${BUILDLINK_PACKAGES:Nperl}
BUILDLINK_PACKAGES+=	perl

.if !empty(PERL5_BUILDLINK3_MK:M+)
.  if empty(_USE_NEW_TOOLS:M[yY][eE][sS])
USE_PERL5?=	run
PERL5_REQD+=	5.0
.  endif
USE_TOOLS+=	perl

BUILDLINK_DEPENDS.perl+=
{perl>=${PERL5_REQD},perl-thread>=${PERL5_REQD}}
BUILDLINK_RECOMMENDED.perl+=	perl>=5.8.5nb6
BUILDLINK_PKGSRCDIR.perl?=	../../lang/perl58

.if (defined(USE_PERL5) && !empty(USE_PERL5:Mbuild))
|| \
    (defined(TOOLS_DEPMETHOD.perl) &&
!empty(TOOLS_DEPMETHOD.perl:MBUILD_DEPENDS))
BUILDLINK_DEPMETHOD.perl?=	build
.else
TOOLS_DEPMETHOD.perl?=		DEPENDS
.endif

PERL5_OPTIONS?=		# empty
.if !empty(PERL5_OPTIONS:Mthreads)
USE_PKGINSTALL=		yes
INSTALL_EXTRA_TMPL+=
${.CURDIR}/../../lang/perl5/files/install.tmpl
.endif

.if ${PKG_INSTALLATION_TYPE} == "overwrite"
#
# Perl keeps headers and odd libraries in an odd path
not caught by the
# default BUILDLINK_FILES_CMD, so name them to be
symlinked into
# ${BUILDLINK_DIR}.
#
BUILDLINK_FILES.perl=							\
	${PERL5_SUB_INSTALLARCHLIB}/CORE/*				\

${PERL5_SUB_INSTALLARCHLIB}/auto/DynaLoader/DynaLoader.a
.endif

.endif  # PERL5_BUILDLINK3_MK

BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH:S/+$//}


+++++++++++++++++++++++++++++++++++++++++++++++
Here is the WORKAROUND lang/perl5/buildlink3.mk:
+++++++++++++++++++++++++++++++++++++++++++++++
# $NetBSD: buildlink3.mk,v 1.18 2005/02/24 22:38:42
jlam Exp $

BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH}+
PERL5_BUILDLINK3_MK:=	${PERL5_BUILDLINK3_MK}+

.include "../../mk/bsd.prefs.mk"

.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+=	perl
.endif

BUILDLINK_PACKAGES:=	${BUILDLINK_PACKAGES:Nperl}
BUILDLINK_PACKAGES+=	perl

.if !empty(PERL5_BUILDLINK3_MK:M+)
USE_PERL5?=	run
PERL5_REQD+=	5.0

BUILDLINK_DEPENDS.perl+=
{perl>=${_PERL5_REQD},perl-thread>=${_PERL5_REQD}}
BUILDLINK_RECOMMENDED.perl+=	perl>=5.8.5nb6
BUILDLINK_PKGSRCDIR.perl?=	${PERL5_PKGSRCDIR}

.if !empty(USE_PERL5:M[bB][uU][iI][lL][dD])
BUILDLINK_DEPMETHOD.perl?=	build
.endif

PERL5_OPTIONS?=	# empty
.if !empty(PERL5_OPTIONS:Mthreads)
USE_PKGINSTALL=		yes
INSTALL_EXTRA_TMPL+=
${.CURDIR}/../../lang/perl5/files/install.tmpl
.endif

.include "../../lang/perl5/vars.mk"

.if ${PKG_INSTALLATION_TYPE} == "overwrite"
.  if defined(PERL5_SUB_INSTALLARCHLIB)
#
# Perl keeps headers and odd libraries in an odd path
not caught by the
# default BUILDLINK_FILES_CMD, so name them to be
symlinked into
# ${BUILDLINK_DIR}.
#
BUILDLINK_FILES.perl=							\
	${PERL5_SUB_INSTALLARCHLIB}/CORE/*				\

${PERL5_SUB_INSTALLARCHLIB}/auto/DynaLoader/DynaLoader.a
.  endif
.endif

.endif  # PERL5_BUILDLINK3_MK

BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH:S/+$//}