Unverified Commit 0c811d5f authored by Masum Reza's avatar Masum Reza Committed by GitHub
Browse files

Merge pull request #315899 from stepanstipl/frida-python-darwin

frida-python: add aarch64-darwin support
parents b44b62db 0591be3b
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
@@ -5,14 +5,25 @@
  fetchPypi,
  buildPythonPackage,
  typing-extensions,
  darwin,
}:
let
  version = "16.0.19";
  format = "setuptools";
  devkit = fetchurl {

  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}");

in
buildPythonPackage rec {
  pname = "frida-python";
@@ -32,8 +43,14 @@ buildPythonPackage rec {
    popd
  '';

  env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework AppKit";

  propagatedBuildInputs = [ typing-extensions ];

  buildInputs = lib.optionals stdenv.isDarwin [
    darwin.apple_sdk.frameworks.AppKit
  ];

  pythonImportsCheck = [ "frida" ];

  passthru = {
@@ -45,6 +62,6 @@ buildPythonPackage rec {
    homepage = "https://www.frida.re";
    license = lib.licenses.wxWindows;
    maintainers = with lib.maintainers; [ s1341 ];
    platforms = [ "x86_64-linux" ];
    platforms = [ "aarch64-darwin" "x86_64-linux" ];
  };
}