# bcond_with gtk3 = gtk2 # bcond_without gtk3 = gtk3 %bcond_without gtk3 # build with/without 2.8 compatibility %bcond_without compat28 # build with/without wxGLCanvas Wayland/EGL back-end %bcond_with glcanvasegl # filter out autogenerated reqs from docs %global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}^%{_docdir} %define gtkver %{?with_gtk3:3}%{!?with_gtk3:2} %define uname wxWidgets %define oname wxgtk %define version 3.2.8.1 #define gdate 20210325 %define rel 1 #%%define major %%(echo %%{version} | cut -d. -f3) %define major 0 %define api %(echo %{version} | cut -d. -f1,2) %define libnameudev %mklibname wxgtku %{api} -d %define apind %(echo %{api} |tr -d .) Summary: GTK+ port of the wxWidgets library Name: wxgtk Version: %{version} Release: %mkrel %{?gdate:0.git%gdate.}%{rel} License: wxWidgets Library Licence Group: System/Libraries URL: https://www.wxwidgets.org/ Source0: https://github.com/wxWidgets/wxWidgets/releases/download/v%{version}/%{uname}-%{?gdate}%{!?gdate:%version}.tar.bz2 Source1: gettarball.sh # Mageia patches Patch500: wxWidgets-3.1.4-fix-linking.patch Patch501: wxWidgets-2.9.5-multiarch-includes.patch # Originally from Gentoo Patch600: wxWidgets-3.1.6-collision.patch # Originally from Fedora Patch700: wxWidgets-3.1.6-abicheck.patch BuildRequires: bakefile BuildRequires: git-core BuildRequires: pcre2-devel BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(cppunit) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) %if %{with gtk3} && %{with glcanvasegl} BuildRequires: pkgconfig(egl) >= 1.5 BuildRequires: pkgconfig(wayland-egl) %endif BuildRequires: pkgconfig(gspell-1) BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) %if %{with gtk3} BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(webkit2gtk-4.1) %else BuildRequires: pkgconfig(gtk+-2.0) %endif BuildRequires: pkgconfig(libmspack) BuildRequires: pkgconfig(libnotify) >= 0.7 BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(sm) BuildRequires: pkgconfig(xxf86vm) BuildRequires: pkgconfig(zlib) %description wxWidgets is a free C++ library for cross-platform GUI development. With wxWidgets, you can create applications for different GUIs (GTK+, Motif/LessTif, MS Windows, Mac) from the same source code. %package -n %{name}%{api} Summary: GTK+ port of the wxWidgets library Group: System/Libraries %description -n %{name}%{api} wxWidgets is a free C++ library for cross-platform GUI development. With wxWidgets, you can create applications for different GUIs (GTK+, Motif/LessTif, MS Windows, Mac) from the same source code. %global wxlibs wx_baseu \\\ wx_baseu_net \\\ wx_baseu_xml \\\ wx_gtk%{gtkver}u_adv \\\ wx_gtk%{gtkver}u_aui \\\ wx_gtk%{gtkver}u_core \\\ wx_gtk%{gtkver}u_gl \\\ wx_gtk%{gtkver}u_html \\\ wx_gtk%{gtkver}u_media \\\ wx_gtk%{gtkver}u_propgrid \\\ wx_gtk%{gtkver}u_qa \\\ wx_gtk%{gtkver}u_ribbon \\\ wx_gtk%{gtkver}u_richtext \\\ wx_gtk%{gtkver}u_stc \\\ wx_gtk%{gtkver}u_xrc %if %{with gtk3} %global wxlibs %{wxlibs} wx_gtk%{gtkver}u_webview %endif %{expand:%(for lib in %{wxlibs}; do cat << EOF %%global libname$lib %%mklibname $lib %{api} %{major} %%package -n %%{libname$lib} Summary: wxGTK $lib shared library Group: System/Libraries Requires: %{oname}%{api} >= %{version}-%{release} EOF done)} %{expand:%(for lib in %{wxlibs}; do cat << EOF %%description -n %%{libname$lib} This package contains the library needed to run programs dynamically linked with the wxGTK. EOF done)} %{expand:%(for lib in %{wxlibs}; do cat << EOF %%files -n %%{libname$lib} %{_libdir}/lib$lib-%{api}.so.%{major}{,.*} %if "$lib" == "wx_gtk%{gtkver}u_webview" %if %{with gtk3} %dir %{_libdir}/wx/%{api}/web-extensions/ %{_libdir}/wx/%{api}/web-extensions/webkit2_extu-%{api}.so %endif %endif EOF done)} %package -n %{libnameudev} Summary: Header files and development documentation for wxGTK - unicode Group: Development/C++ Requires: %{expand:%(for lib in %{wxlibs}; do echo -n "%%{libname$lib} = %{version}-%{release} "; done)} Provides: libwxgtku%{api}-devel = %{version}-%{release} Provides: wxgtku%{api}-devel = %{version}-%{release} Provides: wxgtk%{api}-devel = %{version}-%{release} Provides: libwxgtk%{api}-devel = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} Provides: wxGTK3-devel = %{version}-%{release} Requires(post): update-alternatives Requires(postun): update-alternatives %description -n %{libnameudev} Header files for the unicode enabled version of wxGTK, the GTK+ port of the wxWidgets library. %prep %autosetup -n %{uname}-%{?gdate}%{!?gdate:%version} -Sgit # fix plugin dir for 64-bit sed -i -e 's|/lib|/%{_lib}|' src/unix/stdpaths.cpp # build against webkit2gtk-4.1 sed -i -e 's/webkit2gtk-4.0/webkit2gtk-4.1/g' configure.in %build aclocal --force -I$PWD/build/aclocal autoconf -f libtoolize --copy --force # --disable-optimise prevents our $RPM_OPT_FLAGS being overridden # (see OPTIMISE in configure). # this code dereferences type-punned pointers like there's no tomorrow. CFLAGS="%{optflags} -fno-strict-aliasing" CXXFLAGS="%{optflags} -fno-strict-aliasing" %configure \ --with-expat=sys \ --with-gtk=%{gtkver} \ --with-libjpeg=sys \ --with-liblzma \ --with-libmspack \ --with-libpng=sys \ --with-libtiff=sys \ --with-opengl \ --with-regex=sys \ --with-sdl \ --with-zlib=sys \ --enable-calendar \ --enable-catch_segvs \ %{?with_compat28:--enable-compat28} \ --enable-controls \ --enable-dataviewctrl \ --enable-dirdlg \ %{!?with_glcanvasegl:--disable-glcanvasegl} \ --enable-graphics_ctx \ --enable-grid \ --enable-intl \ --enable-ipv6 \ --enable-mediactrl \ --enable-msgdlg \ --enable-numberdlg \ --disable-optimise \ --enable-permissive \ --disable-rpath \ --enable-splash \ --enable-textdlg \ EGREP='grep -E' %make_build # Why isn't this this part of the main build? Need to investigate. %make_build -C locale allmo #gw prepare samples pushd demos make clean rm -f makefile* demos.bkl popd pushd samples make clean rm -f makefile* samples.bkl popd find demos samples -name Makefile|xargs perl -pi -e 's^CXXC =.*^CXXC=\$(CXX) `wx-config --cflags`^' find demos samples -name Makefile|xargs perl -pi -e 's^EXTRALIBS =.*^EXTRALIBS=^' find demos samples -name Makefile|xargs perl -pi -e 's^SAMPLES_RPATH_FLAG =.*^SAMPLES_RPATH_FLAG=^' %install %make_install # dummy translation file find %{buildroot} -name "wxmsw.mo" -delete %find_lang wxstd-%{api} %post -n %{libnameudev} %{_sbindir}/update-alternatives \ --install %{_bindir}/wx-config wx-config %{_bindir}/wx-config-%{api} 40 \ --slave %{_bindir}/wxrc wxrc %{_bindir}/wxrc-%{api} %postun -n %{libnameudev} if [ $1 -eq 0 ]; then %{_sbindir}/update-alternatives \ --remove wx-config %{_bindir}/wx-config-%{api} fi %files -n %{name}%{api} -f wxstd-%{api}.lang %doc README.md %files -n %{libnameudev} %doc samples/ docs/ demos/ %ghost %{_bindir}/wx-config %ghost %{_bindir}/wxrc %{_bindir}/wx-config-%{api} %{_bindir}/wxrc-%{api} %{_includedir}/wx-%{api}/ %dir %{_libdir}/wx/ %dir %{_libdir}/wx/include/ %dir %{_libdir}/wx/include/gtk%{gtkver}-unicode-%{api}/ %dir %{_libdir}/wx/include/gtk%{gtkver}-unicode-%{api}/wx/ %dir %{_libdir}/wx/config %{_libdir}/wx/config/gtk%{gtkver}-unicode-%{api} %{_libdir}/wx/include/gtk%{gtkver}-unicode-%{api}/wx/setup.h %{_libdir}/libwx_baseu-%{api}.so %{_libdir}/libwx_baseu_net-%{api}.so %{_libdir}/libwx_baseu_xml-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_adv-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_aui-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_core-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_gl-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_html-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_media-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_propgrid-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_qa-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_ribbon-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_richtext-%{api}.so %{_libdir}/libwx_gtk%{gtkver}u_stc-%{api}.so %if %{with gtk3} %{_libdir}/libwx_gtk%{gtkver}u_webview-%{api}.so %endif %{_libdir}/libwx_gtk%{gtkver}u_xrc-%{api}.so %{_datadir}/bakefile/presets/wx* %{_datadir}/aclocal/wxwin%{apind}.m4