Rename <package-source> to <origin>; use the `letrec*' behavior in packages.

* guix/packages.scm (<package-source>): Rename to...
  (<origin>): ... this.  Update users.

* distro/base.scm (libsigsegv, gawk, hello): Adjust to renaming; refer
  to VERSION to build the URL.
This commit is contained in:
Ludovic Courtès 2012-07-01 17:32:03 +02:00
parent 8fd5bd2b69
commit 90c68be883
2 changed files with 27 additions and 23 deletions

View File

@ -32,9 +32,11 @@
(package (package
(name "libsigsegv") (name "libsigsegv")
(version "2.10") (version "2.10")
(source (source (source (origin
(method http-fetch) (method http-fetch)
(uri "http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.10.tar.gz") (uri (string-append
"http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-"
version ".tar.gz"))
(sha256 (sha256
(base32 "16hrs8k3nmc7a8jam5j1fpspd6sdpkamskvsdpcw6m29vnis8q44")))) (base32 "16hrs8k3nmc7a8jam5j1fpspd6sdpkamskvsdpcw6m29vnis8q44"))))
(build-system gnu-build-system) (build-system gnu-build-system)
@ -54,9 +56,10 @@ handlers, distributed shared memory, and more.")
(package (package
(name "gawk") (name "gawk")
(version "4.0.0") (version "4.0.0")
(source (source (source (origin
(method http-fetch) (method http-fetch)
(uri "http://ftp.gnu.org/gnu/gawk/gawk-4.0.0.tar.bz2") (uri (string-append "http://ftp.gnu.org/gnu/gawk/gawk-" version
".tar.bz2"))
(sha256 (sha256
(base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0")))) (base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0"))))
(build-system gnu-build-system) (build-system gnu-build-system)
@ -88,9 +91,10 @@ code.")
(package (package
(name "hello") (name "hello")
(version "2.8") (version "2.8")
(source (source (source (origin
(method http-fetch) (method http-fetch)
(uri "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz") (uri (string-append "http://ftp.gnu.org/gnu/hello/hello-" version
".tar.gz"))
(sha256 (sha256
(base32 "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6")))) (base32 "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))))
(build-system gnu-build-system) (build-system gnu-build-system)

View File

@ -29,12 +29,12 @@
location-line location-line
location-column location-column
source origin
package-source? origin?
package-source-uri origin-uri
package-source-method origin-method
package-source-sha256 origin-sha256
package-source-file-name origin-file-name
base32 base32
package package
@ -93,15 +93,15 @@ etc."
(location file (and line (+ line 1)) col))) (location file (and line (+ line 1)) col)))
;; The source of a package, such as a tarball URL and fetcher. ;; The source of a package, such as a tarball URL and fetcher---called
(define-record-type* <package-source> ;; "origin" to avoid name clash with `package-source', `source', etc.
source make-package-source (define-record-type* <origin>
package-source? origin make-origin
(uri package-source-uri) ; string origin?
(method package-source-method) ; symbol (uri origin-uri) ; string
(sha256 package-source-sha256) ; bytevector (method origin-method) ; symbol
(file-name package-source-file-name ; optional file name (sha256 origin-sha256) ; bytevector
(default #f))) (file-name origin-file-name (default #f))) ; optional file name
(define-syntax base32 (define-syntax base32
(lambda (s) (lambda (s)
@ -120,7 +120,7 @@ representation."
package? package?
(name package-name) ; string (name package-name) ; string
(version package-version) ; string (version package-version) ; string
(source package-source) ; <package-source> instance (source package-source) ; <origin> instance
(build-system package-build-system) ; build system (build-system package-build-system) ; build system
(arguments package-arguments ; arguments for the build method (arguments package-arguments ; arguments for the build method
(default '())) (default '()))
@ -155,7 +155,7 @@ representation."
(define (package-source-derivation store source) (define (package-source-derivation store source)
"Return the derivation path for SOURCE, a package source." "Return the derivation path for SOURCE, a package source."
(match source (match source
(($ <package-source> uri method sha256 name) (($ <origin> uri method sha256 name)
(method store uri 'sha256 sha256 name)))) (method store uri 'sha256 sha256 name))))
(define* (package-derivation store package (define* (package-derivation store package