On Tue, 03 Nov 2015 14:35:07 +0100
l...@gnu.org (Ludovic Courtès) wrote:

> Efraim Flashner <efr...@flashner.co.il> skribis:
> 
> > This patch has driven me crazy a bit. C-ares is a library for asynchronous 
> > DNS
> > lookups, and aria2 is a cli program to download multiple files/torrents
> > simultaneously, and also a git-annex dependency. C-ares builds without any
> > problems, but aria2 was a different story. The first problem is that the 
> > tests
> > seem to need network connectivity, and it tries to access files outside the
> > build chroot. Disabling the tests was the easy part.  
> 
> It’s cheating!  ;-)  Could you investigate and see whether/how tests
> could run in the build environment?  A common problem wrt. networking in
> host name lookups.  In the build environment, only “localhost” can be
> found.
> 
> > The second problem was that pkg-config wouldn't find c-ares, so it
> > kept on building without it.  
> 
> In that case, I would do this:
> 
>   guix build -K aria2
>   # … build fails
>   cd /tmp/nix-build*aria2*
>   source environment-variables
>   pkg-config c-ares --libs
> 
> (Replace “c-ares” with the name corresponding to the actual .pc file
> provided by c-ares.)
> 
> It might be that this command fails because of a missing dependency that
> the .pc file requires.
> 
> Ludo’.

In the end rebuilding c-ares with the release tarball and not the github
tarball fixed the issues with aria2 not recognizing c-ares. I wasn't able to
get anything more out of aria2, more than it not finding the locations and
leaving me with with variables pointing to /path/to/dir and the like.

-- 
Efraim Flashner   <efr...@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
From 1f601d7707623ff21da6567eec7f57bef133c3f5 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efr...@flashner.co.il>
Date: Thu, 29 Oct 2015 16:18:36 +0200
Subject: [PATCH 1/2] gnu: Add c-ares.

* gnu/packages/aria2.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
 gnu-system.am          |  1 +
 gnu/packages/aria2.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 gnu/packages/aria2.scm

diff --git a/gnu-system.am b/gnu-system.am
index 946b77e..881ee35 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -35,6 +35,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/aidc.scm				\
   gnu/packages/apl.scm				\
   gnu/packages/apr.scm				\
+  gnu/packages/aria2.scm			\
   gnu/packages/asciidoc.scm			\
   gnu/packages/aspell.scm			\
   gnu/packages/attr.scm				\
diff --git a/gnu/packages/aria2.scm b/gnu/packages/aria2.scm
new file mode 100644
index 0000000..707a3ce
--- /dev/null
+++ b/gnu/packages/aria2.scm
@@ -0,0 +1,49 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Efraim Flashner <efr...@flashner.co.il>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages aria2)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix download)
+  #:use-module (guix packages)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages pkg-config))
+
+(define-public c-ares
+  (package
+    (name "c-ares")
+    (version "1.10.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://c-ares.haxx.se/download/"; name "-" version
+                    ".tar.gz"))
+              (sha256
+               (base32
+                "1nyka87yf2jfd0y6sspll0yxwb8zi7kyvajrdbjmh4axc5s1cw1x"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (home-page "http://c-ares.haxx.se/";)
+    (synopsis "C library for asynchronous DNS requests")
+    (description
+      "C-ares is a C library that performs DNS requests and name resolution
+asynchronously.  It is intended for applications which need to perform DNS
+queries without blocking, or need to perform multiple DNS queries in parallel.
+The primary examples of such applications are servers which communicate with
+multiple clients and programs with graphical user interfaces.")
+    (license (license:x11-style "http://c-ares.haxx.se/license.html";))))
-- 
2.6.2

From ef12a054927c42442ba0806caabee75be0d6f88f Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efr...@flashner.co.il>
Date: Tue, 3 Nov 2015 22:05:47 +0200
Subject: [PATCH 2/2] gnu: Add aria2.

* gnu/packages/aria2.scm (aria2): New variable.
---
 gnu/packages/aria2.scm | 44 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/aria2.scm b/gnu/packages/aria2.scm
index 707a3ce..5a28a77 100644
--- a/gnu/packages/aria2.scm
+++ b/gnu/packages/aria2.scm
@@ -21,7 +21,14 @@
   #:use-module (guix download)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
-  #:use-module (gnu packages pkg-config))
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages nettle)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages ssh)
+  #:use-module (gnu packages xml))
 
 (define-public c-ares
   (package
@@ -47,3 +54,38 @@ queries without blocking, or need to perform multiple DNS queries in parallel.
 The primary examples of such applications are servers which communicate with
 multiple clients and programs with graphical user interfaces.")
     (license (license:x11-style "http://c-ares.haxx.se/license.html";))))
+
+(define-public aria2
+  (package
+    (name "aria2")
+    (version "1.19.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/tatsuhiro-t/aria2/";
+                                  "releases/download/release-" version "/"
+                                  name "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "0gnm1b7yp5q6fcajz1ln2f1rv64p6dv0nz9bcwpqrkcmsinlh19n"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags '("--enable-libaria2")
+       #:tests? #f)) ; tests require network connectivity
+    (native-inputs
+     `(("pkg-config", pkg-config)))
+    (inputs
+     `(("c-ares" ,c-ares)
+       ("gnutls" ,gnutls)
+       ("gmp" ,gmp)
+       ("libssh2" ,libssh2)
+       ("libxml2" ,libxml2)
+       ("nettle" ,nettle)
+       ("sqlite" ,sqlite)
+       ("zlib" ,zlib)))
+    (home-page "http://aria2.sourceforge.net/";)
+    (synopsis "Utility for parallel downloading files")
+    (description
+      "Aria2 is a lightweight, multi-protocol & multi-source command-line
+downloadu tility.  It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.
+Aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.")
+    (license license:gpl2+)))
-- 
2.6.2

Attachment: pgpRwjWlZAR4d.pgp
Description: OpenPGP digital signature

Reply via email to