1- { lib , stdenv , fetchzip , withExtractors ? [ ] , withPacks ? [ ] } :
1+ { lib , stdenv , fetchzip , jdk17 , withExtractors ? [ ] , withPacks ? [ ] } :
22
33stdenv . mkDerivation rec {
44 pname = "codeql-cli" ;
@@ -17,12 +17,27 @@ stdenv.mkDerivation rec {
1717 buildInputs = if ( lib . length withExtractors ) == 0 then [ ] else withExtractors ;
1818 inherit withExtractors withPacks ;
1919
20+ nativeBuildInputs = [ jdk17 ] ;
21+
2022 installPhase = ''
2123 # codeql directory should not be top-level, otherwise,
2224 # it'll include /nix/store to resolve extractors.
2325 mkdir -p $out/{codeql/qlpacks,bin}
2426 cp -R * $out/codeql/
2527
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+
2641 ln -s $out/codeql/codeql $out/bin/
2742
2843 for extractor in $withExtractors; do
0 commit comments