2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
fetchPypi,
|
|
|
|
buildPythonPackage,
|
|
|
|
typing-extensions,
|
2024-07-27 06:49:29 +00:00
|
|
|
darwin,
|
2024-06-05 15:53:02 +00:00
|
|
|
}:
|
2023-07-15 17:15:38 +00:00
|
|
|
let
|
|
|
|
version = "16.0.19";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
devkit = {
|
|
|
|
aarch64-darwin = fetchurl {
|
|
|
|
url = "https://github.com/frida/frida/releases/download/${version}/frida-core-devkit-${version}-macos-arm64.tar.xz";
|
|
|
|
hash = "sha256-5VAZnpHQ5wjl7IM96GhIKOfFYHFDKKOoSjN1STna2UA=";
|
|
|
|
};
|
|
|
|
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://github.com/frida/frida/releases/download/${version}/frida-core-devkit-${version}-linux-x86_64.tar.xz";
|
|
|
|
hash = "sha256-yNXNqv8eCbpdQKFShpAh6rUCEuItrOSNNLOjESimPdk=";
|
|
|
|
};
|
|
|
|
}.${stdenv.hostPlatform.system}
|
|
|
|
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "frida-python";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "frida";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-rikIjjn9wA8VL/St/2JJTcueimn+q/URbt9lw/+nalY=";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
mkdir assets
|
|
|
|
pushd assets
|
|
|
|
tar xvf ${devkit}
|
|
|
|
export FRIDA_CORE_DEVKIT=$PWD
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework AppKit";
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
propagatedBuildInputs = [ typing-extensions ];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.AppKit
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
pythonImportsCheck = [ "frida" ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru = {
|
|
|
|
inherit devkit;
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers (Python bindings)";
|
|
|
|
homepage = "https://www.frida.re";
|
|
|
|
license = lib.licenses.wxWindows;
|
|
|
|
maintainers = with lib.maintainers; [ s1341 ];
|
2024-07-27 06:49:29 +00:00
|
|
|
platforms = [ "aarch64-darwin" "x86_64-linux" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
}
|