9 common = import ./common.nix { inherit lib; };
11 stdenvNoCC.mkDerivation rec {
12 pname = "semgrep-core";
13 inherit (common) version;
14 # fetch pre-built semgrep-core since the ocaml build is complex and relies on
15 # the opam package manager at some point
16 # pulling it out of the python wheel as r2c no longer release a built binary
20 inherit (stdenvNoCC.hostPlatform) system;
21 data = common.core.${system} or (throw "Unsupported system: ${system}");
28 python = "cp38.cp39.cp310.cp311.py37.py38.py39.py310.py311";
29 inherit (data) platform hash;
32 nativeBuildInputs = [ unzip ];
34 # _tryUnzip from unzip's setup-hook doesn't recognise .whl
35 # "do not know how to unpack source archive"
36 # perform unpack by hand
39 LANG=en_US.UTF-8 unzip -qq "$src"
48 install -Dm 755 -t $out/bin semgrep-${version}.data/purelib/semgrep/bin/semgrep-core
52 meta = common.meta // {
53 description = common.meta.description + " - core binary";
54 mainProgram = "semgrep-core";
55 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
56 platforms = lib.attrNames common.core;