From edf3a8376e51458cb44fa282a372fec9517761c3 Mon Sep 17 00:00:00 2001
From: Vincent Laporte <Vincent.Laporte@gmail.com>
Date: Thu, 4 Feb 2021 19:56:05 +0100
Subject: [PATCH] =?UTF-8?q?ocamlPackages.ppx=5Fderiving=5Fprotobuf:=202.7?=
 =?UTF-8?q?=20=E2=86=92=203.0.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../ppx_deriving_protobuf/default.nix         | 24 ++++++++-----------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix
index 7828f2172abc..6f23af44b949 100644
--- a/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix
@@ -1,28 +1,24 @@
-{ lib, fetchFromGitHub, buildDunePackage, ocaml, cppo, ppx_tools, ppx_deriving
-, ppxfind }:
-
-if lib.versionAtLeast ocaml.version "4.11"
-then throw "ppx_deriving_protobuf is not available for OCaml ${ocaml.version}"
-else
+{ lib, fetchurl, buildDunePackage, cppo, ppx_deriving
+, ppxlib
+}:
 
 buildDunePackage rec {
   pname = "ppx_deriving_protobuf";
-  version = "2.7";
+  version = "3.0.0";
 
-  src = fetchFromGitHub {
-    owner = "ocaml-ppx";
-    repo = pname;
-    rev = "v${version}";
-    sha256 = "0aq4f3gbkhhai0c8i5mcw2kpqy8l610f4dknwkrxh0nsizwbwryn";
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/ocaml-ppx/ppx_deriving_protobuf/releases/download/v${version}/ppx_deriving_protobuf-v${version}.tbz";
+    sha256 = "1dc1vxnkd0cnrgac5v3zbaj2lq1d2w8118mp1cmsdxylp06yz1sj";
   };
 
-  buildInputs = [ cppo ppx_tools ppxfind ppx_deriving ];
+  buildInputs = [ cppo ppxlib ppx_deriving ];
 
   meta = with lib; {
     homepage = "https://github.com/ocaml-ppx/ppx_deriving_protobuf";
     description = "A Protocol Buffers codec generator for OCaml";
     license = licenses.mit;
     maintainers = [ maintainers.vyorkin ];
-    broken = true;
   };
 }