From ccb2e9a8328097283cfb0c9866c34c3abb7813dd Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 15 May 2013 00:41:22 +0200 Subject: [PATCH] Adding multiple versions of sbt. Probably you want to use the latest(default). --- .../simple-build-tool/default.nix | 114 +++++++++++++----- 1 file changed, 83 insertions(+), 31 deletions(-) diff --git a/pkgs/development/tools/build-managers/simple-build-tool/default.nix b/pkgs/development/tools/build-managers/simple-build-tool/default.nix index 218957ae360d..a72f94d52f67 100644 --- a/pkgs/development/tools/build-managers/simple-build-tool/default.nix +++ b/pkgs/development/tools/build-managers/simple-build-tool/default.nix @@ -1,41 +1,93 @@ -{ stdenv, fetchurl }: +{ stdenv, versionedDerivation, fetchurl, version ? "xsbt-0.12.3" }: + +let + + description = "A build tool for Scala"; + longDescription = name: '' + ${name} is a simple build tool for Scala projects that aims to do the + basics well. + + This package is the sbt launcher which automatically manages + and downloads dependencies, including the SBT package and the + Scala compiler. + ''; + + metaSBT = { + inherit description; + longDescription = longDescription "sbt"; + homepage = http://code.google.com/p/simple-build-tool/; + license = "bsd"; + }; + + metaXSBT = { + inherit description; + longDescription = longDescription "xsbt"; + homepage = https://github.com/harrah/xsbt; + license = "bsd"; + }; + +in # Depends on a JRE at runtime. -let - version = "0.7.3"; -in - stdenv.mkDerivation rec { +versionedDerivation "simple-build-tool" version { + "0.7.3" = let version = "0.7.3"; in { name = "simple-build-tool-${version}"; src = fetchurl { url = "http://simple-build-tool.googlecode.com/files/sbt-launch-${version}.jar"; sha256 = "1nciifzf00cs54a4h57a7v1hyklm5vgln0sscmz5kzv96ggphs6k"; }; + meta = metaSBT; + }; - installPhase = '' - mkdir -pv "$out/lib/java" - cp $src "$out/lib/java/sbt-launch-${version}.jar" - mkdir -p "$out/bin" - cat > "$out/bin/sbt" < "$out/bin/sbt" <