New port: nettle
This is a complete port of nettle, a low-level cryptographic
library, except for the examples. Examples failed to build on
clang toolchain with an internal compiler error. We are
porting nettle 2.7 rather than 3.0 since gnutls does not
build against 3.0.
TEST=./build_all.sh nettle
Review URL: https://codereview.chromium.org/953493002
diff --git a/ports/nettle/build.sh b/ports/nettle/build.sh
new file mode 100644
index 0000000..e49e38c
--- /dev/null
+++ b/ports/nettle/build.sh
@@ -0,0 +1,15 @@
+# Copyright 2015 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+EXTRA_CONFIGURE_ARGS+=" --disable-assembler"
+
+if [ "${NACL_SHARED}" != "1" ]; then
+ EXTRA_CONFIGURE_ARGS+=" --disable-shared"
+fi
+
+EXECUTABLES="
+ ./tools/sexp-conv${NACL_EXEEXT}
+ ./tools/pkcs1-conv${NACL_EXEEXT}
+ ./tools/nettle-hash${NACL_EXEEXT}
+ ./tools/nettle-lfib-stream${NACL_EXEEXT}"
diff --git a/ports/nettle/nacl.patch b/ports/nettle/nacl.patch
new file mode 100644
index 0000000..db6fa43
--- /dev/null
+++ b/ports/nettle/nacl.patch
@@ -0,0 +1,24 @@
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -16,7 +16,7 @@ MKDIR_P = @MKDIR_P@
+
+ OPT_ASM_SOURCES = @OPT_ASM_SOURCES@
+
+-SUBDIRS = tools testsuite examples
++SUBDIRS = tools testsuite
+
+ include config.make
+
+diff --git a/tools/Makefile.in b/tools/Makefile.in
+--- a/tools/Makefile.in
++++ b/tools/Makefile.in
+@@ -23,7 +23,7 @@ TARGETS = sexp-conv$(EXEEXT) nettle-hash$(EXEEXT) nettle-lfib-stream$(EXEEXT) \
+
+ all: $(TARGETS)
+
+-getopt_OBJS = ../getopt.$(OBJEXT) ../getopt1.$(OBJEXT)
++getopt_OBJS =
+
+ sexp_conv_SOURCES = sexp-conv.c input.c output.c parse.c misc.c
+ pkcs1_conv_SOURCES = pkcs1-conv.c misc.c
diff --git a/ports/nettle/pkg_info b/ports/nettle/pkg_info
new file mode 100644
index 0000000..0147a5f
--- /dev/null
+++ b/ports/nettle/pkg_info
@@ -0,0 +1,6 @@
+NAME=nettle
+VERSION=2.7
+URL=ftp://ftp.gnu.org/gnu/nettle/nettle-2.7.tar.gz
+DEPENDS=(gmp)
+LICENSE=LGPL
+SHA1=e17de3678b987841e88a724b7d2f6856d97ab139