2018-05-30 16:54:56 +01:00
|
|
|
{stdenv, lib, fetchFromGitHub, 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-30 16:54:56 +01:00
|
|
|
src = fetchFromGitHub 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 {
|
2018-07-31 15:54:37 +01:00
|
|
|
version = "0.2.0";
|
2018-05-27 20:13:22 +01:00
|
|
|
name = "mint-${version}";
|
2018-05-30 16:54:56 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mint-lang";
|
|
|
|
repo = "mint";
|
2018-07-31 15:54:37 +01:00
|
|
|
rev = "0.2.0";
|
|
|
|
sha256 = "1ds9zrvbmnfy744i9ri6v4w37aw7ccmdxzxmy8l97h045hzz9cp3";
|
2018-05-27 20:13:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ crystal zlib openssl duktape ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2018-07-06 10:32:08 +01:00
|
|
|
mkdir -p $out/bin tmp
|
2018-05-27 20:13:22 +01:00
|
|
|
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 = {
|
2018-05-30 16:54:56 +01:00
|
|
|
description = "A refreshing language for the front-end web";
|
2018-05-27 20:13:22 +01:00
|
|
|
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" ];
|
|
|
|
};
|
|
|
|
}
|