gnu: erlang: Update phase style.

* gnu/packages/erlang.scm (erlang)[arguments]: Substitute INVOKE for
SYSTEM*, don't use %OUTPUTS, and end phases with #t.
This commit is contained in:
Tobias Geerinckx-Rice 2018-02-15 22:56:05 +01:00
parent 629c1947ea
commit 1b0ce451f4
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -95,9 +95,9 @@ (define-public erlang
(add-after 'unpack 'remove-timestamps (add-after 'unpack 'remove-timestamps
(lambda _ (lambda _
(let ((source-date-epoch (let ((source-date-epoch
(time-utc->date (time-utc->date
(make-time time-utc 0 (string->number (make-time time-utc 0 (string->number
(getenv "SOURCE_DATE_EPOCH")))))) (getenv "SOURCE_DATE_EPOCH"))))))
(substitute* "lib/reltool/src/reltool_target.erl" (substitute* "lib/reltool/src/reltool_target.erl"
(("Date = date\\(\\),") (("Date = date\\(\\),")
(string-append "Date = " (string-append "Date = "
@ -116,8 +116,8 @@ (define-public erlang
(substitute* "lib/dialyzer/test/small_SUITE_data/src/gs_make.erl" (substitute* "lib/dialyzer/test/small_SUITE_data/src/gs_make.erl"
(("tuple_to_list\\(date\\(\\)\\),tuple_to_list\\(time\\(\\)\\)") (("tuple_to_list\\(date\\(\\)\\),tuple_to_list\\(time\\(\\)\\)")
(date->string (date->string
source-date-epoch source-date-epoch
"tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})"))) "tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})")))
(substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl" (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
(("\\{Y,Mo,D\\} = date\\(\\),") (("\\{Y,Mo,D\\} = date\\(\\),")
(date->string source-date-epoch (date->string source-date-epoch
@ -125,7 +125,8 @@ (define-public erlang
(substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl" (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
(("\\{H,Mi,S\\} = time\\(\\),") (("\\{H,Mi,S\\} = time\\(\\),")
(date->string source-date-epoch (date->string source-date-epoch
"{H,Mi,S} = {~H,~M,~S},")))))) "{H,Mi,S} = {~H,~M,~S},")))
#t)))
(add-after 'patch-source-shebangs 'patch-source-env (add-after 'patch-source-shebangs 'patch-source-env
(lambda _ (lambda _
(let ((escripts (let ((escripts
@ -141,31 +142,37 @@ (define-public erlang
"make/verify_runtime_dependencies" "make/verify_runtime_dependencies"
"make/emd2exml.in")))) "make/emd2exml.in"))))
(substitute* escripts (substitute* escripts
(("/usr/bin/env") (which "env")))))) (("/usr/bin/env") (which "env")))
#t)))
(add-before 'configure 'set-erl-top (add-before 'configure 'set-erl-top
(lambda _ (lambda _
(setenv "ERL_TOP" (getcwd)))) (setenv "ERL_TOP" (getcwd))
#t))
(add-after 'patch-source-env 'autoconf (add-after 'patch-source-env 'autoconf
(lambda _ (zero? (system* "./otp_build" "autoconf")))) (lambda _
(invoke "./otp_build" "autoconf")
#t))
(add-after 'install 'patch-erl (add-after 'install 'patch-erl
;; This only works after install. ;; This only works after install.
(lambda _ (lambda* (#:key outputs #:allow-other-keys)
(substitute* (string-append (assoc-ref %outputs "out") "/bin/erl") (let* ((out (assoc-ref outputs "out")))
(("sed") (which "sed"))))) (substitute* (string-append out "/bin/erl")
(("sed") (which "sed")))
#t)))
(add-after 'install 'install-doc (add-after 'install 'install-doc
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(manpages (assoc-ref inputs "erlang-manpages")) (manpages (assoc-ref inputs "erlang-manpages"))
(share (string-append out "/share/"))) (share (string-append out "/share/")))
(mkdir-p share) (mkdir-p share)
(mkdir-p (string-append share "/misc/erlang")) (mkdir-p (string-append share "/misc/erlang"))
(with-directory-excursion share (with-directory-excursion share
(and (invoke "tar" "xvf" manpages)
(zero? (system* "tar" "xvf" manpages))
(rename-file "COPYRIGHT" (rename-file "COPYRIGHT"
(string-append share "/misc/erlang/COPYRIGHT")) (string-append share "/misc/erlang/COPYRIGHT"))
;; Delete superfluous file. ;; Delete superfluous file.
(delete-file "PR.template"))))))))) (delete-file "PR.template"))
#t))))))
(home-page "http://erlang.org/") (home-page "http://erlang.org/")
(synopsis "The Erlang programming language") (synopsis "The Erlang programming language")
(description (description