curl: build with GnuTLS support, add upstream patches

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-09-24 18:31:35 +02:00
parent 7de4f83cbb
commit 34de3a05e3
5 changed files with 221 additions and 5 deletions

View File

@ -23,7 +23,7 @@
. config/options $1
# link against librt because of undefined reference to 'clock_gettime'
LDFLAGS="$LDFLAGS -lrt -lrtmp"
LDFLAGS="$LDFLAGS -lrt -lm -lrtmp"
cd $PKG_BUILD
ac_cv_lib_rtmp_RTMP_Init=yes \
@ -69,12 +69,12 @@ ac_cv_header_librtmp_rtmp_h=yes \
--without-krb4 \
--without-spnego \
--without-gssapi \
--with-ssl \
--with-zlib \
--without-egd-socket \
--enable-thread \
--with-random=/dev/urandom \
--without-gnutls \
--with-gnutls="$SYSROOT_PREFIX/usr" \
--without-ssl \
--without-polarssl \
--without-nss \
--with-ca-bundle="$SSL_CERTIFICATES/cacert.pem" \

View File

@ -25,8 +25,8 @@ PKG_ARCH="any"
PKG_LICENSE="MIT"
PKG_SITE="http://curl.haxx.se"
PKG_URL="http://curl.haxx.se/download/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS="zlib openssl rtmpdump"
PKG_BUILD_DEPENDS="toolchain zlib openssl rtmpdump"
PKG_DEPENDS="zlib gnutls rtmpdump"
PKG_BUILD_DEPENDS="toolchain zlib gnutls rtmpdump"
PKG_PRIORITY="optional"
PKG_SECTION="web"
PKG_SHORTDESC="curl: Client and library for (HTTP, HTTPS, FTP, ...) transfers"

View File

@ -0,0 +1,38 @@
Description: Work around libtool --as-needed reordering bug
Origin: vendor
Bug-Debian: http://bugs.debian.org/347650
Forwarded: not-needed
Author: Alessandro Ghedini <al3xbio@gmail.com>
Reviewed-by: Alessandro Ghedini <al3xbio@gmail.com>
Last-Update: 2013-03-22
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -5800,6 +5800,11 @@
arg=$func_stripname_result
;;
+ -Wl,--as-needed|-Wl,--no-as-needed)
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
-Wl,*)
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
@@ -6163,6 +6168,15 @@
lib=
found=no
case $deplib in
+ -Wl,--as-needed|-Wl,--no-as-needed)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test "$linkmode,$pass" = "prog,link"; then

View File

@ -0,0 +1,30 @@
From 986c7949c0638bebb99bd08d63216433254c2185 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 6 Aug 2012 15:04:25 +0200
Subject: [PATCH] gtls: fix build failure by including nettle-specific headers
Bug: http://curl.haxx.se/bug/view.cgi?id=3554668
Reported by: Anthony G. Basile
---
lib/gtls.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/gtls.c b/lib/gtls.c
index d981ef1..c750a6f 100644
--- a/lib/gtls.c
+++ b/lib/gtls.c
@@ -34,7 +34,10 @@
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-#ifndef USE_GNUTLS_NETTLE
+#ifdef USE_GNUTLS_NETTLE
+#include <gnutls/crypto.h>
+#include <nettle/md5.h>
+#else
#include <gcrypt.h>
#endif
--
1.7.10.4

View File

@ -0,0 +1,148 @@
From 9f304291bd72aae66944cd7523707e1b88c6ad7b Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 6 Aug 2012 19:20:35 +0200
Subject: [PATCH] metalink: change code order to build with gnutls-nettle
Bug: http://curl.haxx.se/bug/view.cgi?id=3554668
Reported by: Anthony G. Basile
---
src/tool_metalink.c | 116 +++++++++++++++++++++++++--------------------------
1 file changed, 58 insertions(+), 58 deletions(-)
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index 5491815..3a24a15 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -82,64 +82,6 @@
return PARAM_NO_MEM; \
} WHILE_FALSE
-const digest_params MD5_DIGEST_PARAMS[] = {
- {
- (Curl_digest_init_func) MD5_Init,
- (Curl_digest_update_func) MD5_Update,
- (Curl_digest_final_func) MD5_Final,
- sizeof(MD5_CTX),
- 16
- }
-};
-
-const digest_params SHA1_DIGEST_PARAMS[] = {
- {
- (Curl_digest_init_func) SHA1_Init,
- (Curl_digest_update_func) SHA1_Update,
- (Curl_digest_final_func) SHA1_Final,
- sizeof(SHA_CTX),
- 20
- }
-};
-
-const digest_params SHA256_DIGEST_PARAMS[] = {
- {
- (Curl_digest_init_func) SHA256_Init,
- (Curl_digest_update_func) SHA256_Update,
- (Curl_digest_final_func) SHA256_Final,
- sizeof(SHA256_CTX),
- 32
- }
-};
-
-static const metalink_digest_def SHA256_DIGEST_DEF[] = {
- {"sha-256", SHA256_DIGEST_PARAMS}
-};
-
-static const metalink_digest_def SHA1_DIGEST_DEF[] = {
- {"sha-1", SHA1_DIGEST_PARAMS}
-};
-
-static const metalink_digest_def MD5_DIGEST_DEF[] = {
- {"md5", MD5_DIGEST_PARAMS}
-};
-
-/*
- * The alias of supported hash functions in the order by preference
- * (basically stronger hash comes first). We included "sha-256" and
- * "sha256". The former is the name defined in the IANA registry named
- * "Hash Function Textual Names". The latter is widely (and
- * historically) used in Metalink version 3.
- */
-static const metalink_digest_alias digest_aliases[] = {
- {"sha-256", SHA256_DIGEST_DEF},
- {"sha256", SHA256_DIGEST_DEF},
- {"sha-1", SHA1_DIGEST_DEF},
- {"sha1", SHA1_DIGEST_DEF},
- {"md5", MD5_DIGEST_DEF},
- {NULL, NULL}
-};
-
#ifdef USE_GNUTLS_NETTLE
static void MD5_Init(MD5_CTX *ctx)
@@ -251,6 +193,64 @@ static void SHA256_Final(unsigned char digest[32], SHA256_CTX *ctx)
#endif /* CRYPTO LIBS */
+const digest_params MD5_DIGEST_PARAMS[] = {
+ {
+ (Curl_digest_init_func) MD5_Init,
+ (Curl_digest_update_func) MD5_Update,
+ (Curl_digest_final_func) MD5_Final,
+ sizeof(MD5_CTX),
+ 16
+ }
+};
+
+const digest_params SHA1_DIGEST_PARAMS[] = {
+ {
+ (Curl_digest_init_func) SHA1_Init,
+ (Curl_digest_update_func) SHA1_Update,
+ (Curl_digest_final_func) SHA1_Final,
+ sizeof(SHA_CTX),
+ 20
+ }
+};
+
+const digest_params SHA256_DIGEST_PARAMS[] = {
+ {
+ (Curl_digest_init_func) SHA256_Init,
+ (Curl_digest_update_func) SHA256_Update,
+ (Curl_digest_final_func) SHA256_Final,
+ sizeof(SHA256_CTX),
+ 32
+ }
+};
+
+static const metalink_digest_def SHA256_DIGEST_DEF[] = {
+ {"sha-256", SHA256_DIGEST_PARAMS}
+};
+
+static const metalink_digest_def SHA1_DIGEST_DEF[] = {
+ {"sha-1", SHA1_DIGEST_PARAMS}
+};
+
+static const metalink_digest_def MD5_DIGEST_DEF[] = {
+ {"md5", MD5_DIGEST_PARAMS}
+};
+
+/*
+ * The alias of supported hash functions in the order by preference
+ * (basically stronger hash comes first). We included "sha-256" and
+ * "sha256". The former is the name defined in the IANA registry named
+ * "Hash Function Textual Names". The latter is widely (and
+ * historically) used in Metalink version 3.
+ */
+static const metalink_digest_alias digest_aliases[] = {
+ {"sha-256", SHA256_DIGEST_DEF},
+ {"sha256", SHA256_DIGEST_DEF},
+ {"sha-1", SHA1_DIGEST_DEF},
+ {"sha1", SHA1_DIGEST_DEF},
+ {"md5", MD5_DIGEST_DEF},
+ {NULL, NULL}
+};
+
digest_context *Curl_digest_init(const digest_params *dparams)
{
digest_context *ctxt;
--
1.7.10.4