@@ -1,37 +1,38 @@
1−{ lib, buildOcaml, fetchurl, ocaml }:
1+{ stdenv, lib, fetchurl, fetchpatch, fetchFromGitHub, ocaml, findlib }:
22
3−if lib.versionAtLeast ocaml.version "4.06"
4−then throw "FrontC is not available for OCaml ${ocaml.version}"
5−else
3+let
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+ };
8+in
69
7−buildOcaml rec {
8− name = "FrontC";
9− version = "3.4";
10+stdenv.mkDerivation rec {
11+ name = "ocaml${ocaml.version}-FrontC-${version}";
12+ version = "3.4.1";
1013
11− src = fetchurl {
12− url = "http://www.irit.fr/recherches/ARCHI/MARCH/frontc/Frontc-${version}.tgz";
13− sha256 = "16dz153s92dgbw1rrfwbhscy73did87kfmjwyh3qpvs748h1sc4g";
14+ src = fetchFromGitHub {
15+ owner = "BinaryAnalysisPlatform";
16+ repo = "FrontC";
17+ rev = "V_3_4_1";
18+ sha256 = "1dq5nks0c9gsbr1m8k39m1bniawr5hqcy1r8x5px7naa95ch06ak";
1419 };
1520
21+ buildInputs = [ ocaml findlib ];
22+
1623 meta = with lib; {
17− homepage = https://www.irit.fr/recherches/ARCHI/MARCH/rubrique.php3?id_rubrique=61;
24+ inherit (src.meta) homepage;
25+ inherit (ocaml.meta) platforms;
1826 description = "C Parsing Library";
1927 license = licenses.lgpl21;
2028 maintainers = [ maintainers.maurer ];
2129 };
2230
23− meta_file = fetchurl {
24− url = https://raw.githubusercontent.com/ocaml/opam-repository/0f0e610f6499bdf0151e4170411b4f05e4d076d4/packages/FrontC/FrontC.3.4/files/META;
25− sha256 = "1flhvwr01crn7d094kby0418s1m4198np85ymjp3b4maz0n7m2mx";
26− };
27−
28− opam_patch = fetchurl {
29− url = https://raw.githubusercontent.com/ocaml/opam-repository/0f0e610f6499bdf0151e4170411b4f05e4d076d4/packages/FrontC/FrontC.3.4/files/opam.patch;
30− sha256 = "0xf83ixx0mf3mznwpwp2mjflii0njdzikhhfxpnms7vhnnmlfzy5";
31− };
32−
33− patches = [ opam_patch ];
34− patchFlags = "-p4";
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+ ];
3536
3637 makeFlags = "PREFIX=$(out) OCAML_SITE=$(OCAMLFIND_DESTDIR)";
3738