3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/interpreters/dart/default.nix
2021-01-27 14:48:09 -03:00

67 lines
2.1 KiB
Nix

{ stdenv
, lib
, fetchurl
, unzip
, version ? "2.10.4"
, sources ?
let
base = "https://storage.googleapis.com/dart-archive/channels";
x86_64 = "x64";
i686 = "ia32";
aarch64 = "arm64";
in
{
"${version}-x86_64-darwin" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-macos-${x86_64}-release.zip";
sha256 = "1d18l8ja8dckzs2y0fxwdbwh06fxzlx0fyhabcgxsvh3xg9qxhj5";
};
"${version}-x86_64-linux" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${x86_64}-release.zip";
sha256 = "0pjqj2bsliq13q8b2mk2v07w4vzjqcmr984ygnwv5kx0dp5md7vq";
};
"${version}-i686-linux" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${i686}-release.zip";
sha256 = "0fyqfikbd85jrckzvxvq7npb2l2kqzifg8pm2jy0ivr5lb1021r8";
};
"${version}-aarch64-linux" = fetchurl {
url = "${base}/stable/release/${version}/sdk/dartsdk-linux-${aarch64}-release.zip";
sha256 = "04743g0z8fcv757jlcrbf6v8m3f0fz5smjmv9n4a6fprfzj8bw0k";
};
}
}:
stdenv.mkDerivation {
pname = "dart";
inherit version;
nativeBuildInputs = [
unzip
];
src = sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}");
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) {} \;
'';
libPath = lib.makeLibraryPath [ stdenv.cc.cc ];
dontStrip = true;
meta = with lib; {
homepage = "https://www.dartlang.org/";
maintainers = with maintainers; [ grburst ];
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.
'';
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" ];
license = licenses.bsd3;
};
}