2019-10-21 16:31:02 +02:00
|
|
|
{stdenv, lib, fetchurl, registryDat}:
|
2018-11-18 21:07:31 +01: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 20:54:20 +02:00
|
|
|
configurePhase = ''
|
|
|
|
true
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
true
|
|
|
|
'';
|
|
|
|
|
2018-11-18 21:07:31 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in ''
|
2019-10-21 16:31:02 +02:00
|
|
|
mkdir -p .elm/${ver}/packages/${name}
|
|
|
|
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
|
2018-11-18 21:07:31 +01:00
|
|
|
'') deps;
|
|
|
|
in (lib.concatStrings cmds) + ''
|
2019-10-21 16:31:02 +02:00
|
|
|
mkdir -p .elm/${ver}/packages;
|
|
|
|
cp ${registryDat} .elm/${ver}/packages/registry.dat;
|
2018-11-18 21:07:31 +01:00
|
|
|
chmod -R +w .elm
|
|
|
|
''
|