From 3c695f159a7124f5355c1b2ee58b39f7b594218c Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sun, 10 Jul 2022 14:26:52 -0400 Subject: [PATCH] binocle: fix build on Darwin --- pkgs/applications/misc/binocle/default.nix | 14 ++++++++++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/binocle/default.nix b/pkgs/applications/misc/binocle/default.nix index ccb748fe3a6..6a999790635 100644 --- a/pkgs/applications/misc/binocle/default.nix +++ b/pkgs/applications/misc/binocle/default.nix @@ -3,6 +3,13 @@ , rustPlatform , fetchFromGitHub , makeWrapper +, AppKit +, CoreFoundation +, CoreGraphics +, CoreVideo +, Foundation +, Metal +, QuartzCore , xorg , vulkan-loader }: @@ -24,7 +31,11 @@ rustPlatform.buildRustPackage rec { makeWrapper ]; - postInstall = '' + buildInputs = lib.optionals stdenv.isDarwin [ + AppKit CoreFoundation CoreGraphics CoreVideo Foundation Metal QuartzCore + ]; + + postInstall = lib.optionalString (!stdenv.isDarwin) '' wrapProgram $out/bin/binocle \ --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with xorg; [ libX11 libXcursor libXi libXrandr ] ++ [ vulkan-loader ])} ''; @@ -34,6 +45,5 @@ rustPlatform.buildRustPackage rec { homepage = "https://github.com/sharkdp/binocle"; license = with licenses; [ asl20 /* or */ mit ]; maintainers = with maintainers; [ SuperSandro2000 ]; - broken = stdenv.isDarwin; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cebeaae9090..c5565a37774 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2044,7 +2044,9 @@ with pkgs; betterdiscord-installer = callPackage ../tools/misc/betterdiscord-installer { }; - binocle = callPackage ../applications/misc/binocle { }; + binocle = callPackage ../applications/misc/binocle { + inherit (darwin.apple_sdk.frameworks) AppKit CoreFoundation CoreGraphics CoreVideo Foundation Metal QuartzCore; + }; bitwise = callPackage ../tools/misc/bitwise { };