gnu-maintenance: Move FTP directory info to 'properties' fields.

* guix/gnu-maintenance.scm (ftp-server/directory): Rewrite to honor
PACKAGE's properties.  Remove list of quirks.
(releases): Add #:server and #:directory parameters.  Remove call
to 'ftp-server/directory'.
(latest-release): Likewise.
(latest-release*): Add call to 'ftp-server/directory'.  Honor
'upstream-name' property of PACKAGE.
* gnu/packages/fonts.scm (font-gnu-freefont-ttf): Add 'properties'
field.
* gnu/packages/gnupg.scm (libgpg-error, libgcrypt, libassuan):
(libksba, gnupg): Likewise.
* gnu/packages/gnuzilla.scm (icecat): Likewise.
* gnu/packages/package-management.scm (guix-0.10.0): Likewise.
* gnu/packages/pretty-print.scm (source-highlight): Likewise.
* gnu/packages/scheme.scm (mit-scheme): Likewise.
* gnu/packages/telephony.scm (ucommon): Likewise.
* gnu/packages/tls.scm (gnutls): Likewise.
This commit is contained in:
Ludovic Courtès 2016-04-14 22:18:56 +02:00
parent 444bb0d857
commit 63e8bb12a4
9 changed files with 102 additions and 96 deletions

View File

@ -306,7 +306,9 @@ sans-serif designed for on-screen reading. It is used by GNOME@tie{}3.")
"The GNU Freefont project aims to provide a set of free outline "The GNU Freefont project aims to provide a set of free outline
(PostScript Type0, TrueType, OpenType...) fonts covering the ISO (PostScript Type0, TrueType, OpenType...) fonts covering the ISO
10646/Unicode UCS (Universal Character Set).") 10646/Unicode UCS (Universal Character Set).")
(license license:gpl3+))) (license license:gpl3+)
(properties '((upstream-name . "freefont")
(ftp-directory . "/gnu/freefont")))))
(define-public font-liberation (define-public font-liberation
(package (package

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
@ -65,7 +65,9 @@
for all GnuPG components. Among these are GPG, GPGSM, GPGME, for all GnuPG components. Among these are GPG, GPGSM, GPGME,
GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
Daemon and possibly more in the future.") Daemon and possibly more in the future.")
(license license:lgpl2.0+))) (license license:lgpl2.0+)
(properties '((ftp-server . "ftp.gnupg.org")
(ftp-directory . "/gcrypt/libgpg-error")))))
(define-public libgcrypt (define-public libgcrypt
(package (package
@ -99,7 +101,9 @@ Daemon and possibly more in the future.")
standard cryptographic building blocks such as symmetric ciphers, hash standard cryptographic building blocks such as symmetric ciphers, hash
algorithms, public key algorithms, large integer functions and random number algorithms, public key algorithms, large integer functions and random number
generation.") generation.")
(license license:lgpl2.0+))) (license license:lgpl2.0+)
(properties '((ftp-server . "ftp.gnupg.org")
(ftp-directory . "/gcrypt/libgcrypt")))))
(define-public libgcrypt-1.5 (define-public libgcrypt-1.5
(package (inherit libgcrypt) (package (inherit libgcrypt)
@ -136,7 +140,9 @@ generation.")
protocol. This protocol is used for IPC between most newer protocol. This protocol is used for IPC between most newer
GnuPG components. Both, server and client side functions are GnuPG components. Both, server and client side functions are
provided.") provided.")
(license license:lgpl2.0+))) (license license:lgpl2.0+)
(properties '((ftp-server . "ftp.gnupg.org")
(ftp-directory . "/gcrypt/libassuan")))))
(define-public libksba (define-public libksba
(package (package
@ -169,7 +175,9 @@ provided.")
"KSBA (pronounced Kasbah) is a library to make X.509 certificates "KSBA (pronounced Kasbah) is a library to make X.509 certificates
as well as the CMS easily accessible by other applications. Both as well as the CMS easily accessible by other applications. Both
specifications are building blocks of S/MIME and TLS.") specifications are building blocks of S/MIME and TLS.")
(license license:gpl3+))) (license license:gpl3+)
(properties '((ftp-server . "ftp.gnupg.org")
(ftp-directory . "/gcrypt/libksba")))))
(define-public npth (define-public npth
(package (package
@ -243,7 +251,9 @@ features powerful key management and the ability to access public key
servers. It includes several libraries: libassuan (IPC between GnuPG servers. It includes several libraries: libassuan (IPC between GnuPG
components), libgpg-error (centralized GnuPG error values), and components), libgpg-error (centralized GnuPG error values), and
libskba (working with X.509 certificates and CMS data).") libskba (working with X.509 certificates and CMS data).")
(license license:gpl3+))) (license license:gpl3+)
(properties '((ftp-server . "ftp.gnupg.org")
(ftp-directory . "/gcrypt/gnupg")))))
(define-public gnupg-2.0 (define-public gnupg-2.0
(package (inherit gnupg) (package (inherit gnupg)

View File

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
@ -508,4 +508,5 @@ standards.")
"IceCat is the GNU version of the Firefox browser. It is entirely free "IceCat is the GNU version of the Firefox browser. It is entirely free
software, which does not recommend non-free plugins and addons. It also software, which does not recommend non-free plugins and addons. It also
features built-in privacy-protecting features.") features built-in privacy-protecting features.")
(license license:mpl2.0))) ; and others, see toolkit/content/license.html (license license:mpl2.0) ;and others, see toolkit/content/license.html
(properties '((ftp-directory . "/gnu/gnuzilla")))))

View File

@ -195,7 +195,8 @@ also a distribution thereof. It includes a virtual machine image. Besides
the usual package management features, it also supports transactional the usual package management features, it also supports transactional
upgrades and roll-backs, per-user profiles, and much more. It is based on upgrades and roll-backs, per-user profiles, and much more. It is based on
the Nix package manager.") the Nix package manager.")
(license gpl3+))) (license gpl3+)
(properties '((ftp-server . "alpha.gnu.org")))))
(define guix-devel (define guix-devel
;; Development version of Guix. ;; Development version of Guix.

View File

@ -191,7 +191,8 @@ their syntactic role. It supports over 150 different languages and it can
output to 8 different formats, including HTML, LaTeX and ODF. It can also output to 8 different formats, including HTML, LaTeX and ODF. It can also
output to ANSI color escape sequences, so that highlighted source code can be output to ANSI color escape sequences, so that highlighted source code can be
seen in a terminal.") seen in a terminal.")
(license gpl3+))) (license gpl3+)
(properties '((ftp-directory . "/gnu/src-highlite")))))
(define-public astyle (define-public astyle
(package (package

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
@ -174,7 +174,8 @@
"GNU/MIT Scheme is an implementation of the Scheme programming "GNU/MIT Scheme is an implementation of the Scheme programming
language. It provides an interpreter, a compiler and a debugger. It also language. It provides an interpreter, a compiler and a debugger. It also
features an integrated Emacs-like editor and a large runtime library.") features an integrated Emacs-like editor and a large runtime library.")
(license gpl2+))) (license gpl2+)
(properties '((ftp-directory . "/gnu/mit-scheme/stable.pkg")))))
(define-public bigloo (define-public bigloo
(package (package

View File

@ -76,7 +76,8 @@ to facilitate using C++ design patterns even for very deeply embedded
applications, such as for systems using uclibc along with posix threading applications, such as for systems using uclibc along with posix threading
support.") support.")
(license gpl3+) (license gpl3+)
(home-page "http://www.gnu.org/software/commoncpp"))) (home-page "http://www.gnu.org/software/commoncpp")
(properties '((ftp-directory . "/gnu/commoncpp")))))
(define-public ccrtp (define-public ccrtp
(package (package

View File

@ -176,7 +176,9 @@ living in the same process.")
and DTLS protocols. It is provided in the form of a C library to support the and DTLS protocols. It is provided in the form of a C library to support the
protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
required structures.") required structures.")
(license license:lgpl2.1+))) (license license:lgpl2.1+)
(properties '((ftp-server . "ftp.gnutls.org")
(ftp-directory . "/gcrypt/gnutls")))))
(define-public openssl (define-public openssl
(package (package

View File

@ -206,34 +206,12 @@ network to check in GNU's database."
;;; Latest release. ;;; Latest release.
;;; ;;;
(define (ftp-server/directory project) (define (ftp-server/directory package)
"Return the FTP server and directory where PROJECT's tarball are "Return the FTP server and directory where PACKAGE's tarball are stored."
stored." (values (or (assoc-ref (package-properties package) 'ftp-server)
(define quirks "ftp.gnu.org")
'(("commoncpp2" "ftp.gnu.org" "/gnu/commoncpp") (or (assoc-ref (package-properties package) 'ftp-directory)
("ucommon" "ftp.gnu.org" "/gnu/commoncpp") (string-append "/gnu/" (package-name package)))))
("libzrtpcpp" "ftp.gnu.org" "/gnu/ccrtp")
("libosip2" "ftp.gnu.org" "/gnu/osip")
("libgcrypt" "ftp.gnupg.org" "/gcrypt/libgcrypt")
("libgpg-error" "ftp.gnupg.org" "/gcrypt/libgpg-error")
("libassuan" "ftp.gnupg.org" "/gcrypt/libassuan")
("gnupg" "ftp.gnupg.org" "/gcrypt/gnupg")
("freefont-ttf" "ftp.gnu.org" "/gnu/freefont")
("gnu-ghostscript" "ftp.gnu.org" "/gnu/ghostscript")
("mit-scheme" "ftp.gnu.org" "/gnu/mit-scheme/stable.pkg")
("icecat" "ftp.gnu.org" "/gnu/gnuzilla")
("source-highlight" "ftp.gnu.org" "/gnu/src-highlite")
("gnutls" "ftp.gnutls.org" "/gcrypt/gnutls")
;; FIXME: ftp.texmacs.org is currently outdated; texmacs.org refers to
;; its own http URL instead.
("TeXmacs" "ftp.texmacs.org" "/TeXmacs/targz")))
(match (assoc project quirks)
((_ server directory)
(values server directory))
(_
(values "ftp.gnu.org" (string-append "/gnu/" project)))))
(define (sans-extension tarball) (define (sans-extension tarball)
"Return TARBALL without its .tar.* or .zip extension." "Return TARBALL without its .tar.* or .zip extension."
@ -276,51 +254,53 @@ true."
(gnu-package-name->name+version (sans-extension tarball)))) (gnu-package-name->name+version (sans-extension tarball))))
version)) version))
(define (releases project) (define* (releases project
"Return the list of releases of PROJECT as a list of release name/directory #:key
pairs. Example: (\"mit-scheme-9.0.1\" . \"/gnu/mit-scheme/stable.pkg/9.0.1\"). " (server "ftp.gnu.org")
(directory (string-append "/gnu/" project)))
"Return the list of <upstream-release> of PROJECT as a list of release
name/directory pairs."
;; TODO: Parse something like fencepost.gnu.org:/gd/gnuorg/packages-ftp. ;; TODO: Parse something like fencepost.gnu.org:/gd/gnuorg/packages-ftp.
(let-values (((server directory) (ftp-server/directory project))) (define conn (ftp-open server))
(define conn (ftp-open server))
(let loop ((directories (list directory)) (let loop ((directories (list directory))
(result '())) (result '()))
(match directories (match directories
(() (()
(ftp-close conn) (ftp-close conn)
(coalesce-sources result)) (coalesce-sources result))
((directory rest ...) ((directory rest ...)
(let* ((files (ftp-list conn directory)) (let* ((files (ftp-list conn directory))
(subdirs (filter-map (match-lambda (subdirs (filter-map (match-lambda
((name 'directory . _) name) ((name 'directory . _) name)
(_ #f)) (_ #f))
files))) files)))
(define (file->url file) (define (file->url file)
(string-append "ftp://" server directory "/" file)) (string-append "ftp://" server directory "/" file))
(define (file->source file) (define (file->source file)
(let ((url (file->url file))) (let ((url (file->url file)))
(upstream-source (upstream-source
(package project) (package project)
(version (tarball->version file)) (version (tarball->version file))
(urls (list url)) (urls (list url))
(signature-urls (list (string-append url ".sig")))))) (signature-urls (list (string-append url ".sig"))))))
(loop (append (map (cut string-append directory "/" <>) (loop (append (map (cut string-append directory "/" <>)
subdirs) subdirs)
rest) rest)
(append (append
;; Filter out signatures, deltas, and files which ;; Filter out signatures, deltas, and files which
;; are potentially not releases of PROJECT--e.g., ;; are potentially not releases of PROJECT--e.g.,
;; in /gnu/guile, filter out guile-oops and ;; in /gnu/guile, filter out guile-oops and
;; guile-www; in mit-scheme, filter out binaries. ;; guile-www; in mit-scheme, filter out binaries.
(filter-map (match-lambda (filter-map (match-lambda
((file 'file . _) ((file 'file . _)
(and (release-file? project file) (and (release-file? project file)
(file->source file))) (file->source file)))
(_ #f)) (_ #f))
files) files)
result)))))))) result)))))))
(define* (latest-ftp-release project (define* (latest-ftp-release project
#:key #:key
@ -412,15 +392,15 @@ return the corresponding signature URL, or #f it signatures are unavailable."
(ftp-close conn) (ftp-close conn)
result)))))) result))))))
(define (latest-release package . rest) (define* (latest-release package
#:key
(server "ftp.gnu.org")
(directory (string-append "/gnu/" package)))
"Return the <upstream-source> for the latest version of PACKAGE or #f. "Return the <upstream-source> for the latest version of PACKAGE or #f.
PACKAGE is the name of a GNU package. This procedure automatically uses the PACKAGE must be the canonical name of a GNU package."
right FTP server and directory for PACKAGE." (latest-ftp-release package
(let-values (((server directory) (ftp-server/directory package))) #:server server
(apply latest-ftp-release package #:directory directory))
#:server server
#:directory directory
rest)))
(define-syntax-rule (false-if-ftp-error exp) (define-syntax-rule (false-if-ftp-error exp)
"Return #f if an FTP error is raise while evaluating EXP; return the result "Return #f if an FTP error is raise while evaluating EXP; return the result
@ -435,10 +415,17 @@ of EXP otherwise."
#f))) #f)))
(define (latest-release* package) (define (latest-release* package)
"Like 'latest-release', but ignore FTP errors that might occur when PACKAGE "Like 'latest-release', but (1) take a <package> object, and (2) ignore FTP
is not actually a GNU package, or not hosted on ftp.gnu.org, or not under that errors that might occur when PACKAGE is not actually a GNU package, or not
name (this is the case for \"emacs-auctex\", for instance.)" hosted on ftp.gnu.org, or not under that name (this is the case for
(false-if-ftp-error (latest-release (package-name package)))) \"emacs-auctex\", for instance.)"
(let-values (((server directory)
(ftp-server/directory package)))
(let ((name (or (assoc-ref (package-properties package) 'upstream-name)
(package-name package))))
(false-if-ftp-error (latest-release name
#:server server
#:directory directory)))))
(define %package-name-rx (define %package-name-rx
;; Regexp for a package name, e.g., "foo-X.Y". Since TeXmacs uses ;; Regexp for a package name, e.g., "foo-X.Y". Since TeXmacs uses