From 011dd72d6a792e1992e3b1166bee7e59b598b260 Mon Sep 17 00:00:00 2001
From: Vincent Laporte <Vincent.Laporte@gmail.com>
Date: Fri, 20 Sep 2019 05:28:52 +0000
Subject: [PATCH] =?UTF-8?q?ocamlPackages.mdx:=20disable=20tests=20for=20OC?=
 =?UTF-8?q?aml=20=E2=89=A5=204.08?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Don’t strip for OCaml 4.04
---
 pkgs/development/ocaml-modules/mdx/default.nix | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/pkgs/development/ocaml-modules/mdx/default.nix b/pkgs/development/ocaml-modules/mdx/default.nix
index 29fee1b6318..0b43cf461e0 100644
--- a/pkgs/development/ocaml-modules/mdx/default.nix
+++ b/pkgs/development/ocaml-modules/mdx/default.nix
@@ -1,11 +1,9 @@
-{ stdenv, fetchFromGitHub, buildDunePackage, astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml_lwt, pandoc, re }:
+{ lib, fetchFromGitHub, buildDunePackage, ocaml, astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml_lwt, pandoc, re }:
 
 buildDunePackage rec {
   pname = "mdx";
   version = "1.4.0";
 
-  minimumOCamlVersion = "4.05";
-
   src = fetchFromGitHub {
     owner = "realworldocaml";
     repo = pname;
@@ -15,14 +13,16 @@ buildDunePackage rec {
 
   nativeBuildInputs = [ cppo ];
   buildInputs = [ astring cmdliner fmt logs ocaml-migrate-parsetree re ];
-  checkInputs = [ ocaml_lwt pandoc ];
+  checkInputs = lib.optionals doCheck [ ocaml_lwt pandoc ];
 
-  doCheck = true;
+  doCheck = !lib.versionAtLeast ocaml.version "4.08";
+
+  dontStrip = lib.versions.majorMinor ocaml.version == "4.04";
 
   meta = {
     homepage = https://github.com/realworldocaml/mdx;
     description = "Executable OCaml code blocks inside markdown files";
-    license = stdenv.lib.licenses.isc;
-    maintainers = [ stdenv.lib.maintainers.romildo ];
+    license = lib.licenses.isc;
+    maintainers = [ lib.maintainers.romildo ];
   };
 }