2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, libgcrypt, fetchFromGitHub, ocamlPackages, perl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "obliv-c";
|
2023-02-09 11:40:11 +00:00
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
version = "0.0pre20210621";
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ perl ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ (with ocamlPackages; [ ocaml findlib ocamlbuild ]);
|
2023-03-08 16:32:21 +00:00
|
|
|
buildInputs = [ ocamlPackages.num ];
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ libgcrypt ];
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samee";
|
|
|
|
repo = "obliv-c";
|
2022-04-03 18:54:34 +00:00
|
|
|
rev = "e02e5c590523ef4dae06e167a7fa00037bb3fdaf";
|
|
|
|
sha256 = "sha256:02vyr4689f4dmwqqs0q1mrack9h3g8jz3pj8zqiz987dk0r5mz7a";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
hardeningDisable = [ "fortify" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [ ./ignore-complex-float128.patch ];
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
# https://github.com/samee/obliv-c/issues/76#issuecomment-438958209
|
|
|
|
env.OCAMLBUILD = "ocamlbuild -package num -ocamlopt 'ocamlopt -dontlink num' -ocamlc 'ocamlc -dontlink num'";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preBuild = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cp bin/* "$out/bin"
|
|
|
|
mkdir -p "$out/share/doc/obliv-c"
|
|
|
|
cp -r doc/* README* CHANGE* Change* LICEN* TODO* "$out/share/doc/obliv-c"
|
|
|
|
mkdir -p "$out/share/obliv-c"
|
|
|
|
cp -r test "$out/share/obliv-c"
|
|
|
|
mkdir -p "$out/include"
|
|
|
|
cp src/ext/oblivc/*.h "$out/include"
|
|
|
|
mkdir -p "$out/lib"
|
|
|
|
gcc $(ar t _build/libobliv.a | sed -e 's@^@_build/@') --shared -o _build/libobliv.so
|
|
|
|
cp _build/lib*.a _build/lib*.so* "$out/lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "GCC wrapper that makes it easy to embed secure computation protocols inside regular C programs";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
maintainers = [lib.maintainers.raskin];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|