From 2efcb620bdb3d7d07269b40331eb8ccea93ad9de Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Mon, 18 Jun 2018 02:44:19 -0700 Subject: [PATCH] support and default to wxgtk3 not gtk2 on arch Change installdeps to install wxgtk3 on arch instead of the wxgtk package which uses gtk2. Update the cmake code to check for the renamed wx-config executable wx-config-gtk3 on arch, first checking for wx-config-gtk4 for the future. --- installdeps | 2 +- src/wx/CMakeLists.txt | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/installdeps b/installdeps index 1c954e57..d31dca6f 100755 --- a/installdeps +++ b/installdeps @@ -545,7 +545,7 @@ archlinux_installdeps() { # not using the base-devel group because it can break gcc-multilib check $pacman --noconfirm --needed -S binutils file grep gawk gzip libtool make patch sed util-linux nasm cmake pkg-config git - libs="zlib mesa gettext libpng sdl2 openal wxgtk gtk2 gtk3 sfml ffmpeg" + libs="zlib mesa gettext libpng sdl2 openal wxgtk3 gtk3 sfml ffmpeg" if [ -z "$target" -o "$target" = m32 ]; then if [ -z "$target" -o -z "$amd64" ]; then diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index 5efe1e11..5ba0bfcb 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -72,12 +72,26 @@ endif() SET(wxWidgets_USE_UNICODE ON) # adv is for wxAboutBox # xml, html is for xrc -SET(wxWidgets_USE_LIBS xrc xml html adv gl net core base gl) +# do not include gl at first +set(wxWidgets_USE_LIBS xrc xml html adv net core base gl) #list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8) +# check for gtk4 then gtk3 packages first, some dists like arch rename the +# wx-config utility for these packages +set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk4) +find_package(wxWidgets QUIET) +if(NOT wxWidgets_FOUND) + set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk3) + find_package(wxWidgets QUIET) + if(NOT wxWidgets_FOUND) + unset(wxWidgets_CONFIG_EXECUTABLE) + endif() +endif() + # the gl lib may not be available, and if it looks like it is we still have to # do a compile test later -FIND_PACKAGE(wxWidgets QUIET) +list(APPEND wxWidgets_USE_LIBS gl) +find_package(wxWidgets QUIET) normalize_wx_paths() SET(CHECK_WX_OPENGL FALSE)