diff --git a/pkgs/applications/editors/emacs/25.nix b/pkgs/applications/editors/emacs/25.nix index ee21bbbd9bd9..6576cd544729 100644 --- a/pkgs/applications/editors/emacs/25.nix +++ b/pkgs/applications/editors/emacs/25.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 +, alsaLib, cairo, acl, gpm, cf-private, AppKit, GSS, ImageIO , withX ? !stdenv.isDarwin , withGTK2 ? false, gtk2 ? null , withGTK3 ? true, gtk3 ? null, gsettings-desktop-schemas ? null @@ -61,9 +61,12 @@ stdenv.mkDerivation rec { ++ lib.optional (withX && withGTK2) gtk2 ++ lib.optionals (withX && withGTK3) [ gtk3 gsettings-desktop-schemas ] ++ lib.optional (stdenv.isDarwin && withX) cairo - ++ lib.optionals (withX && withXwidgets) [ webkitgtk24x-gtk3 glib-networking ]; - - propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AppKit GSS ImageIO ]; + ++ lib.optionals (withX && withXwidgets) [ webkitgtk24x-gtk3 glib-networking ] + ++ lib.optionals stdenv.isDarwin [ + AppKit GSS ImageIO + # Needed for CFNotificationCenterAddObserver symbols. + cf-private + ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/applications/editors/emacs/macport.nix b/pkgs/applications/editors/emacs/macport.nix index 0876a71cbf73..7070ce597388 100644 --- a/pkgs/applications/editors/emacs/macport.nix +++ b/pkgs/applications/editors/emacs/macport.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls, gettext, autoconf, automake -, AppKit, Carbon, Cocoa, IOKit, OSAKit, Quartz, QuartzCore, WebKit +, cf-private, AppKit, Carbon, Cocoa, IOKit, OSAKit, Quartz, QuartzCore, WebKit , ImageCaptureCore, GSS, ImageIO # These may be optional }: @@ -33,6 +33,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses libxml2 gnutls texinfo gettext AppKit Carbon Cocoa IOKit OSAKit Quartz QuartzCore WebKit ImageCaptureCore GSS ImageIO # may be optional + # Needed for CFNotificationCenterAddObserver symbols. + cf-private ]; postUnpack = '' diff --git a/pkgs/applications/misc/alacritty/default.nix b/pkgs/applications/misc/alacritty/default.nix index 594173f11c62..5237e02f15c0 100644 --- a/pkgs/applications/misc/alacritty/default.nix +++ b/pkgs/applications/misc/alacritty/default.nix @@ -18,6 +18,7 @@ libGL, xclip, # Darwin Frameworks + cf-private, AppKit, CoreFoundation, CoreGraphics, @@ -40,15 +41,6 @@ let libGL libXi ]; - darwinFrameworks = [ - AppKit - CoreFoundation - CoreGraphics - CoreServices - CoreText - Foundation - OpenGL - ]; in buildRustPackage rec { name = "alacritty-unstable-${version}"; version = "0.2.1"; @@ -71,7 +63,11 @@ in buildRustPackage rec { ]; buildInputs = rpathLibs - ++ lib.optionals stdenv.isDarwin darwinFrameworks; + ++ lib.optionals stdenv.isDarwin [ + AppKit CoreFoundation CoreGraphics CoreServices CoreText Foundation OpenGL + # Needed for CFURLResourceIsReachable symbols. + cf-private + ]; outputs = [ "out" "terminfo" ]; diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix index 405d80031e37..b1c798476ead 100644 --- a/pkgs/development/libraries/fltk/default.nix +++ b/pkgs/development/libraries/fltk/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, pkgconfig, xlibsWrapper, inputproto, libXi , freeglut, libGLU_combined, libjpeg, zlib, libXft, libpng -, darwin, libtiff, freetype +, libtiff, freetype, cf-private, Cocoa, AGL, GLUT }: let @@ -35,7 +35,7 @@ in stdenv.mkDerivation { propagatedBuildInputs = [ inputproto ] ++ (if stdenv.isDarwin - then (with darwin.apple_sdk.frameworks; [Cocoa AGL GLUT freetype libtiff]) + then [ Cocoa AGL GLUT freetype libtiff cf-private /* Needed for NSDefaultRunLoopMode */ ] else [ xlibsWrapper libXi freeglut ]); enableParallelBuilding = true; diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix index 8d4d4d10038a..9cbc60dcef5a 100644 --- a/pkgs/development/libraries/glfw/3.x.nix +++ b/pkgs/development/libraries/glfw/3.x.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, cmake, libGL, libXrandr, libXinerama, libXcursor, libX11 -, darwin, fixDarwinDylibNames +, cf-private, Cocoa, Kernel, fixDarwinDylibNames }: stdenv.mkDerivation rec { @@ -21,7 +21,11 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 libXrandr libXinerama libXcursor - ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Cocoa Kernel fixDarwinDylibNames ]); + ] ++ lib.optionals stdenv.isDarwin [ + Cocoa Kernel fixDarwinDylibNames + # Needed for NSDefaultRunLoopMode symbols. + cf-private + ]; cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; diff --git a/pkgs/development/libraries/libui/default.nix b/pkgs/development/libraries/libui/default.nix index 150e299ac422..dcc406accbd7 100644 --- a/pkgs/development/libraries/libui/default.nix +++ b/pkgs/development/libraries/libui/default.nix @@ -1,54 +1,53 @@ -{ stdenv, fetchgit, cmake, pkgconfig, gtk3, darwin }: +{ stdenv, fetchgit, cmake, pkgconfig, gtk3, cf-private, Cocoa }: let shortName = "libui"; version = "3.1a"; backend = if stdenv.isDarwin then "darwin" else "unix"; in - stdenv.mkDerivation rec { - name = "${shortName}-${version}"; - src = fetchgit { - url = "https://github.com/andlabs/libui.git"; - rev = "6ebdc96b93273c3cedf81159e7843025caa83058"; - sha256 = "1lpbfa298c61aarlzgp7vghrmxg1274pzxh1j9isv8x758gk6mfn"; - }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ cmake ] ++ - (if backend == "darwin" then [darwin.apple_sdk.frameworks.Cocoa] - else if backend == "unix" then [gtk3] - else null); +stdenv.mkDerivation rec { + name = "${shortName}-${version}"; + src = fetchgit { + url = "https://github.com/andlabs/libui.git"; + rev = "6ebdc96b93273c3cedf81159e7843025caa83058"; + sha256 = "1lpbfa298c61aarlzgp7vghrmxg1274pzxh1j9isv8x758gk6mfn"; + }; - preConfigure = stdenv.lib.optionalString stdenv.isDarwin '' - sed -i 's/set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8")//' ./CMakeLists.txt - ''; + nativeBuildInputs = [ cmake pkgconfig ]; + buildInputs = stdenv.lib.optional stdenv.isLinux gtk3 + ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa cf-private /* For NSDefaultRunLoopMode */ ]; - installPhase = '' - mkdir -p $out/{include,lib} - mkdir -p $out/lib/pkgconfig - '' + stdenv.lib.optionalString stdenv.isLinux '' - mv ./out/${shortName}.so.0 $out/lib/ - ln -s $out/lib/${shortName}.so.0 $out/lib/${shortName}.so - '' + stdenv.lib.optionalString stdenv.isDarwin '' - mv ./out/${shortName}.A.dylib $out/lib/ - ln -s $out/lib/${shortName}.A.dylib $out/lib/${shortName}.dylib - '' + '' - cp $src/ui.h $out/include - cp $src/ui_${backend}.h $out/include + preConfigure = stdenv.lib.optionalString stdenv.isDarwin '' + sed -i 's/set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8")//' ./CMakeLists.txt + ''; - cp ${./libui.pc} $out/lib/pkgconfig/${shortName}.pc - substituteInPlace $out/lib/pkgconfig/${shortName}.pc \ - --subst-var-by out $out \ - --subst-var-by version "${version}" - ''; - postInstall = stdenv.lib.optionalString stdenv.isDarwin '' - install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib - ''; + installPhase = '' + mkdir -p $out/{include,lib} + mkdir -p $out/lib/pkgconfig + '' + stdenv.lib.optionalString stdenv.isLinux '' + mv ./out/${shortName}.so.0 $out/lib/ + ln -s $out/lib/${shortName}.so.0 $out/lib/${shortName}.so + '' + stdenv.lib.optionalString stdenv.isDarwin '' + mv ./out/${shortName}.A.dylib $out/lib/ + ln -s $out/lib/${shortName}.A.dylib $out/lib/${shortName}.dylib + '' + '' + cp $src/ui.h $out/include + cp $src/ui_${backend}.h $out/include - meta = with stdenv.lib; { - homepage = https://github.com/andlabs/libui; - description = "Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports."; - license = licenses.mit; - platforms = platforms.unix; - }; - } + cp ${./libui.pc} $out/lib/pkgconfig/${shortName}.pc + substituteInPlace $out/lib/pkgconfig/${shortName}.pc \ + --subst-var-by out $out \ + --subst-var-by version "${version}" + ''; + postInstall = stdenv.lib.optionalString stdenv.isDarwin '' + install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/andlabs/libui; + description = "Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports."; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix index 66a840fa2a9e..4532285e53dc 100644 --- a/pkgs/development/libraries/opencv/default.nix +++ b/pkgs/development/libraries/opencv/default.nix @@ -10,7 +10,7 @@ , enableFfmpeg ? false, ffmpeg , enableGStreamer ? false, gst_all_1 , enableEigen ? true, eigen -, darwin +, cf-private, Cocoa, QTKit }: let @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { ++ lib.optional enableFfmpeg ffmpeg ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ]) ++ lib.optional enableEigen eigen - ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Cocoa QTKit ]) + ++ lib.optionals stdenv.isDarwin [ Cocoa QTKit cf-private /* For NSDefaultRunLoopMode */ ] ; propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy; diff --git a/pkgs/os-specific/darwin/trash/default.nix b/pkgs/os-specific/darwin/trash/default.nix index 7f327fcf3d7a..e1606383c0dc 100644 --- a/pkgs/os-specific/darwin/trash/default.nix +++ b/pkgs/os-specific/darwin/trash/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, frameworks, perl } : +{ stdenv, fetchFromGitHub, perl, cf-private, AppKit, Cocoa, ScriptingBridge }: + stdenv.mkDerivation rec { version = "0.9.1"; name = "trash-${version}"; @@ -10,11 +11,11 @@ stdenv.mkDerivation rec { sha256 = "0ylkf7jxfy1pj7i1s48w28kzqjdfd57m2pw0jycsgcj5bkzwll41"; }; - buildInputs = with frameworks; [ - Cocoa - AppKit - ScriptingBridge + buildInputs = [ perl + Cocoa AppKit ScriptingBridge + # Neded for OBJC_CLASS_$_NSMutableArray symbols. + cf-private ]; patches = [ ./trash.diff ]; diff --git a/pkgs/tools/misc/noti/default.nix b/pkgs/tools/misc/noti/default.nix index 23646abe7875..43165b4f54bb 100644 --- a/pkgs/tools/misc/noti/default.nix +++ b/pkgs/tools/misc/noti/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildGoPackage, fetchFromGitHub, Cocoa }: +{ stdenv, buildGoPackage, fetchFromGitHub, cf-private, Cocoa }: buildGoPackage rec { name = "noti-${version}"; @@ -11,7 +11,7 @@ buildGoPackage rec { sha256 = "1chsqfqk0pnhx5k2nr4c16cpb8m6zv69l1jvv4v4903zgfzcm823"; }; - buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Cocoa ]; + buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Cocoa cf-private /* For OBJC_CLASS_$_NSDate */ ]; # TODO: Remove this when we update apple_sdk NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [ "-fno-objc-arc" ]; diff --git a/pkgs/tools/security/keybase/default.nix b/pkgs/tools/security/keybase/default.nix index 555244bc38cd..720c382ebd67 100644 --- a/pkgs/tools/security/keybase/default.nix +++ b/pkgs/tools/security/keybase/default.nix @@ -1,6 +1,7 @@ -{ stdenv, lib, buildGoPackage, fetchFromGitHub -, AVFoundation ? null, AudioToolbox ? null, ImageIO ? null, CoreMedia ? null -, Foundation ? null, CoreGraphics ? null, MediaToolbox ? null }: +{ stdenv, lib, buildGoPackage, fetchFromGitHub, cf-private +, AVFoundation, AudioToolbox, ImageIO, CoreMedia +, Foundation, CoreGraphics, MediaToolbox +}: buildGoPackage rec { name = "keybase-${version}"; @@ -18,7 +19,11 @@ buildGoPackage rec { sha256 = "1sw6v3vf544vp8grw8p287cx078mr9v0v1wffcj6f9p9shlwj7ic"; }; - buildInputs = lib.optionals stdenv.isDarwin [ AVFoundation AudioToolbox ImageIO CoreMedia Foundation CoreGraphics MediaToolbox ]; + buildInputs = lib.optionals stdenv.isDarwin [ + AVFoundation AudioToolbox ImageIO CoreMedia Foundation CoreGraphics MediaToolbox + # Needed for OBJC_CLASS_$_NSData symbols. + cf-private + ]; buildFlags = [ "-tags production" ]; meta = with stdenv.lib; { diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 817200fdd7ce..8767d98ad0a9 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -86,7 +86,6 @@ mapAliases ({ docbook_xml_xslt = docbook_xsl; # added 2018-04-25 double_conversion = double-conversion; # 2017-11-22 dwarf_fortress = dwarf-fortress; # added 2016-01-23 - emacs25Macport_25_1 = emacs25Macport; # added 2018-04-25 emacsMelpa = emacs25PackagesNg; # for backward compatibility emacsPackagesGen = emacsPackagesFor; # added 2018-08-18 emacsPackagesNgGen = emacsPackagesNgFor; # added 2018-08-18 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 331fc07af0c3..a24b16d232d3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -521,6 +521,7 @@ with pkgs; alacritty = callPackage ../applications/misc/alacritty { inherit (xorg) libXcursor libXxf86vm libXi; + inherit (darwin) cf-private; inherit (darwin.apple_sdk.frameworks) AppKit CoreFoundation CoreGraphics CoreServices CoreText Foundation OpenGL; }; @@ -1550,6 +1551,7 @@ with pkgs; noteshrink = callPackage ../tools/misc/noteshrink { }; noti = callPackage ../tools/misc/noti { + inherit (darwin) cf-private; inherit (darwin.apple_sdk.frameworks) Cocoa; }; @@ -3597,6 +3599,7 @@ with pkgs; kexpand = callPackage ../development/tools/kexpand { }; keybase = callPackage ../tools/security/keybase { + inherit (darwin) cf-private; # Reasoning for the inherited apple_sdk.frameworks: # 1. specific compiler errors about: AVFoundation, AudioToolbox, MediaToolbox # 2. the rest are added from here: https://github.com/keybase/client/blob/68bb8c893c5214040d86ea36f2f86fbb7fac8d39/go/chat/attachments/preview_darwin.go#L7 @@ -9586,7 +9589,10 @@ with pkgs; flite = callPackage ../development/libraries/flite { }; - fltk13 = callPackage ../development/libraries/fltk { }; + fltk13 = callPackage ../development/libraries/fltk { + inherit (darwin) cf-private; + inherit (darwin.apple_sdk.frameworks) Cocoa AGL GLUT; + }; fltk = self.fltk13; flyway = callPackage ../development/tools/flyway { }; @@ -9740,7 +9746,10 @@ with pkgs; glfw = glfw3; glfw2 = callPackage ../development/libraries/glfw/2.x.nix { }; - glfw3 = callPackage ../development/libraries/glfw/3.x.nix { }; + glfw3 = callPackage ../development/libraries/glfw/3.x.nix { + inherit (darwin) cf-private; + inherit (darwin.apple_sdk.frameworks) Cocoa Kernel; + }; glibc = callPackage ../development/libraries/glibc { installLocales = config.glibc.locales or false; @@ -11179,7 +11188,10 @@ with pkgs; libuecc = callPackage ../development/libraries/libuecc { }; - libui = callPackage ../development/libraries/libui { }; + libui = callPackage ../development/libraries/libui { + inherit (darwin) cf-private; + inherit (darwin.apple_sdk.frameworks) Cocoa; + }; libunistring = callPackage ../development/libraries/libunistring { }; @@ -11629,6 +11641,8 @@ with pkgs; opencv = callPackage ../development/libraries/opencv { ffmpeg = ffmpeg_2; + inherit (darwin) cf-private; + inherit (darwin.apple_sdk.frameworks) Cocoa QTKit; }; opencv3 = callPackage ../development/libraries/opencv/3.x.nix { @@ -16390,6 +16404,7 @@ with pkgs; imagemagick = null; acl = null; gpm = null; + inherit (darwin) cf-private; inherit (darwin.apple_sdk.frameworks) AppKit GSS ImageIO; }; @@ -16399,8 +16414,8 @@ with pkgs; withGTK3 = false; })); - emacsMacport = emacs25Macport; - emacs25Macport = callPackage ../applications/editors/emacs/macport.nix { + emacsMacport = callPackage ../applications/editors/emacs/macport.nix { + inherit (darwin) cf-private; inherit (darwin.apple_sdk.frameworks) AppKit Carbon Cocoa IOKit OSAKit Quartz QuartzCore WebKit ImageCaptureCore GSS ImageIO; diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 78ca0d20908d..b52afe98f7fa 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -66,7 +66,7 @@ in stubs = callPackages ../os-specific/darwin/stubs { }; - trash = callPackage ../os-specific/darwin/trash { inherit (darwin.apple_sdk) frameworks; }; + trash = darwin.callPackage ../os-specific/darwin/trash { }; usr-include = callPackage ../os-specific/darwin/usr-include { };