2023-03-24 00:07:29 +00:00
|
|
|
{ lib, stdenv, fetchzip, zlib, xorg, freetype, jdk17, curl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "codeql";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.13.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/github/codeql-cli-binaries/releases/download/v${version}/codeql.zip";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-/carrJ87XvnD5Pd+MJAqNdXxA5vyJl0mX1hEbykhSUk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
zlib
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXtst
|
|
|
|
xorg.libXrender
|
|
|
|
freetype
|
2023-03-24 00:07:29 +00:00
|
|
|
jdk17
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# many of the codeql extractors use CODEQL_DIST + CODEQL_PLATFORM to
|
|
|
|
# resolve java home, so to be able to create databases, we want to make
|
|
|
|
# sure that they point somewhere sane/usable since we can not autopatch
|
|
|
|
# the codeql packaged java dist, but we DO want to patch the extractors
|
|
|
|
# as well as the builders which are ELF binaries for the most part
|
|
|
|
rm -rf $out/codeql/tools/linux64/java
|
|
|
|
ln -s ${jdk17} $out/codeql/tools/linux64/java
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
ln -s $out/codeql/codeql $out/bin/
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Semantic code analysis engine";
|
2021-10-08 15:17:17 +00:00
|
|
|
homepage = "https://codeql.github.com";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.dump_stack ];
|
2022-04-27 09:35:20 +00:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
};
|
|
|
|
}
|