Merge pull request #49768 from LnL7/darwin-no-cfprivate

darwin: don't include cf-private in framework dependencies
This commit is contained in:
Daiderd Jordan 2018-11-06 20:15:27 +01:00 committed by GitHub
commit b6dcb9e641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 111 additions and 69 deletions

View File

@ -1,7 +1,7 @@
{ stdenv, lib, fetchurl, ncurses, xlibsWrapper, libXaw, libXpm, Xaw3d
, pkgconfig, gettext, libXft, dbus, libpng, libjpeg, libungif
, libtiff, librsvg, gconf, libxml2, imagemagick, gnutls, libselinux
, alsaLib, cairo, acl, gpm, AppKit, GSS, ImageIO, m17n_lib, libotf
, alsaLib, cairo, acl, gpm, cf-private, AppKit, GSS, ImageIO, m17n_lib, libotf
, systemd ? null
, withX ? !stdenv.isDarwin
, withNS ? stdenv.isDarwin
@ -64,9 +64,12 @@ stdenv.mkDerivation rec {
++ lib.optional (withX && withGTK2) gtk2-x11
++ lib.optionals (withX && withGTK3) [ gtk3-x11 gsettings-desktop-schemas ]
++ lib.optional (stdenv.isDarwin && withX) cairo
++ lib.optionals (withX && withXwidgets) [ webkitgtk ];
propagatedBuildInputs = lib.optionals withNS [ AppKit GSS ImageIO ];
++ lib.optionals (withX && withXwidgets) [ webkitgtk ]
++ lib.optionals withNS [
AppKit GSS ImageIO
# Needed for CFNotificationCenterAddObserver symbols.
cf-private
];
hardeningDisable = [ "format" ];

View File

@ -6,7 +6,7 @@
sha256 = "18ifhv5q9prd175q3vxbqf6qyvkk6bc7d2lhqdk0q78i68kv9y0c";
}
# apple frameworks
, Carbon, Cocoa
, cf-private, Carbon, Cocoa
}:
let
@ -19,7 +19,11 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ gettext pkgconfig ];
buildInputs = [ ncurses ]
++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ];
++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [
Carbon Cocoa
# Needed for OBJC_CLASS_$_NSArray symbols.
cf-private
];
configureFlags = [
"--enable-multibyte"

View File

@ -1,15 +1,16 @@
{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
, openglSupport ? false, libGL, libGLU
, alsaSupport ? true, alsaLib
, x11Support ? stdenv.hostPlatform == stdenv.buildPlatform, libXext, libICE, libXrandr
, pulseaudioSupport ? true, libpulseaudio
{ stdenv, config, libGLSupported, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
, openglSupport ? libGLSupported, libGL, libGLU
, alsaSupport ? stdenv.isLinux, alsaLib
, x11Support ? !stdenv.isCygwin, libXext, libICE, libXrandr
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
, OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
, cf-private
}:
# NOTE: When editing this expression see if the same change applies to
# SDL2 expression too
with lib;
with stdenv.lib;
assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null && libGLU != null);
@ -41,7 +42,11 @@ stdenv.mkDerivation rec {
buildInputs = [ ]
++ optional (!stdenv.hostPlatform.isMinGW) audiofile
++ optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ];
++ optionals stdenv.isDarwin [
AudioUnit CoreAudio CoreServices Kernel OpenGL
# Needed for NSDefaultRunLoopMode symbols.
cf-private
];
configureFlags = [
"--disable-oss"
@ -109,7 +114,7 @@ stdenv.mkDerivation rec {
postFixup = ''
for lib in $out/lib/*.so* ; do
if [[ -L "$lib" ]]; then
patchelf --set-rpath "$(patchelf --print-rpath $lib):${lib.makeLibraryPath propagatedBuildInputs}" "$lib"
patchelf --set-rpath "$(patchelf --print-rpath $lib):${makeLibraryPath propagatedBuildInputs}" "$lib"
fi
done
'';

View File

@ -1,20 +1,20 @@
{ stdenv, lib, fetchurl, pkgconfig, pruneLibtoolFiles
, openglSupport ? false, libGL
, alsaSupport ? true, alsaLib
, x11Support ? true, libX11, xproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
, waylandSupport ? true, wayland, wayland-protocols, libxkbcommon
, dbusSupport ? false, dbus
{ stdenv, config, libGLSupported, fetchurl, pkgconfig, pruneLibtoolFiles
, openglSupport ? libGLSupported, libGL
, alsaSupport ? stdenv.isLinux, alsaLib
, x11Support ? !stdenv.isCygwin, libX11, xproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
, waylandSupport ? stdenv.isLinux, wayland, wayland-protocols, libxkbcommon
, dbusSupport ? stdenv.isLinux, dbus
, udevSupport ? false, udev
, ibusSupport ? false, ibus
, pulseaudioSupport ? true, libpulseaudio
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
, AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
, audiofile, libiconv
, audiofile, cf-private, libiconv
}:
# NOTE: When editing this expression see if the same change applies to
# SDL expression too
with lib;
with stdenv.lib;
assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null);
@ -54,7 +54,11 @@ stdenv.mkDerivation rec {
buildInputs = [ audiofile libiconv ]
++ dlopenBuildInputs
++ optional ibusSupport ibus
++ optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
++ optionals stdenv.isDarwin [
AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL
# Needed for NSDefaultRunLoopMode symbols.
cf-private
];
# /build/SDL2-2.0.7/src/video/wayland/SDL_waylandevents.c:41:10: fatal error:
# pointer-constraints-unstable-v1-client-protocol.h: No such file or directory

View File

@ -34,7 +34,7 @@ with frameworks; with libs; {
CoreMIDIServer = [];
CoreMedia = [ ApplicationServices AudioToolbox CoreAudio CF CoreGraphics CoreVideo ];
CoreMediaIO = [ CF CoreMedia ];
CoreText = [ CF CoreGraphics cf-private ];
CoreText = [ CF CoreGraphics ];
CoreVideo = [ ApplicationServices CF CoreGraphics IOSurface OpenGL ];
CoreWLAN = [ SecurityFoundation ];
DVComponentGlue = [ CoreServices QuickTime ];
@ -48,8 +48,7 @@ with frameworks; with libs; {
ExceptionHandling = [];
FWAUserLib = [];
ForceFeedback = [ CF IOKit ];
# cf-private was moved first in list because of https://github.com/NixOS/nixpkgs/pull/28635
Foundation = [ cf-private CF libobjc Security ApplicationServices SystemConfiguration ];
Foundation = [ CF libobjc Security ApplicationServices SystemConfiguration ];
GLKit = [ CF ];
GLUT = [ OpenGL ];
GSS = [];

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, xorg, pixman, pkgconfig, AppKit, Xplugin, darwin }:
{ stdenv, fetchurl, xorg, pixman, pkgconfig, AppKit, Foundation, Xplugin, cf-private }:
let version = "1.3.1";
in stdenv.mkDerivation {
@ -19,9 +19,11 @@ in stdenv.mkDerivation {
xorg.libXext
pixman
pkgconfig
AppKit Xplugin darwin.apple_sdk.frameworks.Foundation
AppKit Xplugin Foundation
# Needed for CFNotificationCenterAddObserver symbols.
cf-private
];
meta = with lib; {
meta = with stdenv.lib; {
license = licenses.apsl20;
platforms = platforms.darwin;
maintainers = with maintainers; [ matthewbauer ];

View File

@ -2,10 +2,12 @@
stdenv, makeWrapper, lib, fetchurl, fetchpatch,
automake, autoconf, libtool, intltool, mtdev, libevdev, libinput,
python, freetype, apple_sdk, tradcpp, fontconfig,
python, freetype, tradcpp, fontconfig,
libGL, spice-protocol, zlib, libGLU, dbus, libunwind, libdrm,
mesa_noglu, udev, bootstrap_cmds, bison, flex, clangStdenv, autoreconfHook,
mcpp, epoxy, openssl, pkgconfig, llvm_6 }:
mcpp, epoxy, openssl, pkgconfig, llvm_6,
cf-private, ApplicationServices, Carbon, Cocoa, Xplugin
}:
let
inherit (stdenv) lib isDarwin;
@ -108,9 +110,9 @@ self: super:
});
libAppleWM = super.libAppleWM.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ apple_sdk.frameworks.ApplicationServices ];
buildInputs = attrs.buildInputs ++ [ ApplicationServices ];
preConfigure = ''
substituteInPlace src/Makefile.in --replace -F/System -F${apple_sdk.frameworks.ApplicationServices}
substituteInPlace src/Makefile.in --replace -F/System -F${ApplicationServices}
'';
});
@ -466,7 +468,11 @@ self: super:
sha256 = "1j1i3n5xy1wawhk95kxqdc54h34kg7xp4nnramba2q8xqfr5k117";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ];
buildInputs = [ dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ]
++ stdenv.lib.optionals stdenv.isDarwin [
# Needed for NSDefaultRunLoopMode symbols.
cf-private
];
postPatch = stdenv.lib.optionalString stdenv.isLinux "sed '1i#include <malloc.h>' -i include/os.h";
meta.platforms = stdenv.lib.platforms.unix;
} else throw "unsupported xorg abiCompat ${abiCompat} for ${attrs_passed.name}";
@ -538,9 +544,7 @@ self: super:
nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoreconfHook self.utilmacros self.fontutil ];
buildInputs = commonBuildInputs ++ [
bootstrap_cmds automake autoconf
apple_sdk.libs.Xplugin
apple_sdk.frameworks.Carbon
apple_sdk.frameworks.Cocoa
Xplugin Carbon Cocoa
];
propagatedBuildInputs = commonPropagatedBuildInputs ++ [
libAppleWM applewmproto
@ -582,7 +586,7 @@ self: super:
preConfigure = ''
mkdir -p $out/Applications
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error"
substituteInPlace hw/xquartz/pbproxy/Makefile.in --replace -F/System -F${apple_sdk.frameworks.ApplicationServices}
substituteInPlace hw/xquartz/pbproxy/Makefile.in --replace -F/System -F${ApplicationServices}
'';
postInstall = ''
rm -fr $out/share/X11/xkb/compiled

View File

@ -1,6 +1,7 @@
{ stdenv, lib, buildEnv, makeFontsConf, gnused, writeScript, xorg, bashInteractive, xterm, makeWrapper, ruby
{ stdenv, buildEnv, makeFontsConf, gnused, writeScript, xorg, bashInteractive, xterm, makeWrapper, ruby
, quartz-wm, fontconfig, xlsfonts, xfontsel
, ttf_bitstream_vera, freefont_ttf, liberation_ttf
, cf-private
, shell ? "${bashInteractive}/bin/bash"
}:
@ -97,7 +98,11 @@ let
in stdenv.mkDerivation {
name = "xquartz-${stdenv.lib.getVersion xorg.xorgserver}";
buildInputs = [ ruby makeWrapper ];
buildInputs = [
ruby makeWrapper
# Needed for NSDefaultRunLoopMode symbols.
cf-private
];
unpackPhase = "sourceRoot=.";
@ -134,7 +139,7 @@ in stdenv.mkDerivation {
defaultStartX="$out/bin/startx -- $out/bin/Xquartz"
ruby ${./patch_plist.rb} \
${lib.escapeShellArg (builtins.toXML {
${stdenv.lib.escapeShellArg (builtins.toXML {
XQUARTZ_DEFAULT_CLIENT = "${xterm}/bin/xterm";
XQUARTZ_DEFAULT_SHELL = "${shell}";
XQUARTZ_DEFAULT_STARTX = "@STARTX@";
@ -179,7 +184,7 @@ in stdenv.mkDerivation {
--replace "@FONTCONFIG_FILE@" "$fontsConfPath"
'';
meta = with lib; {
meta = with stdenv.lib; {
platforms = platforms.darwin;
maintainers = with maintainers; [ cstrahan ];
license = licenses.mit;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, xcbuildHook, Foundation, AddressBook }:
{ stdenv, fetchurl, xcbuildHook, cf-private, Foundation, AddressBook }:
stdenv.mkDerivation rec {
version = "1.1a-3";
@ -10,16 +10,18 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ Foundation AddressBook ];
buildInputs = [
Foundation AddressBook
# Needed for OBJC_CLASS_$_NSArray symbols.
cf-private
];
installPhase = ''
mkdir -p $out/bin
cp Products/Default/contacts $out/bin
'';
## FIXME: the framework setup hook isn't adding these correctly
NIX_LDFLAGS = " -F${Foundation}/Library/Frameworks/ -F${AddressBook}/Library/Frameworks/";
meta = with stdenv.lib; {
description = "Access contacts from the Mac address book from command-line";
homepage = http://www.gnufoo.org/contacts/contacts.html;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, xcbuildHook, libiconv, Cocoa, ncurses }:
{ stdenv, fetchFromGitHub, xcbuildHook, libiconv, Cocoa, ncurses, cf-private }:
stdenv.mkDerivation rec {
name = "pinentry-mac-0.9.4";
@ -11,7 +11,12 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ libiconv Cocoa ncurses ];
buildInputs = [
libiconv Cocoa ncurses
# Needed for OBJC_CLASS_$_NSArray symbols.
cf-private
];
installPhase = ''
mkdir -p $out/Applications

View File

@ -1,4 +1,4 @@
{ stdenv, fetchhg, autoreconfHook, zlib, darwin }:
{ stdenv, fetchhg, autoreconfHook, zlib, cf-private, Cocoa }:
stdenv.mkDerivation rec {
name = "atomicparsley-${version}";
@ -9,10 +9,14 @@ stdenv.mkDerivation rec {
sha256 = "05n4kbn91ps52h3wi1qb2jwygjsc01qzx4lgkv5mvwl5i49rj8fm";
};
buildInputs =
[ autoreconfHook
zlib
] ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ zlib ]
++ stdenv.lib.optionals stdenv.isDarwin [
Cocoa
# Needed for OBJC_CLASS_$_NSDictionary symbols.
cf-private
];
installPhase = "install -D AtomicParsley $out/bin/AtomicParsley";

View File

@ -573,7 +573,10 @@ with pkgs;
gsl = gsl_1;
};
atomicparsley = callPackage ../tools/video/atomicparsley { };
atomicparsley = callPackage ../tools/video/atomicparsley {
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) Cocoa;
};
autoflake = callPackage ../development/tools/analysis/autoflake { };
@ -1173,6 +1176,7 @@ with pkgs;
codec2 = callPackage ../development/libraries/codec2 { };
contacts = callPackage ../tools/misc/contacts {
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) Foundation AddressBook;
};
@ -4788,6 +4792,7 @@ with pkgs;
};
pinentry_mac = callPackage ../tools/security/pinentry/mac.nix {
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) Cocoa;
};
@ -12139,10 +12144,7 @@ with pkgs;
schroedinger = callPackage ../development/libraries/schroedinger { };
SDL = callPackage ../development/libraries/SDL {
openglSupport = libGLSupported;
alsaSupport = stdenv.isLinux;
x11Support = !stdenv.isCygwin;
pulseaudioSupport = config.pulseaudio or stdenv.isLinux;
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa;
};
@ -12163,12 +12165,7 @@ with pkgs;
SDL_ttf = callPackage ../development/libraries/SDL_ttf { };
SDL2 = callPackage ../development/libraries/SDL2 {
openglSupport = libGLSupported;
alsaSupport = stdenv.isLinux;
x11Support = !stdenv.isCygwin;
waylandSupport = stdenv.isLinux;
udevSupport = stdenv.isLinux;
pulseaudioSupport = config.pulseaudio or stdenv.isLinux;
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL;
};
@ -13866,10 +13863,14 @@ with pkgs;
xqilla = callPackage ../development/tools/xqilla { };
xquartz = callPackage ../servers/x11/xquartz { };
xquartz = callPackage ../servers/x11/xquartz {
inherit (darwin) cf-private;
};
quartz-wm = callPackage ../servers/x11/quartz-wm {
stdenv = clangStdenv;
inherit (darwin.apple_sdk.frameworks) AppKit;
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) AppKit Foundation;
inherit (darwin.apple_sdk.libs) Xplugin;
};
@ -13878,7 +13879,9 @@ with pkgs;
# have created a cycle.
xorg = recurseIntoAttrs ((lib.callPackageWith __splicedPackages ../servers/x11/xorg {
}).overrideScope' (lib.callPackageWith __splicedPackages ../servers/x11/xorg/overrides.nix {
inherit (darwin) apple_sdk;
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) ApplicationServices Carbon Cocoa;
inherit (darwin.apple_sdk.libs) Xplugin;
bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
python = python2; # Incompatible with Python 3x
udev = if stdenv.isLinux then udev else null;
@ -16321,6 +16324,7 @@ with pkgs;
imagemagick = null;
acl = null;
gpm = null;
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) AppKit GSS ImageIO;
};
@ -19393,6 +19397,7 @@ with pkgs;
};
vim = callPackage ../applications/editors/vim {
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) Carbon Cocoa;
};