1{ stdenv, fetchurl, unzip }:
2
3let
4 version = "1.16.1";
5in
6stdenv.mkDerivation {
7 name = "dart-${version}";
8
9 nativeBuildInputs = [
10 unzip
11 ];
12
13 src =
14 if stdenv.system == "x86_64-linux" then
15 fetchurl {
16 url = "https://storage.googleapis.com/dart-archive/channels/stable/release/${version}/sdk/dartsdk-linux-x64-release.zip";
17 sha256 = "01cbnc8hd2wwprmivppmzvld9ps644k16wpgqv31h1596l5p82n2";
18 }
19 else
20 fetchurl {
21 url = "https://storage.googleapis.com/dart-archive/channels/stable/release/${version}/sdk/dartsdk-linux-ia32-release.zip";
22 sha256 = "0jfwzc3jbk4n5j9ka59s9bkb25l5g85fl1nf676mvj36swcfykx3";
23 };
24
25 installPhase = ''
26 mkdir -p $out
27 cp -R * $out/
28 echo $libPath
29 patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
30 --set-rpath $libPath \
31 $out/bin/dart
32 '';
33
34 libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ];
35
36 dontStrip = true;
37
38 meta = {
39 platforms = [ "i686-linux" "x86_64-linux" ];
40 homepage = https://www.dartlang.org/;
41 description = "Scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps";
42 longDescription = ''
43 Dart is a class-based, single inheritance, object-oriented language
44 with C-style syntax. It offers compilation to JavaScript, interfaces,
45 mixins, abstract classes, reified generics, and optional typing.
46 '';
47 license = stdenv.lib.licenses.bsd3;
48 };
49}