From 605704fa22255fa2f64348cf2fe083d1a1140fca Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 30 Jan 2023 08:30:29 +0100 Subject: [PATCH] ocamlPackages.tsdl: fix build on darwin --- pkgs/development/ocaml-modules/tsdl/default.nix | 6 ++++-- pkgs/top-level/ocaml-packages.nix | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/tsdl/default.nix b/pkgs/development/ocaml-modules/tsdl/default.nix index db107003df04..a7d1f573c69a 100644 --- a/pkgs/development/ocaml-modules/tsdl/default.nix +++ b/pkgs/development/ocaml-modules/tsdl/default.nix @@ -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) diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 03bd642550f1..301495961e33 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -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 { };