nss-3.74-standalone-1.patch 7.0 KB

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