aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--distro/packages/base.scm29
-rw-r--r--distro/packages/bash.scm4
-rw-r--r--distro/packages/bdw-gc.scm4
-rw-r--r--distro/packages/bootstrap.scm16
-rw-r--r--distro/packages/compression.scm10
-rw-r--r--distro/packages/gawk.scm4
-rw-r--r--distro/packages/gnupg.scm12
-rw-r--r--distro/packages/gperf.scm4
-rw-r--r--distro/packages/guile.scm8
-rw-r--r--distro/packages/libffi.scm4
-rw-r--r--distro/packages/libsigsegv.scm4
-rw-r--r--distro/packages/libtool.scm4
-rw-r--r--distro/packages/libunistring.scm4
-rw-r--r--distro/packages/lout.scm4
-rw-r--r--distro/packages/m4.scm4
-rw-r--r--distro/packages/multiprecision.scm8
-rw-r--r--distro/packages/ncurses.scm4
-rw-r--r--distro/packages/perl.scm4
-rw-r--r--distro/packages/pkg-config.scm4
-rw-r--r--distro/packages/pth.scm4
-rw-r--r--distro/packages/readline.scm4
-rw-r--r--distro/packages/recutils.scm4
-rw-r--r--guix.scm3
-rw-r--r--guix/build/ftp.scm48
-rw-r--r--guix/build/http.scm100
-rw-r--r--guix/ftp.scm65
-rw-r--r--guix/http.scm63
-rw-r--r--tests/builders.scm13
29 files changed, 72 insertions, 371 deletions
diff --git a/Makefile.am b/Makefile.am
index c4e03a2d6a..3cb7bf3bf9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,15 +30,11 @@ MODULES = \
guix/build-system.scm \
guix/build-system/gnu.scm \
guix/build-system/trivial.scm \
- guix/ftp.scm \
guix/ftp-client.scm \
- guix/http.scm \
guix/store.scm \
guix/ui.scm \
guix/build/download.scm \
guix/build/gnu-build-system.scm \
- guix/build/ftp.scm \
- guix/build/http.scm \
guix/build/utils.scm \
guix/build/union.scm \
guix/packages.scm \
diff --git a/distro/packages/base.scm b/distro/packages/base.scm
index 707e8db2f2..04b1cccedc 100644
--- a/distro/packages/base.scm
+++ b/distro/packages/base.scm
@@ -27,8 +27,7 @@
#:use-module (distro packages multiprecision)
#:use-module (distro packages perl)
#:use-module (guix packages)
- #:use-module (guix ftp)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module (guix utils)
@@ -47,7 +46,7 @@
(name "hello")
(version "2.8")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/hello/hello-" version
".tar.gz"))
(sha256
@@ -68,7 +67,7 @@
(name "grep")
(version "2.14")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/grep/grep-"
version ".tar.xz"))
(sha256
@@ -88,7 +87,7 @@ lines.")
(name "sed")
(version "4.2.1")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/sed/sed-" version
".tar.bz2"))
(sha256
@@ -110,7 +109,7 @@ substituting multiple occurrences of a string within a file.")
(name "tar")
(version "1.26")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/tar/tar-"
version ".tar.bz2"))
(sha256
@@ -140,7 +139,7 @@ files (as archives).")
(name "patch")
(version "2.6.1")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/patch/patch-"
version ".tar.xz"))
(sha256
@@ -166,7 +165,7 @@ producing patched versions.")
(name "diffutils")
(version "3.2")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/diffutils/diffutils-"
version ".tar.xz"))
(sha256
@@ -211,7 +210,7 @@ You can use the sdiff command to merge two files interactively.")
(name "findutils")
(version "4.4.2")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/findutils/findutils-"
version ".tar.gz"))
(sha256
@@ -253,7 +252,7 @@ The tools supplied with this package are:
(name "coreutils")
(version "8.19")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/coreutils/coreutils-"
version ".tar.xz"))
(sha256
@@ -279,7 +278,7 @@ are expected to exist on every operating system.")
(name "make")
(version "3.82")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/make/make-" version
".tar.bz2"))
(sha256
@@ -308,7 +307,7 @@ that it is possible to use Make to build and install the program.")
(name "binutils")
(version "2.22")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/binutils/binutils-"
version ".tar.bz2"))
(sha256
@@ -341,7 +340,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
(name "gcc")
(version "4.7.2")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/gcc/gcc-"
version "/gcc-" version ".tar.bz2"))
(sha256
@@ -469,7 +468,7 @@ used in the GNU system including the GNU/Linux variant.")
(name "linux-libre-headers")
(version version*)
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://linux-libre.fsfla.org/pub/linux-libre/releases/3.3.8-gnu/linux-libre-"
version "-gnu.tar.xz"))
@@ -498,7 +497,7 @@ used in the GNU system including the GNU/Linux variant.")
(name "glibc")
(version "2.16.0")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/glibc/glibc-"
version ".tar.xz"))
(sha256
diff --git a/distro/packages/bash.scm b/distro/packages/bash.scm
index b4e5c1158a..3ee54299f9 100644
--- a/distro/packages/bash.scm
+++ b/distro/packages/bash.scm
@@ -20,7 +20,7 @@
#:use-module (distro packages ncurses)
#:use-module (distro packages readline)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -36,7 +36,7 @@
(name "bash")
(version "4.2")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://ftp.gnu.org/gnu/bash/bash-" version ".tar.gz"))
(sha256
diff --git a/distro/packages/bdw-gc.scm b/distro/packages/bdw-gc.scm
index 9cf6c4cb2d..7f9800eb09 100644
--- a/distro/packages/bdw-gc.scm
+++ b/distro/packages/bdw-gc.scm
@@ -18,7 +18,7 @@
(define-module (distro packages bdw-gc)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -27,7 +27,7 @@
(name "libgc")
(version "7.2alpha6")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-"
version ".tar.gz"))
diff --git a/distro/packages/bootstrap.scm b/distro/packages/bootstrap.scm
index 95a7de444c..8165be1d53 100644
--- a/distro/packages/bootstrap.scm
+++ b/distro/packages/bootstrap.scm
@@ -19,8 +19,6 @@
(define-module (distro packages bootstrap)
#:use-module (distro)
#:use-module (guix packages)
- #:use-module (guix ftp)
- #:use-module (guix http)
#:use-module (guix download)
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
@@ -67,11 +65,7 @@
(let ((orig-method (origin-method source)))
(origin (inherit source)
- (method (cond ((eq? orig-method http-fetch)
- (boot http-fetch))
- ((eq? orig-method ftp-fetch)
- (boot ftp-fetch))
- ((eq? orig-method url-fetch)
+ (method (cond ((eq? orig-method url-fetch)
(boot url-fetch))
(else orig-method))))))
@@ -207,7 +201,7 @@ $out/bin/guile --version~%"
(package-from-tarball "bootstrap-binaries"
(lambda (system)
(origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
%bootstrap-base-url "/"
system "/static-binaries.tar.xz"))
@@ -226,7 +220,7 @@ $out/bin/guile --version~%"
(package-from-tarball "binutils-bootstrap"
(lambda (system)
(origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
%bootstrap-base-url "/"
system "/binutils-2.22.tar.xz"))
@@ -280,7 +274,7 @@ $out/bin/guile --version~%"
("tarball" ,(lambda (system)
(bootstrap-origin
(origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append %bootstrap-base-url "/"
system "/glibc-2.16.0.tar.xz"))
(sha256
@@ -351,7 +345,7 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
("tarball" ,(lambda (system)
(bootstrap-origin
(origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append %bootstrap-base-url "/"
system "/gcc-4.7.2.tar.xz"))
(sha256
diff --git a/distro/packages/compression.scm b/distro/packages/compression.scm
index b6f16afdf5..d5299f62bb 100644
--- a/distro/packages/compression.scm
+++ b/distro/packages/compression.scm
@@ -18,7 +18,7 @@
(define-module (distro packages compression)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix build-system gnu))
(define-public zlib
@@ -27,7 +27,7 @@
(version "1.2.7")
(source
(origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://zlib.net/zlib-"
version ".tar.gz"))
(sha256
@@ -66,7 +66,7 @@ in compression.")
(name "gzip")
(version "1.5")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/gzip/gzip-"
version ".tar.gz"))
(sha256
@@ -114,7 +114,7 @@ superior compression ratio of gzip is just a bonus.")
(name "bzip2")
(version "1.0.6")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://www.bzip.org/" version "/bzip2-"
version ".tar.gz"))
(sha256
@@ -150,7 +150,7 @@ decompression.")
(name "xz")
(version "5.0.4")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://tukaani.org/xz/xz-" version
".tar.gz"))
(sha256
diff --git a/distro/packages/gawk.scm b/distro/packages/gawk.scm
index b04a1ebb57..58c1bf1bea 100644
--- a/distro/packages/gawk.scm
+++ b/distro/packages/gawk.scm
@@ -19,7 +19,7 @@
(define-module (distro packages gawk)
#:use-module (distro packages libsigsegv)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -28,7 +28,7 @@
(name "gawk")
(version "4.0.0")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/gawk/gawk-" version
".tar.bz2"))
(sha256
diff --git a/distro/packages/gnupg.scm b/distro/packages/gnupg.scm
index 062187c0f8..7bc3b0c266 100644
--- a/distro/packages/gnupg.scm
+++ b/distro/packages/gnupg.scm
@@ -21,7 +21,7 @@
#:use-module (distro packages readline)
#:use-module (distro packages compression)
#:use-module (guix packages)
- #:use-module (guix ftp)
+ #:use-module (guix download)
#:use-module (guix build-system gnu))
(define-public libgpg-error
@@ -30,7 +30,7 @@
(version "1.10")
(source
(origin
- (method ftp-fetch)
+ (method url-fetch)
(uri (string-append "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-"
version ".tar.bz2"))
(sha256
@@ -53,7 +53,7 @@ Daemon and possibly more in the future.")
(version "1.5.0")
(source
(origin
- (method ftp-fetch)
+ (method url-fetch)
(uri (string-append "ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-"
version ".tar.bz2"))
(sha256
@@ -79,7 +79,7 @@ functions, random numbers and a lot of supporting functions.")
(version "2.0.3")
(source
(origin
- (method ftp-fetch)
+ (method url-fetch)
(uri (string-append "ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-"
version ".tar.bz2"))
(sha256
@@ -104,7 +104,7 @@ provided.")
(version "1.2.0")
(source
(origin
- (method ftp-fetch)
+ (method url-fetch)
(uri (string-append
"ftp://ftp.gnupg.org/gcrypt/libksba/libksba-"
version ".tar.bz2"))
@@ -129,7 +129,7 @@ specifications are building blocks of S/MIME and TLS.")
(version "2.0.19")
(source
(origin
- (method ftp-fetch)
+ (method url-fetch)
(uri (string-append
"ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-" version
".tar.bz2"))
diff --git a/distro/packages/gperf.scm b/distro/packages/gperf.scm
index 392b9dd4fe..099038af69 100644
--- a/distro/packages/gperf.scm
+++ b/distro/packages/gperf.scm
@@ -18,7 +18,7 @@
(define-module (distro packages gperf)
#:use-module (guix packages)
- #:use-module (guix ftp)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -28,7 +28,7 @@
(version "3.0.4")
(source
(origin
- (method ftp-fetch)
+ (method url-fetch)
(uri (string-append "ftp://ftp.gnu.org/gnu/gperf/gperf-"
version ".tar.gz"))
(sha256
diff --git a/distro/packages/guile.scm b/distro/packages/guile.scm
index d65584f371..937be8dd2c 100644
--- a/distro/packages/guile.scm
+++ b/distro/packages/guile.scm
@@ -29,7 +29,7 @@
#:use-module (distro packages pkg-config)
#:use-module (distro packages readline)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix build-system gnu))
;;; Commentary:
@@ -43,7 +43,7 @@
(name "guile")
(version "1.8.8")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
".tar.gz"))
(sha256
@@ -93,7 +93,7 @@ extensible. It supports many SRFIs.")
(name "guile")
(version "2.0.6")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
".tar.xz"))
(sha256
@@ -142,7 +142,7 @@ or 2.0."
(name (string-append "guile-reader-for-guile-" (package-version guile)))
(version "0.6")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
version ".tar.gz"))
diff --git a/distro/packages/libffi.scm b/distro/packages/libffi.scm
index dca0387433..8d702a92dd 100644
--- a/distro/packages/libffi.scm
+++ b/distro/packages/libffi.scm
@@ -18,7 +18,7 @@
(define-module (distro packages libffi)
#:use-module (guix packages)
- #:use-module (guix ftp)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -40,7 +40,7 @@
(name "libffi")
(version "3.0.9")
(source (origin
- (method ftp-fetch)
+ (method url-fetch)
(uri
(string-append "ftp://sourceware.org/pub/libffi/"
name "-" version ".tar.gz"))
diff --git a/distro/packages/libsigsegv.scm b/distro/packages/libsigsegv.scm
index 9c6d80296d..030557f918 100644
--- a/distro/packages/libsigsegv.scm
+++ b/distro/packages/libsigsegv.scm
@@ -18,7 +18,7 @@
(define-module (distro packages libsigsegv)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -27,7 +27,7 @@
(name "libsigsegv")
(version "2.10")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-"
version ".tar.gz"))
diff --git a/distro/packages/libtool.scm b/distro/packages/libtool.scm
index 02af715d32..63c88cd4cd 100644
--- a/distro/packages/libtool.scm
+++ b/distro/packages/libtool.scm
@@ -21,7 +21,7 @@
#:use-module (distro packages m4)
#:use-module (distro packages perl)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -30,7 +30,7 @@
(name "libtool")
(version "2.4.2")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/libtool/libtool-"
version ".tar.gz"))
(sha256
diff --git a/distro/packages/libunistring.scm b/distro/packages/libunistring.scm
index fb912eaf8f..0d865645bd 100644
--- a/distro/packages/libunistring.scm
+++ b/distro/packages/libunistring.scm
@@ -18,7 +18,7 @@
(define-module (distro packages libunistring)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -27,7 +27,7 @@
(name "libunistring")
(version "0.9.3")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://ftp.gnu.org/gnu/libunistring/libunistring-"
version ".tar.gz"))
diff --git a/distro/packages/lout.scm b/distro/packages/lout.scm
index 3045afa3ab..0ea3b0887d 100644
--- a/distro/packages/lout.scm
+++ b/distro/packages/lout.scm
@@ -18,7 +18,7 @@
(define-module (distro packages lout)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -78,7 +78,7 @@
(name "lout")
(version "3.39")
(source (origin
- (method http-fetch)
+ (method url-fetch)
;; FIXME: `http-get' doesn't follow redirects, hence the URL.
(uri (string-append
"http://download-mirror.savannah.gnu.org/releases/lout/lout-"
diff --git a/distro/packages/m4.scm b/distro/packages/m4.scm
index 7097ffb68f..8517b73834 100644
--- a/distro/packages/m4.scm
+++ b/distro/packages/m4.scm
@@ -19,7 +19,7 @@
(define-module (distro packages m4)
#:use-module (distro)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -28,7 +28,7 @@
(name "m4")
(version "1.4.16")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/m4/m4-"
version ".tar.bz2"))
(sha256
diff --git a/distro/packages/multiprecision.scm b/distro/packages/multiprecision.scm
index 98e4c72a72..c780e4ce03 100644
--- a/distro/packages/multiprecision.scm
+++ b/distro/packages/multiprecision.scm
@@ -20,7 +20,7 @@
#:use-module (distro)
#:use-module (distro packages m4)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -29,7 +29,7 @@
(name "gmp")
(version "5.0.5")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/gmp/gmp-" version
".tar.bz2"))
(sha256
@@ -71,7 +71,7 @@ faster algorithms.")
(name "mpfr")
(version "3.1.1")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/mpfr/mpfr-" version
".tar.xz"))
(sha256 (base32
@@ -97,7 +97,7 @@ double-precision floating-point arithmetic (53-bit mantissa).")
(name "mpc")
(version "1.0")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://www.multiprecision.org/mpc/download/mpc-"
version ".tar.gz"))
diff --git a/distro/packages/ncurses.scm b/distro/packages/ncurses.scm
index d9c31c6fee..b16d4002ee 100644
--- a/distro/packages/ncurses.scm
+++ b/distro/packages/ncurses.scm
@@ -18,7 +18,7 @@
(define-module (distro packages ncurses)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -55,7 +55,7 @@
(name "ncurses")
(version "5.9")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/ncurses/ncurses-"
version ".tar.gz"))
(sha256
diff --git a/distro/packages/perl.scm b/distro/packages/perl.scm
index 7e6cf0e4f7..9704ae1440 100644
--- a/distro/packages/perl.scm
+++ b/distro/packages/perl.scm
@@ -19,7 +19,7 @@
(define-module (distro packages perl)
#:use-module (distro)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -29,7 +29,7 @@
(name "perl")
(version "5.16.1")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://www.cpan.org/src/5.0/perl-"
version ".tar.gz"))
(sha256
diff --git a/distro/packages/pkg-config.scm b/distro/packages/pkg-config.scm
index 7e44efb429..554be6bcde 100644
--- a/distro/packages/pkg-config.scm
+++ b/distro/packages/pkg-config.scm
@@ -18,7 +18,7 @@
(define-module (distro packages pkg-config)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -27,7 +27,7 @@
(name "pkg-config")
(version "0.27.1")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append
"http://pkgconfig.freedesktop.org/releases/pkg-config-"
version ".tar.gz"))
diff --git a/distro/packages/pth.scm b/distro/packages/pth.scm
index 94e0dbbaee..bb65c41598 100644
--- a/distro/packages/pth.scm
+++ b/distro/packages/pth.scm
@@ -18,7 +18,7 @@
(define-module (distro packages pth)
#:use-module (guix packages)
- #:use-module (guix ftp)
+ #:use-module (guix download)
#:use-module (guix build-system gnu))
(define-public pth
@@ -27,7 +27,7 @@
(version "2.0.7")
(source
(origin
- (method ftp-fetch)
+ (method url-fetch)
(uri (string-append "ftp://ftp.gnu.org/gnu/pth/pth-" version
".tar.gz"))
(sha256
diff --git a/distro/packages/readline.scm b/distro/packages/readline.scm
index 6f54d32825..18c149b2c6 100644
--- a/distro/packages/readline.scm
+++ b/distro/packages/readline.scm
@@ -20,7 +20,7 @@
#:use-module (distro)
#:use-module (distro packages ncurses)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -29,7 +29,7 @@
(name "readline")
(version "6.2")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/readline/readline-"
version ".tar.gz"))
(sha256
diff --git a/distro/packages/recutils.scm b/distro/packages/recutils.scm
index c3b74b6085..a03e73b7d6 100644
--- a/distro/packages/recutils.scm
+++ b/distro/packages/recutils.scm
@@ -19,7 +19,7 @@
(define-module (distro packages recutils)
#:use-module (distro)
#:use-module (guix packages)
- #:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu))
@@ -28,7 +28,7 @@
(name "recutils")
(version "1.5")
(source (origin
- (method http-fetch)
+ (method url-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/recutils/recutils-"
version ".tar.gz"))
(sha256
diff --git a/guix.scm b/guix.scm
index 1e136372bc..9efc6e7139 100644
--- a/guix.scm
+++ b/guix.scm
@@ -27,8 +27,7 @@
build-system
derivations
ftp-client
- ftp
- http
+ download
packages
store
utils))
diff --git a/guix/build/ftp.scm b/guix/build/ftp.scm
deleted file mode 100644
index 17486953c2..0000000000
--- a/guix/build/ftp.scm
+++ /dev/null
@@ -1,48 +0,0 @@
-;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
-;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
-;;;
-;;; This file is part of Guix.
-;;;
-;;; 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.
-;;;
-;;; 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 Guix. If not, see <http://www.gnu.org/licenses/>.
-
-(define-module (guix build ftp)
- #:use-module (guix ftp-client)
- #:use-module (guix build utils)
- #:use-module (web uri)
- #:export (ftp-fetch))
-
-;;; Commentary:
-;;;
-;;; Fetch data such as tarballs over FTP (builder-side code).
-;;;
-;;; Code:
-
-(define (ftp-fetch url file)
- "Fetch data from URL and write it to FILE. Return FILE on success."
-
- (setvbuf (current-output-port) _IOLBF)
- (format #t "starting FTP download of `~a' from `~a'...~%" file url)
- (let* ((uri (string->uri url))
- (conn (ftp-open (uri-host uri)))
- (in (ftp-retr conn (basename (uri-path uri))
- (dirname (uri-path uri)))))
- (call-with-output-file file
- (lambda (out)
- ;; TODO: Show a progress bar.
- (dump-port in out)))
-
- (ftp-close conn))
- file)
-
-;;; ftp.scm ends here
diff --git a/guix/build/http.scm b/guix/build/http.scm
deleted file mode 100644
index 65c09fa4cd..0000000000
--- a/guix/build/http.scm
+++ /dev/null
@@ -1,100 +0,0 @@
-;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
-;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
-;;;
-;;; This file is part of Guix.
-;;;
-;;; 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.
-;;;
-;;; 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 Guix. If not, see <http://www.gnu.org/licenses/>.
-
-(define-module (guix build http)
- #:use-module (web uri)
- #:use-module (web client)
- #:use-module (web response)
- #:use-module (rnrs io ports)
- #:use-module (srfi srfi-11)
- #:export (http-fetch))
-
-;;; Commentary:
-;;;
-;;; Fetch data such as tarballs over HTTP (builder-side code).
-;;;
-;;; Code:
-
-(define (open-connection-for-uri uri)
- "Return an open input/output port for a connection to URI.
-
-This is the same as Guile's `open-socket-for-uri', except that we always
-use a numeric port argument, to avoid the need to go through libc's NSS,
-which is not available during bootstrap."
- (define addresses
- (let ((port (or (uri-port uri)
- (case (uri-scheme uri)
- ((http) 80) ; /etc/services, not for me!
- (else
- (error "unsupported URI scheme" uri))))))
- (getaddrinfo (uri-host uri)
- (number->string port)
- AI_NUMERICSERV)))
-
- (let loop ((addresses addresses))
- (let* ((ai (car addresses))
- (s (with-fluids ((%default-port-encoding #f))
- (socket (addrinfo:fam ai) (addrinfo:socktype ai)
- (addrinfo:protocol ai)))))
- (catch 'system-error
- (lambda ()
- (connect s (addrinfo:addr ai))
-
- ;; Buffer input and output on this port.
- (setvbuf s _IOFBF)
- ;; Enlarge the receive buffer.
- (setsockopt s SOL_SOCKET SO_RCVBUF (* 12 1024))
- s)
- (lambda args
- ;; Connection failed, so try one of the other addresses.
- (close s)
- (if (null? addresses)
- (apply throw args)
- (loop (cdr addresses))))))))
-
-;; XXX: This is an awful hack to make sure the (set-port-encoding! p
-;; "ISO-8859-1") call in `read-response' passes, even during bootstrap
-;; where iconv is not available.
-(module-define! (resolve-module '(web response))
- 'set-port-encoding!
- (lambda (p e) #f))
-
-(define (http-fetch url file)
- "Fetch data from URL and write it to FILE. Return FILE on success."
-
- (setvbuf (current-output-port) _IOLBF)
- (format #t "starting HTTP download of `~a' from `~a'...~%" file url)
-
- ;; FIXME: Use a variant of `http-get' that returns a port instead of
- ;; loading everything in memory.
- (let*-values (((uri)
- (string->uri url))
- ((connection)
- (open-connection-for-uri uri))
- ((resp bv)
- (http-get uri #:port connection #:decode-body? #f))
- ((code)
- (response-code resp)))
- (if (= 200 code)
- (begin
- (call-with-output-file file
- (lambda (p)
- (put-bytevector p bv)))
- file)
- (error "download failed" url
- code (response-reason-phrase resp)))))
diff --git a/guix/ftp.scm b/guix/ftp.scm
deleted file mode 100644
index 2717bf3fb3..0000000000
--- a/guix/ftp.scm
+++ /dev/null
@@ -1,65 +0,0 @@
-;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
-;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
-;;;
-;;; This file is part of Guix.
-;;;
-;;; 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.
-;;;
-;;; 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 Guix. If not, see <ftp://www.gnu.org/licenses/>.
-
-(define-module (guix ftp)
- #:use-module (ice-9 match)
- #:use-module (guix derivations)
- #:use-module (guix packages)
- #:use-module ((guix store) #:select (derivation-path?))
- #:use-module (guix utils)
- #:export (ftp-fetch))
-
-;;; Commentary:
-;;;
-;;; Produce fixed-output derivations with data fetched over FTP.
-;;;
-;;; Code:
-
-(define* (ftp-fetch store url hash-algo hash
- #:optional name
- #:key (system (%current-system)) guile)
- "Return the path of a fixed-output derivation in STORE that fetches URL,
-which is expected to have hash HASH of type HASH-ALGO (a symbol). By
-default, the file name is the base name of URL; optionally, NAME can specify
-a different file name."
- (define builder
- `(begin
- (use-modules (guix build ftp))
- (ftp-fetch ,url %output)))
-
- (define guile-for-build
- (match guile
- ((? package?)
- (package-derivation store guile system))
- ((and (? string?) (? derivation-path?))
- guile)
- (#f ; the default
- (let* ((distro (resolve-interface '(distro packages base)))
- (guile (module-ref distro 'guile-final)))
- (package-derivation store guile system)))))
-
- (build-expression->derivation store (or name (basename url)) system
- builder '()
- #:hash-algo hash-algo
- #:hash hash
- #:modules '((guix ftp-client)
- (guix build ftp)
- (guix build utils))
- #:guile-for-build guile-for-build))
-
-;;; ftp.scm ends here
diff --git a/guix/http.scm b/guix/http.scm
deleted file mode 100644
index 182d011b77..0000000000
--- a/guix/http.scm
+++ /dev/null
@@ -1,63 +0,0 @@
-;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
-;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
-;;;
-;;; This file is part of Guix.
-;;;
-;;; 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.
-;;;
-;;; 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 Guix. If not, see <http://www.gnu.org/licenses/>.
-
-(define-module (guix http)
- #:use-module (ice-9 match)
- #:use-module (guix derivations)
- #:use-module (guix packages)
- #:use-module ((guix store) #:select (derivation-path?))
- #:use-module (guix utils)
- #:export (http-fetch))
-
-;;; Commentary:
-;;;
-;;; Produce fixed-output derivations with data fetched over HTTP.
-;;;
-;;; Code:
-
-(define* (http-fetch store url hash-algo hash
- #:optional name
- #:key (system (%current-system)) guile)
- "Return the path of a fixed-output derivation in STORE that fetches URL,
-which is expected to have hash HASH of type HASH-ALGO (a symbol). By
-default, the file name is the base name of URL; optionally, NAME can specify
-a different file name."
- (define builder
- `(begin
- (use-modules (guix build http))
- (http-fetch ,url %output)))
-
- (define guile-for-build
- (match guile
- ((? package?)
- (package-derivation store guile system))
- ((and (? string?) (? derivation-path?))
- guile)
- (#f ; the default
- (let* ((distro (resolve-interface '(distro packages base)))
- (guile (module-ref distro 'guile-final)))
- (package-derivation store guile system)))))
-
- (build-expression->derivation store (or name (basename url)) system
- builder '()
- #:hash-algo hash-algo
- #:hash hash
- #:modules '((guix build http))
- #:guile-for-build guile-for-build))
-
-;;; http.scm ends here
diff --git a/tests/builders.scm b/tests/builders.scm
index 9cc86ef1c2..d2691c521f 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -18,7 +18,6 @@
(define-module (test-builders)
- #:use-module (guix http)
#:use-module (guix download)
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
@@ -54,16 +53,6 @@
(test-begin "builders")
-(test-assert "http-fetch"
- (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
- (hash (nix-base32-string->bytevector
- "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
- (drv-path (http-fetch %store url 'sha256 hash))
- (out-path (derivation-path->output-path drv-path)))
- (and (build-derivations %store (list drv-path))
- (file-exists? out-path)
- (valid-path? %store out-path))))
-
(test-assert "url-fetch"
(let* ((url '("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"
"ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
@@ -83,7 +72,7 @@
(let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
(hash (nix-base32-string->bytevector
"0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
- (tarball (http-fetch %store url 'sha256 hash))
+ (tarball (url-fetch %store url 'sha256 hash))
(build (gnu-build %store "hello-2.8" tarball
%bootstrap-inputs
#:implicit-inputs? #f