biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / security / sonar-scanner-cli / default.nix
blobb97a2bc3a105da59bd3027d1ed8a767fba133f4d
1 { stdenv, lib, fetchurl, unzip, jre }:
3 let
5   version = "4.7.0.2747";
7   sonarScannerArchPackage = {
8     "x86_64-linux" = {
9       url = "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${version}-linux.zip";
10       sha256 = "0qy97lcn9nfwg0x32v9x5kh5jswnjyw3wpvxj45z7cddlj2is4iy";
11     };
12     "x86_64-darwin" = {
13       url = "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${version}-macosx.zip";
14       sha256 = "0f8km7wqkw09g01l03kcrjgvq7b6xclzpvb5r64ymsmrc39p0ylp";
15     };
16   };
18 in stdenv.mkDerivation rec {
19   inherit version;
20   pname = "sonar-scanner-cli";
22   src = fetchurl sonarScannerArchPackage.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
24   nativeBuildInputs = [ unzip ];
26   installPhase = ''
27     mkdir -p $out/lib
28     cp -r lib/* $out/lib/
29     mkdir -p $out/bin
30     cp bin/* $out/bin/
31     mkdir -p $out/conf
32     cp conf/* $out/conf/
33   '';
35   fixupPhase = ''
36     substituteInPlace $out/bin/sonar-scanner \
37       --replace "\$sonar_scanner_home/jre" "${lib.getBin jre}"
38   '';
40   meta = with lib; {
41     homepage = "https://github.com/SonarSource/sonar-scanner-cli";
42     description = "SonarQube Scanner used to start code analysis";
43     license = licenses.gpl3Plus;
44     maintainers = with maintainers; [ peterromfeldhk ];
45     platforms = builtins.attrNames sonarScannerArchPackage;
46   };