Unverified Commit 1ec2dce6 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #213521 from wegank/tsdl-darwin

ocamlPackages.tsdl: fix build on darwin
parents 6356b18b 605704fa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, result, SDL2, pkg-config, ocb-stubblr }:
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, result, SDL2, pkg-config
, AudioToolbox, Cocoa, CoreAudio, CoreVideo, ForceFeedback }:

if lib.versionOlder ocaml.version "4.03"
then throw "tsdl is not available for OCaml ${ocaml.version}"
@@ -20,7 +21,8 @@ stdenv.mkDerivation {

  nativeBuildInputs = [ pkg-config ocaml findlib ocamlbuild topkg ];
  buildInputs = [ topkg ];
  propagatedBuildInputs = [ SDL2 ctypes ];
  propagatedBuildInputs = [ SDL2 ctypes ]
    ++ lib.optionals stdenv.isDarwin [ AudioToolbox Cocoa CoreAudio CoreVideo ForceFeedback ];

  preConfigure = ''
    # The following is done to avoid an additional dependency (ncurses)
+3 −1
Original line number Diff line number Diff line
@@ -1477,7 +1477,9 @@ let

    trie = callPackage ../development/ocaml-modules/trie { };

    tsdl = callPackage ../development/ocaml-modules/tsdl { };
    tsdl = callPackage ../development/ocaml-modules/tsdl {
      inherit (pkgs.darwin.apple_sdk.frameworks) AudioToolbox Cocoa CoreAudio CoreVideo ForceFeedback;
    };

    tsdl-image = callPackage ../development/ocaml-modules/tsdl-image { };