;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2016, 2017 Pjotr Prins <pjotr.guix@thebird.nl>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 ng0 <ng0@n0.is>
;;;
;;; This file is part of GNU Guix.
;;;
(define-module (gnu packages erlang)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system emacs)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages)
(define-public erlang
(package
(name "erlang")
- (version "20.2.3")
+ (version "21.0.5")
(source (origin
- (method url-fetch)
+ (method git-fetch)
;; The tarball from http://erlang.org/download contains many
;; pre-compiled files, so we use this snapshot of the source
;; repository.
- (uri (string-append "https://github.com/erlang/otp/archive/OTP-"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (uri (git-reference
+ (url "https://github.com/erlang/otp.git")
+ (commit (string-append "OTP-" version))))
+ (file-name (git-file-name name version))
(sha256
(base32
- "0s9g4ijdbqq21k4cqggz074d3fiimah942qisv2kgizhlivpw2nm"))
+ "0gv83i5ybj1z3ykbbldjzf7dbfjszp84c0yzrpshj611b9wp0176"))
(patches (search-patches "erlang-man-path.patch"))))
(build-system gnu-build-system)
(native-inputs
(version-major+minor version) ".tar.gz"))
(sha256
(base32
- "1pyb8wbk7znsyni8d1k4dj1m01lr191dcrrzisli1z27ks7hh3lm"))))))
+ "0cgv23q0215f6lvmhj4w9skx5m29khjs9mb890635s3yp520xgqh"))))))
(inputs
`(("ncurses" ,ncurses)
("openssl" ,openssl)
(guix build gnu-build-system))
#:phases
(modify-phases %standard-phases
+ (delete 'bootstrap)
;; The are several code fragments that embed timestamps into the
;; output. Here, we alter those fragments to use the value of
;; SOURCE_DATE_EPOCH instead.
(date->string source-date-epoch
"{H,Mi,S} = {~H,~M,~S},")))
#t)))
+ (add-after 'unpack 'patch-/bin/sh
+ (lambda _
+ (substitute* "erts/etc/unix/run_erl.c"
+ (("sh = \"/bin/sh\";")
+ (string-append "sh = \""
+ (which "sh")
+ "\";")))
+
+ (substitute* "erts/emulator/sys/unix/sys_drivers.c"
+ (("SHELL \"/bin/sh\"")
+ (string-append "SHELL \""
+ (which "sh")
+ "\"")))
+ (substitute* "erts/emulator/sys/unix/erl_child_setup.c"
+ (("SHELL \"/bin/sh\"")
+ (string-append "SHELL \""
+ (which "sh")
+ "\"")))
+
+ (substitute* "lib/kernel/src/os.erl"
+ (("/bin/sh") (which "sh")))
+
+ #t))
(add-after 'patch-source-shebangs 'patch-source-env
(lambda _
(let ((escripts
;; Delete superfluous file.
(delete-file "PR.template"))
#t))))))
- (home-page "http://erlang.org/")
+ (home-page "https://www.erlang.org/")
(synopsis "The Erlang programming language")
(description
"Erlang is a programming language used to build massively
;; have other licenses. See 'system/COPYRIGHT' in the source distribution.
(license (list license:asl2.0 license:bsd-2 license:bsd-3 license:expat
license:lgpl2.0+ license:tcl/tk license:zlib))))
+
+(define-public emacs-erlang
+ (package
+ (name "emacs-erlang")
+ (version (package-version erlang))
+ (source (package-source erlang))
+ (build-system emacs-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'set-emacs-load-path 'change-working-directory
+ (lambda _ (chdir "lib/tools/emacs") #t)))))
+ (home-page "https://www.erlang.org/")
+ (synopsis "Erlang major mode for Emacs")
+ (description
+ "This package provides an Emacs major mode for editing Erlang source
+files.")
+ (license license:asl2.0)))