diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2019-08-26 18:24:45 +0200 |
---|---|---|
committer | Silvan Mosberger <infinisil@icloud.com> | 2019-08-26 20:05:23 +0200 |
commit | 2f92cd6960f26f1f45e862cf4fea277305a07a4e (patch) | |
tree | 547c0d10f63f4d478ebf8d6be2725ed3eca88eb6 /pkgs/development/compilers/mint | |
parent | 1ffdf01777360f548cc7c10ef5b168cbe78fd183 (diff) |
mint: Use buildCrystalPackage
Diffstat (limited to 'pkgs/development/compilers/mint')
-rw-r--r-- | pkgs/development/compilers/mint/default.nix | 59 |
1 files changed, 11 insertions, 48 deletions
diff --git a/pkgs/development/compilers/mint/default.nix b/pkgs/development/compilers/mint/default.nix index 95b30da5b75ea..5f72bd3649b17 100644 --- a/pkgs/development/compilers/mint/default.nix +++ b/pkgs/development/compilers/mint/default.nix @@ -1,40 +1,7 @@ -# Updating the dependencies for this package: -# -# wget https://raw.githubusercontent.com/mint-lang/mint/0.3.1/shard.lock -# nix-shell -p crystal libyaml --run 'crystal run crystal2nix.cr' -# -{stdenv, lib, fetchFromGitHub, crystal, zlib, openssl_1_0_2, duktape, which, libyaml }: -let - crystalPackages = lib.mapAttrs (name: src: - stdenv.mkDerivation { - name = lib.replaceStrings ["/"] ["-"] name; - src = fetchFromGitHub 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 { +{ lib, fetchFromGitHub, crystal, zlib, openssl_1_0_2, duktape, which, libyaml }: +crystal.buildCrystalPackage rec { version = "0.5.0"; - name = "mint-${version}"; + pname = "mint"; src = fetchFromGitHub { owner = "mint-lang"; repo = "mint"; @@ -42,23 +9,19 @@ stdenv.mkDerivation rec { sha256 = "0vxbx38c390rd2ysvbwgh89v2232sh5rbsp3nk9wzb70jybpslvl"; }; - nativeBuildInputs = [ which crystal zlib openssl_1_0_2 duktape libyaml ]; - - buildPhase = '' - mkdir -p $out/bin tmp - cd tmp - ln -s ${crystalLib} lib - cp -r $src/* . - crystal build src/mint.cr -o $out/bin/mint --verbose --progress --release --no-debug - ''; + buildInputs = [ openssl_1_0_2 ]; - installPhase = ''true''; + # Update with + # nix-shell -p crystal2nix --run crystal2nix + # with mint's shard.lock file in the current directory + shardsFile = ./shards.nix; + crystalBinaries.mint.src = "src/mint.cr"; 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 ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ manveru ]; platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; }; } |