* [ptxdist] [PATCH 2/2] nss: new package
2016-05-18 12:58 [ptxdist] [PATCH 1/2] nspr: new package Lucas Stach
@ 2016-05-18 12:58 ` Lucas Stach
0 siblings, 0 replies; 2+ messages in thread
From: Lucas Stach @ 2016-05-18 12:58 UTC (permalink / raw)
To: ptxdist
Network Security Services (NSS) is a set of libraries designed to support
cross-platform development of security-enabled client and server
applications. Applications built with NSS can support SSL v3, TLS, PKCS #5,
PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other
security standards.
Patches grabbed from openembedded.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
.../0001-Fix-build-failure-on-opensuse-13.1.patch | 23 ++++
.../0002-nss-fix-incorrect-shebang-of-perl.patch | 110 +++++++++++++++++++
.../nss-3.21.1/0003-nss-fix-nsinstall-build.patch | 43 ++++++++
.../0004-nss-fix-support-cross-compiling.patch | 71 ++++++++++++
.../0005-nss-no-rpath-for-cross-compiling.patch | 26 +++++
patches/nss-3.21.1/0006-add-nss.pc.in.patch | 26 +++++
patches/nss-3.21.1/series | 9 ++
rules/nss.in | 13 +++
rules/nss.make | 122 +++++++++++++++++++++
9 files changed, 443 insertions(+)
create mode 100644 patches/nss-3.21.1/0001-Fix-build-failure-on-opensuse-13.1.patch
create mode 100644 patches/nss-3.21.1/0002-nss-fix-incorrect-shebang-of-perl.patch
create mode 100644 patches/nss-3.21.1/0003-nss-fix-nsinstall-build.patch
create mode 100644 patches/nss-3.21.1/0004-nss-fix-support-cross-compiling.patch
create mode 100644 patches/nss-3.21.1/0005-nss-no-rpath-for-cross-compiling.patch
create mode 100644 patches/nss-3.21.1/0006-add-nss.pc.in.patch
create mode 100644 patches/nss-3.21.1/series
create mode 100644 rules/nss.in
create mode 100644 rules/nss.make
diff --git a/patches/nss-3.21.1/0001-Fix-build-failure-on-opensuse-13.1.patch b/patches/nss-3.21.1/0001-Fix-build-failure-on-opensuse-13.1.patch
new file mode 100644
index 000000000000..ac347ed4509f
--- /dev/null
+++ b/patches/nss-3.21.1/0001-Fix-build-failure-on-opensuse-13.1.patch
@@ -0,0 +1,23 @@
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 18 Jan 2016 18:26:16 +0000
+Subject: [PATCH] Fix build failure on opensuse 13.1
+
+Upstream-Status: Inappropriate [gcc 4.8 specific issue]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ nss/cmd/modutil/install-ds.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nss/cmd/modutil/install-ds.h b/nss/cmd/modutil/install-ds.h
+index 3a3afb31494b..433efe095931 100644
+--- a/nss/cmd/modutil/install-ds.h
++++ b/nss/cmd/modutil/install-ds.h
+@@ -243,7 +243,7 @@ struct Pk11Install_Info_str {
+ Pk11Install_Info*
+ Pk11Install_Info_new();
+ void
+-Pk11Install_Info_init();
++Pk11Install_Info_init(Pk11Install_Info* _this);
+ void
+ Pk11Install_Info_delete(Pk11Install_Info* _this);
+ /*// Returns NULL for success, error message if parse error.*/
diff --git a/patches/nss-3.21.1/0002-nss-fix-incorrect-shebang-of-perl.patch b/patches/nss-3.21.1/0002-nss-fix-incorrect-shebang-of-perl.patch
new file mode 100644
index 000000000000..3ef149af7caf
--- /dev/null
+++ b/patches/nss-3.21.1/0002-nss-fix-incorrect-shebang-of-perl.patch
@@ -0,0 +1,110 @@
+From: unknown author <unknown.author@example.com>
+Date: Tue, 12 Apr 2016 11:33:52 +0200
+Subject: [PATCH] nss-fix-incorrect-shebang-of-perl
+
+Replace incorrect shebang of perl with `#!/usr/bin/env perl'.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ nss/cmd/smimetools/smime | 2 +-
+ nss/coreconf/cpdist.pl | 2 +-
+ nss/coreconf/import.pl | 2 +-
+ nss/coreconf/jniregen.pl | 2 +-
+ nss/coreconf/outofdate.pl | 2 +-
+ nss/coreconf/release.pl | 2 +-
+ nss/coreconf/version.pl | 2 +-
+ nss/tests/clean_tbx | 2 +-
+ nss/tests/path_uniq | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/nss/cmd/smimetools/smime b/nss/cmd/smimetools/smime
+index 634c3fbb49b2..d6315c6e4eae 100755
+--- a/nss/cmd/smimetools/smime
++++ b/nss/cmd/smimetools/smime
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/cpdist.pl b/nss/coreconf/cpdist.pl
+index 800edfb46692..75293de63078 100755
+--- a/nss/coreconf/cpdist.pl
++++ b/nss/coreconf/cpdist.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/import.pl b/nss/coreconf/import.pl
+index dd2d177f6854..aeb6b3954940 100755
+--- a/nss/coreconf/import.pl
++++ b/nss/coreconf/import.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/jniregen.pl b/nss/coreconf/jniregen.pl
+index 2039180546a2..1dc4e9da2d7d 100755
+--- a/nss/coreconf/jniregen.pl
++++ b/nss/coreconf/jniregen.pl
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/outofdate.pl b/nss/coreconf/outofdate.pl
+index 33d80bb3318e..d6d4c9d9ab5e 100755
+--- a/nss/coreconf/outofdate.pl
++++ b/nss/coreconf/outofdate.pl
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/release.pl b/nss/coreconf/release.pl
+index 7cde19d5eb0f..9ea2c90ca0ee 100755
+--- a/nss/coreconf/release.pl
++++ b/nss/coreconf/release.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/version.pl b/nss/coreconf/version.pl
+index d2a494289b20..3ba7323b7502 100644
+--- a/nss/coreconf/version.pl
++++ b/nss/coreconf/version.pl
+@@ -1,4 +1,4 @@
+-#!/usr/sbin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/tests/clean_tbx b/nss/tests/clean_tbx
+index 4de955576cab..c15a069623f8 100755
+--- a/nss/tests/clean_tbx
++++ b/nss/tests/clean_tbx
+@@ -1,4 +1,4 @@
+-#! /bin/perl
++#!/usr/bin/env perl
+
+ #######################################################################
+ #
+diff --git a/nss/tests/path_uniq b/nss/tests/path_uniq
+index f29f60a00e76..850332a6cb92 100755
+--- a/nss/tests/path_uniq
++++ b/nss/tests/path_uniq
+@@ -1,4 +1,4 @@
+-#! /bin/perl
++#!/usr/bin/env perl
+
+ ########################################################################
+ #
diff --git a/patches/nss-3.21.1/0003-nss-fix-nsinstall-build.patch b/patches/nss-3.21.1/0003-nss-fix-nsinstall-build.patch
new file mode 100644
index 000000000000..0ae8e58d8d63
--- /dev/null
+++ b/patches/nss-3.21.1/0003-nss-fix-nsinstall-build.patch
@@ -0,0 +1,43 @@
+From: unknown author <unknown.author@example.com>
+Date: Tue, 12 Apr 2016 11:33:52 +0200
+Subject: [PATCH] nss-fix-nsinstall-build
+
+Fix nss multilib build on openSUSE 11.x 32bit
+
+While building lib64-nss on openSUSE 11.x 32bit, the nsinstall will
+fail with error:
+
+* nsinstall.c:1:0: sorry, unimplemented: 64-bit mode not compiled
+
+It caused by the '-m64' option which passed to host gcc.
+
+The nsinstall was built first while nss starting to build, it only runs
+on host to install built files, it doesn't need any cross-compling or
+multilib build options. Just clean the ARCHFLAG and LDFLAGS to fix this
+error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+===================================================
+---
+ nss/coreconf/nsinstall/Makefile | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
+index 1850bcb93cf7..5aee84f22ac7 100644
+--- a/nss/coreconf/nsinstall/Makefile
++++ b/nss/coreconf/nsinstall/Makefile
+@@ -18,6 +18,12 @@ INTERNAL_TOOLS = 1
+
+ include $(DEPTH)/coreconf/config.mk
+
++# nsinstall is unfit for cross-compiling/multilib-build since it was
++# always run on local host to install built files. This change intends
++# to clean the '-m64' from ARCHFLAG and LDFLAGS.
++ARCHFLAG =
++LDFLAGS =
++
+ ifeq (,$(filter-out OS2 WIN%,$(OS_TARGET)))
+ PROGRAM =
+ else
diff --git a/patches/nss-3.21.1/0004-nss-fix-support-cross-compiling.patch b/patches/nss-3.21.1/0004-nss-fix-support-cross-compiling.patch
new file mode 100644
index 000000000000..0b7274734849
--- /dev/null
+++ b/patches/nss-3.21.1/0004-nss-fix-support-cross-compiling.patch
@@ -0,0 +1,71 @@
+From: unknown author <unknown.author@example.com>
+Date: Tue, 12 Apr 2016 11:33:53 +0200
+Subject: [PATCH] nss-fix-support-cross-compiling
+
+Let some make variables be assigned from outside makefile.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Inappropriate [configuration]
+---
+ nss/coreconf/Linux.mk | 12 +++++++++++-
+ nss/coreconf/arch.mk | 2 +-
+ nss/lib/freebl/Makefile | 6 ++++++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk
+index 7a2411876dd9..a905d60a2968 100644
+--- a/nss/coreconf/Linux.mk
++++ b/nss/coreconf/Linux.mk
+@@ -17,11 +17,21 @@ ifeq ($(USE_PTHREADS),1)
+ IMPL_STRATEGY = _PTH
+ endif
+
++ifndef CC
+ CC = gcc
++endif
++
++ifdef CXX
++CCC = $(CXX)
++else
+ CCC = g++
++endif
++
++ifndef RANLIB
+ RANLIB = ranlib
++endif
+
+-DEFAULT_COMPILER = gcc
++DEFAULT_COMPILER = $(CC)
+
+ ifeq ($(OS_TARGET),Android)
+ ifndef ANDROID_NDK
+diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
+index 62ba8d5dd351..56cb6e68a8af 100644
+--- a/nss/coreconf/arch.mk
++++ b/nss/coreconf/arch.mk
+@@ -37,7 +37,7 @@ OS_TEST := $(shell uname -m)
+ ifeq ($(OS_TEST),i86pc)
+ OS_RELEASE := $(shell uname -r)_$(OS_TEST)
+ else
+- OS_RELEASE := $(shell uname -r)
++ OS_RELEASE ?= $(shell uname -r)
+ endif
+
+ #
+diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
+index ab0b1e571771..9311038dee54 100644
+--- a/nss/lib/freebl/Makefile
++++ b/nss/lib/freebl/Makefile
+@@ -36,6 +36,12 @@ ifdef USE_64
+ DEFINES += -DNSS_USE_64
+ endif
+
++ifeq ($(OS_TEST),mips)
++ifndef USE_64
++ DEFINES += -DNS_PTR_LE_32
++endif
++endif
++
+ ifdef USE_ABI32_FPU
+ DEFINES += -DNSS_USE_ABI32_FPU
+ endif
diff --git a/patches/nss-3.21.1/0005-nss-no-rpath-for-cross-compiling.patch b/patches/nss-3.21.1/0005-nss-no-rpath-for-cross-compiling.patch
new file mode 100644
index 000000000000..6cc0ed568ef3
--- /dev/null
+++ b/patches/nss-3.21.1/0005-nss-no-rpath-for-cross-compiling.patch
@@ -0,0 +1,26 @@
+From: unknown author <unknown.author@example.com>
+Date: Tue, 12 Apr 2016 11:33:53 +0200
+Subject: [PATCH] nss-no-rpath-for-cross-compiling
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Inappropriate [configuration]
+---
+ nss/cmd/platlibs.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
+index 812a27fdc5c1..5c4ba6b44983 100644
+--- a/nss/cmd/platlibs.mk
++++ b/nss/cmd/platlibs.mk
+@@ -18,9 +18,9 @@ endif
+
+ ifeq ($(OS_ARCH), Linux)
+ ifeq ($(USE_64), 1)
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
++#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
+ else
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
++#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
+ endif
+ endif
+
diff --git a/patches/nss-3.21.1/0006-add-nss.pc.in.patch b/patches/nss-3.21.1/0006-add-nss.pc.in.patch
new file mode 100644
index 000000000000..06371a2c595f
--- /dev/null
+++ b/patches/nss-3.21.1/0006-add-nss.pc.in.patch
@@ -0,0 +1,26 @@
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Tue, 12 Apr 2016 11:36:26 +0200
+Subject: [PATCH] add nss.pc.in
+
+---
+ nss/nss.pc.in | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+ create mode 100644 nss/nss.pc.in
+
+diff --git a/nss/nss.pc.in b/nss/nss.pc.in
+new file mode 100644
+index 000000000000..36f78dca4de3
+--- /dev/null
++++ b/nss/nss.pc.in
+@@ -0,0 +1,11 @@
++prefix=PTXPREFIX
++exec_prefix=PTXEXECPREFIX
++libdir=${prefix}/lib
++includedir=${prefix}/include/nss3
++
++Name: NSS
++Description: Network Security Services
++Version: %NSS_VERSION%
++Requires: nspr >= %NSPR_VERSION%
++Libs: -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
++Cflags: -I${prefix}/include/nss3
diff --git a/patches/nss-3.21.1/series b/patches/nss-3.21.1/series
new file mode 100644
index 000000000000..3401dc7f2cda
--- /dev/null
+++ b/patches/nss-3.21.1/series
@@ -0,0 +1,9 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Fix-build-failure-on-opensuse-13.1.patch
+0002-nss-fix-incorrect-shebang-of-perl.patch
+0003-nss-fix-nsinstall-build.patch
+0004-nss-fix-support-cross-compiling.patch
+0005-nss-no-rpath-for-cross-compiling.patch
+0006-add-nss.pc.in.patch
+# f6f5fd9b27dfac1528a4527f1424774d - git-ptx-patches magic
diff --git a/rules/nss.in b/rules/nss.in
new file mode 100644
index 000000000000..b907009bfa2f
--- /dev/null
+++ b/rules/nss.in
@@ -0,0 +1,13 @@
+## SECTION=networking
+
+config NSS
+ tristate
+ prompt "nss "
+ select NSPR
+ select SQLITE
+ help
+ Network Security Services (NSS) is a set of libraries designed to
+ support cross-platform development of security-enabled client and
+ server applications. Applications built with NSS can support
+ SSL v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME,
+ X.509 v3 certificates, and other security standards.
diff --git a/rules/nss.make b/rules/nss.make
new file mode 100644
index 000000000000..1b6214f0e65c
--- /dev/null
+++ b/rules/nss.make
@@ -0,0 +1,122 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2016 by Lucas Stach <l.stach@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_NSS) += nss
+
+#
+# Paths and names
+#
+NSS_VERSION := 3.21.1
+NSS_MD5 := 5994c5cd300485c21e1b2314abfac65e
+NSS := nss-$(NSS_VERSION)
+NSS_SUFFIX := tar.gz
+NSS_URL := http://ftp.mozilla.org/pub/security/nss/releases/NSS_3_21_1_RTM/src/$(NSS).$(NSS_SUFFIX)
+NSS_SOURCE := $(SRCDIR)/$(NSS).$(NSS_SUFFIX)
+NSS_DIR := $(BUILDDIR)/$(NSS)
+NSS_LICENSE := MPL-2.0
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+ifdef PTXCONF_ARCH_X86
+NSS_ARCH := x86
+endif
+ifdef PTXCONF_ARCH_X86
+NSS_ARCH := x86_64
+endif
+ifdef PTXCONF_ARCH_ARM
+NSS_ARCH := arm
+endif
+ifdef PTXCONF_ARCH_PPC
+NSS_ARCH := ppc
+endif
+
+NSS_CONF_TOOL := NO
+
+NSS_COMPILE_ENV := \
+ $(CROSS_ENV) \
+ CROSS_COMPILE=1 \
+ NATIVE_CC="gcc" \
+ BUILD_OPT=1 \
+ FREEBL_NO_DEPEND=1 \
+ FREEBL_LOWHASH=1 \
+ MOZILLA_CLIENT=1 \
+ NS_USE_GCC=1 \
+ NSS_USE_SYSTEM_SQLITE=1 \
+ NSS_ENABLE_ECC=1 \
+ OS_RELEASE=3.4 \
+ OS_TARGET=Linux \
+ OS_ARCH=Linux \
+ OS_TEST=$(NSS_ARCH) \
+ NSPR_INCLUDE_DIR=$(SYSROOT)/usr/include/nspr
+
+NSS_MAKE_OPT := \
+ CCC=$(CROSS_CC) \
+ OS_TEST=${OS_TEST}
+
+NSS_MAKE_PAR := NO
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+$(STATEDIR)/nss.compile:
+ @$(call targetinfo)
+ @$(call compile, NSS, -C nss OS_TEST=$(NSS_ARCH))
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/nss.install:
+ @$(call targetinfo)
+ @$(call compile, NSS, -C nss OS_TEST=$(NSS_ARCH) install)
+
+ install -d $(NSS_PKGDIR)/usr/lib
+
+ @for file in `find $(NSS_DIR)/dist -name '*.so'`; do \
+ echo "Installing `basename $$file`..."; \
+ cp $$file $(NSS_PKGDIR)/usr/lib/; \
+ done
+
+ install -d $(NSS_PKGDIR)/usr/lib/pkgconfig/
+ sed 's/%NSS_VERSION%/$(NSS_VERSION)/' $(NSS_DIR)/nss/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > $(NSS_PKGDIR)/usr/lib/pkgconfig/nss.pc
+
+ install -d $(SYSROOT)/usr/include/nss3
+ install -m 644 -t $(SYSROOT)/usr/include/nss3 $(NSS_DIR)/dist/public/nss/*
+ install -m 644 -t $(SYSROOT)/usr/include/nss3 $(NSS_DIR)/dist/private/nss/*
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/nss.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, nss)
+ @$(call install_fixup, nss,PRIORITY,optional)
+ @$(call install_fixup, nss,SECTION,base)
+ @$(call install_fixup, nss,AUTHOR,"Lucas Stach <l.stach@pengutronix.de>")
+ @$(call install_fixup, nss,DESCRIPTION,missing)
+
+ @@for file in `find $(NSS_PKGDIR)/usr/lib -name '*.so'`; do \
+ $(call install_copy, nss, 0, 0, 0755, -, /usr/lib/`basename $$file`); \
+ done
+
+ @$(call install_finish, nss)
+
+ @$(call touch)
+
+# vim: syntax=make
--
2.8.0.rc3
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 2+ messages in thread