Lines 1-67
Link Here
|
1 |
# Created by: siasia |
|
|
2 |
# $FreeBSD$ |
1 |
# $FreeBSD$ |
3 |
|
2 |
|
4 |
PORTNAME= v8 |
3 |
PORTNAME= v8 |
5 |
PORTVERSION= 3.18.5 |
4 |
DISTVERSION= 8.5.145 |
6 |
PORTREVISION= 8 |
|
|
7 |
CATEGORIES= lang |
5 |
CATEGORIES= lang |
8 |
MASTER_SITES= LOCAL/vanilla |
6 |
MASTER_SITES= http://mikael.urankar.free.fr/FreeBSD/v8/:build \ |
|
|
7 |
http://mikael.urankar.free.fr/FreeBSD/v8/:buildtools \ |
8 |
http://mikael.urankar.free.fr/FreeBSD/v8/:clang \ |
9 |
http://mikael.urankar.free.fr/FreeBSD/v8/:common \ |
10 |
http://mikael.urankar.free.fr/FreeBSD/v8/:gmock \ |
11 |
http://mikael.urankar.free.fr/FreeBSD/v8/:icu \ |
12 |
http://mikael.urankar.free.fr/FreeBSD/v8/:zlib |
13 |
# XXX sha256 changes everytime you download the archive |
14 |
#MASTER_SITES= https://chromium.googlesource.com/chromium/src/build.git/+archive/:build \ |
15 |
# https://chromium.googlesource.com/chromium/src/buildtools.git/+archive/:buildtools \ |
16 |
# https://chromium.googlesource.com/chromium/src/tools/clang.git/+archive/:clang \ |
17 |
# https://chromium.googlesource.com/chromium/src/base/trace_event/common.git/+archive/:common \ |
18 |
# https://chromium.googlesource.com/external/github.com/google/googletest.git/+archive/:gmock \ |
19 |
# https://chromium.googlesource.com/chromium/deps/icu.git/+archive/:icu \ |
20 |
# https://chromium.googlesource.com/chromium/src/third_party/zlib.git/+archive/:zlib |
21 |
DISTFILES= build-${BUILD_REV}.tar.gz:build \ |
22 |
buildtools-${BUILDTOOLS_REV}.tar.gz:buildtools \ |
23 |
clang-${CLANG_REV}.tar.gz:clang \ |
24 |
common-${COMMON_REV}.tar.gz:common \ |
25 |
gmock-${GMOCK_REV}.tar.gz:gmock \ |
26 |
icu-${ICU_REV}.tar.gz:icu \ |
27 |
zlib-${ZLIB_REV}.tar.gz:zlib |
28 |
EXTRACT_ONLY= ${DISTNAME}.tar.gz |
9 |
|
29 |
|
10 |
MAINTAINER= sunpoet@FreeBSD.org |
30 |
MAINTAINER= sunpoet@FreeBSD.org |
11 |
COMMENT= Open source JavaScript engine by Google |
31 |
COMMENT= Open source JavaScript engine by Google |
12 |
|
32 |
|
13 |
LICENSE= BSD3CLAUSE |
33 |
LICENSE= BSD3CLAUSE |
|
|
34 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
14 |
|
35 |
|
15 |
CONFLICTS_INSTALL= v8-devel-[0-9]* |
36 |
# clang10+ is required, hardcoded in files/patch-build_toolchain_gcc__toolchain.gni |
|
|
37 |
BUILD_DEPENDS= binutils>0:devel/binutils \ |
38 |
gn:devel/chromium-gn \ |
39 |
glib>0:devel/glib20 \ |
40 |
${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \ |
41 |
llvm10>0:devel/llvm10 |
16 |
|
42 |
|
17 |
ONLY_FOR_ARCHS= i386 amd64 |
43 |
USES= pkgconfig ninja python:2.7,build tar:xz |
|
|
44 |
USE_GITHUB= yes |
45 |
USE_LDCONFIG= yes |
18 |
|
46 |
|
19 |
PORTSCOUT= limit:^3.18.* |
47 |
# see ${WRKSRC}/DEPS |
|
|
48 |
BUILD_REV= 8038ef2827d0bc23ac85450a91b0a2a413944a24 |
49 |
BUILDTOOLS_REV= 574cbd5df82c6ae48805b2aa8d75e0ef76aa15aa |
50 |
CLANG_REV= 5e1d63a7e37e51596de0d3c01e239ff8919b5d6e |
51 |
COMMON_REV= ef3586804494b7e402b6c1791d5dccdf2971afff |
52 |
GMOCK_REV= 4fe018038f87675c083d0cfb6a6b57c274fb1753 |
53 |
ICU_REV= 46f53dfc09c520b7c520a089ca473bb0ee29c07e |
54 |
ZLIB_REV= a68151fd9b9f5ad11b96a3765f706361ff22dbc8 |
20 |
|
55 |
|
21 |
ALL_TARGET= native |
56 |
BUILDTYPE= Release |
22 |
MAKE_ARGS= library=shared |
|
|
23 |
MAKE_ENV= CC.host=${CC} CXX.host=${CXX} LINK.host=${CXX} LINK.target=${CXX} |
24 |
USE_LDCONFIG= yes |
25 |
USES= alias compiler cpe gmake python:2.7 shebangfix tar:xz |
26 |
|
57 |
|
27 |
CPE_VENDOR= google |
58 |
BINARY_ALIAS= python=${PYTHON_CMD} |
28 |
|
59 |
|
29 |
SHEBANG_FILES= build/gyp/gyp |
60 |
# Run "gn args out/Release --list" for all variables. |
|
|
61 |
# Some parts don't have use_system_* flag, and can be turned on/off by using |
62 |
# replace_gn_files.py script, some parts just turned on/off for target host |
63 |
# OS "target_os == is_bsd", like libusb, libpci. |
64 |
GN_ARGS+= clang_use_chrome_plugins=false \ |
65 |
is_clang=true \ |
66 |
treat_warnings_as_errors=false \ |
67 |
use_aura=true \ |
68 |
use_lld=true \ |
69 |
extra_cxxflags="${CXXFLAGS}" \ |
70 |
extra_ldflags="${LDFLAGS}" |
30 |
|
71 |
|
31 |
.include <bsd.port.pre.mk> |
72 |
MAKE_ARGS= -C out/${BUILDTYPE} |
32 |
|
73 |
|
33 |
.if ${COMPILER_TYPE} == clang |
74 |
post-extract: |
34 |
CXXFLAGS+= -Wno-nested-anon-types -Wno-unused-function -Wno-unused-private-field |
75 |
${MKDIR} \ |
35 |
MAKE_ENV+= LINK=clang++ |
76 |
${WRKSRC}/base/trace_event/common \ |
36 |
.if ${COMPILER_VERSION} >= 34 |
77 |
${WRKSRC}/build \ |
37 |
CXXFLAGS+= -Wno-unused-const-variable |
78 |
${WRKSRC}/buildtools \ |
38 |
.if ${COMPILER_VERSION} >= 35 |
79 |
${WRKSRC}/third_party/googletest/src \ |
39 |
CXXFLAGS+= -Wno-tautological-undefined-compare |
80 |
${WRKSRC}/third_party/icu \ |
40 |
.if ${COMPILER_VERSION} >= 36 |
81 |
${WRKSRC}/third_party/zlib \ |
41 |
CXXFLAGS+= -Wno-unused-local-typedef |
82 |
${WRKSRC}/tools/clang |
42 |
.if ${COMPILER_VERSION} >= 60 |
83 |
${TAR} -xf ${DISTDIR}/build-${BUILD_REV}.tar.gz -C ${WRKSRC}/build |
43 |
CXXFLAGS+= -Wno-null-pointer-arithmetic -Wno-vexing-parse |
84 |
${TAR} -xf ${DISTDIR}/buildtools-${BUILDTOOLS_REV}.tar.gz -C ${WRKSRC}/buildtools |
44 |
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src-stub-cache.cc |
85 |
${TAR} -xf ${DISTDIR}/clang-${CLANG_REV}.tar.gz -C ${WRKSRC}/tools/clang |
45 |
.endif |
86 |
${TAR} -xf ${DISTDIR}/common-${COMMON_REV}.tar.gz -C ${WRKSRC}/base/trace_event/common |
46 |
.endif |
87 |
${TAR} -xf ${DISTDIR}/gmock-${GMOCK_REV}.tar.gz -C ${WRKSRC}/third_party/googletest/src |
47 |
.endif |
88 |
${TAR} -xf ${DISTDIR}/icu-${ICU_REV}.tar.gz -C ${WRKSRC}/third_party/icu |
48 |
.endif |
89 |
${TAR} -xf ${DISTDIR}/zlib-${ZLIB_REV}.tar.gz -C ${WRKSRC}/third_party/zlib |
49 |
.else |
|
|
50 |
MAKE_ARGS+= strictaliasing=off |
51 |
USE_GCC= any |
52 |
.endif |
53 |
|
90 |
|
54 |
post-patch: |
91 |
post-patch: |
55 |
@${REINPLACE_CMD} -e 's|test/cctest/cctest.gyp||' ${WRKSRC}/Makefile |
92 |
${REINPLACE_CMD} "s|%%LOCALBASE%%|${LOCALBASE}|" \ |
56 |
@${REINPLACE_CMD} -e '/test\/cctest\/cctest.gyp/d' ${WRKSRC}/build/all.gyp |
93 |
${WRKSRC}/build/toolchain/gcc_toolchain.gni |
57 |
@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/build/common.gypi ${WRKSRC}/tools/gyp/v8.gyp |
94 |
do-configure: |
58 |
@${REINPLACE_CMD} -e 's, | MAP_NORESERVE,,' ${WRKSRC}/src/platform-freebsd.cc |
95 |
@${ECHO_CMD} 'is_clang=true' > ${WRKSRC}/build/args/release.gn |
59 |
@${REINPLACE_CMD} -e 's|python|${PYTHON_CMD}|' ${WRKSRC}/tools/gyp/v8.gyp |
96 |
@${ECHO_CMD} 'treat_warnings_as_errors=false' >> ${WRKSRC}/build/args/release.gn |
|
|
97 |
@${ECHO_CMD} 'use_custom_libcxx=false' >> ${WRKSRC}/build/args/release.gn |
98 |
@${ECHO_CMD} 'use_lld=true' >> ${WRKSRC}/build/args/release.gn |
99 |
@${ECHO_CMD} 'extra_cxxflags="-I${PREFIX}/include"' >> ${WRKSRC}/build/args/release.gn |
100 |
@${ECHO_CMD} 'extra_ldflags="-L${PREFIX}/lib"' >> ${WRKSRC}/build/args/release.gn |
101 |
cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} gn gen out/${BUILDTYPE} \ |
102 |
--args='import("//build/args/release.gn") ${GN_ARGS}' |
60 |
|
103 |
|
61 |
do-install: |
104 |
do-install: |
62 |
${INSTALL_PROGRAM} ${WRKSRC}/out/native/d8 ${STAGEDIR}${PREFIX}/bin/d8 |
105 |
# XXX cppgc? |
63 |
cd ${WRKSRC}/include/ && ${INSTALL_DATA} *.h ${STAGEDIR}${PREFIX}/include/ |
106 |
${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/d8 ${STAGEDIR}${PREFIX}/bin/d8 |
64 |
${INSTALL_LIB} ${WRKSRC}/out/native/lib.target/libv8.so ${STAGEDIR}${PREFIX}/lib/libv8.so.1 |
107 |
# ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/d8 ${STAGEDIR}${PREFIX}/bin/cctest |
65 |
${LN} -fs ${PREFIX}/lib/libv8.so.1 ${STAGEDIR}${PREFIX}/lib/libv8.so |
108 |
# ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/mksnapshot ${STAGEDIR}${PREFIX}/bin/mksnapshot |
|
|
109 |
# ${INSTALL_PROGRAM} ${WRKSRC}/out/${BUILDTYPE}/mkgrokdump ${STAGEDIR}${PREFIX}/bin/mkgrokdump |
110 |
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libv8.so ${STAGEDIR}${PREFIX}/lib/libv8.so |
111 |
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libv8_libbase.so ${STAGEDIR}${PREFIX}/lib/libv8_libbase.so |
112 |
${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/libv8_libplatform.so ${STAGEDIR}${PREFIX}/lib/libv8_libplatform.so |
66 |
|
113 |
|
67 |
.include <bsd.port.post.mk> |
114 |
${INSTALL_DATA} ${WRKSRC}/include/*.h ${STAGEDIR}${PREFIX}/include/ |
|
|
115 |
${MKDIR} ${STAGEDIR}${PREFIX}/include/libplatform/ |
116 |
${INSTALL_DATA} ${WRKSRC}/include/libplatform/*.h ${STAGEDIR}${PREFIX}/include/libplatform/ |
117 |
${INSTALL_DATA} ${FILESDIR}/*.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig |
118 |
${REINPLACE_CMD} "s|%%PREFIX%%|${PREFIX}|" \ |
119 |
${STAGEDIR}${PREFIX}/libdata/pkgconfig/* |
120 |
|
121 |
.include <bsd.port.mk> |