mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-29 03:10:19 +00:00
beamPackages.mixRelease: extract mixDepsCompileHook
This commit is contained in:
@@ -85,6 +85,7 @@ makeScopeWithSplicing' {
|
||||
mixAppConfigPatchHook
|
||||
mixBuildDirHook
|
||||
mixCompileHook
|
||||
mixDepsCompileHook
|
||||
mixEscriptSetupHook
|
||||
mixFodDepsSetupHook
|
||||
mixNixDepsSetupHook
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
meta.license = lib.licenses.mit;
|
||||
} ./mix-compile-hook.sh;
|
||||
|
||||
mixDepsCompileHook = makeSetupHook {
|
||||
name = "mix-deps-compile-hook.sh";
|
||||
meta.license = lib.licenses.mit;
|
||||
} ./mix-deps-compile-hook.sh;
|
||||
|
||||
mixEscriptSetupHook = makeSetupHook {
|
||||
name = "mix-escript-setup-hook.sh";
|
||||
meta.license = lib.licenses.mit;
|
||||
|
||||
17
pkgs/development/beam-modules/hooks/mix-deps-compile-hook.sh
Executable file
17
pkgs/development/beam-modules/hooks/mix-deps-compile-hook.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
# shellcheck shell=bash
|
||||
#
|
||||
# This is needed for projects that have a specific compile step
|
||||
# the dependency needs to be compiled in order for the task
|
||||
# to be available.
|
||||
#
|
||||
# Phoenix projects for example will need compile.phoenix.
|
||||
|
||||
mixDepsCompileHook() {
|
||||
echo "Executing mixDepsCompileHook"
|
||||
|
||||
mix deps.compile --no-deps-check --skip-umbrella-children
|
||||
|
||||
echo "Finished mixDepsCompileHook"
|
||||
}
|
||||
|
||||
postConfigureHooks+=(mixDepsCompileHook)
|
||||
@@ -19,6 +19,7 @@
|
||||
gawk,
|
||||
mixBuildDirHook,
|
||||
mixCompileHook,
|
||||
mixDepsCompileHook,
|
||||
mixEscriptSetupHook,
|
||||
mixFodDepsSetupHook,
|
||||
mixNixDepsSetupHook,
|
||||
@@ -122,6 +123,7 @@ lib.extendMkDerivation {
|
||||
|
||||
mixBuildDirHook
|
||||
mixCompileHook
|
||||
mixDepsCompileHook
|
||||
]
|
||||
++ lib.optionals (escriptBinName != null) [ mixEscriptSetupHook ]
|
||||
++ lib.optionals (escriptBinName == null) [ mixReleaseSetupHook ]
|
||||
@@ -165,20 +167,6 @@ lib.extendMkDerivation {
|
||||
}
|
||||
// (attrs.env or { });
|
||||
|
||||
configurePhase =
|
||||
attrs.configurePhase or ''
|
||||
runHook preConfigure
|
||||
|
||||
# This is needed for projects that have a specific compile step
|
||||
# the dependency needs to be compiled in order for the task
|
||||
# to be available.
|
||||
#
|
||||
# Phoenix projects for example will need compile.phoenix.
|
||||
mix deps.compile --no-deps-check --skip-umbrella-children
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
echo "removing files for Microsoft Windows"
|
||||
rm -f "$out"/bin/*.bat
|
||||
|
||||
Reference in New Issue
Block a user