Skip to content

Commit

Permalink
Merge pull request #209132 from Et7f3/ocamlPackages_fix_build_on_darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Jan 12, 2023
2 parents da8a79b + 50100d1 commit e7d3753
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 20 deletions.
4 changes: 2 additions & 2 deletions pkgs/development/ocaml-modules/bjack/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, libsamplerate, libjack2 }:
{ lib, stdenv, buildDunePackage, fetchFromGitHub, Accelerate, CoreAudio, dune-configurator, libsamplerate, libjack2 }:

buildDunePackage rec {
pname = "bjack";
Expand All @@ -13,7 +13,7 @@ buildDunePackage rec {
sha256 = "1gf31a8i9byp6npn0x6gydcickn6sf5dnzmqr2c1b9jn2nl7334c";
};

buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ Accelerate CoreAudio ];
propagatedBuildInputs = [ libsamplerate libjack2 ];

meta = with lib; {
Expand Down
8 changes: 6 additions & 2 deletions pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
, AudioToolbox
, ffmpeg-base ? callPackage ./base.nix { }
, ffmpeg-avutil, ffmpeg-avcodec, ffmpeg }:
, ffmpeg-avutil, ffmpeg-avcodec, ffmpeg
, stdenv
, VideoToolbox
}:

buildDunePackage {
pname = "ffmpeg-av";
Expand All @@ -10,7 +14,7 @@ buildDunePackage {
inherit (ffmpeg-base) version src useDune2;

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ AudioToolbox VideoToolbox ];
propagatedBuildInputs = [ ffmpeg-avutil ffmpeg-avcodec ffmpeg.dev ];

doCheck = true;
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
, AudioToolbox
, ffmpeg-base ? callPackage ./base.nix { }
, ffmpeg-avutil, ffmpeg
, stdenv
, VideoToolbox
}:

buildDunePackage {
Expand All @@ -11,7 +14,8 @@ buildDunePackage {
inherit (ffmpeg-base) version src useDune2;

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ]
++ lib.optionals stdenv.isDarwin [ AudioToolbox VideoToolbox ];
propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ];

doCheck = true;
Expand Down
11 changes: 10 additions & 1 deletion pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
, AppKit
, AudioToolbox
, Cocoa
, CoreImage
, ForceFeedback
, ffmpeg-base ? callPackage ./base.nix { }
, ffmpeg-av, ffmpeg
, OpenGL
, stdenv
, VideoToolbox
}:

buildDunePackage {
Expand All @@ -11,7 +19,8 @@ buildDunePackage {
inherit (ffmpeg-base) version src useDune2;

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ]
++ lib.optionals stdenv.isDarwin [ AppKit AudioToolbox Cocoa CoreImage ForceFeedback OpenGL VideoToolbox ];
propagatedBuildInputs = [ ffmpeg-av ffmpeg.dev ];

doCheck = true;
Expand Down
8 changes: 7 additions & 1 deletion pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
, AppKit
, CoreImage
, ffmpeg-base ? callPackage ./base.nix { }
, ffmpeg-avutil, ffmpeg
, OpenGL
, stdenv
, VideoToolbox
}:

buildDunePackage {
Expand All @@ -11,7 +16,8 @@ buildDunePackage {
inherit (ffmpeg-base) version src useDune2;

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ]
++ lib.optionals stdenv.isDarwin [ AppKit CoreImage OpenGL VideoToolbox ];
propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ];

doCheck = true;
Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
{ lib, stdenv, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
, AudioToolbox, VideoToolbox
, ffmpeg-base ? callPackage ./base.nix { }
, ffmpeg
}:
Expand All @@ -11,7 +12,7 @@ buildDunePackage {
inherit (ffmpeg-base) version src useDune2;

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ AudioToolbox VideoToolbox ];
propagatedBuildInputs = [ ffmpeg.dev ];

doCheck = true;
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
, ffmpeg-base ? callPackage ./base.nix { }
, ffmpeg-avutil, ffmpeg-avcodec, ffmpeg
, stdenv
, VideoToolbox
}:

buildDunePackage {
Expand All @@ -11,7 +13,7 @@ buildDunePackage {
inherit (ffmpeg-base) version src useDune2;

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ VideoToolbox ];
propagatedBuildInputs = [ ffmpeg-avutil ffmpeg-avcodec ffmpeg.dev ];

doCheck = true;
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage
, ffmpeg-base ? callPackage ./base.nix { }
, ffmpeg-avutil, ffmpeg
, stdenv
, VideoToolbox
}:

buildDunePackage {
Expand All @@ -11,7 +13,7 @@ buildDunePackage {
inherit (ffmpeg-base) version src useDune2;

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ VideoToolbox ];
propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ];

doCheck = true;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/ocaml-modules/gstreamer/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, glib, gst_all_1 }:
{ lib, stdenv, buildDunePackage, fetchFromGitHub, dune-configurator, AppKit, Foundation, pkg-config, glib, gst_all_1 }:

buildDunePackage rec {
pname = "gstreamer";
Expand All @@ -12,7 +12,7 @@ buildDunePackage rec {
};

nativeBuildInputs = [ pkg-config ];
buildInputs = [ dune-configurator ];
buildInputs = [ dune-configurator ] ++ lib.optionals stdenv.isDarwin [ AppKit Foundation ];
propagatedBuildInputs = [ glib.dev gst_all_1.gstreamer.dev gst_all_1.gst-plugins-base ];

CFLAGS_COMPILE = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/ocaml-modules/labltk/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, makeWrapper, fetchzip, ocaml, findlib, tcl, tk }:
{ stdenv, lib, makeWrapper, fetchzip, Cocoa, ocaml, findlib, tcl, tk }:

let
params =
Expand Down Expand Up @@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-labltk";

nativeBuildInputs = [ ocaml findlib makeWrapper ];
buildInputs = [ tcl tk ];
buildInputs = [ tcl tk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];

configureFlags = [ "--use-findlib" "--installbindir" "$(out)/bin" ];
dontAddPrefix = true;
Expand Down
7 changes: 6 additions & 1 deletion pkgs/development/ocaml-modules/ocaml-libvirt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitLab, libvirt, autoreconfHook, pkg-config, ocaml, findlib, perl }:
{ lib, stdenv, fetchFromGitLab, libvirt, AppKit, Foundation, autoreconfHook, pkg-config, ocaml, findlib, perl }:

lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02")
"libvirt is not available for OCaml ${ocaml.version}"
Expand All @@ -18,6 +18,11 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ autoreconfHook pkg-config findlib perl ocaml ];

buildInputs = lib.optionals stdenv.isDarwin [
Foundation
AppKit
];

strictDeps = true;

buildFlags = [ "all" "opt" "CPPFLAGS=-Wno-error" ];
Expand Down
23 changes: 19 additions & 4 deletions pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ let

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

bjack = callPackage ../development/ocaml-modules/bjack { };
bjack = callPackage ../development/ocaml-modules/bjack {
inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate CoreAudio;
};

bls12-381 = callPackage ../development/ocaml-modules/bls12-381 { };
bls12-381-gen = callPackage ../development/ocaml-modules/bls12-381/gen.nix { };
Expand Down Expand Up @@ -450,24 +452,31 @@ let
ffmpeg = callPackage ../development/ocaml-modules/ffmpeg { };
ffmpeg-avutil = callPackage ../development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix {
inherit (pkgs) ffmpeg;
inherit (pkgs.darwin.apple_sdk.frameworks) AudioToolbox VideoToolbox;
};
ffmpeg-avcodec = callPackage ../development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix {
inherit (pkgs) ffmpeg;
inherit (pkgs.darwin.apple_sdk.frameworks) AudioToolbox VideoToolbox;
};
ffmpeg-avfilter = callPackage ../development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix {
inherit (pkgs) ffmpeg;
inherit (pkgs.darwin.apple_sdk.frameworks) AppKit CoreImage OpenGL VideoToolbox;
};
ffmpeg-swscale = callPackage ../development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix {
inherit (pkgs) ffmpeg;
inherit (pkgs.darwin.apple_sdk.frameworks) VideoToolbox;
};
ffmpeg-swresample = callPackage ../development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix {
inherit (pkgs) ffmpeg;
inherit (pkgs.darwin.apple_sdk.frameworks) VideoToolbox;
};
ffmpeg-av = callPackage ../development/ocaml-modules/ffmpeg/ffmpeg-av.nix {
inherit (pkgs) ffmpeg;
inherit (pkgs.darwin.apple_sdk.frameworks) AudioToolbox VideoToolbox;
};
ffmpeg-avdevice = callPackage ../development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix {
inherit (pkgs) ffmpeg;
inherit (pkgs.darwin.apple_sdk.frameworks) AppKit AudioToolbox Cocoa CoreImage ForceFeedback OpenGL VideoToolbox;
};

fiber = callPackage ../development/ocaml-modules/fiber { };
Expand Down Expand Up @@ -524,7 +533,9 @@ let
inherit (pkgs) gsl;
};

gstreamer = callPackage ../development/ocaml-modules/gstreamer { };
gstreamer = callPackage ../development/ocaml-modules/gstreamer {
inherit (pkgs.darwin.apple_sdk.frameworks) AppKit Foundation;
};

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

Expand Down Expand Up @@ -707,7 +718,9 @@ let
then callPackage ../development/ocaml-modules/lablgtk-extras { }
else callPackage ../development/ocaml-modules/lablgtk-extras/1.4.nix { };

labltk = callPackage ../development/ocaml-modules/labltk { };
labltk = callPackage ../development/ocaml-modules/labltk {
inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;
};

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

Expand Down Expand Up @@ -1000,7 +1013,9 @@ let
ocamlgraph = callPackage ../development/ocaml-modules/ocamlgraph { };
ocamlgraph_gtk = callPackage ../development/ocaml-modules/ocamlgraph/gtk.nix { };

ocaml_libvirt = callPackage ../development/ocaml-modules/ocaml-libvirt { };
ocaml_libvirt = callPackage ../development/ocaml-modules/ocaml-libvirt {
inherit (pkgs.darwin.apple_sdk.frameworks) Foundation AppKit;
};

ocamlify = callPackage ../development/tools/ocaml/ocamlify { };

Expand Down

0 comments on commit e7d3753

Please sign in to comment.