3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/interpreters/dart/default.nix

73 lines
2.4 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, fetchurl
, unzip
2021-03-21 13:06:57 +00:00
, version ? "2.12.2"
, sources ?
let
base = "https://storage.googleapis.com/dart-archive/channels";
x86_64 = "x64";
i686 = "ia32";
aarch64 = "arm64";
2021-01-25 14:36:46 +00:00
# Make sure that if the user overrides version parameter they're
# also need to override sources, to avoid mistakes
2021-03-21 13:06:57 +00:00
version = "2.12.2";
in
{
"${version}-x86_64-darwin" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-macos-${x86_64}-release.zip";
sha256 = "0h6mpy0kfc842vhg053fyxbjnd8lw1d1shdcsj800048260lxhyd";
2020-11-26 07:49:08 +00:00
};
"${version}-x86_64-linux" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${x86_64}-release.zip";
2021-03-21 13:06:57 +00:00
sha256 = "1gg210gf4yif3bl9k19znkndc4c1cd529xwxpi20ykaw3zfxxz2z";
2021-01-15 20:32:57 +00:00
};
"${version}-i686-linux" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${i686}-release.zip";
sha256 = "1wngxba71j20gq9vy7n8q0m9rnqs047xm5b03bxk3hhaq6dyzkwn";
2021-01-15 20:32:57 +00:00
};
"${version}-aarch64-linux" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${aarch64}-release.zip";
sha256 = "0rqsmzl5g5kgk54qb03kamjm5n5g5pqfl79np37xdzwqbv0zx22b";
2020-10-07 03:54:12 +01:00
};
}
}:
2021-01-25 14:36:46 +00:00
assert version != null && version != "";
assert sources != null && (builtins.isAttrs sources);
2013-04-17 15:35:40 +01:00
stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "dart";
inherit version;
2016-06-03 09:10:13 +01:00
nativeBuildInputs = [
unzip
];
src = sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}");
2016-06-03 09:10:13 +01:00
installPhase = ''
mkdir -p $out
cp -R * $out/
echo $libPath
find $out/bin -executable -type f -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \;
2016-06-03 09:10:13 +01:00
'';
libPath = lib.makeLibraryPath [ stdenv.cc.cc ];
2018-05-01 19:51:03 +01:00
2013-04-17 15:35:40 +01:00
dontStrip = true;
2018-05-01 19:51:03 +01:00
meta = with lib; {
homepage = "https://www.dartlang.org/";
maintainers = with maintainers; [ grburst thiagokokada ];
2016-06-03 09:10:13 +01:00
description = "Scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps";
longDescription = ''
Dart is a class-based, single inheritance, object-oriented language
with C-style syntax. It offers compilation to JavaScript, interfaces,
mixins, abstract classes, reified generics, and optional typing.
'';
2020-11-26 07:49:08 +00:00
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" ];
license = licenses.bsd3;
2016-06-03 09:10:13 +01:00
};
}