Merge pull request #213521 from wegank/tsdl-darwin

ocamlPackages.tsdl: fix build on darwin
This commit is contained in:
Weijia Wang 2023-01-30 10:32:40 +01:00 committed by GitHub
commit 1ec2dce631
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 { };