1
- { lib , stdenv , fetchzip , withExtractors ? [ ] , withPacks ? [ ] } :
1
+ { lib , stdenv , fetchzip , jdk17 , withExtractors ? [ ] , withPacks ? [ ] } :
2
2
3
3
stdenv . mkDerivation rec {
4
4
pname = "codeql-cli" ;
@@ -17,12 +17,27 @@ stdenv.mkDerivation rec {
17
17
buildInputs = if ( lib . length withExtractors ) == 0 then [ ] else withExtractors ;
18
18
inherit withExtractors withPacks ;
19
19
20
+ nativeBuildInputs = [ jdk17 ] ;
21
+
20
22
installPhase = ''
21
23
# codeql directory should not be top-level, otherwise,
22
24
# it'll include /nix/store to resolve extractors.
23
25
mkdir -p $out/{codeql/qlpacks,bin}
24
26
cp -R * $out/codeql/
25
27
28
+
29
+ if [ "$platform" == "linux64" ]; then
30
+ ln -sf $out/codeql/tools/linux64/lib64trace.so $out/codeql/tools/linux64/libtrace.so
31
+ fi
32
+
33
+ # many of the codeql extractors use CODEQL_DIST + CODEQL_PLATFORM to
34
+ # resolve java home, so to be able to create databases, we want to make
35
+ # sure that they point somewhere sane/usable since we can not autopatch
36
+ # the codeql packaged java dist, but we DO want to patch the extractors
37
+ # as well as the builders which are ELF binaries for the most part
38
+ rm -rf $out/codeql/tools/$platform/java
39
+ ln -s ${ jdk17 } $out/codeql/tools/$platform/java
40
+
26
41
ln -s $out/codeql/codeql $out/bin/
27
42
28
43
for extractor in $withExtractors; do
0 commit comments