gnu: ovmf: Simplify build.

* gnu/packages/firmware.scm (ovmf)[arguments]: Change custom 'build-ia32
phase to replace 'build. Remove unneeded substitutions in 'configure,
'build and 'build-x64. Shorten 'build and 'build-x64 phases.
This commit is contained in:
Efraim Flashner 2018-06-07 12:18:32 +03:00
parent 6d095c4cab
commit bb63502f0b
No known key found for this signature in database
GPG Key ID: 41AAE7DCCA3D8351
1 changed files with 7 additions and 17 deletions

View File

@ -262,36 +262,26 @@ coreboot.")
(setenv "PATH" (string-append (getenv "PATH") ":" bin)) (setenv "PATH" (string-append (getenv "PATH") ":" bin))
; FIXME: The below script errors out. When using 'invoke' instead ; FIXME: The below script errors out. When using 'invoke' instead
; of 'system*' this causes the build to fail. ; of 'system*' this causes the build to fail.
(system* "bash" "edksetup.sh" "BaseTools") (system* "bash" "edksetup.sh")
(substitute* "Conf/target.txt" (substitute* "Conf/target.txt"
(("^TARGET[ ]*=.*$") "TARGET = RELEASE\n") (("^TARGET[ ]*=.*$") "TARGET = RELEASE\n")
(("^TOOL_CHAIN_TAG[ ]*=.*$") "TOOL_CHAIN_TAG = GCC49\n")
(("^MAX_CONCURRENT_THREAD_NUMBER[ ]*=.*$") (("^MAX_CONCURRENT_THREAD_NUMBER[ ]*=.*$")
(format #f "MAX_CONCURRENT_THREAD_NUMBER = ~a~%" (format #f "MAX_CONCURRENT_THREAD_NUMBER = ~a~%"
(number->string (parallel-job-count))))) (number->string (parallel-job-count)))))
;; Build build support. ;; Build build support.
(setenv "BUILD_CC" "gcc") (setenv "BUILD_CC" "gcc")
(invoke "make" "-C" (string-append tools "/Source/C")) (invoke "make" "-C" tools)
#t))) #t)))
(add-after 'build 'build-ia32 (replace 'build
(lambda _ (lambda _
(substitute* "Conf/target.txt" (invoke "build" "-a" "IA32" "-t" "GCC49"
(("^TARGET_ARCH[ ]*=.*$") "TARGET_ARCH = IA32\n") "-p" "OvmfPkg/OvmfPkgIa32.dsc")))
(("^ACTIVE_PLATFORM[ ]*=.*$")
"ACTIVE_PLATFORM = OvmfPkg/OvmfPkgIa32.dsc\n"))
(invoke "build")
#t))
,@(if (string=? "x86_64-linux" (%current-system)) ,@(if (string=? "x86_64-linux" (%current-system))
'((add-after 'build 'build-x64 '((add-after 'build 'build-x64
(lambda _ (lambda _
(substitute* "Conf/target.txt" (invoke "build" "-a" "X64" "-t" "GCC49"
(("^TARGET_ARCH[ ]*=.*$") "TARGET_ARCH = X64\n") "-p" "OvmfPkg/OvmfPkgX64.dsc"))))
(("^ACTIVE_PLATFORM[ ]*=.*$")
"ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc\n"))
(invoke "build")
#t)))
'()) '())
(delete 'build)
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))