push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
From e6f6d1529d1725e8c1ed3c96eecc4aea43417aea Mon Sep 17 00:00:00 2001
From: Matthew Maurer <matthew.r.maurer@gmail.com>
Date: Sun, 19 Apr 2020 15:50:01 -0700
Subject: [PATCH] Remove attempt to work around libcurses dependency issues.
BAP doesn't actually link against libcurses, LLVM does. By adding
-lcurses to this file, we accidentally broke linking on any systems
where LLVM got linked against libncurses (not libcurses) without a
libcurses compatibility shim.
Overall, we should get -l flags from llvm-config, not attempt to
shoehorn them in later, as this is fragile.
---
oasis/llvm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/oasis/llvm b/oasis/llvm
index 966c407..fba3fb4 100644
--- a/oasis/llvm
+++ b/oasis/llvm
@@ -31,7 +31,7 @@ Library bap_llvm
Bap_llvm_ogre_samples,
Bap_llvm_ogre_types
CCOpt: $cc_optimization
- CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lcurses -lzstd
+ CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lncurses -lzstd
CSources: llvm_disasm.h,
llvm_disasm.c,
llvm_stubs.c,
--
2.22.0

View File

@@ -0,0 +1,152 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
ocaml,
findlib,
ocamlbuild,
ocaml_oasis,
bitstring,
camlzip,
cmdliner,
core_kernel,
ezjsonm,
fileutils,
jane_rope ? null,
mmap,
lwt,
ocamlgraph,
ocurl,
re,
uri,
zarith,
piqi,
piqi-ocaml,
uuidm,
llvm,
frontc,
ounit,
ppx_jane,
parsexp ? null,
utop,
libxml2,
ncurses,
linenoise,
ppx_bap,
ppx_bitstring,
yojson,
which,
makeWrapper,
writeText,
z3,
}:
if lib.versionOlder ocaml.version "4.08" then
throw "BAP is not available for OCaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-bap";
version = "2.5.0+pr1621";
src = fetchFromGitHub {
owner = "BinaryAnalysisPlatform";
repo = "bap";
rev = "65c282d94e8b7028e8a986c637db3a2378a753f6";
hash = "sha256-LUZZOgG1T8xa5jLA/fDft8ofYb/Yf6QjTrl6AlLY7H0=";
};
sigs = fetchurl {
url = "https://github.com/BinaryAnalysisPlatform/bap/releases/download/v${version}/sigs.zip";
sha256 = "0d69jd28z4g64mglq94kj5imhmk5f6sgcsh9q2nij3b0arpcliwk";
};
createFindlibDestdir = true;
setupHook = writeText "setupHook.sh" ''
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/ocaml${ocaml.version}-bap-${version}/"
export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/ocaml${ocaml.version}-bap-${version}-llvm-plugins/"
'';
nativeBuildInputs = [
which
makeWrapper
ocaml
findlib
ocamlbuild
ocaml_oasis
];
buildInputs = [
ocamlbuild
linenoise
ounit
ppx_bitstring
z3
utop
libxml2
ncurses
];
propagatedBuildInputs = [
bitstring
camlzip
cmdliner
ppx_bap
core_kernel
ezjsonm
fileutils
jane_rope
mmap
lwt
ocamlgraph
ocurl
re
uri
zarith
piqi
parsexp
piqi-ocaml
uuidm
frontc
yojson
];
installPhase = ''
runHook preInstall
export OCAMLPATH=$OCAMLPATH:$OCAMLFIND_DESTDIR;
export PATH=$PATH:$out/bin
export CAML_LD_LIBRARY_PATH=''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}$OCAMLFIND_DESTDIR/bap-plugin-llvm/:$OCAMLFIND_DESTDIR/bap/
mkdir -p $out/lib/bap
make install
rm $out/bin/baptop
makeWrapper ${utop}/bin/utop $out/bin/baptop --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH --add-flags "-ppx ppx-bap -short-paths -require \"bap.top\""
wrapProgram $out/bin/bapbuild --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH
ln -s $sigs $out/share/bap/sigs.zip
runHook postInstall
'';
disableIda = "--disable-ida";
disableGhidra = "--disable-ghidra";
patches = [
./curses_is_ncurses.patch
];
preConfigure = ''
substituteInPlace oasis/monads --replace-warn core_kernel.rope jane_rope
'';
configureFlags = [
"--enable-everything ${disableIda} ${disableGhidra}"
"--with-llvm-config=${llvm.dev}/bin/llvm-config"
];
meta = with lib; {
description = "Platform for binary analysis. It is written in OCaml, but can be used from other languages";
homepage = "https://github.com/BinaryAnalysisPlatform/bap/";
license = licenses.mit;
maintainers = [ maintainers.maurer ];
mainProgram = "bap";
};
}