1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-16 09:53:17 +00:00
nixpkgs/pkgs/development/compilers/elm/makeDotElm.nix
Márton Boros 31c42bb05b
makeDotElm: fix
Some elm packages (eg. https://github.com/NoRedInk/elm-simple-fuzzy/ ) have a Makefile which the standard builder tries to build and fails because of missing dependencies. This change forces a no-op configure and build phase to avoid such a situation.
2020-05-03 21:54:20 +03:00

36 lines
1.1 KiB
Nix

{stdenv, lib, fetchurl, registryDat}:
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;
};
configurePhase = ''
true
'';
buildPhase = ''
true
'';
installPhase = ''
mkdir -p $out
cp -r * $out
'';
};
in ''
mkdir -p .elm/${ver}/packages/${name}
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
'') deps;
in (lib.concatStrings cmds) + ''
mkdir -p .elm/${ver}/packages;
cp ${registryDat} .elm/${ver}/packages/registry.dat;
chmod -R +w .elm
''