about summary refs log tree commit diff
path: root/pkgs/development/beam-modules/build-erlang-mk.nix
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/beam-modules/build-erlang-mk.nix
parentbd683bb1ef7a96fbf2fb2e7d45e667009bd99791 (diff)
beam: nixpkgs-fmt
Diffstat (limited to 'pkgs/development/beam-modules/build-erlang-mk.nix')
-rw-r--r--pkgs/development/beam-modules/build-erlang-mk.nix76
1 files changed, 42 insertions, 34 deletions
diff --git a/pkgs/development/beam-modules/build-erlang-mk.nix b/pkgs/development/beam-modules/build-erlang-mk.nix
index a94524276b26a..d1afa55387d3a 100644
--- a/pkgs/development/beam-modules/build-erlang-mk.nix
+++ b/pkgs/development/beam-modules/build-erlang-mk.nix
@@ -1,19 +1,21 @@
 { stdenv, writeText, erlang, perl, which, gitMinimal, wget, lib }:
 
-{ name, version
+{ name
+, version
 , src
 , setupHook ? null
-, buildInputs ? []
-, beamDeps ? []
+, buildInputs ? [ ]
+, beamDeps ? [ ]
 , postPatch ? ""
 , compilePorts ? false
 , installPhase ? null
 , buildPhase ? null
 , configurePhase ? null
-, meta ? {}
+, meta ? { }
 , enableDebugInfo ? false
-, buildFlags ? []
-, ... }@attrs:
+, buildFlags ? [ ]
+, ...
+}@attrs:
 
 with lib;
 
@@ -21,11 +23,11 @@ let
   debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "+debug_info";
 
   shell = drv: stdenv.mkDerivation {
-          name = "interactive-shell-${drv.name}";
-          buildInputs = [ drv ];
-    };
+    name = "interactive-shell-${drv.name}";
+    buildInputs = [ drv ];
+  };
 
-  pkg = self: stdenv.mkDerivation ( attrs // {
+  pkg = self: stdenv.mkDerivation (attrs // {
     app_name = name;
     name = "${name}-${version}";
     inherit version;
@@ -34,11 +36,13 @@ let
 
     inherit src;
 
-    setupHook = if setupHook == null
-    then writeText "setupHook.sh" ''
-       addToSearchPath ERL_LIBS "$1/lib/erlang/lib"
-    ''
-    else setupHook;
+    setupHook =
+      if setupHook == null
+      then
+        writeText "setupHook.sh" ''
+          addToSearchPath ERL_LIBS "$1/lib/erlang/lib"
+        ''
+      else setupHook;
 
     buildInputs = buildInputs ++ [ erlang perl which gitMinimal wget ];
     propagatedBuildInputs = beamDeps;
@@ -47,30 +51,33 @@ let
       ++ lib.optional (enableDebugInfo || erlang.debugInfo) ''ERL_OPTS="$ERL_OPTS +debug_info"''
       ++ buildFlags;
 
-    configurePhase = if configurePhase == null
-    then ''
-      runHook preConfigure
+    configurePhase =
+      if configurePhase == null
+      then ''
+        runHook preConfigure
 
-      # We shouldnt need to do this, but it seems at times there is a *.app in
-      # the repo/package. This ensures we start from a clean slate
-      make SKIP_DEPS=1 clean
+        # We shouldnt need to do this, but it seems at times there is a *.app in
+        # the repo/package. This ensures we start from a clean slate
+        make SKIP_DEPS=1 clean
 
-      runHook postConfigure
-    ''
-    else configurePhase;
+        runHook postConfigure
+      ''
+      else configurePhase;
 
-    buildPhase = if buildPhase == null
-    then ''
+    buildPhase =
+      if buildPhase == null
+      then ''
         runHook preBuild
 
         make $buildFlags "''${buildFlagsArray[@]}"
 
         runHook postBuild
-    ''
-    else buildPhase;
+      ''
+      else buildPhase;
 
-    installPhase =  if installPhase == null
-    then ''
+    installPhase =
+      if installPhase == null
+      then ''
         runHook preInstall
 
         mkdir -p $out/lib/erlang/lib/${name}
@@ -90,13 +97,14 @@ let
         fi
 
         runHook postInstall
-    ''
-    else installPhase;
+      ''
+      else installPhase;
 
     passthru = {
       packageName = name;
       env = shell self;
       inherit beamDeps;
     };
-});
-in fix pkg
+  });
+in
+fix pkg