diff options
author | Anderson Torres <torres.anderson.85@protonmail.com> | 2021-11-04 11:21:15 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-04 11:21:15 -0300 |
commit | a9d2ce6284f3dd73cfa8af36aacbf4457135f199 (patch) | |
tree | 5435d30b0870db83caf7d357cd47c5885f35287e | |
parent | 7cb82625b086d04cf5c40c964b6efd9e30125814 (diff) | |
parent | 49193f4ad3b5b0d25109848045ebd6c215ec7d5e (diff) |
Merge pull request #142850 from kubukoz/init-scala-cli
scala-cli: init at 0.0.7
-rw-r--r-- | maintainers/maintainer-list.nix | 6 | ||||
-rw-r--r-- | pkgs/development/tools/build-managers/scala-cli/default.nix | 65 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
3 files changed, 73 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 35823b3ca6024..4dc3eec884d0c 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6252,6 +6252,12 @@ githubId = 278013; name = "Tomasz Kontusz"; }; + kubukoz = { + email = "kubukoz@gmail.com"; + github = "kubukoz"; + githubId = 894884; + name = "Jakub Kozłowski"; + }; kurnevsky = { email = "kurnevsky@gmail.com"; github = "kurnevsky"; diff --git a/pkgs/development/tools/build-managers/scala-cli/default.nix b/pkgs/development/tools/build-managers/scala-cli/default.nix new file mode 100644 index 0000000000000..74b1caa2c0e67 --- /dev/null +++ b/pkgs/development/tools/build-managers/scala-cli/default.nix @@ -0,0 +1,65 @@ +{ stdenv, coreutils, lib, installShellFiles, zlib, autoPatchelfHook, fetchurl }: + +let + version = "0.0.7"; + assets = { + x86_64-darwin = { + asset = "scala-cli-x86_64-apple-darwin.gz"; + sha256 = "0v6vlmw1zrzvbpa59y4cfv74mx56lyx109vk9cb942pyiv0ia6gf"; + }; + x86_64-linux = { + asset = "scala-cli-x86_64-pc-linux.gz"; + sha256 = "1xdkvjfw550lpjw5fsrv7mbnx5i8ix8lrxcd31yipm8p9g4vjcdn"; + }; + }; +in +stdenv.mkDerivation { + pname = "scala-cli"; + inherit version; + nativeBuildInputs = [ autoPatchelfHook installShellFiles ]; + buildInputs = [ coreutils zlib stdenv.cc.cc ]; + src = + let + asset = assets."${stdenv.hostPlatform.system}" or (throw "Unsupported platform ${stdenv.hostPlatform.system}"); + in + fetchurl { + url = "https://github.com/Virtuslab/scala-cli/releases/download/v${version}/${asset.asset}"; + sha256 = asset.sha256; + }; + + unpackPhase = '' + runHook preUnpack + gzip -d < $src > scala-cli + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + install -Dm755 scala-cli $out/bin/scala-cli + runHook postInstall + ''; + + # We need to call autopatchelf before generating completions + dontAutoPatchelf = true; + + postFixup = '' + autoPatchelf $out + + # hack to ensure the completion function looks right + # as $0 is used to generate the compdef directive + PATH="$out/bin:$PATH" + + installShellCompletion --cmd scala-cli \ + --bash <(scala-cli completions bash) \ + --zsh <(scala-cli completions zsh) + ''; + + meta = with lib; { + homepage = "https://scala-cli.virtuslab.org"; + downloadPage = "https://github.com/VirtusLab/scala-cli/releases/v${version}"; + license = licenses.asl20; + description = "Command-line tool to interact with the Scala language"; + maintainers = [ maintainers.kubukoz ]; + platforms = builtins.attrNames assets; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 761d1b8e3177c..2f546e13c93af 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15097,6 +15097,8 @@ with pkgs; sbt-extras = callPackage ../development/tools/build-managers/sbt-extras { }; + scala-cli = callPackage ../development/tools/build-managers/scala-cli {}; + scc = callPackage ../development/tools/misc/scc { }; scss-lint = callPackage ../development/tools/scss-lint { }; |