nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 fetchpatch,
5 buildGhidraExtension,
6 ghidra,
7}:
8buildGhidraExtension {
9 pname = "ret-sync-ghidra";
10 version = "0-unstable-2024-05-29";
11
12 src = fetchFromGitHub {
13 owner = "bootleg";
14 repo = "ret-sync";
15 rev = "0617c75746ddde7fe2bdbbf880175af8ad27553e";
16 hash = "sha256-+G5ccdHnFL0sHpueuIYwLRU9FhzN658CYqQCHCBwxV4=";
17 };
18 patches = [
19 # This patch is needed to get the extension compiling with Ghidra 11.2.
20 # Once it's fixed upstream, the src can be updated and this can be removed.
21 (fetchpatch {
22 # https://github.com/bootleg/ret-sync/pull/126
23 name = "ghidra-11.2-fix.patch";
24 url = "https://github.com/bootleg/ret-sync/commit/d81d953c24b4369b499e90ba64c1c9f78513a008.patch";
25 hash = "sha256-t/voPcBfsZtfdYnskgBAPfqMTBw1LRTT0aXyyb5qtr8=";
26 })
27 ];
28 preConfigure = ''
29 cd ext_ghidra
30 '';
31 preInstall = ''
32 correct_version=$(ls dist | grep ${ghidra.version})
33 mv dist/$correct_version dist/safe.zip
34 rm dist/ghidra*
35 mv dist/safe.zip dist/$correct_version
36 '';
37 meta = with lib; {
38 description = "Reverse-Engineering Tools SYNChronization. Allows syncing between a debugging session and Ghidra";
39 homepage = "https://github.com/bootleg/ret-sync";
40 license = licenses.gpl3Only;
41 };
42}