Unverified Commit 6d3cf22d authored by Bernardo Meurer's avatar Bernardo Meurer Committed by GitHub
Browse files

Merge pull request #263199 from lovesegfault/cov-build-update

cov-build: 7.0.2 -> 2022.12.2
parents 136bfe60 3759827b
Loading
Loading
Loading
Loading
+40 −19
Original line number Diff line number Diff line
{ lib, stdenv, requireFile }:
{ lib
, stdenv
, fetchurl

, autoPatchelfHook

, alsa-lib
, libxcrypt-legacy
, lttng-ust_2_12
, xorg
, zlib
}:

let
  message = ''
    Register an account at https://scan.coverity.com, download the
    build tools, and add it to the nix store with nix-prefetch-url
  '';
in
stdenv.mkDerivation rec {
  pname = "cov-build";
  version = "7.0.2";
  version = "2022.12.2";

  src =
    if stdenv.hostPlatform.system == "i686-linux"
    then requireFile {
      name = "cov-analysis-linux32-${version}.tar.gz";
      sha256 = "0i06wbd7blgx9adh9w09by4i18vwmldfp9ix97a5dph2cjymsviy";
      inherit message;
    then fetchurl {
      url = "https://archive.org/download/cov-analysis-linux-${version}.tar/cov-analysis-linux-${version}.tar.gz";
      hash = "sha256-Jr9bMUo9GRp+dgoAPqKxaTqWYWh4djGArdG9ukUK+ZY=";
    }
    else requireFile {
      name = "cov-analysis-linux64-${version}.tar.gz";
      sha256 = "0iby75p0g8gv7b501xav47milr8m9781h0hcgm1ch6x3qj6irqd8";
      inherit message;
    };
    else if stdenv.hostPlatform.system == "x86_64-linux"
    then fetchurl {
      url = "https://archive.org/download/cov-analysis-linux64-${version}.tar/cov-analysis-linux64-${version}.tar.gz";
      hash = "sha256-CyNKILJXlDMOCXbZZF4r/knz0orRx32oSj+Kpq/nxXQ=";
    }
    else throw "Unsupported platform '${stdenv.hostPlatform.system}'";

  nativeBuildInputs = [ autoPatchelfHook ];

  buildInputs = [
    alsa-lib
    libxcrypt-legacy
    lttng-ust_2_12
    xorg.libXext
    xorg.libXrender
    xorg.libXtst
    zlib
  ];

  dontConfigure = true;

  dontBuild = true;

  dontStrip = true;
  buildPhase = false;
  installPhase = ''
    mkdir -p $out/bin $out/libexec
    mv * $out/libexec
@@ -38,6 +57,8 @@ stdenv.mkDerivation rec {
    done
  '';

  dontStrip = true;

  meta = {
    description = "Coverity Scan build tools";
    homepage    = "https://scan.coverity.com";