summary refs log tree commit diff
path: root/pkgs/development/interpreters/erlang
diff options
context:
space:
mode:
authorhappysalada <raphael@megzari.com>2021-06-03 21:58:02 +0900
committerRaphael Megzari <raphael@megzari.com>2021-06-03 22:15:31 +0900
commitaf0844c7a2992b7d653a879e1cb1f7257e5957c0 (patch)
treec7df050d37a4517b34b3c6fc76c320d9d48c3096 /pkgs/development/interpreters/erlang
parentbd683bb1ef7a96fbf2fb2e7d45e667009bd99791 (diff)
downloadnixpkgs-af0844c7a2992b7d653a879e1cb1f7257e5957c0.tar
nixpkgs-af0844c7a2992b7d653a879e1cb1f7257e5957c0.tar.gz
nixpkgs-af0844c7a2992b7d653a879e1cb1f7257e5957c0.tar.bz2
nixpkgs-af0844c7a2992b7d653a879e1cb1f7257e5957c0.tar.lz
nixpkgs-af0844c7a2992b7d653a879e1cb1f7257e5957c0.tar.xz
nixpkgs-af0844c7a2992b7d653a879e1cb1f7257e5957c0.tar.zst
nixpkgs-af0844c7a2992b7d653a879e1cb1f7257e5957c0.zip
beam: nixpkgs-fmt
Diffstat (limited to 'pkgs/development/interpreters/erlang')
-rw-r--r--pkgs/development/interpreters/erlang/generic-builder.nix141
1 files changed, 90 insertions, 51 deletions
diff --git a/pkgs/development/interpreters/erlang/generic-builder.nix b/pkgs/development/interpreters/erlang/generic-builder.nix
index aba4c318bea..1f2f3a25a5e 100644
--- a/pkgs/development/interpreters/erlang/generic-builder.nix
+++ b/pkgs/development/interpreters/erlang/generic-builder.nix
@@ -1,12 +1,32 @@
-{ pkgs, lib, stdenv, fetchFromGitHub, makeWrapper, gawk, gnum4, gnused
-, libxml2, libxslt, ncurses, openssl, perl, autoconf
+{ pkgs
+, lib
+, stdenv
+, fetchFromGitHub
+, makeWrapper
+, gawk
+, gnum4
+, gnused
+, libxml2
+, libxslt
+, ncurses
+, openssl
+, perl
+, autoconf
 , openjdk11 ? null # javacSupport
 , unixODBC ? null # odbcSupport
-, libGL ? null, libGLU ? null, wxGTK ? null, wxmac ? null, xorg ? null
+, libGL ? null
+, libGLU ? null
+, wxGTK ? null
+, wxmac ? null
+, xorg ? null
 , parallelBuild ? false
-, systemd, wxSupport ? true
-# updateScript deps
-, writeScript, common-updater-scripts, coreutils, git
+, systemd
+, wxSupport ? true
+  # updateScript deps
+, writeScript
+, common-updater-scripts
+, coreutils
+, git
 }:
 { baseName ? "erlang"
 , version
@@ -18,25 +38,42 @@
 , enableThreads ? true
 , enableSmpSupport ? true
 , enableKernelPoll ? true
-, javacSupport ? false, javacPackages ? [ openjdk11 ]
-, odbcSupport ? false, odbcPackages ? [ unixODBC ]
+, javacSupport ? false
+, javacPackages ? [ openjdk11 ]
+, odbcSupport ? false
+, odbcPackages ? [ unixODBC ]
 , withSystemd ? stdenv.isLinux # systemd support in epmd
 , opensslPackage ? openssl
 , wxPackages ? [ libGL libGLU wxGTK xorg.libX11 ]
-, preUnpack ? "", postUnpack ? ""
-, patches ? [], patchPhase ? "", prePatch ? "", postPatch ? ""
-, configureFlags ? [], configurePhase ? "", preConfigure ? "", postConfigure ? ""
-, buildPhase ? "", preBuild ? "", postBuild ? ""
-, installPhase ? "", preInstall ? "", postInstall ? ""
+, preUnpack ? ""
+, postUnpack ? ""
+, patches ? [ ]
+, patchPhase ? ""
+, prePatch ? ""
+, postPatch ? ""
+, configureFlags ? [ ]
+, configurePhase ? ""
+, preConfigure ? ""
+, postConfigure ? ""
+, buildPhase ? ""
+, preBuild ? ""
+, postBuild ? ""
+, installPhase ? ""
+, preInstall ? ""
+, postInstall ? ""
 , installTargets ? [ "install" "install-docs" ]
-, checkPhase ? "", preCheck ? "", postCheck ? ""
-, fixupPhase ? "", preFixup ? "", postFixup ? ""
-, meta ? {}
+, checkPhase ? ""
+, preCheck ? ""
+, postCheck ? ""
+, fixupPhase ? ""
+, preFixup ? ""
+, postFixup ? ""
+, meta ? { }
 }:
 
 assert wxSupport -> (if stdenv.isDarwin
-  then wxmac != null
-  else libGL != null && libGLU != null && wxGTK != null && xorg != null);
+then wxmac != null
+else libGL != null && libGLU != null && wxGTK != null && xorg != null);
 
 assert odbcSupport -> unixODBC != null;
 assert javacSupport -> openjdk11 != null;
@@ -45,7 +82,8 @@ let
   inherit (lib) optional optionals optionalAttrs optionalString;
   wxPackages2 = if stdenv.isDarwin then [ wxmac ] else wxPackages;
 
-in stdenv.mkDerivation ({
+in
+stdenv.mkDerivation ({
   name = "${baseName}-${version}"
     + optionalString javacSupport "-javac"
     + optionalString odbcSupport "-odbc";
@@ -109,19 +147,20 @@ in stdenv.mkDerivation ({
   passthru = {
     updateScript =
       let major = builtins.head (builtins.splitVersion version);
-      in writeScript "update.sh" ''
-      #!${stdenv.shell}
-      set -ox errexit
-      PATH=${lib.makeBinPath [ common-updater-scripts coreutils git gnused ]}
-      latest=$(list-git-tags https://github.com/erlang/otp.git | sed -n 's/^OTP-${major}/${major}/p' | sort -V | tail -1)
-      if [ "$latest" != "${version}" ]; then
-        nixpkgs="$(git rev-parse --show-toplevel)"
-        nix_file="$nixpkgs/pkgs/development/interpreters/erlang/R${major}.nix"
-        update-source-version ${baseName}R${major} "$latest" --version-key=version --print-changes --file="$nix_file"
-      else
-        echo "${baseName}R${major} is already up-to-date"
-      fi
-    '';
+      in
+      writeScript "update.sh" ''
+        #!${stdenv.shell}
+        set -ox errexit
+        PATH=${lib.makeBinPath [ common-updater-scripts coreutils git gnused ]}
+        latest=$(list-git-tags https://github.com/erlang/otp.git | sed -n 's/^OTP-${major}/${major}/p' | sort -V | tail -1)
+        if [ "$latest" != "${version}" ]; then
+          nixpkgs="$(git rev-parse --show-toplevel)"
+          nix_file="$nixpkgs/pkgs/development/interpreters/erlang/R${major}.nix"
+          update-source-version ${baseName}R${major} "$latest" --version-key=version --print-changes --file="$nix_file"
+        else
+          echo "${baseName}R${major} is already up-to-date"
+        fi
+      '';
   };
 
   meta = with lib; ({
@@ -143,24 +182,24 @@ in stdenv.mkDerivation ({
     license = licenses.asl20;
   } // meta);
 }
-// optionalAttrs (preUnpack != "")      { inherit preUnpack; }
-// optionalAttrs (postUnpack != "")     { inherit postUnpack; }
-// optionalAttrs (patches != [])        { inherit patches; }
-// optionalAttrs (prePatch != "")       { inherit prePatch; }
-// optionalAttrs (patchPhase != "")     { inherit patchPhase; }
+// optionalAttrs (preUnpack != "") { inherit preUnpack; }
+// optionalAttrs (postUnpack != "") { inherit postUnpack; }
+// optionalAttrs (patches != [ ]) { inherit patches; }
+// optionalAttrs (prePatch != "") { inherit prePatch; }
+// optionalAttrs (patchPhase != "") { inherit patchPhase; }
 // optionalAttrs (configurePhase != "") { inherit configurePhase; }
-// optionalAttrs (preConfigure != "")   { inherit preConfigure; }
-// optionalAttrs (postConfigure != "")  { inherit postConfigure; }
-// optionalAttrs (buildPhase != "")     { inherit buildPhase; }
-// optionalAttrs (preBuild != "")       { inherit preBuild; }
-// optionalAttrs (postBuild != "")      { inherit postBuild; }
-// optionalAttrs (checkPhase != "")     { inherit checkPhase; }
-// optionalAttrs (preCheck != "")       { inherit preCheck; }
-// optionalAttrs (postCheck != "")      { inherit postCheck; }
-// optionalAttrs (installPhase != "")   { inherit installPhase; }
-// optionalAttrs (installTargets != []) { inherit installTargets; }
-// optionalAttrs (preInstall != "")     { inherit preInstall; }
-// optionalAttrs (fixupPhase != "")     { inherit fixupPhase; }
-// optionalAttrs (preFixup != "")       { inherit preFixup; }
-// optionalAttrs (postFixup != "")      { inherit postFixup; }
+// optionalAttrs (preConfigure != "") { inherit preConfigure; }
+// optionalAttrs (postConfigure != "") { inherit postConfigure; }
+// optionalAttrs (buildPhase != "") { inherit buildPhase; }
+// optionalAttrs (preBuild != "") { inherit preBuild; }
+// optionalAttrs (postBuild != "") { inherit postBuild; }
+// optionalAttrs (checkPhase != "") { inherit checkPhase; }
+// optionalAttrs (preCheck != "") { inherit preCheck; }
+// optionalAttrs (postCheck != "") { inherit postCheck; }
+// optionalAttrs (installPhase != "") { inherit installPhase; }
+// optionalAttrs (installTargets != [ ]) { inherit installTargets; }
+// optionalAttrs (preInstall != "") { inherit preInstall; }
+// optionalAttrs (fixupPhase != "") { inherit fixupPhase; }
+// optionalAttrs (preFixup != "") { inherit preFixup; }
+// optionalAttrs (postFixup != "") { inherit postFixup; }
 )