Merge pull request #21382 from johbo/darwin-pygtk-quartz-backend
Darwin gtk2/pygtk quartz backend
This commit is contained in:
commit
826d6aa6cd
@ -1,5 +1,8 @@
|
|||||||
{stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk, pango,
|
{stdenv, fetchpatch, fetchurl, autoreconfHook, pkgconfig, atk, cairo, glib
|
||||||
libxml2Python, perl, intltool, gettext}:
|
, gnome_common, gtk, pango
|
||||||
|
, libxml2Python, perl, intltool, gettext, gtk-mac-integration }:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "gtksourceview-${version}";
|
name = "gtksourceview-${version}";
|
||||||
@ -9,6 +12,29 @@ stdenv.mkDerivation rec {
|
|||||||
url = "mirror://gnome/sources/gtksourceview/2.10/${name}.tar.bz2";
|
url = "mirror://gnome/sources/gtksourceview/2.10/${name}.tar.bz2";
|
||||||
sha256 = "c585773743b1df8a04b1be7f7d90eecdf22681490d6810be54c81a7ae152191e";
|
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
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
|
|||||||
libiconv
|
libiconv
|
||||||
] ++ libintlOrEmpty ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
] ++ libintlOrEmpty ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||||
CoreGraphics
|
CoreGraphics
|
||||||
ApplicationServices
|
CoreText
|
||||||
Carbon
|
Carbon
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -56,6 +56,9 @@ stdenv.mkDerivation rec {
|
|||||||
++ optionals xcbSupport [ libxcb xcbutil ]
|
++ optionals xcbSupport [ libxcb xcbutil ]
|
||||||
++ optional gobjectSupport glib
|
++ optional gobjectSupport glib
|
||||||
++ optional glSupport mesa_noglu
|
++ optional glSupport mesa_noglu
|
||||||
|
++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||||
|
ApplicationServices
|
||||||
|
])
|
||||||
; # TODO: maybe liblzo but what would it be for here?
|
; # TODO: maybe liblzo but what would it be for here?
|
||||||
|
|
||||||
configureFlags = if stdenv.isDarwin then [
|
configureFlags = if stdenv.isDarwin then [
|
||||||
|
@ -2,11 +2,15 @@
|
|||||||
, gdk_pixbuf, libintlOrEmpty, xlibsWrapper
|
, gdk_pixbuf, libintlOrEmpty, xlibsWrapper
|
||||||
, xineramaSupport ? stdenv.isLinux
|
, xineramaSupport ? stdenv.isLinux
|
||||||
, cupsSupport ? true, cups ? null
|
, cupsSupport ? true, cups ? null
|
||||||
|
, gdktarget ? "x11"
|
||||||
|
, AppKit, Cocoa
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert xineramaSupport -> xorg.libXinerama != null;
|
assert xineramaSupport -> xorg.libXinerama != null;
|
||||||
assert cupsSupport -> cups != null;
|
assert cupsSupport -> cups != null;
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "gtk+-2.24.31";
|
name = "gtk+-2.24.31";
|
||||||
|
|
||||||
@ -20,7 +24,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (libintlOrEmpty != []) "-lintl";
|
NIX_CFLAGS_COMPILE = optionalString (libintlOrEmpty != []) "-lintl";
|
||||||
|
|
||||||
setupHook = ./setup-hook.sh;
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
@ -28,7 +32,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
patches = [ ./2.0-immodules.cache.patch ];
|
patches = [ ./2.0-immodules.cache.patch ];
|
||||||
|
|
||||||
propagatedBuildInputs = with xorg; with stdenv.lib;
|
propagatedBuildInputs = with xorg;
|
||||||
[ glib cairo pango gdk_pixbuf atk ]
|
[ glib cairo pango gdk_pixbuf atk ]
|
||||||
++ optionals (stdenv.isLinux || stdenv.isDarwin) [
|
++ optionals (stdenv.isLinux || stdenv.isDarwin) [
|
||||||
libXrandr libXrender libXcomposite libXi libXcursor
|
libXrandr libXrender libXcomposite libXi libXcursor
|
||||||
@ -36,11 +40,13 @@ stdenv.mkDerivation rec {
|
|||||||
++ optionals stdenv.isDarwin [ xlibsWrapper libXdamage ]
|
++ optionals stdenv.isDarwin [ xlibsWrapper libXdamage ]
|
||||||
++ libintlOrEmpty
|
++ libintlOrEmpty
|
||||||
++ optional xineramaSupport libXinerama
|
++ optional xineramaSupport libXinerama
|
||||||
++ optionals cupsSupport [ cups ];
|
++ optionals cupsSupport [ cups ]
|
||||||
|
++ optionals (gdktarget == "quartz") [ AppKit Cocoa ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
|
"--with-gdktarget=${gdktarget}"
|
||||||
"--with-xinput=yes"
|
"--with-xinput=yes"
|
||||||
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
] ++ optionals stdenv.isDarwin [
|
||||||
"--disable-glibtest"
|
"--disable-glibtest"
|
||||||
"--disable-introspection"
|
"--disable-introspection"
|
||||||
"--disable-visibility"
|
"--disable-visibility"
|
||||||
@ -57,9 +63,10 @@ stdenv.mkDerivation rec {
|
|||||||
rm $out/lib/gtk-2.0/2.10.0/immodules.cache
|
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
|
$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 */ '';
|
''; # 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";
|
description = "A multi-platform toolkit for creating graphical user interfaces";
|
||||||
homepage = http://www.gtk.org/;
|
homepage = http://www.gtk.org/;
|
||||||
license = licenses.lgpl2Plus;
|
license = licenses.lgpl2Plus;
|
||||||
|
30
pkgs/development/libraries/gtk-mac-integration/default.nix
Normal file
30
pkgs/development/libraries/gtk-mac-integration/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, libXft, cairo, harfbuzz
|
{ stdenv, fetchurl, pkgconfig, libXft, cairo, harfbuzz
|
||||||
, libintlOrEmpty, gobjectIntrospection
|
, libintlOrEmpty, gobjectIntrospection, darwin
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -19,7 +19,12 @@ stdenv.mkDerivation rec {
|
|||||||
outputs = [ "bin" "dev" "out" "devdoc" ];
|
outputs = [ "bin" "dev" "out" "devdoc" ];
|
||||||
|
|
||||||
buildInputs = [ gobjectIntrospection ];
|
buildInputs = [ gobjectIntrospection ];
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ]
|
||||||
|
++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||||
|
Carbon
|
||||||
|
CoreGraphics
|
||||||
|
CoreText
|
||||||
|
]);
|
||||||
propagatedBuildInputs = [ cairo harfbuzz libXft ] ++ libintlOrEmpty;
|
propagatedBuildInputs = [ cairo harfbuzz libXft ] ++ libintlOrEmpty;
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
@ -48,6 +53,6 @@ stdenv.mkDerivation rec {
|
|||||||
license = licenses.lgpl2Plus;
|
license = licenses.lgpl2Plus;
|
||||||
|
|
||||||
maintainers = with maintainers; [ raskin urkud ];
|
maintainers = with maintainers; [ raskin urkud ];
|
||||||
platforms = with platforms; linux ++ darwin;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
name = "pygtk-2.24.0";
|
name = "pygtk-2.24.0";
|
||||||
|
|
||||||
disabled = isPy3k;
|
disabled = isPy3k;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
@ -20,6 +20,8 @@ buildPythonPackage rec {
|
|||||||
|
|
||||||
buildPhase = "buildPhase";
|
buildPhase = "buildPhase";
|
||||||
|
|
||||||
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-ObjC";
|
||||||
|
|
||||||
installPhase = "installPhase";
|
installPhase = "installPhase";
|
||||||
|
|
||||||
checkPhase = stdenv.lib.optionalString (libglade == null)
|
checkPhase = stdenv.lib.optionalString (libglade == null)
|
||||||
|
@ -7492,6 +7492,8 @@ in
|
|||||||
|
|
||||||
gtk2 = callPackage ../development/libraries/gtk+/2.x.nix {
|
gtk2 = callPackage ../development/libraries/gtk+/2.x.nix {
|
||||||
cupsSupport = config.gtk2.cups or stdenv.isLinux;
|
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 { };
|
gtk3 = callPackage ../development/libraries/gtk+/3.x.nix { };
|
||||||
@ -7517,6 +7519,10 @@ in
|
|||||||
|
|
||||||
gtk-sharp-beans = callPackage ../development/libraries/gtk-sharp-beans { };
|
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 { };
|
gtkspell2 = callPackage ../development/libraries/gtkspell { };
|
||||||
|
|
||||||
gtkspell3 = callPackage ../development/libraries/gtkspell/3.nix { };
|
gtkspell3 = callPackage ../development/libraries/gtkspell/3.nix { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user