evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / ocaml-modules / hacl-star / raw.nix
blobe481fea3866b2473a79386c3b19ab5ec2797f96e
1 { lib
2 , which
3 , stdenv
4 , fetchzip
5 , cmake
6 , ocaml
7 , findlib
8 , ctypes
9 , cppo
11 stdenv.mkDerivation rec {
12   pname = "ocaml${ocaml.version}-hacl-star-raw";
13   version = "0.7.2";
15   src = fetchzip {
16     url = "https://github.com/cryspen/hacl-packages/releases/download/ocaml-v${version}/hacl-star.${version}.tar.gz";
17     hash = "sha256-6WPbdkT9IsX0Q8mF2vLBJMktEES8tU45JztOPepAL0o=";
18     stripRoot = false;
19   };
21   patches = [
22     ./aligned-alloc.patch
23   ];
25   # strictoverflow is disabled because it breaks aarch64-darwin
26   hardeningDisable = [ "strictoverflow" ];
28   postPatch = ''
29     patchShebangs ./
30   '';
32   buildPhase = ''
33     runHook preBuild
35     make -C hacl-star-raw build-c
36     make -C hacl-star-raw build-bindings
38     runHook postBuild
39   '';
41   preInstall = ''
42     mkdir $out
43     mkdir -p $OCAMLFIND_DESTDIR/stublibs
44   '';
46   installPhase = ''
47     runHook preInstall
49     make -C hacl-star-raw install
51     runHook postInstall
52   '';
54   dontUseCmakeConfigure = true;
55   dontAddPrefix = true;
56   dontAddStaticConfigureFlags = true;
57   createFindlibDestdir = true;
59   nativeBuildInputs = [
60     which
61     cmake
62     ocaml
63     findlib
64   ];
66   propagatedBuildInputs = [
67     ctypes
68   ];
70   checkInputs = [
71     cppo
72   ];
74   strictDeps = true;
76   doCheck = true;
78   meta = {
79     inherit (ocaml.meta) platforms;
80     description = "Auto-generated low-level OCaml bindings for EverCrypt/HACL*";
81     license = lib.licenses.asl20;
82     maintainers = [ lib.maintainers.ulrikstrid ];
83   };