From b2c5bbc2c740070036a1b7e20fc3363fdf436d6c Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Fri, 10 Mar 2023 11:03:29 +0100
Subject: [PATCH] [nix] ppx_deriving_yaml nix package is too old. use a custom
 derivation

---
 nix/pkgs.nix              |  1 +
 nix/ppx_deriving_yaml.nix | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 nix/ppx_deriving_yaml.nix

diff --git a/nix/pkgs.nix b/nix/pkgs.nix
index 1729378c62e..6f226cf8b06 100644
--- a/nix/pkgs.nix
+++ b/nix/pkgs.nix
@@ -8,6 +8,7 @@ let
     mlmpfr = oself.callPackage ./mlmpfr.nix {};
     why3 = oself.callPackage ./why3.nix {};
     yaml = oself.callPackage ./yaml.nix {};
+    ppx_deriving_yaml = oself.callPackage ./ppx_deriving_yaml.nix {};
     # Helpers
     mk_tests = oself.callPackage ./mk_tests.nix {};
     mk_plugin = oself.callPackage ./mk_plugin.nix {};
diff --git a/nix/ppx_deriving_yaml.nix b/nix/ppx_deriving_yaml.nix
new file mode 100644
index 00000000000..44b6e980ae6
--- /dev/null
+++ b/nix/ppx_deriving_yaml.nix
@@ -0,0 +1,27 @@
+{ lib, buildDunePackage, fetchurl, ppxlib, alcotest, mdx
+, ppx_deriving, yaml
+}:
+
+buildDunePackage rec {
+  pname = "ppx_deriving_yaml";
+  version = "0.2.1";
+
+  minimalOCamlVersion = "4.08";
+
+  src = fetchurl {
+    url = "https://github.com/patricoferris/ppx_deriving_yaml/releases/download/v${version}/ppx_deriving_yaml-${version}.tbz";
+    sha256 = "sha256-3vmay8UY7d3j96VOQ+D3oYEotzVls91F51ebXWQ/9SQ=";
+  };
+
+  propagatedBuildInputs = [ ppxlib ppx_deriving yaml ];
+
+  doCheck = true;
+  checkInputs = [ alcotest mdx ];
+
+  meta = {
+    description = "A YAML codec generator for OCaml";
+    homepage = "https://github.com/patricoferris/ppx_deriving_yaml";
+    license = lib.licenses.isc;
+    maintainers = [ ];
+  };
+}
-- 
GitLab