From 8c859b4cc98720f5d9df83777cfb802e8fcaa9c8 Mon Sep 17 00:00:00 2001
From: Ruben Maher <ruben@maher.fyi>
Date: Sat, 6 Jan 2018 23:09:22 +1030
Subject: [PATCH] ocaml-modules/dtoa: disable hardening (strictoverflow) on
 darwin (#33443)

* ocaml-modules/dtoa: disable hardening (strictoverflow) on darwin

This prevents a compile-time error on macOS:

clang-4.0: error: argument unused during compilation: '-fno-strict-overflow'
  [-Werror,-Wunused-command-line-argument]

* ocaml-modules/dtoa: remove unnecessary createFindLibDestdir

* ocaml-modules/dtoa: remove ounit from build inputs
---
 pkgs/development/ocaml-modules/dtoa/default.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/development/ocaml-modules/dtoa/default.nix b/pkgs/development/ocaml-modules/dtoa/default.nix
index 47d761894d50..9b6e56266143 100644
--- a/pkgs/development/ocaml-modules/dtoa/default.nix
+++ b/pkgs/development/ocaml-modules/dtoa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, jbuilder, ounit }:
+{ stdenv, fetchurl, ocaml, findlib, jbuilder }:
 
 assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
 
@@ -14,13 +14,13 @@ stdenv.mkDerivation rec {
 
   unpackCmd = "tar xjf $src";
 
-  buildInputs = [ ocaml findlib jbuilder ounit ];
+  buildInputs = [ ocaml findlib jbuilder ];
 
   buildPhase = "jbuilder build -p dtoa";
 
   inherit (jbuilder) installPhase;
 
-  createFindLibDestdir = true;
+  hardeningDisable = stdenv.lib.optional stdenv.isDarwin "strictoverflow";
 
   meta = with stdenv.lib; {
     homepage = https://github.com/flowtype/ocaml-dtoa;