From 72b343dd7bcc8dfdec2f1ddbc8dae33fa5872ac0 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 31 Aug 2016 23:14:17 +0200 Subject: [PATCH] Sync mingw-w64-wxmsw with AUR AUR version is fine, actually no need for further customization --- wxwidgets/mingw-w64/PKGBUILD | 129 +++++++++++++++----------------- wxwidgets/mingw-w64/PR222.patch | 34 +++++++++ 2 files changed, 94 insertions(+), 69 deletions(-) create mode 100644 wxwidgets/mingw-w64/PR222.patch diff --git a/wxwidgets/mingw-w64/PKGBUILD b/wxwidgets/mingw-w64/PKGBUILD index 496671e4..4f07815b 100644 --- a/wxwidgets/mingw-w64/PKGBUILD +++ b/wxwidgets/mingw-w64/PKGBUILD @@ -1,93 +1,84 @@ +# Maintainer: Ivan Puntiy +# Contributor: Schala + pkgname=mingw-w64-wxmsw epoch=1 pkgver=3.0.2 pkgrel=2 -pkgdesc="Win32 implementation of wxWidgets API for GUI (mingw-w64)" +pkgdesc='Win32 implementation of wxWidgets API for GUI (mingw-w64)' arch=('any') -url="http://wxwidgets.org" -license=("custom:wxWindows") +url='http://wxwidgets.org' +license=('custom:wxWindows') depends=('mingw-w64-crt' 'mingw-w64-libpng' 'mingw-w64-libjpeg-turbo' 'mingw-w64-libtiff') -makedepends=('mingw-w64-gcc') +makedepends=('mingw-w64-configure') options=(staticlibs !strip !buildflags) conflicts=('mingw-w64-wxmsw2.9' 'mingw-w64-wxmsw-static') provides=('mingw-w64-wxmsw2.9' 'mingw-w64-wxmsw-static') -replaces=('mingw-w64-wxmsw2.9') -source=("http://downloads.sourceforge.net/wxwindows/wxWidgets-${pkgver}.tar.bz2") -sha1sums=('6461eab4428c0a8b9e41781b8787510484dea800') +source=( + "http://downloads.sourceforge.net/wxwindows/wxWidgets-${pkgver}.tar.bz2" + 'PR222.patch' # https://github.com/wxWidgets/wxWidgets/pull/222 +) +sha1sums=('6461eab4428c0a8b9e41781b8787510484dea800' + '118ca9fb5c299a118e0c87a0cc18a98e5030077b') -_architectures="i686-w64-mingw32 x86_64-w64-mingw32" +_architectures='i686-w64-mingw32 x86_64-w64-mingw32' + +prepare() { + cd "${srcdir}/wxWidgets-${pkgver}/" + + # fix errors with GCC 6 + patch -p1 -i "${srcdir}/PR222.patch" +} build() { - # shared builds - for _arch in ${_architectures}; do - unset LDFLAGS - mkdir -p "${srcdir}/${pkgname}-${pkgver}-build-shared-${_arch}" - cd "${srcdir}/${pkgname}-${pkgver}-build-shared-${_arch}" - "${srcdir}"/wxWidgets-$pkgver/configure \ - --prefix=/usr/${_arch} \ - --build=$CHOST \ - --host=${_arch} \ - --with-msw \ - --with-opengl \ - --disable-mslu \ - --enable-unicode \ - --enable-shared \ - #--enable-monolithic \ - --enable-stl \ - --with-regex=builtin \ - --disable-precomp-headers \ - --enable-graphics_ctx \ - --enable-webview \ - --enable-mediactrl \ - --with-libpng=sys \ - --with-libxpm=builtin \ - --with-libjpeg=sys \ - --with-libtiff=sys - make - done + local _build_flags="\ + --with-msw \ + --with-opengl \ + --disable-mslu \ + --enable-unicode \ + --with-regex=builtin \ + --disable-precomp-headers \ + --enable-graphics_ctx \ + --enable-webview \ + --enable-mediactrl \ + --with-libpng=sys \ + --with-libxpm=builtin \ + --with-libjpeg=sys \ + --with-libtiff=sys" - # static builds + cd "${srcdir}/wxWidgets-${pkgver}" for _arch in ${_architectures}; do - unset LDFLAGS - mkdir -p "${srcdir}/${pkgname}-${pkgver}-build-static-${_arch}" - cd "${srcdir}/${pkgname}-${pkgver}-build-static-${_arch}" - "${srcdir}"/wxWidgets-$pkgver/configure \ - --prefix=/usr/${_arch} \ - --build=$CHOST \ - --host=${_arch} \ - --with-msw \ - --with-opengl \ - --disable-mslu \ - --enable-unicode \ - --disable-shared \ - --enable-stl \ - --with-regex=builtin \ - --disable-precomp-headers \ - --enable-graphics_ctx \ - --enable-webview \ - --enable-mediactrl \ - --with-libpng=sys \ - --with-libxpm=builtin \ - --with-libjpeg=sys \ - --with-libtiff=sys + # shared build + mkdir -p build-shared-${_arch} && pushd build-shared-${_arch} + ${_arch}-configure ${_build_flags} .. make + popd + + # static build + mkdir -p build-static-${_arch} && pushd build-static-${_arch} + ${_arch}-configure ${_build_flags} --disable-shared .. + make + popd done } package() { - mkdir -p "$pkgdir/usr/bin" + mkdir -p "${pkgdir}/usr/bin" for _arch in ${_architectures}; do - for _build in "shared" "static"; do - cd "${srcdir}/${pkgname}-${pkgver}-build-${_build}-${_arch}" - make DESTDIR="$pkgdir" install + for _build in shared static; do + cd "${srcdir}/wxWidgets-${pkgver}/build-${_build}-${_arch}" + make DESTDIR="${pkgdir}" install done - mv "$pkgdir/usr/${_arch}/lib/"*.dll "$pkgdir/usr/${_arch}/bin" - find "$pkgdir/usr/${_arch}" -name '*.exe' | xargs -rtl1 rm - find "$pkgdir/usr/${_arch}" -name '*.dll' | xargs -rtl1 ${_arch}-strip --strip-unneeded - find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs -rtl1 ${_arch}-strip -g - rm -r "$pkgdir/usr/${_arch}/share" + + mv "${pkgdir}/usr/${_arch}/lib/"*.dll "${pkgdir}/usr/${_arch}/bin/" + ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll + ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a + + ln -s "/usr/${_arch}/lib/wx/config/${_arch}-msw-unicode-${pkgver%.*}" \ + "$pkgdir/usr/bin/${_arch}-wx-config" + + ${_arch}-strip --strip-all "${pkgdir}/usr/${_arch}/bin/"*.exe rm "$pkgdir/usr/${_arch}/bin/wxrc-3.0" - cd "$pkgdir/usr/bin/" - ln -s "../${_arch}/lib/wx/config/${_arch}-msw-unicode-${pkgver%.*}" "./${_arch}-wx-config" + # rm -r "$pkgdir/usr/${_arch}/share" done } diff --git a/wxwidgets/mingw-w64/PR222.patch b/wxwidgets/mingw-w64/PR222.patch new file mode 100644 index 00000000..7d1b0228 --- /dev/null +++ b/wxwidgets/mingw-w64/PR222.patch @@ -0,0 +1,34 @@ +From aae8432e4cc8557a4e6c2b189e2924d1ae3f7ea7 Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Sat, 20 Feb 2016 00:08:14 -0500 +Subject: [PATCH] Fix STC compilation with GCC6 + +Closes #17147 +--- + src/stc/scintilla/src/Editor.cxx | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/stc/scintilla/src/Editor.cxx b/src/stc/scintilla/src/Editor.cxx +index cd72953..2081df2 100644 +--- a/src/stc/scintilla/src/Editor.cxx ++++ b/src/stc/scintilla/src/Editor.cxx +@@ -11,6 +11,7 @@ + #include + #include + ++#include + #include + #include + #include +@@ -5841,9 +5842,9 @@ void Editor::GoToLine(int lineNo) { + } + + static bool Close(Point pt1, Point pt2) { +- if (abs(pt1.x - pt2.x) > 3) ++ if (std::abs(pt1.x - pt2.x) > 3) + return false; +- if (abs(pt1.y - pt2.y) > 3) ++ if (std::abs(pt1.y - pt2.y) > 3) + return false; + return true; + }