nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, fetchurl, fetchpatch, fetchFromGitHub, ocaml, findlib }:
2
3let
4 meta_file = fetchurl {
5 url = https://raw.githubusercontent.com/ocaml/opam-repository/3c191ae9356ca7b3b628f2707cfcb863db42480f/packages/FrontC/FrontC.3.4.1/files/META;
6 sha256 = "0s2wsinycldk8y5p09xd0hsgbhckhy7bkghzl63bph6mwv64kq2d";
7 };
8in
9
10stdenv.mkDerivation rec {
11 name = "ocaml${ocaml.version}-FrontC-${version}";
12 version = "3.4.1";
13
14 src = fetchFromGitHub {
15 owner = "BinaryAnalysisPlatform";
16 repo = "FrontC";
17 rev = "V_3_4_1";
18 sha256 = "1dq5nks0c9gsbr1m8k39m1bniawr5hqcy1r8x5px7naa95ch06ak";
19 };
20
21 buildInputs = [ ocaml findlib ];
22
23 meta = with lib; {
24 inherit (src.meta) homepage;
25 inherit (ocaml.meta) platforms;
26 description = "C Parsing Library";
27 license = licenses.lgpl21;
28 maintainers = [ maintainers.maurer ];
29 };
30
31 patches = [ (fetchpatch {
32 url = https://raw.githubusercontent.com/ocaml/opam-repository/3c191ae9356ca7b3b628f2707cfcb863db42480f/packages/FrontC/FrontC.3.4.1/files/opam.patch;
33 sha256 = "0v4f6740jbj1kxg1y03dzfa3x3gsrhv06wpzdj30gl4ki5fvj4hs";
34 })
35 ];
36
37 makeFlags = "PREFIX=$(out) OCAML_SITE=$(OCAMLFIND_DESTDIR)";
38
39 postInstall = "cp ${meta_file} $OCAMLFIND_DESTDIR/FrontC/META";
40}