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:
Eric Merritt 2016-01-10 15:16:53 -08:00
parent 10fd4dff99
commit b509dadbf1
2 changed files with 0 additions and 69 deletions

View File

@ -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;
};
})

View File

@ -4,7 +4,6 @@ let
self = rec {
hex = import ./hex-packages.nix { callPackage = self.callPackage; };
callPackage = pkgs.lib.callPackageWith (pkgs // self // hex);
buildErlang = callPackage ./build-erlang.nix {};
buildHex = callPackage ./build-hex.nix {};
};
in self // self.hex