erlang support: remove broken buildErlang function
The buildErlang function is broken and and leads Engineers down a wrong path. For vanilla erlang that doesn't user rebar3, its better to simply use `stdenv.mkDerivation` along with a set setupHook then the existing functionality.
This commit is contained in:
parent
10fd4dff99
commit
b509dadbf1
|
@ -1,68 +0,0 @@
|
||||||
# This file is not used not tested at this time, build-hex.nix is the currently
|
|
||||||
# main vehicle of bringing Erlang packages in.
|
|
||||||
|
|
||||||
{ stdenv, erlang, rebar, openssl, libyaml }:
|
|
||||||
|
|
||||||
{ name, version
|
|
||||||
, buildInputs ? [], erlangDeps ? []
|
|
||||||
, postPatch ? ""
|
|
||||||
, meta ? {}
|
|
||||||
, ... }@attrs:
|
|
||||||
|
|
||||||
with stdenv.lib;
|
|
||||||
|
|
||||||
stdenv.mkDerivation (attrs // {
|
|
||||||
name = "${name}-${version}";
|
|
||||||
|
|
||||||
buildInputs = buildInputs ++ [ erlang rebar openssl libyaml ];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
rm -f rebar
|
|
||||||
if [ -e "src/${name}.app.src" ]; then
|
|
||||||
sed -i -e 's/{ *vsn *,[^}]*}/{vsn, "${version}"}/' "src/${name}.app.src"
|
|
||||||
fi
|
|
||||||
${postPatch}
|
|
||||||
'';
|
|
||||||
|
|
||||||
configurePhase = let
|
|
||||||
getDeps = drv: [drv] ++ (map getDeps drv.erlangDeps);
|
|
||||||
recursiveDeps = uniqList {
|
|
||||||
inputList = flatten (map getDeps erlangDeps);
|
|
||||||
};
|
|
||||||
in ''
|
|
||||||
runHook preConfigure
|
|
||||||
${concatMapStrings (dep: ''
|
|
||||||
header "linking erlang dependency ${dep}"
|
|
||||||
mkdir deps
|
|
||||||
ln -s "${dep}" "deps/${dep.packageName}"
|
|
||||||
stopNest
|
|
||||||
'') recursiveDeps}
|
|
||||||
runHook postConfigure
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
runHook preBuild
|
|
||||||
rebar compile
|
|
||||||
runHook postBuild
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
for reldir in src ebin priv include; do
|
|
||||||
[ -e "$reldir" ] || continue
|
|
||||||
mkdir "$out"
|
|
||||||
cp -rt "$out" "$reldir"
|
|
||||||
success=1
|
|
||||||
done
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
inherit (erlang.meta) platforms;
|
|
||||||
} // meta;
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
packageName = name;
|
|
||||||
inherit erlangDeps;
|
|
||||||
};
|
|
||||||
})
|
|
|
@ -4,7 +4,6 @@ let
|
||||||
self = rec {
|
self = rec {
|
||||||
hex = import ./hex-packages.nix { callPackage = self.callPackage; };
|
hex = import ./hex-packages.nix { callPackage = self.callPackage; };
|
||||||
callPackage = pkgs.lib.callPackageWith (pkgs // self // hex);
|
callPackage = pkgs.lib.callPackageWith (pkgs // self // hex);
|
||||||
buildErlang = callPackage ./build-erlang.nix {};
|
|
||||||
buildHex = callPackage ./build-hex.nix {};
|
buildHex = callPackage ./build-hex.nix {};
|
||||||
};
|
};
|
||||||
in self // self.hex
|
in self // self.hex
|
||||||
|
|
Loading…
Reference in New Issue