git.iko.soy/typeable/nixpkgs
on master help sign in
erlang: 18.3 -> 18.3.4 (#16244)

Minor OTP releases (and their manpages) are not available for dowload at http://erlang.org/download But e.g.: - 18.3.1 contains an important fix for mnesia - 18.3.1-18.3.4 has a lot of SSL/TLS fixes So we have to fetch from GitHub and build everything ourselves. Also replace explicit path patching with upstream patches: - https://github.com/erlang/otp/pull/1023 - https://github.com/erlang/otp/pull/1103 - with this patch it's now possible to build erlang in sandboxed mode

commit54a15fb2e4272ce80dc30b153b77fe8089c8a7f3 authorAlexey Lebedeff <binarin@gmail.com> dateWed 13 Jul 2016, 21:41 (10 years ago) parent5d00148
1 file changed+34−23
pkgs/development/interpreters/erlang/R18.nix+34−23
pkgs/development/interpreters/erlang/R18.nix+34−23
@@ -1,5 +1,5 @@
1−{ stdenv, fetchurl, perl, gnum4, ncurses, openssl
2−, gnused, gawk, makeWrapper
1+{ stdenv, fetchurl, fetchFromGitHub, perl, gnum4, ncurses, openssl
2+, gnused, gawk, autoconf, libxslt, libxml2, makeWrapper
33, Carbon, Cocoa
44, odbcSupport ? false, unixODBC ? null
55, wxSupport ? true, mesa ? null, wxGTK ? null, xorg ? null, wxmac ? null
@@ -20,15 +20,21 @@ with stdenv.lib;
2020stdenv.mkDerivation rec {
2121 name = "erlang-" + version + "${optionalString odbcSupport "-odbc"}"
2222 + "${optionalString javacSupport "-javac"}";
23− version = "18.2";
24−
25− src = fetchurl {
26− url = "http://www.erlang.org/download/otp_src_${version}.tar.gz";
27− sha256 = "1l1zzf245w1abiylll8pjm0pppqwvvw4fihknqkcybkx62n2ipj3";
23+ version = "18.3.4";
24+
25+ # Minor OTP releases are not always released as tarbals at
26+ # http://erlang.org/download/ So we have to download from
27+ # github. And for the same reason we can't use a prebuilt manpages
28+ # tarball and need to build manpages ourselves.
29+ src = fetchFromGitHub {
30+ owner = "erlang";
31+ repo = "otp";
32+ rev = "OTP-${version}";
33+ sha256 = "1f8nhybzsdmjvkmkzpjj3wj9jzx8mihlvi6gfp47fxkalansz39h";
2834 };
2935
3036 buildInputs =
31− [ perl gnum4 ncurses openssl makeWrapper
37+ [ perl gnum4 ncurses openssl autoconf libxslt libxml2 makeWrapper
3238 ] ++ optionals wxSupport (if stdenv.isDarwin then [ wxmac ] else [ mesa wxGTK xorg.libX11 ])
3339 ++ optional odbcSupport unixODBC
3440 ++ optional javacSupport openjdk
@@ -36,11 +42,23 @@ stdenv.mkDerivation rec {
3642
3743 debugInfo = enableDebugInfo;
3844
39− patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
45+ rmAndPwdPatch = fetchurl {
46+ url = "https://github.com/erlang/otp/commit/98b8650d22e94a5ff839170833f691294f6276d0.patch";
47+ sha256 = "0cd5pkqrigiqz6cyma5irqwzn0bi17k371k9vlg8ir31h3zmqfip";
48+ };
49+
50+ envAndCpPatch = fetchurl {
51+ url = "https://github.com/binarin/otp/commit/9f9841eb7327c9fe73e84e197fd2965a97b639cf.patch";
52+ sha256 = "10h5348p6g279b4q01i5jdqlljww5chcvrx5b4b0dv79pk0p0m9f";
53+ };
54+
55+ patches = [
56+ rmAndPwdPatch
57+ envAndCpPatch
58+ ];
4059
4160 preConfigure = ''
42− export HOME=$PWD/../
43− sed -e s@/bin/pwd@pwd@g -i otp_build
61+ ./otp_build autoconf
4462 '';
4563
4664 configureFlags= [
@@ -51,19 +69,12 @@ stdenv.mkDerivation rec {
5169 ++ optional javacSupport "--with-javac"
5270 ++ optional stdenv.isDarwin "--enable-darwin-64bit";
5371
54− postInstall = let
55− manpages = fetchurl {
56− url = "http://www.erlang.org/download/otp_doc_man_${version}.tar.gz";
57− sha256 = "0abaqnw6hkr1h1zw6cdqwg2k7rfmj2b9sqqldnqf3qaj0shz759n";
58− };
59− in ''
72+ # install-docs will generate and install manpages and html docs
73+ # (PDFs are generated only when fop is available).
74+ installTargets = "install install-docs";
75+
76+ postInstall = ''
6077 ln -s $out/lib/erlang/lib/erl_interface*/bin/erl_call $out/bin/erl_call
61− tar xf "${manpages}" -C "$out/lib/erlang"
62− for i in "$out"/lib/erlang/man/man[0-9]/*.[0-9]; do
63− prefix="''${i%/*}"
64− ensureDir "$out/share/man/''${prefix##*/}"
65− ln -s "$i" "$out/share/man/''${prefix##*/}/''${i##*/}erl"
66− done
6778 '';
6879
6980 # Some erlang bin/ scripts run sed and awk