Skip to content

Commit

Permalink
wxgtk: make a gtk3 variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Hoeg committed Feb 2, 2017
1 parent f66d782 commit 6935502
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
31 changes: 17 additions & 14 deletions pkgs/development/libraries/wxGTK-3.0/default.nix
@@ -1,5 +1,6 @@
{ stdenv, fetchurl, pkgconfig, gtk2, libXinerama, libSM, libXxf86vm, xf86vidmodeproto
, gstreamer, gst_plugins_base, GConf, setfile
{ stdenv, fetchurl, pkgconfig, libXinerama, libSM, libXxf86vm, xf86vidmodeproto
, gstreamer, gst_plugins_base, libnotify, setfile
, withGtk3 ? false, gtk2 ? null, gtk3 ? null
, withMesa ? true, mesa ? null, compat24 ? false, compat26 ? true, unicode ? true
, withWebKit ? false, webkitgtk2 ? null
, AGL ? null, Carbon ? null, Cocoa ? null, Kernel ? null, QTKit ? null
Expand All @@ -13,28 +14,31 @@ with stdenv.lib;

let
version = "3.0.2";
in
stdenv.mkDerivation {
name = "wxwidgets-${version}";
gtk = (if withGtk3 then gtk3 else gtk2);

in stdenv.mkDerivation {
name = "wxwidgets-${version}-gtk${if withGtk3 then "3" else "2"}";

src = fetchurl {
url = "mirror://sourceforge/wxwindows/wxWidgets-${version}.tar.bz2";
sha256 = "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l";
};

buildInputs =
[ gtk2 libXinerama libSM libXxf86vm xf86vidmodeproto gstreamer
gst_plugins_base GConf ]
[ libnotify libXinerama libSM libXxf86vm xf86vidmodeproto
gstreamer gst_plugins_base ]
++ [ gtk ]
++ optional withMesa mesa
++ optional withWebKit webkitgtk2
++ optional (withWebKit && !withGtk3) webkitgtk2
++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];

nativeBuildInputs = [ pkgconfig ];

propagatedBuildInputs = optional stdenv.isDarwin AGL;

configureFlags =
[ "--enable-gtk2" "--disable-precomp-headers" "--enable-mediactrl"
[ "--disable-precomp-headers" "--enable-mediactrl"
(if withGtk3 then "--enable-gtk3" else "--enable-gtk2")
(if compat24 then "--enable-compat24" else "--disable-compat24")
(if compat26 then "--enable-compat26" else "--disable-compat26") ]
++ optional unicode "--enable-unicode"
Expand Down Expand Up @@ -65,13 +69,12 @@ stdenv.mkDerivation {
";

passthru = {
inherit compat24 compat26 unicode;
gtk = gtk2;
inherit compat24 compat26 gtk unicode;
};

enableParallelBuilding = true;
meta = {
platforms = with stdenv.lib.platforms; darwin ++ linux;

meta = with stdenv.lib; {
platforms = with platforms; darwin ++ linux;
};
}
7 changes: 7 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -9834,6 +9834,13 @@ with pkgs;
withMesa = lib.elem system lib.platforms.mesaPlatforms;
};

wxGTK30-gtk3 = callPackage ../development/libraries/wxGTK-3.0/default.nix {
withGtk3 = true;
inherit (darwin.stubs) setfile;
inherit (darwin.apple_sdk.frameworks) AGL Carbon Cocoa Kernel QTKit;
withMesa = lib.elem system lib.platforms.mesaPlatforms;
};

wxmac = callPackage ../development/libraries/wxmac {
inherit (darwin.apple_sdk.frameworks) AGL Cocoa Kernel;
inherit (darwin.stubs) setfile rez derez;
Expand Down

0 comments on commit 6935502

Please sign in to comment.