From mat@aragorn.in.absolight.net  Sun Feb  2 14:30:23 2014
Return-Path: <mat@aragorn.in.absolight.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id A627F60B
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Feb 2014 14:30:23 +0000 (UTC)
Received: from prod2.absolight.net (mx3.absolight.net [IPv6:2a01:678:2:100::25])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 6750D10CC
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Feb 2014 14:30:22 +0000 (UTC)
Received: from prod2.absolight.net (localhost [127.0.0.1])
	by prod2.absolight.net (Postfix) with ESMTP id A995ABDC5A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Feb 2014 15:30:19 +0100 (CET)
Received: from gw.in.absolight.net (gw-ecl.in.absolight.net [79.143.241.69])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "gw.in.absolight.net", Issuer "CA Cert Signing Authority" (not verified))
	by prod2.absolight.net (Postfix) with ESMTPSA id 84580BDC56
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Feb 2014 15:30:19 +0100 (CET)
Received: from aragorn.in.absolight.net (aragorn.in.absolight.net [79.143.241.225])
	by gw.in.absolight.net (Postfix) with ESMTP id EFF196119
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  2 Feb 2014 15:30:18 +0100 (CET)
Received: by aragorn.in.absolight.net (Postfix, from userid 1000)
	id 6BC811426A2; Sun,  2 Feb 2014 15:30:18 +0100 (CET)
Message-Id: <20140202143018.6BC811426A2@aragorn.in.absolight.net>
Date: Sun,  2 Feb 2014 15:30:18 +0100 (CET)
From: Mathieu Arnold <mat@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] lang/v8: Fix build when >= 10.0 and no clang
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         186373
>Category:       ports
>Synopsis:       [PATCH] lang/v8: Fix build when >= 10.0 and no clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    vanilla
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 02 14:40:00 UTC 2014
>Closed-Date:    Tue Feb 04 09:16:03 UTC 2014
>Last-Modified:  Tue Feb  4 09:20:00 UTC 2014
>Originator:     Mathieu Arnold
>Release:        FreeBSD 10.0-RELEASE i386
>Organization:
Absolight
>Environment:
System: FreeBSD aragorn.in.absolight.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Fri Jan 17 01:46:25 UTC
>Description:
On some architectures, there's no clang, like on mips, and it breaks package buildings:

root@pkg:/usr/ports/lang/v8-devel # make -V PKGNAME
make: "/usr/ports/lang/v8-devel/Makefile" line 38: warning: String comparison operator should be either == or !=
make: "/usr/ports/lang/v8-devel/Makefile" line 38: Malformed conditional (${_CLANG} >= 33)
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/lang/v8-devel

The lang/v8 only gives out a warning, but would not compile in the end because
it would try to use clang++ which doesnt exist:

root@pkg:/usr/ports/lang/v8 # make -V PKGNAME
clang: not found
make: "/usr/ports/lang/v8/Makefile" line 27: warning: Couldn't read shell's output for "clang --version | /usr/bin/head -1 | /usr/bin/sed -e 's/.*clang version \([0-9]\)\.\([0-9]\).*/\1\2/'"
v8-3.18.5

This little patch fixes both, though, you may be better of adding USES=compiler
and test for COMPILER_TYPE.

Generated with FreeBSD Port Tools 0.99_11 (mode: change, diff: SVN)
>How-To-Repeat:
>Fix:


Index: lang/v8/Makefile
===================================================================
--- lang/v8/Makefile	(revision 342297)
+++ lang/v8/Makefile	(working copy)
@@ -23,7 +23,7 @@
 
 .include <bsd.port.pre.mk>
 
-.if ${CC:T:Mclang} == "clang" || ${CXX:T:Mclang++} == "clang++" || ${OSVERSION} >= 1000024
+.if ${CC:T:Mclang} == "clang" || ${CXX:T:Mclang++} == "clang++" || (${OSVERSION} >= 1000024 && exists(/usr/bin/clang))
 _CLANG!=	clang --version | ${HEAD} -1 | ${SED} -e 's/.*clang version \([0-9]\)\.\([0-9]\).*/\1\2/'
 MAKE_ENV+=	LINK=clang++
 CFLAGS+=	-Wno-unused-private-field
Index: lang/v8-devel/Makefile
===================================================================
--- lang/v8-devel/Makefile	(revision 341832)
+++ lang/v8-devel/Makefile	(working copy)
@@ -30,7 +30,7 @@
 
 .include <bsd.port.pre.mk>
 
-.if ${CC:T:Mclang} == "clang" || ${CXX:T:Mclang++} == "clang++" || ${OSVERSION} >= 1000024
+.if ${CC:T:Mclang} == "clang" || ${CXX:T:Mclang++} == "clang++" || (${OSVERSION} >= 1000024 && exists(/usr/bin/clang))
 _CLANG!=	${CC} --version | ${HEAD} -1 | ${SED} -e 's/.*clang version \([0-9]\)\.\([0-9]\).*/\1\2/'
 MAKE_ENV+=	LINK=clang++ AR=/usr/bin/ar
 MAKE_ARGS+=	clang=on
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->vanilla 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Feb 2 14:40:08 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186373 
State-Changed-From-To: open->closed 
State-Changed-By: vanilla 
State-Changed-When: Tue Feb 4 09:16:02 UTC 2014 
State-Changed-Why:  
Committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186373 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/186373: commit references a PR
Date: Tue,  4 Feb 2014 09:15:45 +0000 (UTC)

 Author: vanilla
 Date: Tue Feb  4 09:15:37 2014
 New Revision: 342488
 URL: http://svnweb.freebsd.org/changeset/ports/342488
 QAT: https://qat.redports.org/buildarchive/r342488/
 
 Log:
   1: use compiler.mk
   2: upgrade v8-devel to 3.24.30.
   
   PR:		ports/186373 [1]
   Submitted by:	mat@ [1]
 
 Modified:
   head/lang/v8-devel/Makefile
   head/lang/v8-devel/distinfo
   head/lang/v8-devel/files/patch-Makefile
   head/lang/v8/Makefile
 
 Modified: head/lang/v8-devel/Makefile
 ==============================================================================
 --- head/lang/v8-devel/Makefile	Tue Feb  4 07:12:12 2014	(r342487)
 +++ head/lang/v8-devel/Makefile	Tue Feb  4 09:15:37 2014	(r342488)
 @@ -2,7 +2,7 @@
  # $FreeBSD$
  
  PORTNAME=	v8
 -PORTVERSION=	3.24.7
 +PORTVERSION=	3.24.30
  CATEGORIES=	lang
  MASTER_SITES=	LOCAL/vanilla
  PKGNAMESUFFIX=	-devel
 @@ -16,7 +16,7 @@ LIB_DEPENDS=	libexecinfo.so:${PORTSDIR}/
  
  CONFLICTS=	v8-3.19.*
  
 -USES=		gmake shebangfix
 +USES=		gmake shebangfix compiler
  SHEBANG_LANG=	sh
  SHEBANG_FILES=	${WRKSRC}/build/gyp/gyp
  USE_XZ=		yes
 @@ -30,12 +30,11 @@ sh_CMD=		${SH}
  
  .include <bsd.port.pre.mk>
  
 -.if ${CC:T:Mclang} == "clang" || ${CXX:T:Mclang++} == "clang++" || ${OSVERSION} >= 1000024
 -_CLANG!=	${CC} --version | ${HEAD} -1 | ${SED} -e 's/.*clang version \([0-9]\)\.\([0-9]\).*/\1\2/'
 +.if ${COMPILER_TYPE} == clang
  MAKE_ENV+=	LINK=clang++ AR=/usr/bin/ar
  MAKE_ARGS+=	clang=on
  CFLAGS+=	-Wno-unused-private-field -Wno-unused-variable
 -.if ${_CLANG} >= 33
 +.if ${COMPILER_VERSION} >= 33
  CFLAGS+=	-Wno-nested-anon-types -Wno-unused-function
  .endif
  .else
 
 Modified: head/lang/v8-devel/distinfo
 ==============================================================================
 --- head/lang/v8-devel/distinfo	Tue Feb  4 07:12:12 2014	(r342487)
 +++ head/lang/v8-devel/distinfo	Tue Feb  4 09:15:37 2014	(r342488)
 @@ -1,2 +1,2 @@
 -SHA256 (v8-3.24.7.tar.xz) = 4007211042d1e34d88af30025aa9536d2556da0f3bb744e5290e33698939086b
 -SIZE (v8-3.24.7.tar.xz) = 35186840
 +SHA256 (v8-3.24.30.tar.xz) = 9178700254290e38eb7085e44d879ffbc7871dd1eeacebb7c08cb1c49924e22a
 +SIZE (v8-3.24.30.tar.xz) = 34185612
 
 Modified: head/lang/v8-devel/files/patch-Makefile
 ==============================================================================
 --- head/lang/v8-devel/files/patch-Makefile	Tue Feb  4 07:12:12 2014	(r342487)
 +++ head/lang/v8-devel/files/patch-Makefile	Tue Feb  4 09:15:37 2014	(r342488)
 @@ -1,5 +1,5 @@
 ---- Makefile.orig	2013-10-24 23:26:16.000000000 +0800
 -+++ Makefile	2013-10-25 10:19:26.000000000 +0800
 +--- Makefile.orig	2014-02-04 10:07:31.000000000 +0800
 ++++ Makefile	2014-02-04 17:01:29.349287737 +0800
  @@ -52,6 +52,14 @@ endif
   ifdef console
     GYPFLAGS += -Dconsole=$(console)
 @@ -15,7 +15,7 @@
   # disassembler=on
   ifeq ($(disassembler), on)
     GYPFLAGS += -Dv8_enable_disassembler=1
 -@@ -223,7 +231,7 @@ NACL_ARCHES = nacl_ia32 nacl_x64
 +@@ -233,7 +241,7 @@ NACL_ARCHES = nacl_ia32 nacl_x64
   # List of files that trigger Makefile regeneration:
   GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \
              build/toolchain.gypi samples/samples.gyp src/d8.gyp \
 @@ -24,3 +24,23 @@
   
   # If vtunejit=on, the v8vtune.gyp will be appended.
   ifeq ($(vtunejit), on)
 +@@ -386,8 +394,7 @@ clean: $(addsuffix .clean, $(ARCHES) $(A
 + # GYP file generation targets.
 + OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS))
 + $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
 +-	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \
 +-	PYTHONPATH="$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
 ++	PYTHONPATH="$(shell pwd)/build/gyp/pylib:$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \
 + 	GYP_GENERATORS=make \
 + 	build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
 + 	              -Ibuild/standalone.gypi --depth=. \
 +@@ -396,8 +403,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
 + 	              -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
 + 
 + $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
 +-	PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \
 +-	PYTHONPATH="$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \
 ++	PYTHONPATH="$(shell pwd)/build/gyp/pylib:$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \
 + 	GYP_GENERATORS=make \
 + 	build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
 + 	              -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS)
 
 Modified: head/lang/v8/Makefile
 ==============================================================================
 --- head/lang/v8/Makefile	Tue Feb  4 07:12:12 2014	(r342487)
 +++ head/lang/v8/Makefile	Tue Feb  4 09:15:37 2014	(r342488)
 @@ -12,22 +12,22 @@ COMMENT=	Google\'s open source JavaScrip
  BUILD_DEPENDS=	python:${PORTSDIR}/lang/python
  LIB_DEPENDS=	execinfo:${PORTSDIR}/devel/libexecinfo
  
 -CONFLICTS=      v8-devel-*
 +CONFLICTS=	v8-3.24.*
  
 -USES=		gmake
 +USES=		gmake compiler
  USE_XZ=		yes
  USE_PYTHON=	2
  USE_LDCONFIG=	yes
  ALL_TARGET=	native
  MAKE_ARGS=	library=shared
 +MAKE_ENV+=	CC.host=${CC} CXX.host=${CXX} LINK.host=${CXX} LINK.target=${CXX}
  
  .include <bsd.port.pre.mk>
  
 -.if ${CC:T:Mclang} == "clang" || ${CXX:T:Mclang++} == "clang++" || ${OSVERSION} >= 1000024
 -_CLANG!=	clang --version | ${HEAD} -1 | ${SED} -e 's/.*clang version \([0-9]\)\.\([0-9]\).*/\1\2/'
 +.if ${COMPILER_TYPE} == clang
  MAKE_ENV+=	LINK=clang++
  CFLAGS+=	-Wno-unused-private-field
 -.if ${_CLANG} >= 33
 +.if ${COMPILER_VERSION} >= 33
  CFLAGS+=	-Wno-nested-anon-types -Wno-unused-function
  .endif
  .else
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
