From f2b27801b51d51745fd1b0435afc88c406a32d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 19 Jan 2021 21:49:12 +0700 Subject: [PATCH] wxWidgets: fix -config script after lib64 change --- srcpkgs/wxWidgets/template | 49 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/srcpkgs/wxWidgets/template b/srcpkgs/wxWidgets/template index 820c9e1133..6cca7f994f 100644 --- a/srcpkgs/wxWidgets/template +++ b/srcpkgs/wxWidgets/template @@ -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 (isn’t 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 (isn’t 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 } }