2021-01-15 21:22:01 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2022-07-22 06:46:57 +02:00
|
|
|
, version ? "2.17.3"
|
2021-06-16 03:42:30 +02:00
|
|
|
, sources ? let
|
2018-02-18 13:10:51 +01:00
|
|
|
base = "https://storage.googleapis.com/dart-archive/channels";
|
2020-02-27 13:21:35 +01:00
|
|
|
x86_64 = "x64";
|
|
|
|
i686 = "ia32";
|
|
|
|
aarch64 = "arm64";
|
2021-01-25 15:36:46 +01:00
|
|
|
# Make sure that if the user overrides version parameter they're
|
|
|
|
# also need to override sources, to avoid mistakes
|
2022-07-22 06:46:57 +02:00
|
|
|
version = "2.17.3";
|
2021-01-15 21:22:01 +01:00
|
|
|
in
|
|
|
|
{
|
2022-02-20 19:00:08 +01:00
|
|
|
"${version}-aarch64-darwin" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-macos-${aarch64}-release.zip";
|
2022-07-22 06:46:57 +02:00
|
|
|
sha256 = "sha256-NjkqC9DaaFGN47Qe46xUlsEx2O2bQrKhb1eJyxfr7Vg=";
|
2022-02-20 19:00:08 +01:00
|
|
|
};
|
2021-01-15 21:22:01 +01:00
|
|
|
"${version}-x86_64-darwin" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-macos-${x86_64}-release.zip";
|
2022-07-22 06:46:57 +02:00
|
|
|
sha256 = "sha256-+6y4lOGS8VyWrZCMSgLFun0E/WOCGlHEE8J5cQiVpUY=";
|
2020-11-26 08:49:08 +01:00
|
|
|
};
|
2021-01-15 21:22:01 +01:00
|
|
|
"${version}-x86_64-linux" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${x86_64}-release.zip";
|
2022-07-22 06:46:57 +02:00
|
|
|
sha256 = "sha256-aPmgmsYaqxwTWtLmSjm/rAiJANQ5lB3uJ12OqMhUG5U=";
|
2021-01-15 21:32:57 +01:00
|
|
|
};
|
|
|
|
"${version}-i686-linux" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${i686}-release.zip";
|
2022-07-22 06:46:57 +02:00
|
|
|
sha256 = "sha256-BFIN36OURaWIgBUiO35GkMkhCBHnqtKYPJVetdJ5cZI=";
|
2021-01-15 21:32:57 +01:00
|
|
|
};
|
|
|
|
"${version}-aarch64-linux" = fetchurl {
|
|
|
|
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${aarch64}-release.zip";
|
2022-07-22 06:46:57 +02:00
|
|
|
sha256 = "sha256-yZMke1raq0Mvu01LFE1aUsTEARZWMS0rAI727FHq6ts=";
|
2020-10-07 04:54:12 +02:00
|
|
|
};
|
2021-01-15 21:22:01 +01:00
|
|
|
}
|
|
|
|
}:
|
2020-02-27 13:21:35 +01:00
|
|
|
|
2021-01-25 15:36:46 +01:00
|
|
|
assert version != null && version != "";
|
|
|
|
assert sources != null && (builtins.isAttrs sources);
|
|
|
|
|
2013-04-17 16:35:40 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "dart";
|
|
|
|
inherit version;
|
2016-06-03 10:10:13 +02:00
|
|
|
|
2021-06-16 03:42:30 +02:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2018-02-18 13:10:51 +01:00
|
|
|
|
2018-08-20 21:11:29 +02:00
|
|
|
src = sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}");
|
2016-06-03 10:10:13 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R * $out/
|
|
|
|
echo $libPath
|
2022-02-20 19:00:08 +01:00
|
|
|
'' + lib.optionalString(stdenv.isLinux) ''
|
2020-09-17 20:33:17 +02:00
|
|
|
find $out/bin -executable -type f -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \;
|
2016-06-03 10:10:13 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-15 21:22:01 +01:00
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc ];
|
2018-05-01 20:51:03 +02:00
|
|
|
|
2013-04-17 16:35:40 +02:00
|
|
|
dontStrip = true;
|
2018-05-01 20:51:03 +02:00
|
|
|
|
2021-01-15 21:22:01 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.dartlang.org/";
|
2022-01-04 19:28:42 +01:00
|
|
|
maintainers = with maintainers; [ grburst flexagoon ];
|
2016-06-03 10:10:13 +02: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.
|
|
|
|
'';
|
2022-02-20 19:00:08 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2020-02-27 13:21:35 +01:00
|
|
|
license = licenses.bsd3;
|
2016-06-03 10:10:13 +02:00
|
|
|
};
|
2015-01-15 05:25:26 +01:00
|
|
|
}
|