Sync mingw-w64-wxmsw with AUR

AUR version is fine, actually no need for
further customization
This commit is contained in:
Martchus 2016-08-31 23:14:17 +02:00
parent d47b1ba602
commit 72b343dd7b
2 changed files with 94 additions and 69 deletions

View File

@ -1,93 +1,84 @@
# Maintainer: Ivan Puntiy <ivan.puntiy-at-gmail>
# 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
}

View File

@ -0,0 +1,34 @@
From aae8432e4cc8557a4e6c2b189e2924d1ae3f7ea7 Mon Sep 17 00:00:00 2001
From: Scott Talbert <swt@techie.net>
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 <ctype.h>
#include <assert.h>
+#include <cmath>
#include <string>
#include <vector>
#include <map>
@@ -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;
}