3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/mint/default.nix

61 lines
1.6 KiB
Nix
Raw Normal View History

2018-05-27 21:41:44 +01:00
{stdenv, lib, fetchgit, crystal, zlib, openssl, duktape}:
2018-05-27 20:13:22 +01:00
let
crystalPackages = lib.mapAttrs (name: src:
stdenv.mkDerivation {
name = lib.replaceStrings ["/"] ["-"] name;
2018-05-27 21:41:44 +01:00
src = fetchgit src;
2018-05-27 20:13:22 +01:00
phases = "installPhase";
installPhase = ''cp -r $src $out'';
passthru = { libName = name; };
}
) (import ./shards.nix);
crystalLib = stdenv.mkDerivation {
name = "crystal-lib";
src = lib.attrValues crystalPackages;
libNames = lib.mapAttrsToList (k: v: [k v]) crystalPackages;
phases = "buildPhase";
buildPhase = ''
mkdir -p $out
linkup () {
while [ "$#" -gt 0 ]; do
ln -s $2 $out/$1
shift; shift
done
}
linkup $libNames
'';
};
in
stdenv.mkDerivation rec {
version = "2018-05-27";
name = "mint-${version}";
2018-05-27 21:41:44 +01:00
src = fetchgit {
2018-05-27 20:13:22 +01:00
url = "https://github.com/mint-lang/mint.git";
rev = "a3f0c86f54b8b3a18dda5c39c2089bdb1d774b4f";
2018-05-27 21:41:44 +01:00
sha256 = "1bgs6jkwfc2ksq4gj55cl3h2l5g25f5bwlsjryiw9cbx5k4bp1kz";
2018-05-27 20:13:22 +01:00
};
buildInputs = [ crystal zlib openssl duktape ];
buildPhase = ''
mkdir -p $out/bin
mkdir tmp
cd tmp
ln -s ${crystalLib} lib
cp -r $src/* .
crystal build src/mint.cr -o $out/bin/mint --verbose --progress --release --no-debug
'';
installPhase = ''true'';
meta = {
description = "A refreshing language for the front-end web.";
homepage = https://mint-lang.com/;
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ manveru ];
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
};
}