Skip to content

Commit

Permalink
Merge pull request #49284 from LnL7/darwin-watchexec
Browse files Browse the repository at this point in the history
watchexec: fix darwin build
  • Loading branch information
LnL7 committed Nov 8, 2018
2 parents c4c7356 + 82365eb commit a06e7c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 10 additions & 2 deletions pkgs/tools/misc/watchexec/default.nix
@@ -1,4 +1,4 @@
{ stdenv, rustPlatform, fetchFromGitHub }:
{ stdenv, rustPlatform, fetchFromGitHub, CoreServices, CoreFoundation }:

rustPlatform.buildRustPackage rec {
name = "watchexec-${version}";
Expand All @@ -13,11 +13,19 @@ rustPlatform.buildRustPackage rec {

cargoSha256 = "1li84kq9myaw0zwx69y72f3lx01s7i9p8yays4rwvl1ymr614y1l";

buildInputs = stdenv.lib.optionals stdenv.isDarwin [ CoreServices ];

# FIXME: Use impure version of CoreFoundation because of missing symbols.
# Undefined symbols for architecture x86_64: "_CFURLResourceIsReachable"
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
export NIX_LDFLAGS="-F${CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS"
'';

meta = with stdenv.lib; {
description = "Executes commands in response to file modifications";
homepage = https://github.com/watchexec/watchexec;
license = with licenses; [ asl20 ];
maintainers = [ maintainers.michalrus ];
platforms = platforms.linux;
platforms = platforms.linux ++ platforms.darwin;
};
}
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -5997,7 +5997,9 @@ with pkgs;

wal_e = callPackage ../tools/backup/wal-e { };

watchexec = callPackage ../tools/misc/watchexec { };
watchexec = callPackage ../tools/misc/watchexec {
inherit (darwin.apple_sdk.frameworks) CoreServices CoreFoundation;
};

watchman = callPackage ../development/tools/watchman {
inherit (darwin.apple_sdk.frameworks) CoreServices;
Expand Down

0 comments on commit a06e7c5

Please sign in to comment.