[wxGTK3] Fixed GTK3 bug with wx-config

mystro256 mystro256 at fedoraproject.org
Fri Feb 28 00:48:18 UTC 2014


commit ff74a613035f6897a5cc8106285c31392871abc6
Author: alexjnewt at hotmail.com <alexjnewt at hotmail.com>
Date:   Thu Feb 27 19:49:08 2014 -0500

    Fixed GTK3 bug with wx-config
    
    - Fixed a unused-direct-shlib-dependency error

 .gitignore                    |    2 +
 sources                       |    2 +
 wx-config                     |   45 +++++++
 wxGTK3-3.0.0-gtk3_build.patch |   20 +++
 wxGTK3.spec                   |  262 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 331 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..a506246 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/wxWidgets-3.0.0-docs-html.tar.bz2
+/wxWidgets-3.0.0.tar.bz2
diff --git a/sources b/sources
index e69de29..3f2354d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+d356e1a86c33d7ebe1f5c4a94e844f37  wxWidgets-3.0.0-docs-html.tar.bz2
+241998efc12205172ed24c18788ea2cd  wxWidgets-3.0.0.tar.bz2
diff --git a/wx-config b/wx-config
new file mode 100644
index 0000000..014cfaf
--- /dev/null
+++ b/wx-config
@@ -0,0 +1,45 @@
+#! /bin/sh
+#
+# Multilib-aware wrapper for the wx-config script
+#
+# Usage: wx-config [--arch <arch>] <regular wx-config options>
+#
+
+version=3.0
+
+if [ $# -ge 2 ]; then
+    if [ $1 = "--arch" ]; then
+	arch=$2
+	shift 2
+    fi
+fi
+
+if [ -z $arch ]; then
+    arch=`uname -m`
+fi
+
+case $arch in
+    i?86|ppc|s390|sparc|arm*|ia64)
+        libdir=/usr/lib
+        ;;
+    x86_64|ppc64|s390x|sparc64)
+        libdir=/usr/lib64
+        ;;
+    *)
+        echo "Unsupported architecture '$arch'"
+        exit 8
+        ;;
+esac
+
+wxconfig=$libdir/wx/config/gtk2-unicode-$version
+# special case when using 32-bit userspace and 64-bit kernel
+if [ ! -f $wxconfig -a \( $arch = ppc64 -o $arch = sparc64 \) ]; then
+    wxconfig=/usr/lib/wx/config/gtk2-unicode-$version
+fi
+
+if [ -x $wxconfig ]; then
+    exec $wxconfig $@
+else
+    echo "wxWidgets3-devel isn't installed for architecture '$arch'"
+    exit 9
+fi
diff --git a/wxGTK3-3.0.0-gtk3_build.patch b/wxGTK3-3.0.0-gtk3_build.patch
new file mode 100644
index 0000000..1038981
--- /dev/null
+++ b/wxGTK3-3.0.0-gtk3_build.patch
@@ -0,0 +1,20 @@
+Index: /wxWidgets/trunk/src/gtk/toplevel.cpp
+===================================================================
+--- src/gtk/toplevel.cpp (revision 74977)
++++ src/gtk/toplevel.cpp (revision 75182)
+@@ -39,4 +39,7 @@
+     #include <X11/Xatom.h>  // XA_CARDINAL
+     #include "wx/unix/utilsx11.h"
++#endif
++#ifdef GDK_WINDOWING_WAYLAND
++    #include <gdk/gdkwayland.h>
+ #endif
+ 
+@@ -731,5 +734,5 @@
+ #if defined(GDK_WINDOWING_WAYLAND) && GTK_CHECK_VERSION(3,10,0)
+         else if (
+-            GDK_IS_WAYLAND_SCREEN(gtk_window_get_screen(GTK_WINDOW(m_widget))) &&
++            GDK_IS_WAYLAND_DISPLAY(gtk_widget_get_display(m_widget)) &&
+             gtk_check_version(3,10,0) == NULL)
+         {
+
diff --git a/wxGTK3.spec b/wxGTK3.spec
new file mode 100644
index 0000000..880abc2
--- /dev/null
+++ b/wxGTK3.spec
@@ -0,0 +1,262 @@
+%global srcname wxWidgets
+%global wxgtkname wxGTK3
+%global wxbasename wxBase3
+#RHEL 6 does not have gtk3
+#RHEL prior to 6 is unsupported by this package
+%if 0%{?el6}
+%global gtkver 2
+%else
+%global gtkver 3
+%endif
+
+Name:           %{wxgtkname}
+Version:        3.0.0
+Release:        4%{?dist}
+Summary:        GTK port of the wxWidgets GUI library
+License:        wxWidgets
+Group:          System Environment/Libraries
+URL:            http://www.wxwidgets.org/
+Source0:        http://downloads.sf.net/wxwindows/%{srcname}-%{version}.tar.bz2
+Source1:        http://downloads.sf.net/wxwindows/%{srcname}-%{version}-docs-html.tar.bz2
+Source10:       wx-config
+
+# http://trac.wxwidgets.org/ticket/15667
+Patch0:         %{name}-3.0.0-gtk3_build.patch
+
+BuildRequires:  gtk%{gtkver}-devel
+#Note webkitgtk (GTK2) does not appear to be supported
+%if %{gtkver} == 3
+BuildRequires:  webkitgtk3-devel
+%endif
+BuildRequires:  zlib-devel
+BuildRequires:  libpng-devel
+BuildRequires:  libjpeg-devel
+BuildRequires:  libtiff-devel
+BuildRequires:  expat-devel
+BuildRequires:  SDL-devel
+BuildRequires:  libgnomeprintui22-devel
+BuildRequires:  libGLU-devel
+BuildRequires:  libSM-devel
+BuildRequires:  gstreamer-plugins-base-devel
+BuildRequires:  GConf2-devel
+BuildRequires:  gettext
+BuildRequires:  cppunit-devel
+BuildRequires:  libmspack-devel
+
+Provides:       %{srcname} = %{version}-%{release}
+Requires:       %{wxbasename}%{?_isa} = %{version}-%{release}
+
+%description
+wxWidgets is the GTK port of the C++ cross-platform wxWidgets
+GUI library, offering classes for all common GUI controls as well as a
+comprehensive set of helper classes for most common application tasks,
+ranging from networking to HTML display and image manipulation.
+
+
+%package        devel
+Group:          Development/Libraries
+Summary:        Development files for the wxGTK3 library
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Requires:       %{name}-gl = %{version}-%{release}
+Requires:       %{name}-media = %{version}-%{release}
+Requires:       %{wxbasename} = %{version}-%{release}
+Requires:       gtk%{gtkver}-devel
+Requires:       libGLU-devel
+Provides:       %{srcname}-devel = %{version}-%{release}
+
+%description devel
+This package include files needed to link with the wxGTK3 library.
+wxWidgets is the GTK port of the C++ cross-platform wxWidgets
+GUI library, offering classes for all common GUI controls as well as a
+comprehensive set of helper classes for most common application tasks,
+ranging from networking to HTML display and image manipulation.
+
+
+%package        gl
+Summary:        OpenGL add-on for the wxWidgets library
+Group:          System Environment/Libraries
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
+%description gl
+OpenGL (a 3D graphics API) add-on for the wxWidgets library.
+wxWidgets is the GTK port of the C++ cross-platform wxWidgets
+GUI library, offering classes for all common GUI controls as well as a
+comprehensive set of helper classes for most common application tasks,
+ranging from networking to HTML display and image manipulation.
+
+
+%package        media
+Summary:        Multimedia add-on for the wxWidgets library
+Group:          System Environment/Libraries
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+
+%description media
+Multimedia add-on for the wxWidgets library.
+wxWidgets is the GTK port of the C++ cross-platform wxWidgets
+GUI library, offering classes for all common GUI controls as well as a
+comprehensive set of helper classes for most common application tasks,
+ranging from networking to HTML display and image manipulation.
+
+
+%package -n     %{wxbasename}
+Summary:        Non-GUI support classes from the wxWidgets library
+Group:          System Environment/Libraries
+
+%description -n %{wxbasename}
+Every wxWidgets application must link against this library. It contains
+mandatory classes that any wxWidgets code depends on (like wxString) and
+portability classes that abstract differences between platforms. wxBase can
+be used to develop console mode applications -- it does not require any GUI
+libraries or the X Window System.
+
+
+%package        docs
+Group:          Development/Libraries
+Summary:        Documentation for the wxGTK3 library
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Provides:       %{srcname}-docs = %{version}-%{release}
+BuildArch:      noarch
+
+%description docs
+This package provides documentation for the %{srcname} library.
+
+
+%prep
+%setup -q -n %{srcname}-%{version} -a 1
+
+# in case of gtk3
+%if %{gtkver} == 3
+%patch0 -p0 -b .GTK3
+sed -i -e 's|gtk2|gtk3|' %{SOURCE10}
+%endif
+
+# patch some installed files to avoid conflicts with 2.8.*
+sed -i -e 's|aclocal)|aclocal/wxwin3.m4)|' Makefile.in
+sed -i -e 's|wxstd.mo|wxstd3.mo|' Makefile.in
+sed -i -e 's|wxmsw.mo|wxmsw3.mo|' Makefile.in
+
+# rename docs directory
+mv %{srcname}-%{version} html
+
+sed -i -e 's|/usr/lib\b|%{_libdir}|' wx-config.in configure
+
+# fix plugin dir for 64-bit
+sed -i -e 's|/lib|/%{_lib}|' src/unix/stdpaths.cpp
+
+
+%build
+# likely still dereferences type-punned pointers
+CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
+CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
+# fix unused-direct-shlib-dependency error:
+export LDFLAGS="-Wl,--as-needed"
+
+%configure \
+  --with-gtk=%{gtkver} \
+  --with-opengl \
+  --with-sdl \
+  --with-gnomeprint \
+  --with-libmspack \
+  --enable-intl \
+  --enable-no_deps \
+  --disable-rpath \
+  --enable-ipv6 \
+  --disable-catch_segvs \
+  --disable-compat28
+
+make %{?_smp_mflags}
+
+%install
+%makeinstall
+
+# install our multilib-aware wrapper
+rm %{buildroot}%{_bindir}/wx-config
+rm %{buildroot}%{_bindir}/wxrc
+install -p -m 755 %{SOURCE10} %{buildroot}%{_bindir}/wx-config-3.0
+
+# move bakefiles to avoid conflicts with 2.8.*
+mkdir %{buildroot}%{_datadir}/bakefile/presets/wx3
+mv %{buildroot}%{_datadir}/bakefile/presets/*.* %{buildroot}%{_datadir}/bakefile/presets/wx3
+
+%find_lang wxstd3
+%find_lang wxmsw3
+cat wxmsw3.lang >> wxstd3.lang
+
+%check
+pushd tests
+make %{?_smp_mflags} test
+popd
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%post gl -p /sbin/ldconfig
+%postun gl -p /sbin/ldconfig
+
+%post media -p /sbin/ldconfig
+%postun media -p /sbin/ldconfig
+
+%post -n %{wxbasename} -p /sbin/ldconfig
+%postun -n %{wxbasename} -p /sbin/ldconfig
+
+%files -f wxstd3.lang
+%doc docs/changes.txt docs/gpl.txt docs/lgpl.txt docs/licence.txt
+%doc docs/licendoc.txt docs/preamble.txt docs/readme.txt
+%{_libdir}/libwx_gtk%{gtkver}u_adv-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_aui-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_core-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_html-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_propgrid-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_qa-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_ribbon-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_richtext-*.so.*
+%{_libdir}/libwx_gtk%{gtkver}u_stc-*.so.*
+%if %{gtkver} == 3
+%{_libdir}/libwx_gtk%{gtkver}u_webview-*.so.*
+%endif
+%{_libdir}/libwx_gtk%{gtkver}u_xrc-*.so.*
+
+%files devel
+%{_bindir}/wx-config*
+%{_bindir}/wxrc-3.0
+%{_includedir}/wx-3.0
+%{_libdir}/libwx_*.so
+%{_libdir}/wx
+%{_datadir}/aclocal/wxwin3.m4
+%{_datadir}/bakefile/presets/wx3/
+
+%files gl
+%{_libdir}/libwx_gtk%{gtkver}u_gl-*.so.*
+
+%files media
+%{_libdir}/libwx_gtk%{gtkver}u_media-*.so.*
+
+%files -n %{wxbasename}
+%doc docs/changes.txt docs/gpl.txt docs/lgpl.txt docs/licence.txt
+%doc docs/licendoc.txt docs/preamble.txt docs/readme.txt
+%{_libdir}/libwx_baseu-*.so.*
+%{_libdir}/libwx_baseu_net-*.so.*
+%{_libdir}/libwx_baseu_xml-*.so.*
+
+%files docs
+%doc html
+
+%changelog
+* Wed Feb 19 2014 Jeremy Newton <alexjnewt at hotmail.com> - 3.0.0-4
+- Fixed GTK3 bug with wx-config
+- Fixed a unused-direct-shlib-dependency error
+
+* Mon Feb 17 2014 Jeremy Newton <alexjnewt at hotmail.com> - 3.0.0-3
+- Added patch to avoid build fail on gtk 3.10+
+- Reverted patching to make devel package compatible with wxGTK-devel
+- Added combatibility for RHEL 6+
+- Changed all mention of GTK3 and GTK2 to GTK for consistency
+
+* Mon Feb 10 2014 Jeremy Newton <alexjnewt at hotmail.com> - 3.0.0-2
+- Changed to build against gtk3
+- Add webkit to build requires
+- Removed patching to make devel package compatible with wxGTK-devel
+- Disable 2.8.* combatibility (redundant functionality)
+
+* Sat Jan 4 2014 Jeremy Newton <alexjnewt at hotmail.com> - 3.0.0-1
+- Initial build of wxwidgets version 3, mostly based on wxGTK spec


More information about the scm-commits mailing list