Skip to content

Commit

Permalink
gtirb-semantics: test and fix bundled python scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinafyi committed Feb 7, 2024
1 parent ec4944a commit 46819bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 17 additions & 3 deletions gtirb/gtirb-semantics.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, buildDunePackage
, fetchFromGitHub
, testVersion
, protobuf
, asli
, buildDunePackage
, libllvm
, ocaml-protoc-plugin
, ocaml-hexstring
, base64
Expand All @@ -11,6 +13,7 @@
, makePythonPth
, python3Packages
, python-gtirb
, gtirb-semantics
}:

let
Expand All @@ -29,9 +32,9 @@ let
'';
};

pth = makePythonPth python3Packages "gtirb-semantics" [ protobuf ];
pth = makePythonPth python3Packages "gtirb-semantics" [ protobuf libllvm ];
python' = python3Packages.python.withPackages
(p: [ p.protobuf pth python-gtirb ]);
(p: [ pth python-gtirb ]);

in
buildDunePackage {
Expand All @@ -56,6 +59,17 @@ buildDunePackage {

outputs = [ "out" "dev" ];

passthru.tests.test-debug-gts = testVersion {
package = gtirb-semantics;
command = "debug-gts.py --help";
version = "debug-gts.py";
};
passthru.tests.test-proto-json = testVersion {
package = gtirb-semantics;
command = "proto-json.py --help";
version = "proto-json.py";
};

meta = {
homepage = "https://github.com/UQ-PAC/gtirb-semantics";
description = "Add instruction semantics to the IR of a dissassembled ARM64 binary";
Expand Down
3 changes: 2 additions & 1 deletion gtirb/python-gtirb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ python3Packages.buildPythonPackage {

src = gtirb.python;

buildInputs = with python3Packages; [ pip networkx typing-extensions sortedcontainers intervaltree protobuf3 ];
buildInputs = with python3Packages; [ pip ];
propagatedBuildInputs = with python3Packages; [ networkx typing-extensions sortedcontainers intervaltree protobuf3 ];

preConfigure = ''
ln -s /build/gtirb* /build/source
Expand Down

0 comments on commit 46819bf

Please sign in to comment.