lkundrak pushed to compat-wxGTK3-gtk2 (epel7). "Build with gtk2 (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Jun 4 15:32:45 UTC 2015


From 8dc0076c809aae435fb3863fe6d52c9e49490ff0 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak at v3.sk>
Date: Sat, 21 Mar 2015 11:48:21 +0100
Subject: Build with gtk2

https://bugzilla.redhat.com/show_bug.cgi?id=1203587

diff --git a/compat-wxGTK3-gtk2.spec b/compat-wxGTK3-gtk2.spec
index fe6b7f0..9fb9d09 100644
--- a/compat-wxGTK3-gtk2.spec
+++ b/compat-wxGTK3-gtk2.spec
@@ -1,9 +1,18 @@
+%bcond_without compat
+
 %global srcname wxWidgets
+%if %with compat
+%global wxwidgets compat-wxWidgets-gtk2
+%global wxgtkname compat-wxGTK3-gtk2
+%global wxbasename compat-wxBase3-gtk2
+%else
+%global wxwidgets %{srcname}
 %global wxgtkname wxGTK3
 %global wxbasename wxBase3
+%endif
 #RHEL 6 does not have gtk3
 #RHEL prior to 6 is unsupported by this package
-%if 0%{?el6}
+%if %with compat || 0%{?el6}
 %global gtkver 2
 %else
 %global gtkver 3
@@ -11,8 +20,8 @@
 
 Name:           %{wxgtkname}
 Version:        3.0.2
-Release:        3%{?dist}
-Summary:        GTK port of the wxWidgets GUI library
+Release:        3.1%{?dist}
+Summary:        GTK%{gtkver} port of the wxWidgets GUI library
 License:        wxWidgets
 Group:          System Environment/Libraries
 URL:            http://www.wxwidgets.org/
@@ -21,9 +30,10 @@ Source1:        http://downloads.sf.net/wxwindows/%{srcname}-%{version}-docs-htm
 Source10:       wx-config
 
 BuildRequires:  gtk%{gtkver}-devel
-#Note webkitgtk (GTK2) does not appear to be supported
 %if %{gtkver} == 3
 BuildRequires:  webkitgtk3-devel
+%else
+BuildRequires:  webkitgtk-devel
 %endif
 BuildRequires:  zlib-devel
 BuildRequires:  libpng-devel
@@ -40,14 +50,26 @@ BuildRequires:  gettext
 BuildRequires:  cppunit-devel
 BuildRequires:  libmspack-devel
 
-Provides:       %{srcname} = %{version}-%{release}
+Provides:       %{wxwidgets} = %{version}-%{release}
 Requires:       %{wxbasename}%{?_isa} = %{version}-%{release}
 
+%if %with compat
+%global wxversion %{version}-gtk%{gtkver}
+%global wxrelease %(echo %{wxversion} |sed 's/\\([0-9]*\\.[0-9]*\\)\\.[0-9]*/\\1/')
+%global wxrelease_nodot %(echo %{wxrelease} |sed 's/\\.//g')
+%global wxsubversion %{version}.${wx_subrelease_number}-gtk%{gtkver}
+%global mfl WX_RELEASE=%{wxrelease} WX_RELEASE_NODOT=%{wxrelease_nodot} WX_VERSION=%{wxversion}
+%endif
+
 %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.
+%if %with compat
+This is a version linked with old GTK version for compatibility with
+programs that don't work with more recent GTK yet.
+%endif
 
 
 %package        devel
@@ -59,7 +81,7 @@ Requires:       %{name}-media = %{version}-%{release}
 Requires:       %{wxbasename} = %{version}-%{release}
 Requires:  	gtk%{gtkver}-devel
 Requires:       libGLU-devel
-Provides:       %{srcname}-devel = %{version}-%{release}
+Provides:       %{wxwidgets}-devel = %{version}-%{release}
 
 %description devel
 This package include files needed to link with the wxGTK3 library.
@@ -67,6 +89,12 @@ 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.
+%if %with compat
+This is a version linked with old GTK version for compatibility with
+programs that don't work with more recent GTK yet.
+
+Do not use this for new packages!
+%endif
 
 
 %package        gl
@@ -80,6 +108,10 @@ 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.
+%if %with compat
+This is a version linked with old GTK version for compatibility with
+programs that don't work with more recent GTK yet.
+%endif
 
 
 %package        media
@@ -93,6 +125,10 @@ 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.
+%if %with compat
+This is a version linked with old GTK version for compatibility with
+programs that don't work with more recent GTK yet.
+%endif
 
 
 %package -n     %{wxbasename}
@@ -111,20 +147,24 @@ libraries or the X Window System.
 Group:          Development/Libraries
 Summary:        Documentation for the wxGTK3 library
 Requires:       %{name} = %{version}-%{release}
-Provides:       %{srcname}-docs = %{version}-%{release}
+Provides:       %{wxwidgets}-docs = %{version}-%{release}
 BuildArch:      noarch
 
 %description docs
 This package provides documentation for the %{srcname} library.
+%if %with compat
+This is a version linked with old GTK version for compatibility with
+programs that don't work with more recent GTK yet.
+%endif
 
 
 %prep
 %setup -q -n %{srcname}-%{version} -a 1
 
 # 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
+sed -i -e 's|aclocal)|aclocal/wxwin%{wxrelease_nodot}.m4)|' Makefile.in
+sed -i -e 's|wxstd.mo|wxstd%{wxrelease_nodot}.mo|' Makefile.in
+sed -i -e 's|wxmsw.mo|wxmsw%{wxrelease_nodot}.mo|' Makefile.in
 
 # rename docs directory
 mv %{srcname}-%{version} html
@@ -135,6 +175,13 @@ sed -i -e 's|/usr/lib\b|%{_libdir}|' wx-config.in configure
 sed -i -e 's|/lib|/%{_lib}|' src/unix/stdpaths.cpp
 
 
+%if %with compat
+sed 's/WX_RELEASE=.*/WX_RELEASE=%{wxrelease}/' -i configure
+sed 's/WX_VERSION=.*/WX_VERSION=%{wxversion}/' -i configure
+sed 's/WX_SUBVERSION=.*/WX_SUBVERSION=%{wxsubversion}/' -i configure
+sed "s/WX_VERSION_TAG=.*/WX_VERSION_TAG=`echo WX\${lib_unicode_suffix}\${WX_LIB_FLAVOUR}_%(echo %{wxrelease} |sed 's/-.*//') | tr '[[a-z]]' '[[A-Z]]'`/" -i configure
+%endif
+
 %build
 # likely still dereferences type-punned pointers
 CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
@@ -153,37 +200,39 @@ export LDFLAGS="-Wl,--as-needed"
   --disable-rpath \
   --enable-ipv6
 
-make %{?_smp_mflags}
+make %{?_smp_mflags} %{?mfl}
+
 
 %install
-%makeinstall
+%makeinstall %{mfl}
 
 # install our multilib-aware wrapper
 ##Remove installed
 rm %{buildroot}%{_bindir}/wx-config
 ##Install new and symlink
 install -p -D -m 755 %{SOURCE10} %{buildroot}%{_libexecdir}/%{name}/wx-config
-ln -s ../..%{_libexecdir}/%{name}/wx-config %{buildroot}%{_bindir}/wx-config-3.0
+ln -s ../..%{_libexecdir}/%{name}/wx-config %{buildroot}%{_bindir}/wx-config-%{wxrelease}
 ##If gtk2
 %if %{gtkver} == 2
 sed -i -e 's|gtk3|gtk2|' %{buildroot}%{_libexecdir}/%{name}/wx-config
 %endif
+sed -i -e 's|version=.*|version=%{wxrelease}|' %{buildroot}%{_libexecdir}/%{name}/wx-config
 
 #Move wxrc to libexec and symlink (avoid conflict with wxGTK)
 mv %{buildroot}%{_bindir}/wxrc* %{buildroot}%{_libexecdir}/%{name}
-ln -s ../..%{_libexecdir}/%{name}/wxrc-3.0 %{buildroot}%{_bindir}/wxrc-3.0
+ln -s ../..%{_libexecdir}/%{name}/wxrc-%{wxrelease} %{buildroot}%{_bindir}/wxrc-%{wxrelease}
 
 # move bakefiles to avoid conflicts with 2.8.*
-mkdir %{buildroot}%{_datadir}/bakefile/presets/wx3
-mv %{buildroot}%{_datadir}/bakefile/presets/*.* %{buildroot}%{_datadir}/bakefile/presets/wx3
+mkdir %{buildroot}%{_datadir}/bakefile/presets/wx%{wxrelease_nodot}
+mv %{buildroot}%{_datadir}/bakefile/presets/*.* %{buildroot}%{_datadir}/bakefile/presets/wx%{wxrelease_nodot}
 
-%find_lang wxstd3
-%find_lang wxmsw3
-cat wxmsw3.lang >> wxstd3.lang
+%find_lang wxstd%{wxrelease_nodot}
+%find_lang wxmsw%{wxrelease_nodot}
+cat wxmsw%{wxrelease_nodot}.lang >> wxstd%{wxrelease_nodot}.lang
 
 %check
 pushd tests
-make %{?_smp_mflags} test
+make %{?_smp_mflags} test %{?mfl}
 popd
 
 %post -p /sbin/ldconfig
@@ -198,7 +247,7 @@ popd
 %post -n %{wxbasename} -p /sbin/ldconfig
 %postun -n %{wxbasename} -p /sbin/ldconfig
 
-%files -f wxstd3.lang
+%files -f wxstd%{wxrelease_nodot}.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.*
@@ -210,19 +259,17 @@ popd
 %{_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}/wxrc-3.0
-%{_bindir}/wx-config-3.0
-%{_includedir}/wx-3.0
+%{_bindir}/wxrc-%{wxrelease}
+%{_bindir}/wx-config-%{wxrelease}
+%{_includedir}/wx-%{wxrelease}
 %{_libdir}/libwx_*.so
 %{_libdir}/wx
-%{_datadir}/aclocal/wxwin3.m4
-%{_datadir}/bakefile/presets/wx3/*.*
+%{_datadir}/aclocal/wxwin%{wxrelease_nodot}.m4
+%{_datadir}/bakefile/presets/wx%{wxrelease_nodot}/*.*
 %{_libexecdir}/%{name}
 
 %files gl
@@ -242,6 +289,9 @@ popd
 %doc html
 
 %changelog
+* Thu Mar 19 2015 Lubomir Rintel <lkundrak at v3.sk> - 3.0.2-3.1
+- Modify for GTK2 compatibility build, needed for KiCAD
+
 * Thu Feb 26 2015 Jeremy Newton <alexjnewt at hotmail.com> - 3.0.2-3
 - Bump to rebuild for gcc 5.0 to fix some issues
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/compat-wxGTK3-gtk2.git/commit/?h=epel7&id=8dc0076c809aae435fb3863fe6d52c9e49490ff0


More information about the scm-commits mailing list