void-packages/srcpkgs/wxWidgets/template
newbluemoon e8842e10d7 wxWidgets: fix cross compilation
xbps-src: add wx-config to 02-script-wrapper.sh
2017-12-16 01:48:46 +01:00

51 lines
1.9 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Template file for 'wxWidgets'
pkgname=wxWidgets
version=3.0.3.1
revision=3
build_style=gnu-configure
configure_args="--enable-unicode --with-opengl --with-sdl --with-libmspack
--with-libnotify"
short_desc="The wxWidgets GUI toolkit library (version 3)"
maintainer="Martin Riese <grauehaare@gmx.de>"
license="wxWindows"
homepage="https://www.wxwidgets.org/"
hostmakedepends="pkg-config"
makedepends="gtk+-devel libjpeg-turbo-devel tiff-devel libSM-devel libnotify-devel
libXinerama-devel libmspack-devel SDL-devel glu-devel webkitgtk2-devel"
distfiles="https://github.com/wxWidgets/wxWidgets/releases/download/v${version}/wxWidgets-${version}.tar.bz2"
checksum=3164ad6bc5f61c48d2185b39065ddbe44283eb834a5f62beb13f1d0923e366e4
wxWidgets-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.so"
vmove usr/share
vmove usr/bin
vmove usr/lib/wx
ln -sf wx-config-3.0 ${PKGDESTDIR}/usr/bin/wx-config
ln -sf wxrc-3.0 ${PKGDESTDIR}/usr/bin/wxrc
# remove all occurrences of $XBPS_CROSS_TRIPLET
# wx-config:
# - mark this build as native build
# - ignore --host option; breaks configure scripts when
# cross compiling (isnt necessary in our case anyway)
if [ -n "$CROSS_BUILD" ]; then
local _config="gtk2-unicode-3.0"
mv ${PKGDESTDIR}/usr/lib/wx/include/{${XBPS_CROSS_TRIPLET}-${_config},${_config}}
rename "${XBPS_CROSS_TRIPLET}-" "" ${PKGDESTDIR}/usr/lib/wx/config/*
rename -- "-${XBPS_CROSS_TRIPLET}" "" ${PKGDESTDIR}/usr/lib/*
sed -i -e "s/${XBPS_CROSS_TRIPLET}-//g" \
-e "s/-${XBPS_CROSS_TRIPLET}//g" \
-e 's/is_cross() { \[ "xyes" = "xyes" \]; }/is_cross() { \[ "xno" = "xyes" \]; }/g' \
-e 's/--\*=\*)/--host=\*) continue;;\n\n --\*=\*)/' \
${PKGDESTDIR}/usr/lib/wx/config/${_config}
ln -sf ../lib/wx/config/${_config} ${PKGDESTDIR}/usr/bin/wx-config-3.0
fi
}
}