2019-10-21 15:31:02 +01: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;
|
|
|
|
};
|
|
|
|
|
2020-05-03 19:54:20 +01:00
|
|
|
configurePhase = ''
|
|
|
|
true
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
true
|
|
|
|
'';
|
|
|
|
|
2018-11-18 20:07:31 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in ''
|
2019-10-21 15:31:02 +01: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 15:31:02 +01: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
|
|
|
|
''
|