summaryrefslogtreecommitdiff
path: root/lang/nodejs/Makefile.common
blob: 4f131d37211b9708f0b3f13fcb71b7b213ea0db3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# $NetBSD: Makefile.common,v 1.13 2017/01/01 14:43:45 wiz Exp $
# used by lang/nodejs/Makefile
# used by lang/nodejs4/Makefile
# used by lang/nodejs6/Makefile

CATEGORIES=	devel
MASTER_SITES=	http://nodejs.org/dist/${DISTNAME:S/node-//}/
PKGNAME=	${DISTNAME:S/-v/js-/}

MAINTAINER=	filip@joyent.com
HOMEPAGE=	http://nodejs.org/
COMMENT=	V8 JavaScript for clients and servers
LICENSE=	mit

HAS_CONFIGURE=	yes
USE_TOOLS+=	bash gmake pkg-config
USE_LANGUAGES=	c c++

PYTHON_VERSIONS_INCOMPATIBLE=	34 35 36 # not yet ported as of 0.10.24

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

GCC_REQD+=		4.8

CONFIG_SHELL=		${PYTHONBIN}
CONFIGURE_ARGS+=	--prefix=${PREFIX}
CONFIGURE_ARGS+=	--shared-zlib
CONFIGURE_ARGS+=	--with-intl=system-icu
PTHREAD_AUTO_VARS=	yes

CONFIGURE_ENV.NetBSD+=	GYP_DEFINES="OS=netbsd"
MAKE_ENV.NetBSD+=	GYP_DEFINES="OS=netbsd"

.if ${OPSYS} == "Linux" && !exists(/usr/bin/gold)
CONFIGURE_ENV+=		GYP_DEFINES="linux_use_gold_flags=0"
.endif

REPLACE_PYTHON+=	configure
REPLACE_PYTHON+=	tools/genv8constants.py
REPLACE_PYTHON+=	tools/gyp/pylib/gyp/flock_tool.py

CHECK_INTERPRETER_SKIP+=	lib/node_modules/npm/*

.if ${OPSYS} == "NetBSD"
BUILD_DEPENDS+=	lockf-[0-9]*:../../sysutils/lockf
.endif

TEST_TARGET=		check

.if defined(TOOLS_PLATFORM.paxctl)
SUBST_CLASSES+=			mksnapshot
SUBST_STAGE.mksnapshot=		post-configure
SUBST_FILES.mksnapshot=		out/deps/v8/tools/gyp/mksnapshot.target.mk
SUBST_FILES.mksnapshot+=	out/deps/v8/src/mksnapshot.target.mk
SUBST_SED.mksnapshot+=		-e 's|call do_cmd,link)|call do_cmd,link)\${.newline}	${TOOLS_PLATFORM.paxctl} +m $$@|'
.endif

pre-install:
	${FIND} ${WRKSRC}/deps/npm -name '*.orig' | ${XARGS} ${RM} -f
	${CHMOD} -R g-w ${WRKSRC}

post-install:
	cd ${DESTDIR}${PREFIX} && ${SETENV} ${BASH} \
		./lib/node_modules/npm/scripts/relocate.sh ${PREFIX}/bin/node
.if defined(TOOLS_PLATFORM.paxctl)
	${TOOLS_PLATFORM.paxctl} +m ${DESTDIR}${PREFIX}/bin/node
.endif

.if ${OPSYS} != "Darwin"
.include "../../devel/libexecinfo/buildlink3.mk"
.endif
.include "../../devel/zlib/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../lang/python/tool.mk"
.include "../../textproc/icu/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"