summaryrefslogtreecommitdiff
path: root/devel/nss/Makefile
blob: b2caf02d01a5cf1b84fe88e5de53ec740d05ceb1 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# $NetBSD: Makefile,v 1.116 2016/07/02 12:22:47 ryoon Exp $

DISTNAME=		nss-${NSS_RELEASE:S/.0$//}
NSS_RELEASE=		3.25.0
CATEGORIES=		security
MASTER_SITES=		${MASTER_SITE_MOZILLA_ALL:=security/nss/releases/NSS_${NSS_MAJOR_VERSION}_${NSS_MINOR_VERSION}_RTM/src/}

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		http://www.mozilla.org/projects/security/pki/nss/
COMMENT=		Libraries to support development of security-enabled applications
LICENSE=		mpl-2.0

CHECK_PORTABILITY_SKIP+=${MOZILLA_DIR}nss/tests/libpkix/libpkix.sh
CHECK_PORTABILITY_SKIP+=${MOZILLA_DIR}nss/tests/multinit/multinit.sh
CHECK_PORTABILITY_SKIP+=${MOZILLA_DIR}js/src/configure
CHECK_PORTABILITY_SKIP+=${MOZILLA_DIR}configure

USE_GCC_RUNTIME=	yes
USE_TOOLS+=		gmake perl pax pkg-config
MAKE_JOBS_SAFE=		no

BUILD_DIRS=		nss

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

SUBST_CLASSES.Darwin+=		exec_path
SUBST_STAGE.exec_path=		pre-configure
SUBST_MESSAGE.exec_path=	Fixing @executable_path
SUBST_FILES.exec_path=		nss/coreconf/Darwin.mk
SUBST_SED.exec_path=		-e 's,@executable_path,${PREFIX}/lib/nss,g'

SUBST_CLASSES+=			zlib
SUBST_STAGE.zlib=		pre-configure
SUBST_MESSAGE.zlib=		Use ZLIB_LIBS from environment
SUBST_FILES.zlib=		nss/coreconf/*.mk
SUBST_SED.zlib=			-e 's,^ZLIB_LIBS,\#ZLIB_LIBS,g'

BUILDLINK_TRANSFORM+=	rm:-Werror
BUILDLINK_TRANSFORM+=	rm:-ansi

MAKE_ENV.Linux+=	FREEBL_NO_DEPEND=0

.if ${OBJECT_FMT} == "ELF"
SO_SUFFIX=		so
.elif ${OBJECT_FMT} == "Mach-O"
SO_SUFFIX=		dylib
.else
SO_SUFFIX=		so.1.0
.endif
PLIST_SUBST+=		SO_SUFFIX=${SO_SUFFIX:Q}

.if ${OPSYS} == "SunOS" && (${PKGSRC_COMPILER} == "clang" || ${PKGSRC_COMPILER} == "gcc")
MAKE_ENV+=	NS_USE_GCC=YES
.endif

.for platform in ${LP64PLATFORMS}
.  if ${MACHINE_PLATFORM:M${platform}}
MAKE_ENV+=	USE_64=1
.  endif
.endfor

MAKE_ENV+=	BUILD_OPT=1
#MAKE_ENV+=	OPTIMIZER=${CFLAGS:Q}
MAKE_ENV+=	INCLUDES=-I${BUILDLINK_PREFIX.nspr}/include/nspr
MAKE_ENV+=	NSS_USE_SYSTEM_SQLITE=1
MAKE_ENV+=	ZLIB_LIBS="${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.zlib}/lib -L${BUILDLINK_PREFIX.zlib}/lib -lz"
MAKE_ENV+=	USE_SYSTEM_ZLIB=1
MAKE_ENV+=	EXTRA_SHARED_LIBS="${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.nspr}/lib/nspr ${COMPILER_RPATH_FLAG}${PREFIX}/lib/nss -L${BUILDLINK_PREFIX.nspr}/lib/nspr -lplc4 -lplds4 -lnspr4"
MAKE_ENV+=	NSS_DISABLE_GTESTS=yes
.include "../../mk/compiler.mk"
.if !empty(CC_VERSION:Mgcc-4.[0-7]*)
CFLAGS+=	-DNSS_NO_GCC48
.endif

NSS_MAJOR_VERSION=	${NSS_RELEASE:C/\.[0-9.]*//}
NSS_MINOR_VERSION=	${NSS_RELEASE:S/3.//:C/\.[0-9]*//}
NSS_PATCH_VERSION=	${NSS_RELEASE:C/[0-9.]*\.//}

SUBST_CLASSES+=		config
SUBST_SED.config+=	-e "s,@PREFIX@,${PREFIX},g"
SUBST_SED.config+=	-e "s,@NSS_MAJOR_VERSION@,${NSS_MAJOR_VERSION},"
SUBST_SED.config+=	-e "s,@NSS_MINOR_VERSION@,${NSS_MINOR_VERSION},"
SUBST_SED.config+=	-e "s,@NSS_PATCH_VERSION@,${NSS_PATCH_VERSION},"
SUBST_SED.config+=	-e "s!@COMPILER_RPATH_FLAG@!${COMPILER_RPATH_FLAG}!"
SUBST_SED.config+=	-e "s,@PTHREAD@,${BUILDLINK_LIBS.pthread:Q},"
SUBST_STAGE.config=	pre-build
SUBST_MESSAGE.config=	Preparing *-config files.
SUBST_FILES.config+=	nss.pc nss-config

INSTALLATION_DIRS=	bin include/nss lib/nss lib/pkgconfig
DIST=	${WRKSRC}/dist

post-extract:
	find ${WRKSRC} -type f | xargs ${CHMOD} 644
	find ${WRKSRC} -type d | xargs ${CHMOD} 755
	${CP} ${FILESDIR}/nss.pc.in ${WRKSRC}/nss.pc
	${CP} ${FILESDIR}/nss-config.in ${WRKSRC}/nss-config

do-install:
	(cd ${DIST}/public && pax -Lrw . ${DESTDIR}${PREFIX}/include/nss/ )
	(cd ${DIST}/*_OPT.OBJ/lib && \
		pax -Lrw *.${SO_SUFFIX} ${DESTDIR}${PREFIX}/lib/nss/ )
	${INSTALL_LIB} ${DIST}/*_OPT.OBJ/lib/libcrmf.a \
		${DESTDIR}${PREFIX}/lib/nss/
	${INSTALL_DATA} ${WRKSRC}/nss.pc ${DESTDIR}${PREFIX}/lib/pkgconfig/nss.pc
	${INSTALL_SCRIPT} ${WRKSRC}/nss-config ${DESTDIR}${PREFIX}/bin/nss-config

# For consistency of libxul.so link in www/firefox.
BUILDLINK_API_DEPENDS.sqlite3+=	sqlite3>=3.8.4.2
.include "../../databases/sqlite3/buildlink3.mk"
BUILDLINK_API_DEPENDS.nspr+=	nspr>=4.12
.include "../../devel/nspr/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"