ocamlPackages.tsdl: fix build on darwin

This commit is contained in:
Weijia Wang 2023-01-30 08:30:29 +01:00
parent 99f5676ba0
commit 605704fa22
2 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,5 @@
{ 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)

View file

@ -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 { };