Merge pull request #21382 from johbo/darwin-pygtk-quartz-backend

Darwin gtk2/pygtk quartz backend
This commit is contained in:
Daiderd Jordan 2017-01-08 00:18:33 +01:00 committed by GitHub
commit 826d6aa6cd
7 changed files with 93 additions and 14 deletions

View File

@ -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
'';
}

View File

@ -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 [

View File

@ -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;

View File

@ -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;
};
}

View File

@ -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;
};
}

View File

@ -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)

View File

@ -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 { };