From c21944020753ad13fc2c9874fa750a61bea6bda1 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 27 May 2024 03:31:39 +0000 Subject: automatic import of wxGTK3 --- .gitignore | 1 + add-pie-compile-option.patch | 12 +++ sources | 1 + wx-config | 51 +++++++++ wxGTK3-3.1.6-abicheck.patch | 16 +++ wxGTK3.spec | 247 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 328 insertions(+) create mode 100644 add-pie-compile-option.patch create mode 100644 sources create mode 100644 wx-config create mode 100644 wxGTK3-3.1.6-abicheck.patch create mode 100644 wxGTK3.spec diff --git a/.gitignore b/.gitignore index e69de29..1565ea0 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/wxWidgets-3.2.2.1.tar.bz2 diff --git a/add-pie-compile-option.patch b/add-pie-compile-option.patch new file mode 100644 index 0000000..9f7bfc2 --- /dev/null +++ b/add-pie-compile-option.patch @@ -0,0 +1,12 @@ +diff -Nur a/utils/wxrc/Makefile.in b/utils/wxrc/Makefile.in +--- a/utils/wxrc/Makefile.in 2023-09-07 15:51:55.352827569 +0800 ++++ b/utils/wxrc/Makefile.in 2023-09-07 16:05:11.820373156 +0800 +@@ -114,7 +114,7 @@ + rm -f config.cache config.log config.status bk-deps bk-make-pch Makefile + + @COND_USE_XML_1@wxrc$(EXEEXT): $(WXRC_OBJECTS) +-@COND_USE_XML_1@ $(CXX) -o $@ $(WXRC_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_PNG_IF_MONO_p) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) ++@COND_USE_XML_1@ $(CXX) -fPIE -o $@ $(WXRC_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_PNG_IF_MONO_p) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) + + @COND_USE_XML_1@install_wxrc: $(__wxrc___depname) + @COND_USE_XML_1@ $(INSTALL_DIR) $(DESTDIR)$(bindir) diff --git a/sources b/sources new file mode 100644 index 0000000..bfa728f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +45bd5f56a06e7c4ca7caf6c0b4d5d506 wxWidgets-3.2.2.1.tar.bz2 diff --git a/wx-config b/wx-config new file mode 100644 index 0000000..df56d0d --- /dev/null +++ b/wx-config @@ -0,0 +1,51 @@ +#! /bin/sh +# +# Multilib-aware wrapper for the wx-config script +# +# Usage: wx-config [--arch ] +# + +version=3.2 + +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|mips|mipsel|riscv32|sw_64) + libdir=/usr/lib + ;; + x86_64|ppc64|s390x|sparc64|aarch64|ppc64le|mips64*|riscv64|loongarch64) + libdir=/usr/lib64 + ;; + *) + echo "Unsupported architecture '$arch'" + exit 8 + ;; +esac + +wxconfig=$libdir/wx/config/gtk3-unicode-$version +if [ ! -f $wxconfig ]; then + wxconfig=$libdir/wx/config/gtk2-unicode-$version +fi +# 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/gtk3-unicode-$version + if [ ! -f $wxconfig ]; then + wxconfig=/usr/lib/wx/config/gtk2-unicode-$version + fi +fi + +if [ -x $wxconfig ]; then + exec $wxconfig $@ +else + echo "wxGTK-devel isn't installed for architecture '$arch'" + exit 9 +fi diff --git a/wxGTK3-3.1.6-abicheck.patch b/wxGTK3-3.1.6-abicheck.patch new file mode 100644 index 0000000..1c4e618 --- /dev/null +++ b/wxGTK3-3.1.6-abicheck.patch @@ -0,0 +1,16 @@ +diff -up wxWidgets-3.1.6/src/common/appbase.cpp.abicheck wxWidgets-3.1.6/src/common/appbase.cpp +--- wxWidgets-3.1.6/src/common/appbase.cpp.abicheck 2022-04-04 09:41:33.000000000 -0400 ++++ wxWidgets-3.1.6/src/common/appbase.cpp 2022-04-04 19:14:33.883814729 -0400 +@@ -843,11 +843,8 @@ bool wxAppConsoleBase::CheckBuildOptions + wxString prog = wxString::FromAscii(optionsSignature); + wxString progName = wxString::FromAscii(componentName); + +- wxLogFatalError(wxT("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."), ++ wxLogWarning(wxT("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."), + lib, progName, prog); +- +- // normally wxLogFatalError doesn't return +- return false; + } + + return true; diff --git a/wxGTK3.spec b/wxGTK3.spec new file mode 100644 index 0000000..1cd7d6f --- /dev/null +++ b/wxGTK3.spec @@ -0,0 +1,247 @@ +Name: wxGTK3 +Version: 3.2.2.1 +Release: 2 +Summary: C++ Library for Cross-Platform Development + +License: GPL-2.0-or-later or LGPL-2.1-only +URL: https://www.wxwidgets.org/ +Source0: https://github.com/wxWidgets/wxWidgets/releases/download/v%{version}/wxWidgets-%{version}.tar.bz2 +Source1: wx-config +Patch0001: wxGTK3-3.1.6-abicheck.patch +Patch0002: add-pie-compile-option.patch + +BuildRequires: gtk2-devel gtk3-devel webkit2gtk3-devel zlib-devel libpng-devel libjpeg-devel +BuildRequires: libtiff-devel expat-devel SDL2-devel libGLU-devel libSM-devel gstreamer1-plugins-base-devel +BuildRequires: GConf2-devel gettext cppunit-devel libmspack-devel doxygen gcc gcc-c++ + +Requires: wxBase3 = %{version}-%{release} wxGTK3-i18n = %{version}-%{release} +Provides: wxWidgets = %{version}-%{release} bundled(scintilla) = 3.2.1 + +Provides: wxGTK3-gl = %{version}-%{release} wxGTK3-media = %{version}-%{release} wxGTK3-webview = %{version}-%{release} +Obsoletes: wxGTK3-gl < %{version}-%{release} wxGTK3-media < %{version}-%{release} wxGTK3-webview < %{version}-%{release} + +%description +wxWidgets is a C++ library for cross-platform GUI. +With wxWidgets, you can create applications for different GUIs (GTK+, +Motif, MS Windows, MacOS X, Windows CE, GPE) from the same source code. +This package contains all library of GTK3-backed wxWidgets. + +%package -n compat-wxGTK3-gtk2 +Summary: C++ Library for Cross-Platform Development of GTK2-backed wxWidgets +Requires: wxBase3 = %{version}-%{release} wxGTK3-i18n = %{version}-%{release} +Provides: compat-wxWidgets-gtk2 = %{version}-%{release} bundled(scintilla) = 3.2.1 + +Provides: compat-wxGTK3-gtk2-gl = %{version}-%{release} compat-wxGTK3-gtk2-media = %{version}-%{release} +Obsoletes: compat-wxGTK3-gtk2-gl < %{version}-%{release} compat-wxGTK3-gtk2-media < %{version}-%{release} + +%description -n compat-wxGTK3-gtk2 +wxWidgets is a C++ library for cross-platform GUI. +With wxWidgets, you can create applications for different GUIs (GTK+, +Motif, MS Windows, MacOS X, Windows CE, GPE) from the same source code. +This package contains all library of GTK2-backed wxWidgets. + +%package -n wxBase3-devel +Summary: Development files for GTK2-backed and GTK3-backed wxWidgets +Requires: wxBase3 = %{version}-%{release} +Requires(post): chkconfig +Requires(postun): chkconfig + +%description -n wxBase3-devel +This package contains all files needed for developing with GTK2-backed and GTK3-backed wxWidgets. + +%package devel +Summary: Development files for GTK3-backed wxWidgets +Requires: wxGTK3 = %{version}-%{release} wxGTK3-gl = %{version}-%{release} +Requires: wxGTK3-media = %{version}-%{release} wxGTK3-webview = %{version}-%{release} +Requires: wxBase3 = %{version}-%{release} wxBase3-devel = %{version}-%{release} +Requires: gtk3-devel libGLU-devel +Provides: wxWidgets-devel = %{version}-%{release} + +%description devel +This package contains all files needed for developing with GTK3-backed wxWidgets. + +%package -n compat-wxGTK3-gtk2-devel +Summary: Development files for GTK2-backed wxWidgets +Requires: compat-wxGTK3-gtk2 = %{version}-%{release} compat-wxGTK3-gtk2-gl = %{version}-%{release} +Requires: compat-wxGTK3-gtk2-media = %{version}-%{release} +Requires: wxBase3 = %{version}-%{release} wxBase3-devel = %{version}-%{release} +Requires: gtk2-devel libGLU-devel +Provides: compat-wxWidgets-gtk2-devel = %{version}-%{release} + +%description -n compat-wxGTK3-gtk2-devel +This package contains all files needed for developing with GTK2-backed wxWidgets. + + +%package i18n +Summary: i18n message catalogs of the wxGTK3 +BuildArch: noarch + +%description i18n +This package contains i18n message catalogs for the wxWidgets library. + +%package -n wxBase3 +Summary: Non-GUI support classes of the wxGTK3 +Provides: compat-wxBase3-gtk2 = %{version}-%{release} +Obsoletes: compat-wxBase3-gtk2 < %{version}-%{release} + +%description -n wxBase3 +Non-GUI support classes from the wxWidgets library. + +%package help +Summary: Help documentation for the wxGTK3 library +Requires: %{name} = %{version}-%{release} +Provides: wxWidgets-docs = %{version}-%{release} compat-wxWidgets-gtk2 = %{version}-%{release} +Provides: wxWidgets-xmldocs = %{version}-%{release} +Provides: wxGTK3-docs = %{version}-%{release} compat-wxGTK3-gtk2-docs = %{version}-%{release} +Provides: wxGTK3-xmldocs = %{version}-%{release} compat-wxGTK3-gtk2-xmldocs = %{version}-%{release} +Obsoletes: wxGTK3-docs < %{version}-%{release} compat-wxGTK3-gtk2-docs < %{version}-%{release} +Obsoletes: wxGTK3-xmldocs < %{version}-%{release} compat-wxGTK3-gtk2-xmldocs < %{version}-%{release} +BuildArch: noarch + +%description help +This package provides documentation for the wxGTK3-docs library. + +%prep +%autosetup -n wxWidgets-%{version} -p1 + +sed -i -e 's|aclocal)|aclocal/wxwin32.m4)|;s|wxstd.mo|wxstd3.mo|;s|wxmsw.mo|wxmsw3.mo|' Makefile.in +sed -i -e 's|/usr/lib\b|%{_libdir}|' wx-config.in configure +sed -i -e 's|/lib|/%{_lib}|' src/unix/stdpaths.cpp +sed -i -e 's|$CPPUNIT_CONFIG --version|$CPPUNIT_CONFIG --modversion|' configure + +%build +CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +export LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--as-needed" +export CPPUNIT_CONFIG="/usr/bin/pkg-config cppunit" + +%global _configure ../configure + +install -d bld_gtk2 +cd bld_gtk2 +%configure --with-gtk=2 --with-opengl --with-sdl --with-libmspack --enable-intl \ + --disable-rpath --disable-glcanvasegl --enable-ipv6 + +%make_build +cd - + +install -d bld_gtk3 +cd bld_gtk3 +%configure --with-gtk=3 --with-opengl --with-sdl --with-libmspack --enable-intl \ + --disable-rpath --disable-glcanvasegl --enable-ipv6 + +%make_build +cd - + +WX_SKIP_DOXYGEN_VERSION_CHECK=1 docs/doxygen/regen.sh html +mv docs/doxygen/out/html . + +cd docs/doxygen +WX_SKIP_DOXYGEN_VERSION_CHECK=1 ./regen.sh xml +cd - + +%install +cd bld_gtk2 +%make_install +cd - + +cd bld_gtk3 +%make_install +cd - + +rm %{buildroot}%{_bindir}/wx-config +install -pD -m 755 %{SOURCE1} %{buildroot}%{_libexecdir}/wxGTK3/wx-config +sed -i -e 's|=/usr|=%{_prefix}|' %{buildroot}%{_libexecdir}/%{name}/wx-config +ln -s ../..%{_libexecdir}/wxGTK3/wx-config %{buildroot}%{_bindir}/wx-config-3.2 +touch %{buildroot}%{_bindir}/wx-config + +mv %{buildroot}%{_bindir}/wxrc* %{buildroot}%{_libexecdir}/wxGTK3 +ln -s ../..%{_libexecdir}/wxGTK3/wxrc-3.2 %{buildroot}%{_bindir}/wxrc-3.2 +touch %{buildroot}%{_bindir}/wxrc + + +install -d %{buildroot}%{_datadir}/bakefile/presets/wx32 +mv %{buildroot}%{_datadir}/bakefile/presets/*.* %{buildroot}%{_datadir}/bakefile/presets/wx32 + +%find_lang wxstd-3.2 + +%check +cd bld_gtk2/tests +%make_build test +cd - + +cd bld_gtk3/tests +%make_build test +cd - + +%post -n wxBase3-devel +if [ -f %{_bindir}/wx-config ] && [ ! -h %{_bindir}/wx-config ] ; then rm %{_bindir}/wx-config; fi; + +%{_sbindir}/update-alternatives --install %{_bindir}/wx-config wx-config %{_libexecdir}/%{name}/wx-config 25 + +%{_sbindir}/update-alternatives --install %{_bindir}/wxrc wxrc %{_libexecdir}/%{name}/wxrc 25 + +%postun -n wxBase3-devel +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove wx-config %{_libexecdir}/%{name}/wx-config + %{_sbindir}/update-alternatives --remove wxrc %{_libexecdir}/%{name}/wxrc +fi + +%files +%{_libdir}/libwx_gtk3u_*.so.* +%dir %{_libdir}/wx +%{_libdir}/wx/3.2 + +%files -n compat-wxGTK3-gtk2 +%{_libdir}/libwx_gtk2u_*.so.* + +%files -n wxBase3-devel +%ghost %{_bindir}/{wx-config,wxrc} +%{_bindir}/{wxrc-3.2,wx-config-3.2} +%{_includedir}/wx-3.2 +%{_libdir}/libwx_baseu*.so +%dir %{_libdir}/wx +%dir %{_libdir}/wx/config +%dir %{_libdir}/wx/include +%{_datadir}/{aclocal/wxwin32.m4,bakefile/presets/wx32} +%{_libexecdir}/wxGTK3 + +%files devel +%{_libdir}/libwx_gtk3u_*.so +%{_libdir}/wx/{config/gtk3-unicode-3.2,include/gtk3-unicode-3.2} + +%files -n compat-wxGTK3-gtk2-devel +%{_libdir}/libwx_gtk2u_*.so +%{_libdir}/wx/{config/gtk2-unicode-3.2,include/gtk2-unicode-3.2} + +%files i18n -f wxstd-3.2.lang + +%files -n wxBase3 +%{_libdir}/libwx_baseu*.so.* + +%files help +%doc docs/* +%doc html + + +%changelog +* Tue Sep 26 2023 lvgenggeng - 3.2.2.1-2 +- support sw_64 + +* Wed Sep 06 2023 wulei - 3.2.2.1-1 +- Update to 3.2.2.1 + +* Wed Jun 07 2023 xu_ping <707078654@qq.com> - 3.0.4-9 +- Add pie compile option + +* Mon Nov 28 2022 huajingyun - 3.0.4-8 +- modify wx-config to support loongarch64 + +* Wed Jul 27 2022 yaoxin - 3.0.4-7 +- License compliance rectification + +* Mon May 31 2021 huanghaitao - 3.0.4-6 +- Completing build dependencies to fix gcc/gcc-c++ compiler missing error + +* Fri Dec 06 2019 daiqianwen - 3.0.4-5 +- Package init -- cgit v1.2.3