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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
# $NetBSD: Makefile,v 1.230 2022/06/24 06:10:38 wiz Exp $
#
# release notes
# https://firefox-source-docs.mozilla.org/security/nss/releases/index.html
DISTNAME= nss-${NSS_RELEASE:S/.0$//}
NSS_RELEASE= 3.80.0
CATEGORIES= devel security
MASTER_SITES= ${MASTER_SITE_MOZILLA_ALL:=security/nss/releases/NSS_${NSS_DIST_DIR_VERSION:S/_0$//}_RTM/src/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
COMMENT= Libraries to support development of security-enabled applications
LICENSE= mpl-2.0
CHECK_PORTABILITY_SKIP+= nss/tests/*/*.sh
CHECK_PORTABILITY_SKIP+= js/src/configure
CHECK_PORTABILITY_SKIP+= configure
CTF_SUPPORTED= no # https://smartos.org/bugview/OS-6510
USE_GCC_RUNTIME= yes
USE_LANGUAGES= c99
USE_TOOLS+= gmake perl pax pkg-config
MAKE_JOBS_SAFE= no
BUILD_DIRS= nss
.include "../../mk/bsd.prefs.mk"
.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
# nss doesn't really depend on nspr as a tool, but the
# EXTRA_SHARED_LIBS we set there get passed through to the build of a
# tool `nsinstall' and getting them to not be passed through is more
# trouble than it is worth to nix this dependency. (But if you feel
# like going to the trouble to patch around it -- go for it!)
TOOL_DEPENDS+= nspr>=0:../../devel/nspr
MAKE_FLAGS+= CROSS_COMPILE=1
MAKE_FLAGS+= NATIVE_CC=${NATIVE_CC:Q}
NSS_CPU_ARCH.aarch64eb= aarch64
NSS_CPU_ARCH.amd64= x86_64
NSS_CPU_ARCH.arm26?= arm
NSS_CPU_ARCH.arm32?= arm
NSS_CPU_ARCH.earm?= arm
NSS_CPU_ARCH.earmeb?= arm
NSS_CPU_ARCH.earmhf?= arm
NSS_CPU_ARCH.earmhfeb?= arm
NSS_CPU_ARCH.earmv4?= arm
NSS_CPU_ARCH.earmv4eb?= arm
NSS_CPU_ARCH.earmv5?= arm
NSS_CPU_ARCH.earmv5eb?= arm
NSS_CPU_ARCH.earmv6?= arm
NSS_CPU_ARCH.earmv6eb?= arm
NSS_CPU_ARCH.earmv6hf?= arm
NSS_CPU_ARCH.earmv6hfeb?= arm
NSS_CPU_ARCH.earmv7?= arm
NSS_CPU_ARCH.earmv7eb?= arm
NSS_CPU_ARCH.earmv7hf?= arm
NSS_CPU_ARCH.earmv7hfeb?= arm
NSS_CPU_ARCH.i386= x86
NSS_CPU_ARCH.i486= x86
NSS_CPU_ARCH.i586= x86
NSS_CPU_ARCH.i686= x86
NSS_CPU_ARCH.powerpc64= ppc64
NSS_CPU_ARCH.powerpc= ppc
NSS_CPU_ARCH= ${NSS_CPU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
MAKE_FLAGS+= CPU_ARCH=${NSS_CPU_ARCH:Q}
.endif
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
LDFLAGS.NetBSD+= -lrt # sem_wait(3)
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 !empty(PKGSRC_COMPILER:Mclang) || !empty(PKGSRC_COMPILER:Mgcc)
MAKE_ENV+= NS_USE_GCC=YES
.endif
.if !empty(PKGSRC_COMPILER:Mclang)
MAKE_ENV+= CC_IS_CLANG=YES
.endif
SUBST_CLASSES+= 64bit
SUBST_STAGE.64bit= pre-configure
SUBST_FILES.64bit= nss/lib/freebl/*
SUBST_SED.64bit= -e 's,NSS_USE_64,_LP64,g'
SUBST_MESSAGE.64bit= Use a generic 64bit check
# Just to be safe, do this as well as the _LP64 replacement
# NSS has a lot more logic for USE_64
.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 "${LDFLAGS:Q}
MAKE_ENV+= NSS_DISABLE_GTESTS=yes
MAKE_ENV+= NSS_ENABLE_TLS_1_3=1
.include "../../mk/compiler.mk"
.if !empty(CC_VERSION:Mgcc-4.[0-7]*)
CFLAGS+= -DNSS_NO_GCC48
.endif
MOD_MAJOR_VERSION= ${NSS_RELEASE:C/\.[0-9.]*//}
MOD_MINOR_VERSION= ${NSS_RELEASE:S/3.//:C/\.[0-9]*//}
MOD_PATCH_VERSION= ${NSS_RELEASE:C/[0-9.]*\.//}
NSS_DIST_DIR_VERSION= ${MOD_MAJOR_VERSION}_${MOD_MINOR_VERSION}_${MOD_PATCH_VERSION}
NSPR_MINIMUM_VERSION= 4.34
PKGCONFIG_OVERRIDE= nss.pc
SUBST_CLASSES+= config
# nss.pc
SUBST_SED.config+= -e "s,@PTHREAD@,${BUILDLINK_LIBS.pthread:Q},"
SUBST_SED.config+= -e "s,%prefix%,${PREFIX},"
SUBST_SED.config+= -e "s,%exec_prefix%,${PREFIX},"
SUBST_SED.config+= -e "s,%libdir%,${PREFIX}/lib/nss,"
SUBST_SED.config+= -e "s,%includedir%,${PREFIX}/include/nss,"
SUBST_SED.config+= -e "s,%NSS_VERSION%,${PKGVERSION_NOREV},"
SUBST_SED.config+= -e "s,%NSPR_VERSION%,${NSPR_MINIMUM_VERSION},"
# nss-config
SUBST_SED.config+= -e "s,@prefix@,${PREFIX},"
SUBST_VARS.config+= MOD_MAJOR_VERSION
SUBST_VARS.config+= MOD_MINOR_VERSION
SUBST_VARS.config+= MOD_PATCH_VERSION
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
INSTALL_CMDS+= certutil cmsutil crlutil derdump makepqg \
mangle modutil ocspclnt oidcalc p7content p7env p7sign \
p7verify pk12util rsaperf shlibsign signtool signver \
ssltap strsclnt symkeyutil vfychain vfyserv
post-extract:
find ${WRKSRC} -type f | xargs ${CHMOD} 644
find ${WRKSRC} -type d | xargs ${CHMOD} 755
${CP} ${WRKSRC}/nss/pkg/pkg-config/nss.pc.in ${WRKSRC}/nss.pc
${CP} ${WRKSRC}/nss/pkg/pkg-config/nss-config.in ${WRKSRC}/nss-config
do-install:
(cd ${WRKSRC}/dist/public/nss && pax -Lrw . ${DESTDIR}${PREFIX}/include/nss )
(cd ${WRKSRC}/dist/*_OPT.OBJ/lib && \
pax -Lrw *.${SO_SUFFIX} ${DESTDIR}${PREFIX}/lib/nss/ )
${INSTALL_DATA} ${WRKSRC}/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 cmd in ${INSTALL_CMDS}
${INSTALL_PROGRAM} ${WRKSRC}/dist/*_OPT.OBJ/bin/${cmd} ${DESTDIR}${PREFIX}/bin
.endfor
# 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>=${NSPR_MINIMUM_VERSION}
.include "../../devel/nspr/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
|