Continue with the upgrades...
[dragora.git] / patches / nss / nss-3.74-standalone-1.patch
blob009184f61db804565fa8da84ba7b305d7c62aa6e
1 Submitted By: Xi Ruoyao <xry111_AT_mengyan1223_DOT_wang>
2 Date: 2020-08-22
3 Initial Package Version: 3.12.4
4 Upstream Status: Not applicable
5 Origin: Self, adjusted for nss-3.56.
6 Description: Adds auto-generated nss.pc and nss-config script, and
7 allows building without nspr in the source tree.
8 Minimum NSPR version is now read out from package,
9 instead of hardcoded value in the patch.
11 diff --color -uNar nss-3.55.orig/nss/config/Makefile nss-3.55/nss/config/Makefile
12 --- nss-3.55.orig/nss/config/Makefile 1970-01-01 08:00:00.000000000 +0800
13 +++ nss-3.55/nss/config/Makefile 2020-07-25 19:34:36.272982957 +0800
14 @@ -0,0 +1,42 @@
15 +CORE_DEPTH = ..
16 +DEPTH = ..
18 +include $(CORE_DEPTH)/coreconf/config.mk
20 +NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
21 +NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
22 +NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
23 +NSS_NSPR_MINIMUM = `head -n1 ../automation/release/nspr-version.txt`
24 +PREFIX = /usr
26 +all: export libs
28 +export:
29 + # Create the nss.pc file
30 + mkdir -p $(DIST)/lib/pkgconfig
31 + sed -e "s,@prefix@,$(PREFIX)," \
32 + -e "s,@exec_prefix@,\$${prefix}," \
33 + -e "s,@libdir@,\$${prefix}/lib," \
34 + -e "s,@includedir@,\$${prefix}/include/nss," \
35 + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
36 + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
37 + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
38 + -e "s,@NSS_NSPR_MINIMUM@,$(NSS_NSPR_MINIMUM)," \
39 + nss.pc.in > nss.pc
40 + chmod 0644 nss.pc
41 + ln -sf ../../../../nss/config/nss.pc $(DIST)/lib/pkgconfig
43 + # Create the nss-config script
44 + mkdir -p $(DIST)/bin
45 + sed -e "s,@prefix@,$(PREFIX)," \
46 + -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
47 + -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
48 + -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
49 + nss-config.in > nss-config
50 + chmod 0755 nss-config
51 + ln -sf ../../../nss/config/nss-config $(DIST)/bin
53 +libs:
55 +dummy: all export libs
57 diff --color -uNar nss-3.55.orig/nss/config/nss-config.in nss-3.55/nss/config/nss-config.in
58 --- nss-3.55.orig/nss/config/nss-config.in 1970-01-01 08:00:00.000000000 +0800
59 +++ nss-3.55/nss/config/nss-config.in 2020-07-25 19:32:37.239032214 +0800
60 @@ -0,0 +1,153 @@
61 +#!/bin/sh
63 +prefix=@prefix@
65 +major_version=@NSS_MAJOR_VERSION@
66 +minor_version=@NSS_MINOR_VERSION@
67 +patch_version=@NSS_PATCH_VERSION@
69 +usage()
71 + cat <<EOF
72 +Usage: nss-config [OPTIONS] [LIBRARIES]
73 +Options:
74 + [--prefix[=DIR]]
75 + [--exec-prefix[=DIR]]
76 + [--includedir[=DIR]]
77 + [--libdir[=DIR]]
78 + [--version]
79 + [--libs]
80 + [--cflags]
81 +Dynamic Libraries:
82 + nss
83 + nssutil
84 + smime
85 + ssl
86 + softokn
87 +EOF
88 + exit $1
91 +if test $# -eq 0; then
92 + usage 1 1>&2
93 +fi
95 +lib_nss=yes
96 +lib_nssutil=yes
97 +lib_smime=yes
98 +lib_ssl=yes
99 +lib_softokn=yes
101 +while test $# -gt 0; do
102 + case "$1" in
103 + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
104 + *) optarg= ;;
105 + esac
107 + case $1 in
108 + --prefix=*)
109 + prefix=$optarg
110 + ;;
111 + --prefix)
112 + echo_prefix=yes
113 + ;;
114 + --exec-prefix=*)
115 + exec_prefix=$optarg
116 + ;;
117 + --exec-prefix)
118 + echo_exec_prefix=yes
119 + ;;
120 + --includedir=*)
121 + includedir=$optarg
122 + ;;
123 + --includedir)
124 + echo_includedir=yes
125 + ;;
126 + --libdir=*)
127 + libdir=$optarg
128 + ;;
129 + --libdir)
130 + echo_libdir=yes
131 + ;;
132 + --version)
133 + echo ${major_version}.${minor_version}.${patch_version}
134 + ;;
135 + --cflags)
136 + echo_cflags=yes
137 + ;;
138 + --libs)
139 + echo_libs=yes
140 + ;;
141 + nss)
142 + lib_nss=yes
143 + ;;
144 + nssutil)
145 + lib_nssutil=yes
146 + ;;
147 + smime)
148 + lib_smime=yes
149 + ;;
150 + ssl)
151 + lib_ssl=yes
152 + ;;
153 + softokn)
154 + lib_softokn=yes
155 + ;;
156 + *)
157 + usage 1 1>&2
158 + ;;
159 + esac
160 + shift
161 +done
163 +# Set variables that may be dependent upon other variables
164 +if test -z "$exec_prefix"; then
165 + exec_prefix=`pkg-config --variable=exec_prefix nss`
167 +if test -z "$includedir"; then
168 + includedir=`pkg-config --variable=includedir nss`
170 +if test -z "$libdir"; then
171 + libdir=`pkg-config --variable=libdir nss`
174 +if test "$echo_prefix" = "yes"; then
175 + echo $prefix
178 +if test "$echo_exec_prefix" = "yes"; then
179 + echo $exec_prefix
182 +if test "$echo_includedir" = "yes"; then
183 + echo $includedir
186 +if test "$echo_libdir" = "yes"; then
187 + echo $libdir
190 +if test "$echo_cflags" = "yes"; then
191 + echo -I$includedir
194 +if test "$echo_libs" = "yes"; then
195 + libdirs="-L$libdir"
196 + if test -n "$lib_nss"; then
197 + libdirs="$libdirs -lnss${major_version}"
198 + fi
199 + if test -n "$lib_nssutil"; then
200 + libdirs="$libdirs -lnssutil${major_version}"
201 + fi
202 + if test -n "$lib_smime"; then
203 + libdirs="$libdirs -lsmime${major_version}"
204 + fi
205 + if test -n "$lib_ssl"; then
206 + libdirs="$libdirs -lssl${major_version}"
207 + fi
208 + if test -n "$lib_softokn"; then
209 + libdirs="$libdirs -lsoftokn${major_version}"
210 + fi
211 + echo $libdirs
212 +fi
214 diff --color -uNar nss-3.55.orig/nss/config/nss.pc.in nss-3.55/nss/config/nss.pc.in
215 --- nss-3.55.orig/nss/config/nss.pc.in 1970-01-01 08:00:00.000000000 +0800
216 +++ nss-3.55/nss/config/nss.pc.in 2020-07-25 19:33:05.958889937 +0800
217 @@ -0,0 +1,12 @@
218 +prefix=@prefix@
219 +exec_prefix=@exec_prefix@
220 +libdir=@libdir@
221 +includedir=@includedir@
223 +Name: NSS
224 +Description: Network Security Services
225 +Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
226 +Requires: nspr >= @NSS_NSPR_MINIMUM@
227 +Libs: -L@libdir@ -lnss@NSS_MAJOR_VERSION@ -lnssutil@NSS_MAJOR_VERSION@ -lsmime@NSS_MAJOR_VERSION@ -lssl@NSS_MAJOR_VERSION@ -lsoftokn@NSS_MAJOR_VERSION@
228 +Cflags: -I${includedir}
230 diff --color -uNar nss-3.55.orig/nss/Makefile nss-3.55/nss/Makefile
231 --- nss-3.55.orig/nss/Makefile 2020-07-24 23:10:32.000000000 +0800
232 +++ nss-3.55/nss/Makefile 2020-07-25 19:32:37.239032214 +0800
233 @@ -4,6 +4,8 @@
234 # License, v. 2.0. If a copy of the MPL was not distributed with this
235 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
237 +default: nss_build_all
239 #######################################################################
240 # (1) Include initial platform-independent assignments (MANDATORY). #
241 #######################################################################
242 @@ -48,12 +50,10 @@
243 #######################################################################
245 nss_build_all:
246 - $(MAKE) build_nspr
247 $(MAKE) all
248 $(MAKE) latest
250 nss_clean_all:
251 - $(MAKE) clobber_nspr
252 $(MAKE) clobber
254 NSPR_CONFIG_STATUS = $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/config.status
255 diff --color -uNar nss-3.55.orig/nss/manifest.mn nss-3.55/nss/manifest.mn
256 --- nss-3.55.orig/nss/manifest.mn 2020-07-24 23:10:32.000000000 +0800
257 +++ nss-3.55/nss/manifest.mn 2020-07-25 19:32:37.240032237 +0800
258 @@ -10,7 +10,7 @@
260 RELEASE = nss
262 -DIRS = coreconf lib cmd cpputil gtests
263 +DIRS = coreconf lib cmd cpputil gtests config
265 lib: coreconf
266 cmd: lib