2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2021-06-28 23:13:55 +00:00
|
|
|
, version ? "2.13.1"
|
|
|
|
, sources ? let
|
2020-04-24 23:36:52 +00:00
|
|
|
base = "https://storage.googleapis.com/dart-archive/channels";
|
|
|
|
x86_64 = "x64";
|
|
|
|
i686 = "ia32";
|
|
|
|
aarch64 = "arm64";
|
2021-02-05 17:12:51 +00:00
|
|
|
# Make sure that if the user overrides version parameter they're
|
|
|
|
# also need to override sources, to avoid mistakes
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "2.13.1";
|
2021-02-05 17:12:51 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
"${version}-x86_64-darwin" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-macos-${x86_64}-release.zip";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "0kb6r2rmp5d0shvgyy37fmykbgww8qaj4f8k79rmqfv5lwa3izya";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
"${version}-x86_64-linux" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${x86_64}-release.zip";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "0zq8wngyrw01wjc5s6w1vz2jndms09ifiymjjixxby9k41mr6jrq";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
"${version}-i686-linux" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${i686}-release.zip";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "0zv4q8xv2i08a6izpyhhnil75qhs40m5mgyvjqjsswqkwqdf7lkj";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
"${version}-aarch64-linux" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${aarch64}-release.zip";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "0bb9jdmg5p608jmmiqibp13ydiw9avgysxlmljvgsl7wl93j6rgc";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
assert version != null && version != "";
|
|
|
|
assert sources != null && (builtins.isAttrs sources);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "dart";
|
|
|
|
inherit version;
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R * $out/
|
|
|
|
echo $libPath
|
2020-11-09 15:59:12 +00:00
|
|
|
find $out/bin -executable -type f -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \;
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.dartlang.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ grburst thiagokokada ];
|
2020-04-24 23:36:52 +00: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-30 08:33:03 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|