diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-03-17 21:48:40 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-03-17 23:25:53 +0100 |
| commit | 176febe3776b272dffbe757414225702d08c3bdf (patch) | |
| tree | b91d9240ae2cd46399aac5f2095dac7ebef111f4 /tests | |
| parent | 48b444304e206c35cf2c8e0d87a4711f1aac4fd4 (diff) | |
profiles: Packages in a profile can be cross-compiled.
* guix/profiles.scm (profile-derivation): Add #:target parameter; pass
it to 'gexp->derivation'.
* tests/profiles.scm ("profile-derivation, cross-compilation"): New test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/profiles.scm | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm index 55363648892..d0b1e14a865 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2014 Alex Kost <alezost@gmail.com> | 3 | ;;; Copyright © 2014 Alex Kost <alezost@gmail.com> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -212,6 +212,35 @@ | |||
| 212 | #:locales? #f))) | 212 | #:locales? #f))) |
| 213 | (return (derivation-inputs drv)))) | 213 | (return (derivation-inputs drv)))) |
| 214 | 214 | ||
| 215 | (test-assertm "profile-derivation, cross-compilation" | ||
| 216 | (mlet* %store-monad | ||
| 217 | ((manifest -> (packages->manifest (list packages:sed packages:grep))) | ||
| 218 | (target -> "arm-linux-gnueabihf") | ||
| 219 | (grep (package->cross-derivation packages:grep target)) | ||
| 220 | (sed (package->cross-derivation packages:sed target)) | ||
| 221 | (locales (package->derivation packages:glibc-utf8-locales)) | ||
| 222 | (drv (profile-derivation manifest | ||
| 223 | #:hooks '() | ||
| 224 | #:locales? #t | ||
| 225 | #:target target))) | ||
| 226 | (define (find-input name) | ||
| 227 | (let ((name (string-append name ".drv"))) | ||
| 228 | (any (lambda (input) | ||
| 229 | (let ((input (derivation-input-path input))) | ||
| 230 | (and (string-suffix? name input) input))) | ||
| 231 | (derivation-inputs drv)))) | ||
| 232 | |||
| 233 | ;; The inputs for grep and sed should be cross-build derivations, but that | ||
| 234 | ;; for the glibc-utf8-locales should be a native build. | ||
| 235 | (return (and (string=? (derivation-system drv) (%current-system)) | ||
| 236 | (string=? (find-input (package-full-name packages:grep)) | ||
| 237 | (derivation-file-name grep)) | ||
| 238 | (string=? (find-input (package-full-name packages:sed)) | ||
| 239 | (derivation-file-name sed)) | ||
| 240 | (string=? (find-input | ||
| 241 | (package-full-name packages:glibc-utf8-locales)) | ||
| 242 | (derivation-file-name locales)))))) | ||
| 243 | |||
| 215 | (test-assert "package->manifest-entry defaults to \"out\"" | 244 | (test-assert "package->manifest-entry defaults to \"out\"" |
| 216 | (let ((outputs (package-outputs packages:glibc))) | 245 | (let ((outputs (package-outputs packages:glibc))) |
| 217 | (equal? (manifest-entry-output | 246 | (equal? (manifest-entry-output |
