nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv
2, fetchzip
3, zlib
4, xorg
5, freetype
6, alsaLib
7, jdk11
8, curl
9, lttng-ust
10, autoPatchelfHook
11}:
12
13stdenv.mkDerivation rec {
14 pname = "codeql";
15 version = "2.0.2";
16
17 dontConfigure = true;
18 dontBuild = true;
19 dontStrip = true;
20
21 src = fetchzip {
22 url = "https://github.com/github/codeql-cli-binaries/releases/download/v${version}/codeql.zip";
23 sha256 = "11siv8qmj4arl6qxks7bqnhx5669r3kxqcxq37ai7sf9f7v78k1i";
24 };
25
26 nativeBuildInputs = [
27 zlib
28 xorg.libX11
29 xorg.libXext
30 xorg.libXi
31 xorg.libXtst
32 xorg.libXrender
33 freetype
34 alsaLib
35 jdk11
36 stdenv.cc.cc.lib
37 curl
38 lttng-ust
39 autoPatchelfHook
40 ];
41
42 installPhase = ''
43 # codeql directory should not be top-level, otherwise,
44 # it'll include /nix/store to resolve extractors.
45 mkdir -p $out/{codeql,bin}
46 cp -R * $out/codeql/
47
48 ln -sf $out/codeql/tools/linux64/lib64trace.so $out/codeql/tools/linux64/libtrace.so
49
50 sed -i 's;"$CODEQL_DIST/tools/$CODEQL_PLATFORM/java/bin/java";"${jdk11}/bin/java";' $out/codeql/codeql
51
52 ln -s $out/codeql/codeql $out/bin/
53 '';
54
55 meta = with stdenv.lib; {
56 description = "Semantic code analysis engine";
57 homepage = "https://semmle.com/codeql";
58 maintainers = [ maintainers.dump_stack ];
59 license = licenses.unfree;
60 };
61}