diff options
Diffstat (limited to 'dev-libs/nss')
-rw-r--r-- | dev-libs/nss/Manifest | 11 | ||||
-rw-r--r-- | dev-libs/nss/files/nss-3.53-gentoo-fixups.patch | 290 | ||||
-rw-r--r-- | dev-libs/nss/nss-3.51.1-r1.ebuild (renamed from dev-libs/nss/nss-3.51.1.ebuild) | 2 | ||||
-rw-r--r-- | dev-libs/nss/nss-3.51.ebuild | 2 | ||||
-rw-r--r-- | dev-libs/nss/nss-3.52.1-r1.ebuild | 2 | ||||
-rw-r--r-- | dev-libs/nss/nss-3.52.ebuild | 2 | ||||
-rw-r--r-- | dev-libs/nss/nss-3.53.1.ebuild | 350 |
7 files changed, 651 insertions, 8 deletions
diff --git a/dev-libs/nss/Manifest b/dev-libs/nss/Manifest index 5db6e3cccaf9..c00b2dfc6edb 100644 --- a/dev-libs/nss/Manifest +++ b/dev-libs/nss/Manifest @@ -1,13 +1,16 @@ AUX nss-3.21-gentoo-fixup-warnings.patch 178 BLAKE2B b51f80310db3db416d8aeaf9117ef801389b5b2df47c04aff51bf0759dd5bff41b09d1e9011f99b345d5769a3aab19acb943ee97f8437465518115f6902a0da1 SHA512 7667a020311ca11e8f1836bc146e4a3c94ff2a489882dbe87debcccfeaafeb50e6607574c64254a826b4b6f0bb436b310a3386fff4a58324f0e5e58debaa9d51 AUX nss-3.23-hppa-byte_order.patch 460 BLAKE2B 97358cc8fbea0b0d3beee0697833e48ef01039ceb08fd00792a7f7ef68409eb076022c03764ab079fdaa971a0358130002fa11c0c182ebeb33dcdf660be26408 SHA512 ad0097bb6cf409d61eb28202d7460c87e983d6db977aba38ff9ef2749b3f7bb8fdadce4174f5bf806350ae33733097a1f444792d31cc43574b28341893642e5a AUX nss-3.47-gentoo-fixups.patch 5260 BLAKE2B 994233aad2a0016676e6aea2bf4331a131561aa2b67bf6bab369b86e3a31e2fe651b0cd3fe77c6b8127fd276a5a2b8fccf3db90e0ecf63cd6d3a43e4dc26849a SHA512 c917ee0a2e4c889613f0d931b2553a6338c60a4ef898ea30bcdb888f94a30994849a3d33cd0b9eb7c5d1baebd2c7d991f2dfef44b50a0b59bf2f6b332ee3ef84 +AUX nss-3.53-gentoo-fixups.patch 6886 BLAKE2B 1c605d8db02ebe0492c41955207368197a79990e43e219a71962cb28ac0cecd9e0acc2b76e16f5b116fdb8bf8790d96046cb4f376df9b8634ac48e54924589f8 SHA512 51031f92519f57d4b57a547cf549f2d5da1c5a7212d4b304fb0d71d6a85a5aefd64724ec9075c14c9b49c1e99c3ffe91cbec501c3504985aa9b16eacf2aa15ed DIST nss-3.51.1.tar.gz 78310874 BLAKE2B c295b5fdf6e1d24cc79474f2c5a9e91fccf777212fbb072e8a64576ed1b060fea6ecbde1fa59bb07c998b9aa92bb7d450e722a8f34a72eaa35aef6cbd693420a SHA512 1878780886cc330489a14a60ee5cb67b174f3167d020db256eacdce079652ef8af65813914cd0fb5684457053fa27acc9bff72d0713fbea28795613ca45a6d46 DIST nss-3.51.tar.gz 78305125 BLAKE2B 2c7b90d4cc9fe283bf81e21d0dceefff503e5a31f0053828b140b2b927ddab8c8881b23c7d4c003f3e2d0dcd22efbe699baee63443cab6e72d33a552fd430e3c SHA512 9c894b1ea41449b000750a7b3a89fcb43dfc3d0d4d6dcc0dc288bc73996f76f1ee1ede927a8aecae6d4a07f9f3d3e3a042c6a60cf06e27e0cdc004fce2e510fd DIST nss-3.52.1.tar.gz 81222116 BLAKE2B e7a1a24c0a4765fb13a4c13a93187a26df6df68b3e8d623514928cf505215e67f5f22387b6a6b0680117b1c2af13752cb981c173bb50424784d05b459704d528 SHA512 be8746984e3028e5ed49f2132ca08687f6ac75e50208d8cfd6ffbcfd5db1ab8dcaf1f2a0a6c6c1920573de80490301b21c022759c7e2309a22d29698bb169dd6 DIST nss-3.52.tar.gz 81220587 BLAKE2B 0208c9047c61233ed36f02d57fdc64fa1734ef69d17fa499707f4a3b14a2e880b1dcf4b19b17a38e9b41d2e46b4a9488613d82989be747ad82aebc35b8e491af SHA512 a45baf38717bceda03c292b2c01def680a24a846327e17d36044a85e30ed40c68220c78c0a2c3025c11778ee58f5d5eb0fff1b4cd274b95c408fb59e394e62c6 +DIST nss-3.53.1.tar.gz 81297900 BLAKE2B 7a053aa8322cb55b787730c87f1a6e8a799265574114d63257699348f4921007457d19e5fdc4684a512a91478d1912db45ce066daa8b9d9cde5130ff506aed9e SHA512 5d7572999a007c513df4cbdf74769c1a4eb53eb8680da27a89fea770763d88b6bea80cd9ab20426a905396745129276cffb6dd9e8e1e6377fa98c0a103b522d0 DIST nss-cacert-class1-class3.patch 22950 BLAKE2B 9d5e60df5f161a3c27c41e5a9419440a54f888eda454e3cde5ebe626d4075b65cf9938b5144d0fb022377f4bd415bff5e5c67d104409860aa9391b3eb8872c68 SHA512 a5aa740bf110a3f0262e3f1ef2fc739ac2b44f042e220039d48aee8e97cd764d5c10718220364f4098aba955882bd02cadb5481512388971a8290312f88a7df0 -EBUILD nss-3.51.1.ebuild 9075 BLAKE2B 785cd1575155157ff31324bdbdf9fa04aaa240015daf32a2fd8fd7eff61db3d94447e453776fbf3fcf0f67be1cb3aa07b24d3978c85fc2f1e8b995f5794d4c9a SHA512 83d5380894b6a7f4d740d841e788a1f44034cbcb4e285911534f2645ef5e8563357f93615a76a2c1573a1af2bd20de62b79395cbd231cd311909bae5ad55da38 -EBUILD nss-3.51.ebuild 9000 BLAKE2B 3da318878a972b15b782c1865d0ad5071dbf6a3411e536276b1508ddf4bf416eb14d9423a83b2ab9fa4c474ca6a4d78314d086cc9296a0d68bcc935acd242361 SHA512 792e46aad9198990f87436dcf53367de057eb868210bcea00b4cd1da80585104d97efcaa4c95071d8b897df8b365b4b98bc170a25a275d603e603694ffb03801 -EBUILD nss-3.52.1-r1.ebuild 9115 BLAKE2B c4f48c78fb123f15c7b25193cd6fb26f9a4a505e1fbd25f241a3b04977beb8c76fb3fbd153e8bc063cc209429d02b17652cb1e86273e751c24b212d7da487876 SHA512 4b9352ce8e0e75ded26a30dccc1e63a2a67393c7f9fcc34602b20e12b7fc03c90d5c0076f4bd305917a49cba3c6c0c891de8a49bfcd59a2db8ca289391988e52 -EBUILD nss-3.52.ebuild 9075 BLAKE2B 785cd1575155157ff31324bdbdf9fa04aaa240015daf32a2fd8fd7eff61db3d94447e453776fbf3fcf0f67be1cb3aa07b24d3978c85fc2f1e8b995f5794d4c9a SHA512 83d5380894b6a7f4d740d841e788a1f44034cbcb4e285911534f2645ef5e8563357f93615a76a2c1573a1af2bd20de62b79395cbd231cd311909bae5ad55da38 +EBUILD nss-3.51.1-r1.ebuild 9048 BLAKE2B 01e8547f889fd98894a91687a3951cd45c8d5876eb47535d14787bf9bd640315ecb411caa38223629a02448efbf68575075804de1a7675d25f3ba4eb92e6ad29 SHA512 222a970aaaa15c1f8b936c6f3448f3b7020eb8b27ba620d55fc50643ed489abb1807ebee94412fa2841b3cb55d099de4f134358dbc10dd2c31a9700622d78466 +EBUILD nss-3.51.ebuild 8973 BLAKE2B 38182caddafaa28743e15d70796912f523cdcb34ec6bf3fde4d8f5d147eab19cf3927aaf919a0f9f95ed71b3c4e45c8ae03bd60a9b75596d3428a5a661841e4e SHA512 631181fb368571224d9673fb2dfd70e01fe296c6ff27f5c4ffdb717e7ed2ac8b78ad7a17b29a93426f9e4815370b4c57391568c7ea7b2a141c36de3f3e2fb84f +EBUILD nss-3.52.1-r1.ebuild 9088 BLAKE2B 86e158b71bb6de2a079ea5e332ffc68b8bc59de3a37720406aa8d406d36b22ec557a70400ebc1743027649aa772c1261bebc85ec065e0a9e19aca1b4370b37bf SHA512 9c3321d6e520a5750ab25936263b05c1074a519f05d7cafd2f1cd58d4c01135cfbd6755d9faf82e7235c01752f870720743af640c3d8a7e091f138085635e6e5 +EBUILD nss-3.52.ebuild 9048 BLAKE2B 01e8547f889fd98894a91687a3951cd45c8d5876eb47535d14787bf9bd640315ecb411caa38223629a02448efbf68575075804de1a7675d25f3ba4eb92e6ad29 SHA512 222a970aaaa15c1f8b936c6f3448f3b7020eb8b27ba620d55fc50643ed489abb1807ebee94412fa2841b3cb55d099de4f134358dbc10dd2c31a9700622d78466 +EBUILD nss-3.53.1.ebuild 8928 BLAKE2B 96404c6a1607af4edc143f212c006d01e50d37b3abd0c37291836ebb4b8603d600f8a6a963752381b472f67f275487fa1948fab6cd088d2dd749c675136f399e SHA512 48f702a67bd438f420283370d68d4293310e7920d9a15b9ed2c089d7de63e4d2289e28133f493f8a5ab6414bd15e28fc26e0d96112cf7db09477e58e0764b0c7 MISC metadata.xml 515 BLAKE2B a63fb05a1a3e1b06f929f963ab0794ec1230e89903fc97a7c7db81a0b3c7b7e8b9277eaa7440f8929738ec0f805d8a8dd51c8262e569fb9be2fa0938b08ad7a2 SHA512 6bec952825416ba0ab8282669483eb75935f6b4a3052e0f78dad911c0246b8d8ce245c86cbd82b292d49338848fa50fb2009fb4a9def1ac8d81bf9a3320cd2b0 diff --git a/dev-libs/nss/files/nss-3.53-gentoo-fixups.patch b/dev-libs/nss/files/nss-3.53-gentoo-fixups.patch new file mode 100644 index 000000000000..2d8bdb6f5a31 --- /dev/null +++ b/dev-libs/nss/files/nss-3.53-gentoo-fixups.patch @@ -0,0 +1,290 @@ +From 1b3c48499abb000d708abe5f05413c1f4155e086 Mon Sep 17 00:00:00 2001 +From: Jory Pratt <anarchy@gentoo.org> +Date: Mon, 8 Jun 2020 12:22:29 -0500 +Subject: [PATCH] Add pkg-config and nss-config for Gentoo + +--- + Makefile | 15 +---- + config/Makefile | 40 ++++++++++++ + config/nss-config.in | 145 +++++++++++++++++++++++++++++++++++++++++++ + config/nss.pc.in | 12 ++++ + manifest.mn | 2 +- + 5 files changed, 200 insertions(+), 14 deletions(-) + create mode 100644 config/Makefile + create mode 100644 config/nss-config.in + create mode 100644 config/nss.pc.in + +diff --git a/Makefile b/Makefile +index eb4ed1a..f979d90 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,6 +4,8 @@ + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + ++default: nss_build_all ++ + ####################################################################### + # (1) Include initial platform-independent assignments (MANDATORY). # + ####################################################################### +@@ -48,12 +50,9 @@ include $(CORE_DEPTH)/coreconf/rules.mk + ####################################################################### + + nss_build_all: +- $(MAKE) build_nspr + $(MAKE) all +- $(MAKE) latest + + nss_clean_all: +- $(MAKE) clobber_nspr + $(MAKE) clobber + + NSPR_CONFIG_STATUS = $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/config.status +@@ -138,16 +137,6 @@ $(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE) + --prefix='$(NSS_GYP_PREFIX)' + endif + +-build_nspr: $(NSPR_CONFIG_STATUS) +- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) +- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/pr/tests +- +-install_nspr: build_nspr +- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install +- +-clobber_nspr: $(NSPR_CONFIG_STATUS) +- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) clobber +- + build_docs: + $(MAKE) -C $(CORE_DEPTH)/doc + +diff --git a/config/Makefile b/config/Makefile +new file mode 100644 +index 0000000..aaf1991 +--- /dev/null ++++ b/config/Makefile +@@ -0,0 +1,40 @@ ++CORE_DEPTH = .. ++DEPTH = .. ++ ++include $(CORE_DEPTH)/coreconf/config.mk ++ ++NSS_MAJOR_VERSION = $(shell grep -F "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}') ++NSS_MINOR_VERSION = $(shell grep -F "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}') ++NSS_PATCH_VERSION = $(shell grep -F "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}') ++PREFIX = /usr ++ ++all: export libs ++ ++export: ++ # Create the nss.pc file ++ mkdir -p $(DIST)/lib/pkgconfig ++ sed -e "s,@prefix@,$(PREFIX)," \ ++ -e "s,@exec_prefix@,\$${prefix}," \ ++ -e "s,@libdir@,\$${prefix}/lib64," \ ++ -e "s,@includedir@,\$${prefix}/include/nss," \ ++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \ ++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \ ++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \ ++ nss.pc.in > nss.pc ++ chmod 0644 nss.pc ++ ln -sf ../../../../config/nss.pc $(DIST)/lib/pkgconfig ++ ++ # Create the nss-config script ++ mkdir -p $(DIST)/bin ++ sed -e "s,@prefix@,$(PREFIX)," \ ++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \ ++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \ ++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \ ++ nss-config.in > nss-config ++ chmod 0755 nss-config ++ ln -sf ../../../config/nss-config $(DIST)/bin ++ ++libs: ++ ++dummy: all export libs ++ +diff --git a/config/nss-config.in b/config/nss-config.in +new file mode 100644 +index 0000000..3a957b8 +--- /dev/null ++++ b/config/nss-config.in +@@ -0,0 +1,145 @@ ++#!/bin/sh ++ ++prefix=@prefix@ ++ ++major_version=@NSS_MAJOR_VERSION@ ++minor_version=@NSS_MINOR_VERSION@ ++patch_version=@NSS_PATCH_VERSION@ ++ ++usage() ++{ ++ cat <<EOF ++Usage: nss-config [OPTIONS] [LIBRARIES] ++Options: ++ [--prefix[=DIR]] ++ [--exec-prefix[=DIR]] ++ [--includedir[=DIR]] ++ [--libdir[=DIR]] ++ [--version] ++ [--libs] ++ [--cflags] ++Dynamic Libraries: ++ nss ++ ssl ++ smime ++ nssutil ++EOF ++ exit $1 ++} ++ ++if test $# -eq 0; then ++ usage 1 1>&2 ++fi ++ ++lib_ssl=yes ++lib_smime=yes ++lib_nss=yes ++lib_nssutil=yes ++ ++while test $# -gt 0; do ++ case "$1" in ++ -*=*) optarg=$(echo "$1" | sed 's/[-_a-zA-Z0-9]*=//') ;; ++ *) optarg= ;; ++ esac ++ ++ case $1 in ++ --prefix=*) ++ prefix=${optarg} ++ ;; ++ --prefix) ++ echo_prefix=yes ++ ;; ++ --exec-prefix=*) ++ exec_prefix=${optarg} ++ ;; ++ --exec-prefix) ++ echo_exec_prefix=yes ++ ;; ++ --includedir=*) ++ includedir=${optarg} ++ ;; ++ --includedir) ++ echo_includedir=yes ++ ;; ++ --libdir=*) ++ libdir=${optarg} ++ ;; ++ --libdir) ++ echo_libdir=yes ++ ;; ++ --version) ++ echo ${major_version}.${minor_version}.${patch_version} ++ ;; ++ --cflags) ++ echo_cflags=yes ++ ;; ++ --libs) ++ echo_libs=yes ++ ;; ++ ssl) ++ lib_ssl=yes ++ ;; ++ smime) ++ lib_smime=yes ++ ;; ++ nss) ++ lib_nss=yes ++ ;; ++ nssutil) ++ lib_nssutil=yes ++ ;; ++ *) ++ usage 1 1>&2 ++ ;; ++ esac ++ shift ++done ++ ++# Set variables that may be dependent upon other variables ++if test -z "${exec_prefix}"; then ++ exec_prefix=$(pkg-config --variable=exec_prefix nss) ++fi ++if test -z "${includedir}"; then ++ includedir=$(pkg-config --variable=includedir nss) ++fi ++if test -z "${libdir}"; then ++ libdir=$(pkg-config --variable=libdir nss) ++fi ++ ++if test "${echo_prefix}" = "yes"; then ++ echo ${prefix} ++fi ++ ++if test "${echo_exec_prefix}" = "yes"; then ++ echo ${exec_prefix} ++fi ++ ++if test "${echo_includedir}" = "yes"; then ++ echo ${includedir} ++fi ++ ++if test "${echo_libdir}" = "yes"; then ++ echo ${libdir} ++fi ++ ++if test "${echo_cflags}" = "yes"; then ++ echo -I${includedir} ++fi ++ ++if test "${echo_libs}" = "yes"; then ++ libdirs="" ++ if test -n "${lib_ssl}"; then ++ libdirs="${libdirs} -lssl${major_version}" ++ fi ++ if test -n "${lib_smime}"; then ++ libdirs="${libdirs} -lsmime${major_version}" ++ fi ++ if test -n "${lib_nss}"; then ++ libdirs="${libdirs} -lnss${major_version}" ++ fi ++ if test -n "${lib_nssutil}"; then ++ libdirs="${libdirs} -lnssutil${major_version}" ++ fi ++ echo ${libdirs} ++fi ++ +diff --git a/config/nss.pc.in b/config/nss.pc.in +new file mode 100644 +index 0000000..03f1e39 +--- /dev/null ++++ b/config/nss.pc.in +@@ -0,0 +1,12 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: NSS ++Description: Network Security Services ++Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@ ++Requires: nspr >= 4.25 ++Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3 ++Cflags: -I${includedir} ++ +diff --git a/manifest.mn b/manifest.mn +index dada8ab..72dc9b3 100644 +--- a/manifest.mn ++++ b/manifest.mn +@@ -10,7 +10,7 @@ IMPORTS = nspr20/v4.8 \ + + RELEASE = nss + +-DIRS = coreconf lib cmd cpputil gtests ++DIRS = coreconf lib cmd cpputil config + + lib: coreconf + cmd: lib +-- +2.26.2 + diff --git a/dev-libs/nss/nss-3.51.1.ebuild b/dev-libs/nss/nss-3.51.1-r1.ebuild index 61acd9960f9b..2c01890c4d30 100644 --- a/dev-libs/nss/nss-3.51.1.ebuild +++ b/dev-libs/nss/nss-3.51.1-r1.ebuild @@ -22,7 +22,7 @@ RDEPEND=" >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}] >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}] >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] - >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] + virtual/pkgconfig " DEPEND="${RDEPEND}" diff --git a/dev-libs/nss/nss-3.51.ebuild b/dev-libs/nss/nss-3.51.ebuild index f3bc78472679..25170cb99d38 100644 --- a/dev-libs/nss/nss-3.51.ebuild +++ b/dev-libs/nss/nss-3.51.ebuild @@ -21,7 +21,7 @@ RDEPEND=" >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}] >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}] >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] - >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] + virtual/pkgconfig " DEPEND="${RDEPEND}" diff --git a/dev-libs/nss/nss-3.52.1-r1.ebuild b/dev-libs/nss/nss-3.52.1-r1.ebuild index 0f733991c195..fcd9c6e73a80 100644 --- a/dev-libs/nss/nss-3.52.1-r1.ebuild +++ b/dev-libs/nss/nss-3.52.1-r1.ebuild @@ -22,7 +22,7 @@ RDEPEND=" >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}] >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}] >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] - >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] + virtual/pkgconfig " DEPEND="${RDEPEND}" diff --git a/dev-libs/nss/nss-3.52.ebuild b/dev-libs/nss/nss-3.52.ebuild index 61acd9960f9b..2c01890c4d30 100644 --- a/dev-libs/nss/nss-3.52.ebuild +++ b/dev-libs/nss/nss-3.52.ebuild @@ -22,7 +22,7 @@ RDEPEND=" >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}] >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}] >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] - >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] + virtual/pkgconfig " DEPEND="${RDEPEND}" diff --git a/dev-libs/nss/nss-3.53.1.ebuild b/dev-libs/nss/nss-3.53.1.ebuild new file mode 100644 index 000000000000..df2971ed709b --- /dev/null +++ b/dev-libs/nss/nss-3.53.1.ebuild @@ -0,0 +1,350 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit eutils flag-o-matic multilib toolchain-funcs multilib-minimal + +NSPR_VER="4.25" +RTM_NAME="NSS_${PV//./_}_RTM" + +DESCRIPTION="Mozilla's Network Security Services library that implements PKI support" +HOMEPAGE="http://www.mozilla.org/projects/security/pki/nss/" +SRC_URI="https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz + cacert? ( https://dev.gentoo.org/~axs/distfiles/${PN}-cacert-class1-class3.patch )" + +LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +IUSE="cacert utils" +# pkg-config called by nss-config -> virtual/pkgconfig in RDEPEND +RDEPEND=" + >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}] + >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}] + >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] + virtual/pkgconfig +" +DEPEND="${RDEPEND}" + +RESTRICT="test" + +S="${WORKDIR}/${P}/${PN}" + +MULTILIB_CHOST_TOOLS=( + /usr/bin/nss-config +) + +PATCHES=( + # Custom changes for gentoo + "${FILESDIR}/${PN}-3.53-gentoo-fixups.patch" + "${FILESDIR}/${PN}-3.21-gentoo-fixup-warnings.patch" + "${FILESDIR}/${PN}-3.23-hppa-byte_order.patch" +) + +src_prepare() { + if use cacert ; then #521462 + PATCHES+=( + "${DISTDIR}/${PN}-cacert-class1-class3.patch" + ) + fi + + default + + pushd coreconf >/dev/null || die + # hack nspr paths + echo 'INCLUDES += -I$(DIST)/include/dbm' \ + >> headers.mk || die "failed to append include" + + # modify install path + sed -e '/CORE_DEPTH/s:SOURCE_PREFIX.*$:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \ + -i source.mk || die + + # Respect LDFLAGS + sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk + popd >/dev/null || die + + # Fix pkgconfig file for Prefix + sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \ + config/Makefile || die + + # use host shlibsign if need be #436216 + if tc-is-cross-compiler ; then + sed -i \ + -e 's:"${2}"/shlibsign:shlibsign:' \ + cmd/shlibsign/sign.sh || die + fi + + # dirty hack + sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \ + lib/ssl/config.mk || die + sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \ + cmd/platlibs.mk || die + + multilib_copy_sources + + strip-flags +} + +multilib_src_configure() { + # Ensure we stay multilib aware + sed -i -e "/@libdir@/ s:lib64:$(get_libdir):" config/Makefile || die +} + +nssarch() { + # Most of the arches are the same as $ARCH + local t=${1:-${CHOST}} + case ${t} in + aarch64*)echo "aarch64";; + hppa*) echo "parisc";; + i?86*) echo "i686";; + x86_64*) echo "x86_64";; + *) tc-arch ${t};; + esac +} + +nssbits() { + local cc cppflags="${1}CPPFLAGS" cflags="${1}CFLAGS" + if [[ ${1} == BUILD_ ]]; then + cc=$(tc-getBUILD_CC) + else + cc=$(tc-getCC) + fi + echo > "${T}"/test.c || die + ${cc} ${!cppflags} ${!cflags} -c "${T}"/test.c -o "${T}/${1}test.o" || die + case $(file "${T}/${1}test.o") in + *32-bit*x86-64*) echo USE_X32=1;; + *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;; + *32-bit*|*ppc*|*i386*) ;; + *) die "Failed to detect whether ${cc} builds 64bits or 32bits, disable distcc if you're using it, please";; + esac +} + +multilib_src_compile() { + # use ABI to determine bit'ness, or fallback if unset + local buildbits mybits + case "${ABI}" in + n32) mybits="USE_N32=1";; + x32) mybits="USE_X32=1";; + s390x|*64) mybits="USE_64=1";; + ${DEFAULT_ABI}) + einfo "Running compilation test to determine bit'ness" + mybits=$(nssbits) + ;; + esac + # bitness of host may differ from target + if tc-is-cross-compiler; then + buildbits=$(nssbits BUILD_) + fi + + local makeargs=( + CC="$(tc-getCC)" + CCC="$(tc-getCXX)" + AR="$(tc-getAR) rc \$@" + RANLIB="$(tc-getRANLIB)" + OPTIMIZER= + ${mybits} + ) + + # Take care of nspr settings #436216 + local myCPPFLAGS="${CPPFLAGS} $($(tc-getPKG_CONFIG) nspr --cflags)" + unset NSPR_INCLUDE_DIR + + export NSS_ALLOW_SSLKEYLOGFILE=1 + export NSS_ENABLE_WERROR=0 #567158 + export BUILD_OPT=1 + export NSS_USE_SYSTEM_SQLITE=1 + export NSDISTMODE=copy + export FREEBL_NO_DEPEND=1 + export FREEBL_LOWHASH=1 + export NSS_SEED_ONLY_DEV_URANDOM=1 + export USE_SYSTEM_ZLIB=1 + export ZLIB_LIBS=-lz + export ASFLAGS="" + + local d + + # Build the host tools first. + LDFLAGS="${BUILD_LDFLAGS}" \ + XCFLAGS="${BUILD_CFLAGS}" \ + NSPR_LIB_DIR="${T}/fakedir" \ + emake -j1 -C coreconf \ + CC="$(tc-getBUILD_CC)" \ + ${buildbits-${mybits}} + makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" ) + + # Then build the target tools. + for d in . lib/dbm ; do + CPPFLAGS="${myCPPFLAGS}" \ + XCFLAGS="${CFLAGS} ${CPPFLAGS}" \ + NSPR_LIB_DIR="${T}/fakedir" \ + emake -j1 "${makeargs[@]}" -C ${d} + done +} + +# Altering these 3 libraries breaks the CHK verification. +# All of the following cause it to break: +# - stripping +# - prelink +# - ELF signing +# http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html +# Either we have to NOT strip them, or we have to forcibly resign after +# stripping. +#local_libdir="$(get_libdir)" +#export STRIP_MASK=" +# */${local_libdir}/libfreebl3.so* +# */${local_libdir}/libnssdbm3.so* +# */${local_libdir}/libsoftokn3.so*" + +export NSS_CHK_SIGN_LIBS="freebl3 nssdbm3 softokn3" + +generate_chk() { + local shlibsign="$1" + local libdir="$2" + einfo "Resigning core NSS libraries for FIPS validation" + shift 2 + local i + for i in ${NSS_CHK_SIGN_LIBS} ; do + local libname=lib${i}.so + local chkname=lib${i}.chk + "${shlibsign}" \ + -i "${libdir}"/${libname} \ + -o "${libdir}"/${chkname}.tmp \ + && mv -f \ + "${libdir}"/${chkname}.tmp \ + "${libdir}"/${chkname} \ + || die "Failed to sign ${libname}" + done +} + +cleanup_chk() { + local libdir="$1" + shift 1 + local i + for i in ${NSS_CHK_SIGN_LIBS} ; do + local libfname="${libdir}/lib${i}.so" + # If the major version has changed, then we have old chk files. + [ ! -f "${libfname}" -a -f "${libfname}.chk" ] \ + && rm -f "${libfname}.chk" + done +} + +multilib_src_install() { + pushd dist >/dev/null || die + + dodir /usr/$(get_libdir) + cp -L */lib/*$(get_libname) "${ED}"/usr/$(get_libdir) || die "copying shared libs failed" + local i + for i in crmf freebl nssb nssckfw ; do + cp -L */lib/lib${i}.a "${ED}"/usr/$(get_libdir) || die "copying libs failed" + done + + # Install nss-config and pkgconfig file + dodir /usr/bin + cp -L */bin/nss-config "${ED}"/usr/bin || die + dodir /usr/$(get_libdir)/pkgconfig + cp -L */lib/pkgconfig/nss.pc "${ED}"/usr/$(get_libdir)/pkgconfig || die + + # create an nss-softokn.pc from nss.pc for libfreebl and some private headers + # bug 517266 + sed -e 's#Libs:#Libs: -lfreebl#' \ + -e 's#Cflags:#Cflags: -I${includedir}/private#' \ + */lib/pkgconfig/nss.pc >"${ED}"/usr/$(get_libdir)/pkgconfig/nss-softokn.pc \ + || die "could not create nss-softokn.pc" + + # all the include files + insinto /usr/include/nss + doins public/nss/*.{h,api} + insinto /usr/include/nss/private + doins private/nss/{blapi,alghmac,cmac}.h + + popd >/dev/null || die + + local f nssutils + # Always enabled because we need it for chk generation. + nssutils=( shlibsign ) + + if multilib_is_native_abi ; then + if use utils; then + # The tests we do not need to install. + #nssutils_test="bltest crmftest dbtest dertimetest + #fipstest remtest sdrtest" + # checkcert utils has been removed in nss-3.22: + # https://bugzilla.mozilla.org/show_bug.cgi?id=1187545 + # https://hg.mozilla.org/projects/nss/rev/df1729d37870 + # certcgi has been removed in nss-3.36: + # https://bugzilla.mozilla.org/show_bug.cgi?id=1426602 + nssutils+=( + addbuiltin + atob + baddbdir + btoa + certutil + cmsutil + conflict + crlutil + derdump + digest + makepqg + mangle + modutil + multinit + nonspr10 + ocspclnt + oidcalc + p7content + p7env + p7sign + p7verify + pk11mode + pk12util + pp + rsaperf + selfserv + signtool + signver + ssltap + strsclnt + symkeyutil + tstclnt + vfychain + vfyserv + ) + # install man-pages for utils (bug #516810) + doman doc/nroff/*.1 + fi + pushd dist/*/bin >/dev/null || die + for f in ${nssutils[@]}; do + dobin ${f} + done + popd >/dev/null || die + fi + + # Prelink breaks the CHK files. We don't have any reliable way to run + # shlibsign after prelink. + dodir /etc/prelink.conf.d + printf -- "-b ${EPREFIX}/usr/$(get_libdir)/lib%s.so\n" ${NSS_CHK_SIGN_LIBS} \ + > "${ED}"/etc/prelink.conf.d/nss.conf +} + +pkg_postinst() { + multilib_pkg_postinst() { + # We must re-sign the libraries AFTER they are stripped. + local shlibsign="${EROOT}/usr/bin/shlibsign" + # See if we can execute it (cross-compiling & such). #436216 + "${shlibsign}" -h >&/dev/null + if [[ $? -gt 1 ]] ; then + shlibsign="shlibsign" + fi + generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir) + } + + multilib_foreach_abi multilib_pkg_postinst +} + +pkg_postrm() { + multilib_pkg_postrm() { + cleanup_chk "${EROOT}"/usr/$(get_libdir) + } + + multilib_foreach_abi multilib_pkg_postrm +} |