8 , sources ? import ./sources.nix {inherit fetchurl;}
9 , version ? sources.versionUsed
12 assert sources != null && (builtins.isAttrs sources);
13 stdenv.mkDerivation (finalAttrs: {
17 nativeBuildInputs = [ unzip ];
19 src = sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}");
25 '' + lib.optionalString (stdenv.hostPlatform.isLinux) ''
26 find $out/bin -executable -type f -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \;
29 libPath = lib.makeLibraryPath [ stdenv.cc.cc ];
32 updateScript = ./update.sh;
34 testCreate = runCommand "dart-test-create" { nativeBuildInputs = [ finalAttrs.finalPackage ]; } ''
35 PROJECTNAME="dart_test_project"
36 dart create --no-pub $PROJECTNAME
39 [[ -f $PROJECTNAME/bin/$PROJECTNAME.dart ]]
43 testCompile = runCommand "dart-test-compile" {
44 nativeBuildInputs = [ finalAttrs.finalPackage ]
45 ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools darwin.sigtool ];
47 HELLO_MESSAGE="Hello, world!"
48 echo "void main() => print('$HELLO_MESSAGE');" > hello.dart
49 dart compile exe hello.dart
50 PROGRAM_OUT=$(./hello.exe)
52 [[ "$PROGRAM_OUT" == "$HELLO_MESSAGE" ]]
59 homepage = "https://dart.dev";
60 maintainers = with maintainers; [ grburst ];
61 description = "Scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps";
63 Dart is a class-based, single inheritance, object-oriented language
64 with C-style syntax. It offers compilation to JavaScript, interfaces,
65 mixins, abstract classes, reified generics, and optional typing.
68 platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
69 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
70 license = licenses.bsd3;