2019-10-21 14:31:02 +00:00
|
|
|
{stdenv, lib, fetchurl, registryDat}:
|
2018-11-18 20:07:31 +00:00
|
|
|
|
|
|
|
ver: deps:
|
|
|
|
let cmds = lib.mapAttrsToList (name: info: let
|
|
|
|
pkg = stdenv.mkDerivation {
|
|
|
|
name = lib.replaceChars ["/"] ["-"] name + "-${info.version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/${name}/archive/${info.version}.tar.gz";
|
|
|
|
meta.homepage = "https://github.com/${name}/";
|
|
|
|
inherit (info) sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
in ''
|
2019-10-21 14:31:02 +00:00
|
|
|
mkdir -p .elm/${ver}/packages/${name}
|
|
|
|
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
|
2018-11-18 20:07:31 +00:00
|
|
|
'') deps;
|
|
|
|
in (lib.concatStrings cmds) + ''
|
2019-10-21 14:31:02 +00:00
|
|
|
mkdir -p .elm/${ver}/packages;
|
|
|
|
cp ${registryDat} .elm/${ver}/packages/registry.dat;
|
2018-11-18 20:07:31 +00:00
|
|
|
chmod -R +w .elm
|
|
|
|
''
|