wxWidgets: fix -config script after lib64 change

This commit is contained in:
Đoàn Trần Công Danh 2021-01-19 21:49:12 +07:00
parent fd01cfe069
commit f2b27801b5

View file

@ -1,7 +1,7 @@
# Template file for 'wxWidgets'
pkgname=wxWidgets
version=3.0.5.1
revision=1
revision=2
configure_args="--enable-unicode --with-opengl --with-sdl --with-libmspack
--with-libnotify --enable-mediactrl --with-gtk=2 --disable-webview"
build_style=gnu-configure
@ -18,6 +18,7 @@ distfiles="https://github.com/wxWidgets/wxWidgets/releases/download/v${version}/
checksum=440f6e73cf5afb2cbf9af10cec8da6cdd3d3998d527598a53db87099524ac807
post_install() {
local _config="gtk2-unicode-3.0"
# remove files that are already in wxWidgets-common
rm -f ${DESTDIR}/usr/lib/libwx_baseu*
rm -rf ${DESTDIR}/usr/bin/wxrc*
@ -27,6 +28,29 @@ post_install() {
for f in "" generic gtk; do
rm ${DESTDIR}/usr/include/wx-3.0/wx/$f/notifmsg.h
done
# 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
rename "${XBPS_CROSS_TRIPLET}-" "" \
${DESTDIR}/usr/lib/wx/config/* \
${DESTDIR}/usr/lib/wx/include/*
rename -- "-${XBPS_CROSS_TRIPLET}" "" ${DESTDIR}/usr/lib/*
sed -i -e "s/${XBPS_CROSS_TRIPLET}-//g" \
-e "s/-${XBPS_CROSS_TRIPLET}//g" \
${DESTDIR}/usr/lib/wx/config/${_config}
fi
sed -i -e '/^libdir="\/usr/s,/usr,${exec_prefix},' \
-e '/^bindir="\/usr/s,/usr,${exec_prefix},' \
-e 's/is_cross() { .* }/is_cross() { false; }/g' \
-e '/--\*=\*)/i --host=\*) continue;;' \
${DESTDIR}/usr/lib/wx/config/${_config}
ln -sf ../lib/wx/config/${_config} ${PKGDESTDIR}/usr/bin/wx-config-3.0
ln -sf wx-config-3.0 ${DESTDIR}/usr/bin/wx-config
}
wxWidgets-devel_package() {
@ -37,28 +61,5 @@ wxWidgets-devel_package() {
vmove usr/bin
vmove "usr/lib/*.so"
vmove usr/lib/wx
ln -sf wx-config-3.0 ${PKGDESTDIR}/usr/bin/wx-config
# 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
}
}