Skip to content

Commit

Permalink
ddisasm: init at 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinafyi committed Jan 8, 2024
1 parent c4a9759 commit e8ca6d2
Show file tree
Hide file tree
Showing 12 changed files with 274 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
pkg:
[aslp, bap-aslp, bap-primus, basil,
alive2, retdec-uq-pac, asl-translator,
gtirb-semantics]
gtirb-semantics, ddisasm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
17 changes: 17 additions & 0 deletions _old/menhir.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ lib, fetchFromGitLab, buildDunePackage
, menhirLib, menhirSdk
}:

buildDunePackage rec {
pname = "menhir";

minimalOCamlVersion = "4.03";

inherit (menhirLib) version src;

buildInputs = [ menhirLib menhirSdk ];

meta = menhirSdk.meta // {
description = "A LR(1) parser generator for OCaml";
};
}
28 changes: 28 additions & 0 deletions _old/opaline.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ lib, stdenv, fetchFromGitHub, ocamlPackages, pkgsHostTarget }:

stdenv.mkDerivation rec {
version = "0.3.3";
pname = "opaline";

src = fetchFromGitHub {
owner = "jaapb";
repo = "opaline";
rev = "v${version}";
sha256 = "sha256-6htaiFIcRMUYWn0U7zTNfCyDaTgDEvPch2q57qzvND4=";
};

nativeBuildInputs = with pkgsHostTarget.ocamlPackages; [ ocaml findlib ocamlbuild ];
buildInputs = with ocamlPackages; [ opam-file-format ];

preInstall = "mkdir -p $out/bin";

installFlags = [ "PREFIX=$(out)" ];

meta = {
description = "OPAm Light INstaller Engine";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.vbgl ];
inherit (src.meta) homepage;
inherit (ocamlPackages.ocaml.meta) platforms;
};
}
47 changes: 47 additions & 0 deletions _old/ott.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, ocamlPackages, pkgsHostTarget }:

stdenv.mkDerivation rec {
pname = "ott";
version = "0.33";

src = fetchFromGitHub {
owner = "ott-lang";
repo = "ott";
rev = version;
hash = "sha256-GzeEiok5kigcmfqf/K/UxvlKkl55zy0vOyiRZ2HyMiE=";
};

strictDeps = true;

nativeBuildInputs = [ pkg-config pkgsHostTarget.opaline ] ++ (with pkgsHostTarget.ocamlPackages; [ ocaml findlib ]);
buildInputs = with ocamlPackages; [ ocamlgraph ];

installTargets = "ott.install";

postInstall = ''
opaline -prefix $out
''
# There is `emacsPackages.ott-mode` for this now.
+ ''
rm -r $out/share/emacs
'';

meta = {
description = "A tool for the working semanticist";
longDescription = ''
Ott is a tool for writing definitions of programming languages and
calculi. It takes as input a definition of a language syntax and
semantics, in a concise and readable ASCII notation that is close to
what one would write in informal mathematics. It generates LaTeX to
build a typeset version of the definition, and Coq, HOL, and Isabelle
versions of the definition. Additionally, it can be run as a filter,
taking a LaTeX/Coq/Isabelle/HOL source file with embedded (symbolic)
terms of the defined language, parsing them and replacing them by
target-system terms.
'';
homepage = "http://www.cl.cam.ac.uk/~pes20/ott";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ jwiegley ];
platforms = lib.platforms.unix;
};
}
22 changes: 22 additions & 0 deletions gtirb/capstone.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib
, stdenv
, fetchFromGitHub
, capstone
}:

capstone.overrideAttrs {
pname = "capstone-grammatech";

src = fetchFromGitHub {
owner = "GrammaTech";
repo = "capstone";
rev = "a11159a0bbd680e134c53d6a16e304b53488824b";
hash = "sha256-0aCmlXsrdWYlxqzRlXj8TNkD0s8xHMTq0YlVJ+t1fD4=";
};

preConfigure = ''
substituteInPlace capstone.pc.in \
--replace \''${prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
'';
}

41 changes: 41 additions & 0 deletions gtirb/ddisasm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, boost
, lief
, libehp
, gtirb
, gtirb-pprinter
, capstone-grammatech
, souffle
}:

stdenv.mkDerivation {
pname = "ddisasm";
version = "1.8.0";

src = fetchFromGitHub {
owner = "GrammaTech";
repo = "ddisasm";
rev = "v1.8.0";
hash = "sha256-jCJLqy1BARO9SjV6hzSaow/KdMLlIc+wNXC16LSLlVE=";
};

buildInputs = [ cmake boost lief gtirb gtirb-pprinter libehp ];
nativeBuildInputs = [ capstone-grammatech souffle ];

cmakeFlags = [ "-DDDISASM_ENABLE_TESTS=OFF" "-DDDISASM_GENERATE_MANY=ON" ];
# enableParallelBuilding = false;

preConfigure = ''
export CXXFLAGS='-includeset'
'';

meta = {
homepage = "https://github.com/grammatech/ddisasm";
description = "A fast and accurate disassembler.";
maintainers = [ "Kait Lam <[email protected]>" ];
};
}

40 changes: 40 additions & 0 deletions gtirb/gtirb-pprinter.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, python3
, boost
, abseil-cpp
, doxygen
, gtirb
, capstone-grammatech
, gtest
}:

stdenv.mkDerivation {
pname = "gtirb-pprinter";
version = "2.1.0";

src = fetchFromGitHub {
owner = "GrammaTech";
repo = "gtirb-pprinter";
rev = "v2.1.0";
hash = "sha256-zgYq6FKxaJ6vLzvOTCfOU4ZUyXvMuFc3abNrqg8NADc=";
};

buildInputs = [ cmake python3 gtirb boost abseil-cpp gtest ];
nativeBuildInputs = [ capstone-grammatech ];

cmakeFlags = [ "-DGTIRB_PPRINTER_ENABLE_TESTS=OFF" ];

preConfigure = ''
export CXXFLAGS='-includeset -Wno-error=unused-result -Wno-error=deprecated-declarations'
'';

meta = {
homepage = "https://github.com/grammatech/gtirb-pprinter";
description = "Pretty printer from GTIRB to assembly code.";
maintainers = [ "Kait Lam <[email protected]>" ];
};
}

File renamed without changes.
36 changes: 36 additions & 0 deletions gtirb/gtirb.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, python3
, boost
, protobuf
, doxygen
}:

stdenv.mkDerivation {
pname = "gtirb";
version = "2.0.0";

src = fetchFromGitHub {
owner = "GrammaTech";
repo = "gtirb";
rev = "v2.0.0";
hash = "sha256-ueoqxm6iXv4JgzR/xkImT+O8xx+7bA2upx1TJ828LLA=";
};

buildInputs = [ cmake python3 boost doxygen ];
propagatedBuildInputs = [ protobuf ];

cmakeFlags = [ "-DGTIRB_ENABLE_TESTS=OFF" ];

preConfigure = ''
export CXXFLAGS="-includeset -Wno-error=unused-result"
'';

meta = {
homepage = "https://github.com/GrammaTech/gtirb";
description = "Intermediate Representation for Binary analysis and transformation.";
maintainers = [ "Kait Lam <[email protected]>" ];
};
}
27 changes: 27 additions & 0 deletions gtirb/libehp.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ lib
, stdenv
, fetchFromGitLab
, cmake
}:

stdenv.mkDerivation {
pname = "libehp";
version = "init";

src = fetchFromGitLab {
owner = "opensrc";
repo = "libehp";
rev = "4d2705bcaa4f9731eabbd5d2dc30bba894432e7c";
hash = "sha256-uMKb3FO7LGneeznBknfOVkkDHWLEooxQllUjojoE4sU=";
domain = "git.zephyr-software.com";
};

buildInputs = [ cmake ];

meta = {
homepage = "https://git.zephyr-software.com/opensrc/libehp";
description = "Exception handling parsing support for Elf files (eh_frame, etc.)";
maintainers = [ "Kait Lam <[email protected]>" ];
};
}

10 changes: 10 additions & 0 deletions gtirb/overlay.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
final: prev:
{
ddisasm = prev.callPackage ./ddisasm.nix {};
gtirb = prev.callPackage ./gtirb.nix {};
gtirb-pprinter = prev.callPackage ./gtirb-pprinter.nix {};
capstone-grammatech = prev.callPackage ./capstone.nix {};
libehp = prev.callPackage ./libehp.nix {};

gtirb-semantics = prev.callPackage ./gtirb-semantics.nix {};
}
7 changes: 5 additions & 2 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let

bap-primus = prev.callPackage ./bap-primus.nix {};

gtirb-semantics = prev.callPackage ./gtirb-semantics.nix {};
ocaml-hexstring = prev.callPackage ./ocaml-hexstring.nix {};

# MOVED: basil-related packages now in ./basil/overlay.nix
Expand All @@ -37,5 +36,9 @@ let
};
in final: prev:
prev.lib.composeManyExtensions
[ overlay (import ./basil/overlay.nix) ]
[
overlay
(import ./basil/overlay.nix)
(import ./gtirb/overlay.nix)
]
final prev

0 comments on commit e8ca6d2

Please sign in to comment.