1{ lib, stdenv, fetchurl, fetchPypi, buildPythonPackage, typing-extensions }:
2let
3 version = "16.0.19";
4 devkit = fetchurl {
5 url = "https://github.com/frida/frida/releases/download/${version}/frida-core-devkit-${version}-linux-x86_64.tar.xz";
6 hash = "sha256-yNXNqv8eCbpdQKFShpAh6rUCEuItrOSNNLOjESimPdk=";
7 };
8in buildPythonPackage rec {
9 pname = "frida-python";
10 inherit version;
11
12 src = fetchPypi {
13 pname = "frida";
14 inherit version;
15 hash = "sha256-rikIjjn9wA8VL/St/2JJTcueimn+q/URbt9lw/+nalY=";
16 };
17
18 postPatch = ''
19 mkdir assets
20 pushd assets
21 tar xvf ${devkit}
22 export FRIDA_CORE_DEVKIT=$PWD
23 popd
24 '';
25
26 propagatedBuildInputs = [ typing-extensions ];
27
28 pythonImportsCheck = [ "frida" ];
29
30 passthru = { inherit devkit; };
31
32 meta = {
33 description = "Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers (Python bindings)";
34 homepage = "https://www.frida.re";
35 license = lib.licenses.wxWindows;
36 maintainers = with lib.maintainers; [ s1341 ];
37 platforms = [ "x86_64-linux" ];
38 };
39}