Hi everyone:

After doing some experimentation with a mingw crossdev, I found that I
needed to do a lot of EXTRA_ECONF settings in combination with
USE="aqua" in order to get packages supporting a win32 API to be
configured appropriately.  In order to support this situation better,
I propose adding a new global flag 'win32', modelled after the 'aqua'
flag, that can be used instead to provide this configuration directly
in ebuilds.

Just like USE="aqua", the flag will be use.mask'ed in base/ so that
users don't erroneously enable it.  I didn't un-use.mask it anywhere
yet since (A) I don't have a prefix/windows environment to test, and
(B) the mingw-based crossdev environments use profiles/embedded by
default, which doesn't inherit from profiles/base and so doesn't have
the use.mask restriction.

The attached patch lists the necessary changes to profile/ as well as
the addition of USE=win32 to *ONE VERSION* of gtk+:2, gtk+:3 and cairo
(the actual commit will include more versions).

Comments?
commit 120335a6721cbcee6f92303c8a6d7cb6cc77b36e
Author: Ian Stakenvicius <[email protected]>
Date:   Tue Apr 19 15:00:07 2016 -0400

    Add USE="win32" to profile, x11-libs/cairo, and x11-libs/gtk+
    
    Similar to USE="aqua", the addition of the win32 use flag allows easier
    prefix and crossdev-based building of packages targeting windows (win32)
    environments.
    
    This commit adds the flag to profiles/use.desc, and masks it for all
    profiles via profiles/base/use.mask.  This leaves the flag available
    to be used optionally via the embedded profile, which does not inherit
    from base.
    
    Additionally, the commit adds IUSE="win32" support to x11-libs/gtk+ and
    its depenency, x11-libs/cairo.  Other packages may follow in future commits.
    
    Package-Manager: portage-2.2.26

diff --git a/profiles/base/use.mask b/profiles/base/use.mask
index 3127dad..f5bd582 100644
--- a/profiles/base/use.mask
+++ b/profiles/base/use.mask
@@ -2,6 +2,10 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
+# Ian Stakenvicius <[email protected]> (19 Apr 2016)
+# USE flag(s) specific to Windows (for mingw, cygwin, etc)
+win32
+
 # Brian Evans <[email protected]> (2 Dec 2015)
 # php 5.4 is end of life, masked for removal
 php_targets_php5-4
diff --git a/profiles/use.desc b/profiles/use.desc
index 6acf19f..49eb30f 100644
--- a/profiles/use.desc
+++ b/profiles/use.desc
@@ -371,6 +371,7 @@ wavpack - Add support for wavpack audio compression tools
 wddx - Add support for Web Distributed Data eXchange
 webkit - Add support for the WebKit HTML rendering/layout engine
 wifi - Enable wireless network functions
+win32 - Include support for the Windows GUI (for mingw or cygwin)
 wmf - Add support for the Windows Metafile vector image format
 wxwidgets - Add support for wxWidgets/wxGTK GUI toolkit
 x264 - Enable h264 encoding using x264
diff --git a/x11-libs/cairo/cairo-1.14.2-r1.ebuild b/x11-libs/cairo/cairo-1.14.2-r1.ebuild
index 12d34b3..3f8aa88 100644
--- a/x11-libs/cairo/cairo-1.14.2-r1.ebuild
+++ b/x11-libs/cairo/cairo-1.14.2-r1.ebuild
@@ -19,7 +19,7 @@ DESCRIPTION="A vector graphics library with cross-device output support"
 HOMEPAGE="http://cairographics.org/";
 LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
 SLOT="0"
-IUSE="X aqua debug directfb gles2 +glib opengl static-libs +svg valgrind xcb xlib-xcb"
+IUSE="X aqua debug directfb gles2 +glib opengl static-libs +svg valgrind win32 xcb xlib-xcb"
 # gtk-doc regeneration doesn't seem to work with out-of-source builds
 #[[ ${PV} == *9999* ]] && IUSE="${IUSE} doc" # API docs are provided in tarball, no need to regenerate
 
@@ -128,6 +128,7 @@ multilib_src_configure() {
 		$(use_enable static-libs static) \
 		$(use_enable svg) \
 		$(use_enable valgrind) \
+		$(use_enable win32) \
 		$(use_enable xcb) \
 		$(use_enable xcb xcb-shm) \
 		$(use_enable xlib-xcb) \
 		$(use_enable xlib-xcb) \
diff --git a/x11-libs/gtk+/gtk+-2.24.29.ebuild b/x11-libs/gtk+/gtk+-2.24.29.ebuild
index bef80a7..5bfda5c 100644
--- a/x11-libs/gtk+/gtk+-2.24.29.ebuild
+++ b/x11-libs/gtk+/gtk+-2.24.29.ebuild
@@ -13,9 +13,10 @@ HOMEPAGE="http://www.gtk.org/";
 
 LICENSE="LGPL-2+"
 SLOT="2"
-IUSE="aqua cups examples +introspection test vim-syntax xinerama"
+IUSE="aqua cups examples +introspection test vim-syntax win32 xinerama"
 REQUIRED_USE="
-	xinerama? ( !aqua )
+	xinerama? ( !aqua !win32 )
+	aqua? ( !win32 )
 "
 
 KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
@@ -25,14 +26,14 @@ COMMON_DEPEND="
 	>=dev-libs/atk-2.10.0[introspection?,${MULTILIB_USEDEP}]
 	>=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
 	>=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}]
-	>=x11-libs/cairo-1.12.14-r4:=[aqua?,svg,${MULTILIB_USEDEP}]
+	>=x11-libs/cairo-1.12.14-r4:=[aqua?,svg,win32?,${MULTILIB_USEDEP}]
 	>=x11-libs/gdk-pixbuf-2.30.7:2[introspection?,${MULTILIB_USEDEP}]
 	>=x11-libs/pango-1.36.3[introspection?,${MULTILIB_USEDEP}]
 	x11-misc/shared-mime-info
 
 	cups? ( >=net-print/cups-1.7.1-r2:=[${MULTILIB_USEDEP}] )
 	introspection? ( >=dev-libs/gobject-introspection-0.9.3:= )
-	!aqua? (
+	!aqua? ( !win32? (
 		>=x11-libs/cairo-1.12.14-r4:=[X]
 		>=x11-libs/gdk-pixbuf-2.30.7:2[X]
 		>=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
@@ -45,20 +46,20 @@ COMMON_DEPEND="
 		>=x11-libs/libXcomposite-0.4.4-r1[${MULTILIB_USEDEP}]
 		>=x11-libs/libXdamage-1.1.4-r1[${MULTILIB_USEDEP}]
 		xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
-	)
+	) )
 "
 DEPEND="${COMMON_DEPEND}
 	dev-libs/gobject-introspection-common
 	>=dev-util/gtk-doc-am-1.20
 	sys-devel/gettext
 	>=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
-	!aqua? (
+	!aqua? ( !win32? (
 		>=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
 		>=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
 		>=x11-proto/inputproto-2.3[${MULTILIB_USEDEP}]
 		>=x11-proto/damageproto-1.2.1-r1[${MULTILIB_USEDEP}]
 		xinerama? ( >=x11-proto/xineramaproto-1.2.1-r1[${MULTILIB_USEDEP}] )
-	)
+	) )
 	test? (
 		x11-themes/hicolor-icon-theme
 		media-fonts/font-misc-misc
@@ -172,8 +173,8 @@ multilib_src_configure() {
 
 	ECONF_SOURCE=${S} \
 	gnome2_src_configure \
-		$(usex aqua --with-gdktarget=quartz --with-gdktarget=x11) \
-		$(usex aqua "" --with-xinput) \
+		$(usex aqua --with-gdktarget=quartz $(usex win32 --with-gdktarget=win32 --with-gdktarget=x11)) \
+		$(usex aqua "" $(usex win32 "" --with-xinput)) \
 		$(use_enable cups cups auto) \
 		$(multilib_native_use_enable introspection) \
 		$(use_enable xinerama) \
diff --git a/x11-libs/gtk+/gtk+-3.16.7.ebuild b/x11-libs/gtk+/gtk+-3.16.7.ebuild
index 3b97f90..0638037 100644
--- a/x11-libs/gtk+/gtk+-3.16.7.ebuild
+++ b/x11-libs/gtk+/gtk+-3.16.7.ebuild
@@ -13,9 +13,9 @@ HOMEPAGE="http://www.gtk.org/";
 
 LICENSE="LGPL-2+"
 SLOT="3"
-IUSE="aqua broadway cloudprint colord cups examples +introspection test vim-syntax wayland X xinerama"
+IUSE="aqua broadway cloudprint colord cups examples +introspection test vim-syntax wayland win32 X xinerama"
 REQUIRED_USE="
-	|| ( aqua wayland X )
+	|| ( aqua wayland win32 X )
 	xinerama? ( X )
 "
 
@@ -28,7 +28,7 @@ COMMON_DEPEND="
 	>=dev-libs/glib-2.43.4:2[${MULTILIB_USEDEP}]
 	media-libs/fontconfig[${MULTILIB_USEDEP}]
 	>=media-libs/libepoxy-1.0[${MULTILIB_USEDEP}]
-	>=x11-libs/cairo-1.14[aqua?,glib,svg,X?,${MULTILIB_USEDEP}]
+	>=x11-libs/cairo-1.14[aqua?,glib,svg,win32?,X?,${MULTILIB_USEDEP}]
 	>=x11-libs/gdk-pixbuf-2.30:2[introspection?,X?,${MULTILIB_USEDEP}]
 	>=x11-libs/pango-1.36.7[introspection?,${MULTILIB_USEDEP}]
 	x11-misc/shared-mime-info
@@ -154,6 +154,7 @@ multilib_src_configure() {
 		$(use_enable cups cups auto) \
 		$(multilib_native_use_enable introspection) \
 		$(use_enable wayland wayland-backend) \
+		$(use_enable win32 win32-backend) \
 		$(use_enable X x11-backend) \
 		$(use_enable X xcomposite) \
 		$(use_enable X xdamage) \

Reply via email to