diff --git a/crypto/gnutls/HISTORY b/crypto/gnutls/HISTORY
index 530cc28..71ed09d 100644
--- a/crypto/gnutls/HISTORY
+++ b/crypto/gnutls/HISTORY
@@ -1,3 +1,8 @@
+2011-10-29 Treeve Jelbert <treeve AT sourcemage.org>
+ * DETAILS: 3.0.4
+ * PREPARE: add 3.0 branch (new stable)
+ * DEPENDS: add LZMA, nettle for 3.0 branch
+
2011-10-14 Bor Kraljič <pyrobor AT ver.si>
* DETAILS: fixed long description wrap (scripted)
diff --git a/crypto/gnutls/PREPARE b/crypto/gnutls/PREPARE
index 66848fc..d26b8a4 100755
--- a/crypto/gnutls/PREPARE
+++ b/crypto/gnutls/PREPARE
@@ -13,4 +13,4 @@ if [ "$GNUTLS_OLD" == "n" ]; then
persistent_remove GNUTLS_OLD
fi
-config_query_list GNUTLS_BRANCH "Which branch of GnuTLS do you want to
build?" DEFAULT 1.0 1.2 1.4 1.6 2.0 2.2 2.4 2.6 2.8 2.10 2.12
+config_query_list GNUTLS_BRANCH "Which branch of GnuTLS do you want to
build?" DEFAULT 1.0 1.2 1.4 1.6 2.0 2.2 2.4 2.6 2.8 2.10 2.12 3.0
diff --git a/ftp/curl/HISTORY b/ftp/curl/HISTORY
index b74b860..b4c9025 100644
--- a/ftp/curl/HISTORY
+++ b/ftp/curl/HISTORY
@@ -1,3 +1,6 @@
+2011-10-19 Treeve Jelbert <treeve AT sourcemage.org>
+ * PRE_BUILD, gtls.patch: add upstream path for gnutls-3.x
+
2011-09-14 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: updated spell to 7.22.0
diff --git a/ftp/curl/PRE_BUILD b/ftp/curl/PRE_BUILD
new file mode 100755
index 0000000..2b3766c
--- /dev/null
+++ b/ftp/curl/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+patch -p1 < $SPELL_DIRECTORY/gtls.patch
diff --git a/ftp/curl/gtls.patch b/ftp/curl/gtls.patch
new file mode 100644
index 0000000..3fa097d
--- /dev/null
+++ b/ftp/curl/gtls.patch
@@ -0,0 +1,14 @@
+--- a/lib/gtls.c
++++ b/lib/gtls.c
+@@ -476,8 +476,10 @@ gtls_connect_step1(struct connectdata *conn,
+ gnutls_transport_set_push_function(session, Curl_gtls_push);
+ gnutls_transport_set_pull_function(session, Curl_gtls_pull);
+
++#if GNUTLS_VERSION_NUMBER < 0x020c00
+ /* lowat must be set to zero when using custom push and pull functions. */
+ gnutls_transport_set_lowat(session, 0);
++#endif
+
+ /* This might be a reconnect, so we check for a session ID in the cache
+ to speed up things */
+
[SM-Commit] GIT changes to master grimoire by Treeve Jelbert (284989948e7342bbcf44ccf957a30dfce68624c5),
Treeve Jelbert, 10/19/2011