beamPackages: add the ability to override phases

This commit is contained in:
Eric Merritt
2016-06-15 07:19:44 -07:00
parent 285aee3c12
commit 2e61bd72a1
3 changed files with 40 additions and 16 deletions
+16 -6
View File
@@ -8,6 +8,9 @@
, beamDeps ? []
, postPatch ? ""
, compilePorts ? false
, installPhase ? null
, buildPhase ? null
, configurePhase ? null
, meta ? {}
, ... }@attrs:
@@ -38,13 +41,17 @@ let
inherit buildInputs;
propagatedBuildInputs = [ hexRegistrySnapshot hex elixir ] ++ beamDeps;
configurePhase = ''
configurePhase = if configurePhase == null
then ''
runHook preConfigure
${erlang}/bin/escript ${bootstrapper}
runHook postConfigure
'';
''
else configurePhase ;
buildPhase = ''
buildPhase = if buildPhase == null
then ''
runHook preBuild
export HEX_OFFLINE=1
@@ -54,9 +61,11 @@ let
MIX_ENV=prod mix compile --debug-info --no-deps-check
runHook postBuild
'';
''
else buildPhase;
installPhase = ''
installPhase = if installPhase == null
then ''
runHook preInstall
MIXENV=prod
@@ -74,7 +83,8 @@ let
done
runHook postInstall
'';
''
else installPhase;
passthru = {
packageName = name;