nixpkgs/pkgs/development/tools/analysis/codeql/default.nix
Harry Maclean 1d369f0963 codeql: 2.5.9 -> 2.6.2
This requires a minor change to accommodate a different path to Java in
the codeql script.
2021-10-07 11:57:57 +01:00

49 lines
1.2 KiB
Nix

{ lib, stdenv, fetchzip, zlib, xorg, freetype, jdk11, curl, autoPatchelfHook }:
stdenv.mkDerivation rec {
pname = "codeql";
version = "2.6.2";
dontConfigure = true;
dontBuild = true;
dontStrip = true;
src = fetchzip {
url = "https://github.com/github/codeql-cli-binaries/releases/download/v${version}/codeql.zip";
sha256 = "096w9w52rj854i7rmpgy99k9z9ja2dfvj2d02dnpagwd7pc6a6bl";
};
nativeBuildInputs = [
zlib
xorg.libX11
xorg.libXext
xorg.libXi
xorg.libXtst
xorg.libXrender
freetype
jdk11
stdenv.cc.cc.lib
curl
];
installPhase = ''
# codeql directory should not be top-level, otherwise,
# it'll include /nix/store to resolve extractors.
mkdir -p $out/{codeql,bin}
cp -R * $out/codeql/
ln -sf $out/codeql/tools/linux64/lib64trace.so $out/codeql/tools/linux64/libtrace.so
sed -i 's%\$CODEQL_DIST/tools/\$CODEQL_PLATFORM/java%\${jdk11}%g' $out/codeql/codeql
ln -s $out/codeql/codeql $out/bin/
'';
meta = with lib; {
description = "Semantic code analysis engine";
homepage = "https://codeql.github.com";
maintainers = [ maintainers.dump_stack ];
license = licenses.unfree;
};
}