mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-06 15:00:16 +00:00
To reproduce:
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: nix-x86_64-darwin
language: nix
rule:
any:
- pattern: "\"x86_64-darwin\""
kind: list_expression > string_expression
- pattern:
context: "{ \"x86_64-darwin\" = $EXPR; }"
selector: binding
- pattern:
context: "{ x86_64-darwin = $EXPR; }"
selector: binding
fix:
template: ""
' pkgs
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: json-first-x86_64-darwin
language: json
rule:
kind: object > pair:nth-child(1)
has:
pattern: "\"x86_64-darwin\""
field: key
fix:
template: ""
expandEnd: { regex: "," }
' pkgs
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: json-x86_64-darwin
language: json
rule:
kind: object > pair
has:
pattern: "\"x86_64-darwin\""
field: key
fix:
template: ""
expandStart: { regex: "," }
' pkgs
$ git restore pkgs/by-name/om/omnix/package.nix
$ git diff --name-only -z \
| nix shell nixpkgs/3b32825de172d0bc85664f495edb096b10862524#gnused \
-c xargs -0 sed -i '/^$/N; /^\n\? \+$/d'
$ treefmt
68 lines
1.5 KiB
Nix
68 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
fetchPypi,
|
|
stdenvNoCC,
|
|
buildPythonPackage,
|
|
}:
|
|
let
|
|
version = "17.15.3";
|
|
format = "wheel";
|
|
inherit (stdenvNoCC.hostPlatform) system;
|
|
|
|
# https://pypi.org/project/frida/#files
|
|
pypiMeta =
|
|
{
|
|
x86_64-linux = {
|
|
hash = "sha256-q8E4uhzfFyZV7P/Bft+UviaKX78z49TkXBM7p0oQ/HY=";
|
|
platform = "manylinux1_x86_64";
|
|
};
|
|
aarch64-linux = {
|
|
hash = "sha256-00gr7AWA0ynXmZrvNWphPWkkpeDOOqWIZMKe+jbeAFA=";
|
|
platform = "manylinux2014_aarch64";
|
|
};
|
|
aarch64-darwin = {
|
|
hash = "sha256-AmTFwqjE2huyFwabx6gWdRnymy+pPVqBvlJWzQQb3H4=";
|
|
platform = "macosx_11_0_arm64";
|
|
};
|
|
}
|
|
.${system} or (throw "Unsupported system: ${system}");
|
|
in
|
|
buildPythonPackage {
|
|
pname = "frida-python";
|
|
inherit version format;
|
|
|
|
src = fetchPypi {
|
|
pname = "frida";
|
|
inherit version format;
|
|
inherit (pypiMeta) hash platform;
|
|
abi = "abi3";
|
|
python = "cp37";
|
|
dist = "cp37";
|
|
};
|
|
|
|
pythonImportsCheck = [
|
|
"frida"
|
|
"frida._frida"
|
|
];
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = {
|
|
description = "Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers (Python bindings)";
|
|
homepage = "https://www.frida.re";
|
|
license = with lib.licenses; [
|
|
lgpl2Plus
|
|
wxWindowsException31
|
|
];
|
|
maintainers = with lib.maintainers; [
|
|
s1341
|
|
eyjhb
|
|
];
|
|
platforms = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
};
|
|
}
|