forked from mirrors/nixpkgs
Mint-lang: Init at 2018.05.27
This commit is contained in:
parent
3b5fd4dada
commit
d6c4e3e8fb
27
pkgs/development/compilers/mint/crystal2nix.cr
Normal file
27
pkgs/development/compilers/mint/crystal2nix.cr
Normal file
|
@ -0,0 +1,27 @@
|
|||
require "yaml"
|
||||
|
||||
File.open "shards.nix", "w+" do |file|
|
||||
file.puts "{"
|
||||
yaml = YAML.parse(File.read("shard.lock"))
|
||||
yaml["shards"].each do |key, value|
|
||||
file.puts " #{key} = {"
|
||||
file.puts %( url = "https://github.com/#{value["github"]}";)
|
||||
if value["commit"]?
|
||||
file.puts %( rev = "#{value["commit"]}";)
|
||||
else
|
||||
url = "https://github.com/#{value["github"]}"
|
||||
ref = "v#{value["version"]}"
|
||||
|
||||
puts "git ls-remote #{url} #{ref}"
|
||||
Process.run("git", args: ["ls-remote", url, ref]) do |x|
|
||||
x.error.each_line { |e| puts e }
|
||||
x.output.each_line { |o| value.as_h["commit"] = o.split("\t")[0] }
|
||||
end
|
||||
|
||||
file.puts %( rev = "#{value["commit"]};)
|
||||
end
|
||||
|
||||
file.puts " };"
|
||||
end
|
||||
file.puts "}"
|
||||
end
|
59
pkgs/development/compilers/mint/default.nix
Normal file
59
pkgs/development/compilers/mint/default.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{stdenv, lib, remarshal, runCommand, crystal, zlib, openssl, duktape}:
|
||||
let
|
||||
crystalPackages = lib.mapAttrs (name: src:
|
||||
stdenv.mkDerivation {
|
||||
name = lib.replaceStrings ["/"] ["-"] name;
|
||||
src = fetchGit src;
|
||||
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}";
|
||||
src = fetchGit {
|
||||
url = "https://github.com/mint-lang/mint.git";
|
||||
rev = "a3f0c86f54b8b3a18dda5c39c2089bdb1d774b4f";
|
||||
};
|
||||
|
||||
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" ];
|
||||
};
|
||||
}
|
42
pkgs/development/compilers/mint/shards.nix
Normal file
42
pkgs/development/compilers/mint/shards.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
admiral = {
|
||||
url = "jwaldrip/admiral.cr";
|
||||
rev = "07dde44b2d499c0a941b8da6270e1eac0baadcc2";
|
||||
};
|
||||
ameba = {
|
||||
url = "veelenga/ameba";
|
||||
rev = "7a4fcec5ce62ff92197014f67143c8112866cf8a";
|
||||
};
|
||||
baked_file_system = {
|
||||
url = "schovi/baked_file_system";
|
||||
rev = "22956aa79e889c241884017461e9dc79443d84d9";
|
||||
};
|
||||
duktape = {
|
||||
url = "jessedoyle/duktape.cr";
|
||||
rev = "0e59b56835da23068fe5bd5fbddb935cf0123b67";
|
||||
};
|
||||
kemal = {
|
||||
url = "kemalcr/kemal";
|
||||
rev = "17bd3dce3724b092fd1151cad126f5973da00204";
|
||||
};
|
||||
kilt = {
|
||||
url = "jeromegn/kilt";
|
||||
rev = "d177f02e124a197d22c4cc6d8dee7e1b33821bb1";
|
||||
};
|
||||
radix = {
|
||||
url = "luislavena/radix";
|
||||
rev = "4acb5cfbc304751d94201cdbca72947214af6ee1";
|
||||
};
|
||||
string_inflection = {
|
||||
url = "mosop/string_inflection";
|
||||
rev = "fe46a7269ff8183d4d24728fb24cfa576e89829e";
|
||||
};
|
||||
time_format = {
|
||||
url = "vladfaust/time_format.cr";
|
||||
rev = "30676d3712cb9a0a667c763c69912d801368f90d";
|
||||
};
|
||||
tree_template = {
|
||||
url = "anykeyh/tree_template";
|
||||
rev = "3fcb71ee6852040077dd1a2c8c55c67f4a95ba4e";
|
||||
};
|
||||
}
|
|
@ -6770,6 +6770,8 @@ with pkgs;
|
|||
|
||||
microscheme = callPackage ../development/compilers/microscheme { };
|
||||
|
||||
mint = callPackage ../development/compilers/mint { };
|
||||
|
||||
mitscheme = callPackage ../development/compilers/mit-scheme {
|
||||
texLive = texlive.combine { inherit (texlive) scheme-small; };
|
||||
texinfo = texinfo5;
|
||||
|
|
Loading…
Reference in a new issue