diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index c1bfdf8157da..e95d2b615359 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -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" ]; diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index 26cd61d182bd..2f34a6ddeb6b 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -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" diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix index 7bbb1a5e1c92..7ef3c4c89686 100644 --- a/pkgs/development/libraries/SDL/default.nix +++ b/pkgs/development/libraries/SDL/default.nix @@ -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 ''; diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index d445e1ab917e..07a63a366f1b 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/pkgs/development/libraries/SDL2/default.nix @@ -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 diff --git a/pkgs/os-specific/darwin/apple-sdk/frameworks.nix b/pkgs/os-specific/darwin/apple-sdk/frameworks.nix index 9e47b8d02fdf..aab2852c1689 100644 --- a/pkgs/os-specific/darwin/apple-sdk/frameworks.nix +++ b/pkgs/os-specific/darwin/apple-sdk/frameworks.nix @@ -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 = []; diff --git a/pkgs/servers/x11/quartz-wm/default.nix b/pkgs/servers/x11/quartz-wm/default.nix index d724a81debbb..ccb3937ac85f 100644 --- a/pkgs/servers/x11/quartz-wm/default.nix +++ b/pkgs/servers/x11/quartz-wm/default.nix @@ -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 ]; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 4772ac7f7ee2..8f4c251335a9 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -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 ' -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 diff --git a/pkgs/servers/x11/xquartz/default.nix b/pkgs/servers/x11/xquartz/default.nix index 3fc7aaea9c93..8cb96d0ae39f 100644 --- a/pkgs/servers/x11/xquartz/default.nix +++ b/pkgs/servers/x11/xquartz/default.nix @@ -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; diff --git a/pkgs/tools/misc/contacts/default.nix b/pkgs/tools/misc/contacts/default.nix index dc8f776cef66..b262626b1363 100644 --- a/pkgs/tools/misc/contacts/default.nix +++ b/pkgs/tools/misc/contacts/default.nix @@ -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; diff --git a/pkgs/tools/security/pinentry/mac.nix b/pkgs/tools/security/pinentry/mac.nix index 4acdd6cb897e..8168aa94b3d2 100644 --- a/pkgs/tools/security/pinentry/mac.nix +++ b/pkgs/tools/security/pinentry/mac.nix @@ -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 diff --git a/pkgs/tools/video/atomicparsley/default.nix b/pkgs/tools/video/atomicparsley/default.nix index 701850758bcb..74f4c562102c 100644 --- a/pkgs/tools/video/atomicparsley/default.nix +++ b/pkgs/tools/video/atomicparsley/default.nix @@ -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"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fa58b5f2b65c..5a1b72ff1b38 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; };