Subject: Re: [bug#29738] Add support for HTTP/2 to curl

From: Mark Meyer <[email-masked]>
Date: Sun, 17 Dec 2017 09:35:18 +0100

Hi Ricardo,
thanks for you feedback. The closure changes from 223.7 MiB to 224.5
MiB.

The patches attached apply cleanly to core-updates and split the change
into two components.

Cheers, Mark

On Sun, Dec 17, 2017, at 07:31, Ricardo Wurmus wrote:
> 
> Hi Mark,
> 
> > this patch adds HTTP/2 support to curl, this is a prerequisite to
> > closing bug#29733. I am aware that this will trigger about 2500 rebuilt
> > packages, but having HTTP/2 in curl seems to be worth the hassle.
> 
> We would make this change on the core-updates branch to avoid disrupting
> the availability of substitutes, so rebuilding a large number of
> packages is not a big problem.  Does this patch apply on top of
> core-updates?
> 
> About the patch: it would be better to separate the two changes.  One
> commit would add the nghttp2 package, the other would modify the curl
> package.  Could you please split the patch?
> 
> Since curl is used by a great number of packages we need to pay
> attention to the size of the closure.  How does adding nghttp2 to curl
> affect the size of the closure of the curl package?  (You can check with
> “guix size”.)
> 
> --
> Ricardo
> 
> GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
> https://elephly.net
> 
> 

-- 
  Mark Meyer
  [email-masked]
From 05c8f4a443ad62c013aa5e18b46979b985737dac Mon Sep 17 00:00:00 2001
From: Mark Meyer <[email-masked]>
Date: Sat, 16 Dec 2017 19:02:10 +0100
Subject: [PATCH] gnu: Add nghttp2 support.

* gnu/packages/curl.scm (nghttp2): New variable.
---
 gnu/packages/curl.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm
index 3df8acc2c..741454978 100644
--- a/gnu/packages/curl.scm
+++ b/gnu/packages/curl.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2016, 2017 Leo Famulari <[email-masked]>
 ;;; Copyright © 2017 Marius Bakke <[email-masked]>
 ;;; Copyright © 2017 Efraim Flashner <[email-masked]>
+;;; Copyright © 2017 Mark Meyer <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages gsasl)
@@ -40,6 +42,30 @@
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages tls))
 
+(define-public nghttp2
+  (package
+    (name "nghttp2")
+    (version "1.28.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/nghttp2/nghttp2/releases/download/v"
+                                  version "/nghttp2-" version ".tar.xz"))
+              (sha256
+               (base32
+                "13gxk72manbmaaf3mahvihfw71zas1m7z8j2bs9s7v2dc403yv0d"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("cunit" ,cunit)))
+    (arguments
+     `(#:configure-flags '("--enable-lib-only")))
+    (synopsis "This is an implementation of HTTP version 2 in C")
+    (description "nghttp2 is an implementation of framing layer of HTTP/2 in
+reusable C library.  On top of that, this library implements an HTTP/2 client,
+server and proxy.  HPACK encoder and decoder are available as a public API.")
+    (license (license:non-copyleft "file://COPYING"
+                                   "See COPYING in the distribution."))
+    (home-page "https://nghttp2.org")))
+
 (define-public curl
   (package
    (name "curl")
-- 
2.15.1

From d6d3320046de905ec3cf9c17dca133d01cc105e4 Mon Sep 17 00:00:00 2001
From: Mark Meyer <[email-masked]>
Date: Sun, 17 Dec 2017 09:31:58 +0100
Subject: [PATCH] gnu: Add http2 support to curl.

* gnu/packages/curl.scm (curl)[inputs]: Add nghttp2.
---
 gnu/packages/curl.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm
index 741454978..077f330d2 100644
--- a/gnu/packages/curl.scm
+++ b/gnu/packages/curl.scm
@@ -84,6 +84,7 @@ server and proxy.  HPACK encoder and decoder are available as a public API.")
              ("gss" ,gss)
              ("libidn" ,libidn)
              ("libssh2" ,libssh2)
+             ("nghttp2" ,nghttp2)
              ("openldap" ,openldap)
              ("zlib" ,zlib)))
    (native-inputs
-- 
2.15.1