Skip to content

Instantly share code, notes, and snippets.

@Pamplemousse
Created December 21, 2020 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pamplemousse/c634f2948cc10db8893e18ab337d8e48 to your computer and use it in GitHub Desktop.
Save Pamplemousse/c634f2948cc10db8893e18ab337d8e48 to your computer and use it in GitHub Desktop.
/*
Using this `shell.nix`, here is how to install BAP using `opam`:
```
opam init --comp=4.09.0
eval $(opam env)
opam install bap
```
*/
with import <nixpkgs> { };
mkShell rec {
buildInputs = [
ocaml
opam
gmp
gnum4
libxml2
llvm
llvmPackages.clang
pkg-config
python27
];
shellHook = ''
# `opam install bap` requires `-lcurses`, and NixOS only has `ncurses`;
# See: https://github.com/BinaryAnalysisPlatform/bap/issues/1261.
# The following allows the installation process to find the libraries it requires:
mkdir lib/ 2>/dev/null
cp ${ncurses}/lib/libncurses.so lib/libcurses.so
export LIBRARY_PATH="$(pwd)/lib"
eval $(opam env)
'';
exitHook = ''
rm -Rf lib/
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment