Bug 186373 - [PATCH] lang/v8: Fix build when >= 10.0 and no clang
Summary: [PATCH] lang/v8: Fix build when >= 10.0 and no clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Vanilla I. Shu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-02 14:40 UTC by Mathieu Arnold
Modified: 2014-02-04 09:20 UTC (History)
0 users

See Also:


Attachments
file.diff (1.17 KB, patch)
2014-02-02 14:40 UTC, Mathieu Arnold
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer freebsd_triage 2014-02-02 14:40:00 UTC
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)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-02-02 14:40:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vanilla

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-02-04 09:15:45 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"
Comment 3 Vanilla I. Shu freebsd_committer freebsd_triage 2014-02-04 09:16:02 UTC
State Changed
From-To: open->closed

Committed, thanks.