summaryrefslogtreecommitdiff
path: root/lang/spidermonkey185/Makefile
blob: 1c739b540c28750277eddf8e38bbb78a1b6c3768 (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
# $NetBSD: Makefile,v 1.7 2018/08/22 09:45:22 wiz Exp $
#

DISTNAME=	js185-1.0.0
PKGNAME=	spidermonkey185-1.8.5
PKGREVISION=	2
CATEGORIES=	lang
MASTER_SITES=	${MASTER_SITE_MOZILLA:=js/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://developer.mozilla.org/en/SpiderMonkey
COMMENT=	Standalone JavaScript implementation in C
LICENSE=	mpl-1.1

WRKSRC=		${WRKDIR}/js-1.8.5/js/src

USE_TOOLS+=	gmake pkg-config perl:build zip:build
USE_LANGUAGES=	c c++03
USE_LIBTOOL=	yes

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--enable-threadsafe
CONFIGURE_ARGS+=	--with-pthreads
CONFIGURE_ARGS+=	--with-system-nspr

PYTHON_VERSIONS_ACCEPTED=	27

SUBST_CLASSES+=			incdir
SUBST_STAGE.incdir=		pre-configure
SUBST_MESSAGE.incdir=		Adjust include path
SUBST_FILES.incdir=		js-config.in mozjs185.pc.in
SUBST_SED.incdir=		-e 's,/js,/js-1.8.5,g'

# XXX: workaround for js-config command and mozjs185.pc
CONFIGURE_ENV+=		MOZILLA_VERSION=4.0

PKGCONFIG_OVERRIDE+=	ctypes/libffi/libffi.pc.in
PKGCONFIG_OVERRIDE+=	mozjs185.pc.in

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

.if ${MACHINE_ARCH} == "arm"
PLIST_SUBST+=	ARCH=ARM
.elif ${MACHINE_ARCH} == "mips"
PLIST_SUBST+=	ARCH=MIPS
.elif ${MACHINE_ARCH} == "powerpc"
PLIST_SUBST+=	ARCH=PPC
.elif ${MACHINE_ARCH} == "sparc"
PLIST_SUBST+=	ARCH=Sparc
.elif ${MACHINE_ARCH} == "x86_64"
PLIST_SUBST+=	ARCH=X64
.else
PLIST_SUBST+=	ARCH=${MACHINE_ARCH}
.endif

TEST_TARGET=		check

# o Install js interpreter
# o Install the binaries and headers with a proper version suffix
# o Adjust headers permissions
post-install:
	${INSTALL_PROGRAM} ${WRKSRC}/js ${DESTDIR}${PREFIX}/bin/js185
	${MV} ${DESTDIR}${PREFIX}/bin/js-config ${DESTDIR}${PREFIX}/bin/js185-config
	${MV} ${DESTDIR}${PREFIX}/include/js ${DESTDIR}${PREFIX}/include/js-1.8.5
	${CHMOD} -x ${DESTDIR}${PREFIX}/include/js-1.8.5/*

# Python is only needed for the test target
PYTHON_FOR_BUILD_ONLY=	yes
.include "../../lang/python/application.mk"
.include "../../devel/nspr/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"