@@ -1,12 +1,32 @@
1−{ pkgs, lib, stdenv, fetchFromGitHub, makeWrapper, gawk, gnum4, gnused
2−, libxml2, libxslt, ncurses, openssl, perl, autoconf
1+{ pkgs
2+, lib
3+, stdenv
4+, fetchFromGitHub
5+, makeWrapper
6+, gawk
7+, gnum4
8+, gnused
9+, libxml2
10+, libxslt
11+, ncurses
12+, openssl
13+, perl
14+, autoconf
315, openjdk11 ? null # javacSupport
416, unixODBC ? null # odbcSupport
5−, libGL ? null, libGLU ? null, wxGTK ? null, wxmac ? null, xorg ? null
17+, libGL ? null
18+, libGLU ? null
19+, wxGTK ? null
20+, wxmac ? null
21+, xorg ? null
622, parallelBuild ? false
7−, systemd, wxSupport ? true
8−# updateScript deps
9−, writeScript, common-updater-scripts, coreutils, git
23+, systemd
24+, wxSupport ? true
25+ # updateScript deps
26+, writeScript
27+, common-updater-scripts
28+, coreutils
29+, git
1030}:
1131{ baseName ? "erlang"
1232, version
@@ -18,25 +38,42 @@
1838, enableThreads ? true
1939, enableSmpSupport ? true
2040, enableKernelPoll ? true
21−, javacSupport ? false, javacPackages ? [ openjdk11 ]
22−, odbcSupport ? false, odbcPackages ? [ unixODBC ]
41+, javacSupport ? false
42+, javacPackages ? [ openjdk11 ]
43+, odbcSupport ? false
44+, odbcPackages ? [ unixODBC ]
2345, withSystemd ? stdenv.isLinux # systemd support in epmd
2446, opensslPackage ? openssl
2547, wxPackages ? [ libGL libGLU wxGTK xorg.libX11 ]
26−, preUnpack ? "", postUnpack ? ""
27−, patches ? [], patchPhase ? "", prePatch ? "", postPatch ? ""
28−, configureFlags ? [], configurePhase ? "", preConfigure ? "", postConfigure ? ""
29−, buildPhase ? "", preBuild ? "", postBuild ? ""
30−, installPhase ? "", preInstall ? "", postInstall ? ""
48+, preUnpack ? ""
49+, postUnpack ? ""
50+, patches ? [ ]
51+, patchPhase ? ""
52+, prePatch ? ""
53+, postPatch ? ""
54+, configureFlags ? [ ]
55+, configurePhase ? ""
56+, preConfigure ? ""
57+, postConfigure ? ""
58+, buildPhase ? ""
59+, preBuild ? ""
60+, postBuild ? ""
61+, installPhase ? ""
62+, preInstall ? ""
63+, postInstall ? ""
3164, installTargets ? [ "install" "install-docs" ]
32−, checkPhase ? "", preCheck ? "", postCheck ? ""
33−, fixupPhase ? "", preFixup ? "", postFixup ? ""
34−, meta ? {}
65+, checkPhase ? ""
66+, preCheck ? ""
67+, postCheck ? ""
68+, fixupPhase ? ""
69+, preFixup ? ""
70+, postFixup ? ""
71+, meta ? { }
3572}:
3673
3774assert wxSupport -> (if stdenv.isDarwin
38− then wxmac != null
39− else libGL != null && libGLU != null && wxGTK != null && xorg != null);
75+then wxmac != null
76+else libGL != null && libGLU != null && wxGTK != null && xorg != null);
4077
4178assert odbcSupport -> unixODBC != null;
4279assert javacSupport -> openjdk11 != null;
@@ -45,7 +82,8 @@ let
4582 inherit (lib) optional optionals optionalAttrs optionalString;
4683 wxPackages2 = if stdenv.isDarwin then [ wxmac ] else wxPackages;
4784
48−in stdenv.mkDerivation ({
85+in
86+stdenv.mkDerivation ({
4987 name = "${baseName}-${version}"
5088 + optionalString javacSupport "-javac"
5189 + optionalString odbcSupport "-odbc";
@@ -109,19 +147,20 @@ in stdenv.mkDerivation ({
109147 passthru = {
110148 updateScript =
111149 let major = builtins.head (builtins.splitVersion version);
112− in writeScript "update.sh" ''
113− #!${stdenv.shell}
114− set -ox errexit
115− PATH=${lib.makeBinPath [ common-updater-scripts coreutils git gnused ]}
116− latest=$(list-git-tags https://github.com/erlang/otp.git | sed -n 's/^OTP-${major}/${major}/p' | sort -V | tail -1)
117− if [ "$latest" != "${version}" ]; then
118− nixpkgs="$(git rev-parse --show-toplevel)"
119− nix_file="$nixpkgs/pkgs/development/interpreters/erlang/R${major}.nix"
120− update-source-version ${baseName}R${major} "$latest" --version-key=version --print-changes --file="$nix_file"
121− else
122− echo "${baseName}R${major} is already up-to-date"
123− fi
124− '';
150+ in
151+ writeScript "update.sh" ''
152+ #!${stdenv.shell}
153+ set -ox errexit
154+ PATH=${lib.makeBinPath [ common-updater-scripts coreutils git gnused ]}
155+ latest=$(list-git-tags https://github.com/erlang/otp.git | sed -n 's/^OTP-${major}/${major}/p' | sort -V | tail -1)
156+ if [ "$latest" != "${version}" ]; then
157+ nixpkgs="$(git rev-parse --show-toplevel)"
158+ nix_file="$nixpkgs/pkgs/development/interpreters/erlang/R${major}.nix"
159+ update-source-version ${baseName}R${major} "$latest" --version-key=version --print-changes --file="$nix_file"
160+ else
161+ echo "${baseName}R${major} is already up-to-date"
162+ fi
163+ '';
125164 };
126165
127166 meta = with lib; ({
@@ -143,24 +182,24 @@ in stdenv.mkDerivation ({
143182 license = licenses.asl20;
144183 } // meta);
145184}
146−// optionalAttrs (preUnpack != "") { inherit preUnpack; }
147−// optionalAttrs (postUnpack != "") { inherit postUnpack; }
148−// optionalAttrs (patches != []) { inherit patches; }
149−// optionalAttrs (prePatch != "") { inherit prePatch; }
150−// optionalAttrs (patchPhase != "") { inherit patchPhase; }
185+// optionalAttrs (preUnpack != "") { inherit preUnpack; }
186+// optionalAttrs (postUnpack != "") { inherit postUnpack; }
187+// optionalAttrs (patches != [ ]) { inherit patches; }
188+// optionalAttrs (prePatch != "") { inherit prePatch; }
189+// optionalAttrs (patchPhase != "") { inherit patchPhase; }
151190// optionalAttrs (configurePhase != "") { inherit configurePhase; }
152−// optionalAttrs (preConfigure != "") { inherit preConfigure; }
153−// optionalAttrs (postConfigure != "") { inherit postConfigure; }
154−// optionalAttrs (buildPhase != "") { inherit buildPhase; }
155−// optionalAttrs (preBuild != "") { inherit preBuild; }
156−// optionalAttrs (postBuild != "") { inherit postBuild; }
157−// optionalAttrs (checkPhase != "") { inherit checkPhase; }
158−// optionalAttrs (preCheck != "") { inherit preCheck; }
159−// optionalAttrs (postCheck != "") { inherit postCheck; }
160−// optionalAttrs (installPhase != "") { inherit installPhase; }
161−// optionalAttrs (installTargets != []) { inherit installTargets; }
162−// optionalAttrs (preInstall != "") { inherit preInstall; }
163−// optionalAttrs (fixupPhase != "") { inherit fixupPhase; }
164−// optionalAttrs (preFixup != "") { inherit preFixup; }
165−// optionalAttrs (postFixup != "") { inherit postFixup; }
191+// optionalAttrs (preConfigure != "") { inherit preConfigure; }
192+// optionalAttrs (postConfigure != "") { inherit postConfigure; }
193+// optionalAttrs (buildPhase != "") { inherit buildPhase; }
194+// optionalAttrs (preBuild != "") { inherit preBuild; }
195+// optionalAttrs (postBuild != "") { inherit postBuild; }
196+// optionalAttrs (checkPhase != "") { inherit checkPhase; }
197+// optionalAttrs (preCheck != "") { inherit preCheck; }
198+// optionalAttrs (postCheck != "") { inherit postCheck; }
199+// optionalAttrs (installPhase != "") { inherit installPhase; }
200+// optionalAttrs (installTargets != [ ]) { inherit installTargets; }
201+// optionalAttrs (preInstall != "") { inherit preInstall; }
202+// optionalAttrs (fixupPhase != "") { inherit fixupPhase; }
203+// optionalAttrs (preFixup != "") { inherit preFixup; }
204+// optionalAttrs (postFixup != "") { inherit postFixup; }
166205)