2017-10-12 06:01:24 +00:00
|
|
|
{ stdenv, fetchurl, libgcrypt, fetchFromGitHub, ocamlPackages, perl }:
|
2016-10-06 15:47:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "obliv-c-${version}";
|
2017-08-29 19:17:00 +00:00
|
|
|
version = "0.0pre20170827";
|
2017-10-12 06:01:24 +00:00
|
|
|
buildInputs = [ perl ]
|
|
|
|
++ (with ocamlPackages; [ ocaml findlib ocamlbuild ]);
|
2016-10-06 15:47:50 +00:00
|
|
|
propagatedBuildInputs = [ libgcrypt ];
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samee";
|
|
|
|
repo = "obliv-c";
|
2017-08-29 19:17:00 +00:00
|
|
|
rev = "9a6be5a5f44d341bc357055e11922f6a4c4c3b65";
|
|
|
|
sha256 = "0jz2ayadx62zv2b5ji947bkvw63axl4a2q70lwli86zgmcl390gf";
|
2016-10-06 15:47:50 +00:00
|
|
|
};
|
2017-08-29 19:17:00 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
2016-10-06 15:47:50 +00:00
|
|
|
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"
|
|
|
|
'';
|
2017-08-29 19:17:00 +00:00
|
|
|
|
2016-10-06 15:47:50 +00:00
|
|
|
meta = {
|
|
|
|
inherit version;
|
|
|
|
description = ''A GCC wrapper that makes it easy to embed secure computation protocols inside regular C programs'';
|
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
maintainers = [stdenv.lib.maintainers.raskin];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|