diff --git a/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix b/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix index c69ee82fa26..7c9cd42a0e9 100644 --- a/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix +++ b/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix @@ -1,5 +1,8 @@ -{stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk, pango, - libxml2Python, perl, intltool, gettext}: +{stdenv, fetchpatch, fetchurl, autoreconfHook, pkgconfig, atk, cairo, glib +, gnome_common, gtk, pango +, libxml2Python, perl, intltool, gettext, gtk-mac-integration }: + +with stdenv.lib; stdenv.mkDerivation rec { name = "gtksourceview-${version}"; @@ -9,6 +12,29 @@ stdenv.mkDerivation rec { url = "mirror://gnome/sources/gtksourceview/2.10/${name}.tar.bz2"; sha256 = "c585773743b1df8a04b1be7f7d90eecdf22681490d6810be54c81a7ae152191e"; }; - buildInputs = [pkgconfig atk cairo glib gtk pango libxml2Python perl intltool - gettext]; + + patches = optionals stdenv.isDarwin [ + (fetchpatch { + name = "change-igemacintegration-to-gtkosxapplication.patch"; + url = "https://git.gnome.org/browse/gtksourceview/patch/?id=e88357c5f210a8796104505c090fb6a04c213902"; + sha256 = "0h5q79q9dqbg46zcyay71xn1pm4aji925gjd5j93v4wqn41wj5m7"; + }) + (fetchpatch { + name = "update-to-gtk-mac-integration-2.0-api.patch"; + url = "https://git.gnome.org/browse/gtksourceview/patch/?id=ab46e552e1d0dae73f72adac8d578e40bdadaf95"; + sha256 = "0qzrbv4hpa0v8qbmpi2vp575n13lkrvp3cgllwrd2pslw1v9q3aj"; + }) + ]; + + buildInputs = [ + pkgconfig atk cairo glib gtk + pango libxml2Python perl intltool + gettext + ] ++ optionals stdenv.isDarwin [ + autoreconfHook gnome_common gtk-mac-integration + ]; + + preConfigure = optionalString stdenv.isDarwin '' + intltoolize --force + ''; } diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix index 5d201c52312..5b40f27674d 100644 --- a/pkgs/development/libraries/cairo/default.nix +++ b/pkgs/development/libraries/cairo/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { libiconv ] ++ libintlOrEmpty ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreGraphics - ApplicationServices + CoreText Carbon ]); @@ -56,6 +56,9 @@ stdenv.mkDerivation rec { ++ optionals xcbSupport [ libxcb xcbutil ] ++ optional gobjectSupport glib ++ optional glSupport mesa_noglu + ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + ApplicationServices + ]) ; # TODO: maybe liblzo but what would it be for here? configureFlags = if stdenv.isDarwin then [ diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix index ba12b4eea93..bcbbecd242d 100644 --- a/pkgs/development/libraries/gtk+/2.x.nix +++ b/pkgs/development/libraries/gtk+/2.x.nix @@ -2,11 +2,15 @@ , gdk_pixbuf, libintlOrEmpty, xlibsWrapper , xineramaSupport ? stdenv.isLinux , cupsSupport ? true, cups ? null +, gdktarget ? "x11" +, AppKit, Cocoa }: assert xineramaSupport -> xorg.libXinerama != null; assert cupsSupport -> cups != null; +with stdenv.lib; + stdenv.mkDerivation rec { name = "gtk+-2.24.31"; @@ -20,7 +24,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (libintlOrEmpty != []) "-lintl"; + NIX_CFLAGS_COMPILE = optionalString (libintlOrEmpty != []) "-lintl"; setupHook = ./setup-hook.sh; @@ -28,7 +32,7 @@ stdenv.mkDerivation rec { patches = [ ./2.0-immodules.cache.patch ]; - propagatedBuildInputs = with xorg; with stdenv.lib; + propagatedBuildInputs = with xorg; [ glib cairo pango gdk_pixbuf atk ] ++ optionals (stdenv.isLinux || stdenv.isDarwin) [ libXrandr libXrender libXcomposite libXi libXcursor @@ -36,11 +40,13 @@ stdenv.mkDerivation rec { ++ optionals stdenv.isDarwin [ xlibsWrapper libXdamage ] ++ libintlOrEmpty ++ optional xineramaSupport libXinerama - ++ optionals cupsSupport [ cups ]; + ++ optionals cupsSupport [ cups ] + ++ optionals (gdktarget == "quartz") [ AppKit Cocoa ]; configureFlags = [ + "--with-gdktarget=${gdktarget}" "--with-xinput=yes" - ] ++ stdenv.lib.optionals stdenv.isDarwin [ + ] ++ optionals stdenv.isDarwin [ "--disable-glibtest" "--disable-introspection" "--disable-visibility" @@ -57,9 +63,10 @@ stdenv.mkDerivation rec { rm $out/lib/gtk-2.0/2.10.0/immodules.cache $out/bin/gtk-query-immodules-2.0 $out/lib/gtk-2.0/2.10.0/immodules/*.so > $out/lib/gtk-2.0/2.10.0/immodules.cache ''; # workaround for bug of nix-mode for Emacs */ ''; + inherit gdktarget; }; - meta = with stdenv.lib; { + meta = { description = "A multi-platform toolkit for creating graphical user interfaces"; homepage = http://www.gtk.org/; license = licenses.lgpl2Plus; diff --git a/pkgs/development/libraries/gtk-mac-integration/default.nix b/pkgs/development/libraries/gtk-mac-integration/default.nix new file mode 100644 index 00000000000..30ac8f2fe28 --- /dev/null +++ b/pkgs/development/libraries/gtk-mac-integration/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig, glib, gtk_doc, gtk }: + +stdenv.mkDerivation rec { + name = "gtk-mac-integration-2.0.8"; + + src = fetchFromGitHub { + owner = "GNOME"; + repo = "gtk-mac-integration"; + rev = "79e708870cdeea24ecdb036c77b4630104ae1776"; + sha256 = "1fbhnvj0rqc3089ypvgnpkp6ad2rr37v5qk38008dgamb9h7f3qs"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig gtk_doc ]; + buildInputs = [ glib gtk ]; + + preAutoreconf = '' + gtkdocize + ''; + + meta = with lib; { + description = "Provides integration for Gtk+ applications into the Mac desktop"; + + license = licenses.lgpl21; + + homepage = https://wiki.gnome.org/Projects/GTK+/OSX/Integration; + + maintainers = [ maintainers.matthewbauer ]; + platforms = platforms.darwin; + }; +} diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix index f39fc2afe7d..22cf7be84d0 100644 --- a/pkgs/development/libraries/pango/default.nix +++ b/pkgs/development/libraries/pango/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, pkgconfig, libXft, cairo, harfbuzz -, libintlOrEmpty, gobjectIntrospection +, libintlOrEmpty, gobjectIntrospection, darwin }: with stdenv.lib; @@ -19,7 +19,12 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" "devdoc" ]; buildInputs = [ gobjectIntrospection ]; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig ] + ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + Carbon + CoreGraphics + CoreText + ]); propagatedBuildInputs = [ cairo harfbuzz libXft ] ++ libintlOrEmpty; enableParallelBuilding = true; @@ -48,6 +53,6 @@ stdenv.mkDerivation rec { license = licenses.lgpl2Plus; maintainers = with maintainers; [ raskin urkud ]; - platforms = with platforms; linux ++ darwin; + platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix index 7d0896c1fb8..0940ef00ac9 100644 --- a/pkgs/development/python-modules/pygtk/default.nix +++ b/pkgs/development/python-modules/pygtk/default.nix @@ -3,7 +3,7 @@ buildPythonPackage rec { name = "pygtk-2.24.0"; - + disabled = isPy3k; src = fetchurl { @@ -20,6 +20,8 @@ buildPythonPackage rec { buildPhase = "buildPhase"; + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-ObjC"; + installPhase = "installPhase"; checkPhase = stdenv.lib.optionalString (libglade == null) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e2475fdf4ef..e62fff9f127 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7492,6 +7492,8 @@ in gtk2 = callPackage ../development/libraries/gtk+/2.x.nix { cupsSupport = config.gtk2.cups or stdenv.isLinux; + gdktarget = if stdenv.isDarwin then "quartz" else "x11"; + inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; }; gtk3 = callPackage ../development/libraries/gtk+/3.x.nix { }; @@ -7517,6 +7519,10 @@ in gtk-sharp-beans = callPackage ../development/libraries/gtk-sharp-beans { }; + gtk-mac-integration = callPackage ../development/libraries/gtk-mac-integration { + gtk = gtk2; + }; + gtkspell2 = callPackage ../development/libraries/gtkspell { }; gtkspell3 = callPackage ../development/libraries/gtkspell/3.nix { };