Move 'nix-system->gnu-triplet' to (guix utils) and export it.

* gnu/packages/commencement.scm (nix-system->gnu-triplet): Move to...
* guix/utils.scm (nix-system->gnu-triplet): ... here.  Fix docstring typo.
This commit is contained in:
Mark H Weaver 2014-12-31 03:47:40 -05:00
parent 270b501ee2
commit 8eb8048432
2 changed files with 14 additions and 13 deletions

View File

@ -122,19 +122,6 @@
("file" ,file-boot0) ("file" ,file-boot0)
,@%bootstrap-inputs)) ,@%bootstrap-inputs))
(define* (nix-system->gnu-triplet
#:optional (system (%current-system)) (vendor "unknown"))
"Return an a guess of the GNU triplet corresponding to Nix system
identifier SYSTEM."
(let* ((dash (string-index system #\-))
(arch (substring system 0 dash))
(os (substring system (+ 1 dash))))
(string-append arch
"-" vendor "-"
(if (string=? os "linux")
"linux-gnu"
os))))
(define* (boot-triplet #:optional (system (%current-system))) (define* (boot-triplet #:optional (system (%current-system)))
;; Return the triplet used to create the cross toolchain needed in the ;; Return the triplet used to create the cross toolchain needed in the
;; first bootstrapping stage. ;; first bootstrapping stage.

View File

@ -61,6 +61,7 @@
location-column location-column
source-properties->location source-properties->location
nix-system->gnu-triplet
gnu-triplet->nix-system gnu-triplet->nix-system
%current-system %current-system
%current-target-system %current-target-system
@ -476,6 +477,19 @@ previous value of the keyword argument."
(() (()
(reverse before))))))) (reverse before)))))))
(define* (nix-system->gnu-triplet
#:optional (system (%current-system)) (vendor "unknown"))
"Return a guess of the GNU triplet corresponding to Nix system
identifier SYSTEM."
(let* ((dash (string-index system #\-))
(arch (substring system 0 dash))
(os (substring system (+ 1 dash))))
(string-append arch
"-" vendor "-"
(if (string=? os "linux")
"linux-gnu"
os))))
(define (gnu-triplet->nix-system triplet) (define (gnu-triplet->nix-system triplet)
"Return the Nix system type corresponding to TRIPLET, a GNU triplet as "Return the Nix system type corresponding to TRIPLET, a GNU triplet as
returned by `config.guess'." returned by `config.guess'."