From 9ba5dff3bca83d6555533f57bff1cc25d8243da6 Mon Sep 17 00:00:00 2001 From: xenia Date: Fri, 12 Sep 2025 00:46:37 -0400 Subject: [PATCH] add binsync --- README.md | 4 ++ overlay.nix | 5 ++ pkgs/reverse-engineering/binsync/binsync.nix | 68 +++++++++++++++++++ pkgs/reverse-engineering/binsync/libbs.nix | 70 ++++++++++++++++++++ 4 files changed, 147 insertions(+) create mode 100644 pkgs/reverse-engineering/binsync/binsync.nix create mode 100644 pkgs/reverse-engineering/binsync/libbs.nix diff --git a/README.md b/README.md index f6bea7f..594b2c0 100644 --- a/README.md +++ b/README.md @@ -524,6 +524,10 @@ feedvalidator --base "https://my-base-url/atom.xml" path/to/atom.xml a python utility to access serial ports from the command line +### [`python311Packages.binsync` and `python311Packages.libbs`](./pkgs/reverse-engineering/binsync) + +packaged latest versions of binsync and libbs from git + ### [`outer-wilds-text-adventure`](./pkgs/games/outer-wilds-text-adventure) nix packaging for the Outer Wilds text adventure game. it should work by default on NixOS. if using diff --git a/overlay.nix b/overlay.nix index 39fe614..1a7e243 100644 --- a/overlay.nix +++ b/overlay.nix @@ -37,6 +37,11 @@ final: prev: { feedvalidator = final.python312Packages.feedvalidator; megacom = final.python312Packages.megacom; + python311Packages = prev.python311Packages.overrideScope (pfinal: pprev: { + libbs = pfinal.callPackage ./pkgs/reverse-engineering/binsync/libbs.nix {}; + binsync = pfinal.callPackage ./pkgs/reverse-engineering/binsync/binsync.nix {}; + }); + outer-wilds-text-adventure = prev.callPackage ./pkgs/games/outer-wilds-text-adventure {}; satisfactory-dedicated-server = prev.callPackage ./pkgs/games/satisfactory-dedicated-server {}; diff --git a/pkgs/reverse-engineering/binsync/binsync.nix b/pkgs/reverse-engineering/binsync/binsync.nix new file mode 100644 index 0000000..db96517 --- /dev/null +++ b/pkgs/reverse-engineering/binsync/binsync.nix @@ -0,0 +1,68 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + + setuptools, + + libbs, + + filelock, + gitpython, + prompt-toolkit, + pycparser, + sortedcontainers, + toml, + tqdm, + ply, + wordfreq, + + pyside6, + + pytestCheckHook, + pytest-qt, +}: buildPythonPackage rec { + pname = "binsync"; + version = "5.7.10+dev"; + pyproject = true; + + src = fetchFromGitHub { + owner = "binsync"; + repo = "binsync"; + rev = "e67da5ab9cddc2743f7462c9543ba7100e25eeb5"; + hash = "sha256-QDOfbo2yjfjLsLILMhl/ckKwXDusXfE8+YmFpW5djN0="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + libbs + + filelock + gitpython + prompt-toolkit + pycparser + sortedcontainers + toml + tqdm + ply + wordfreq + ]; + + optional-dependencies = { + ghidra = [ pyside6 ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + pytest-qt + pyside6 + ]; + + disabledTestPaths = [ + # Test tries to import angrmanagement + "tests/test_angr_gui.py" + ]; + + pythonImportsCheck = [ "binsync" ]; +} diff --git a/pkgs/reverse-engineering/binsync/libbs.nix b/pkgs/reverse-engineering/binsync/libbs.nix new file mode 100644 index 0000000..872ddc7 --- /dev/null +++ b/pkgs/reverse-engineering/binsync/libbs.nix @@ -0,0 +1,70 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + + setuptools, + + filelock, + ghidra-bridge, + jfx-bridge, + networkx, + platformdirs, + prompt-toolkit, + psutil, + pycparser, + pyhidra, + toml, + tqdm, + ply, + + pytestCheckHook, + writableTmpDirAsHomeHook, +}: buildPythonPackage rec { + pname = "libbs"; + version = "2.16.4+dev"; + pyproject = true; + + src = fetchFromGitHub { + owner = "binsync"; + repo = "libbs"; + rev = "0ce5c351cc81c1a0120f763aeba584fdb9dc2820"; + hash = "sha256-if27Tg5S0Esrw9xHi6nr+kDIw4OTz7yZ2256/4Kbkeo="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + filelock + ghidra-bridge + jfx-bridge + networkx + platformdirs + prompt-toolkit + psutil + pycparser + pyhidra + toml + tqdm + ply + ]; + + nativeCheckInputs = [ + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + pythonImportsCheck = [ "libbs" ]; + + disabledTests = [ + "test_change_watcher_plugin_cli" + "test_ghidra_artifact_watchers" + "TestHeadlessInterfaces" + ]; + + + disabledTestPaths = [ + "tests/test_decompilers.py" + "tests/test_remote_ghidra.py" + ]; +}