| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Cross-Plattform GUI Library" | 
| Andrew Geissler | eafcbb8 | 2020-06-05 17:59:17 -0500 | [diff] [blame] | 2 | DESCRIPTION = "wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls." | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 3 | HOMEPAGE = "https://www.wxwidgets.org/" | 
|  | 4 | BUGTRACKER = "https://trac.wxwidgets.org/" | 
|  | 5 |  | 
|  | 6 | # wxWidgets licence is a modified version of LGPL explicitly allowing not | 
|  | 7 | # distributing the sources of an application using the library even in the | 
|  | 8 | # case of static linking. | 
|  | 9 | LICENSE = "wxWidgets" | 
|  | 10 | LIC_FILES_CHKSUM = "file://docs/licence.txt;md5=981f50a934828620b08f44d75db557c6" | 
|  | 11 |  | 
|  | 12 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'qt', 'cmake_qt5', 'cmake', d)} | 
| Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 13 | inherit features_check lib_package binconfig pkgconfig | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 |  | 
|  | 15 | # All toolkit-configs except 'no_gui' require x11 explicitly (see toolkit.cmake) | 
|  | 16 | REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('PACKAGECONFIG', 'no_gui', '', 'x11', d)}" | 
|  | 17 |  | 
|  | 18 | DEPENDS += " \ | 
|  | 19 | jpeg \ | 
|  | 20 | libpng \ | 
|  | 21 | tiff \ | 
|  | 22 | " | 
|  | 23 |  | 
| Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 24 | SRC_URI = " \ | 
| Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 25 | git://github.com/wxWidgets/wxWidgets.git;branch=master;protocol=https \ | 
| Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 26 | file://0001-wx-config.in-Disable-cross-magic-it-does-not-work-fo.patch \ | 
| Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 27 | file://fix-libdir-for-multilib.patch \ | 
|  | 28 | file://respect-DESTDIR-when-create-link.patch \ | 
| Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 29 | " | 
|  | 30 | PV = "3.1.4" | 
|  | 31 | SRCREV= "6cdaedd42ba59331b3dc4ead50e0bac76ae14c19" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | S = "${WORKDIR}/git" | 
|  | 33 |  | 
|  | 34 | # These can be either 'builtin' or 'sys' and builtin means cloned soures are | 
|  | 35 | # build. So these cannot be PACKAGECONFIGs and let's use libs where we can (see | 
|  | 36 | # DEPENDS) | 
|  | 37 | EXTRA_OECMAKE += " \ | 
|  | 38 | -DwxUSE_LIBJPEG=sys \ | 
|  | 39 | -DwxUSE_LIBPNG=sys \ | 
|  | 40 | -DwxUSE_LIBTIFF=sys \ | 
|  | 41 | -DwxUSE_REGEX=builtin \ | 
| Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 42 | -DwxPLATFORM_LIB_DIR=${@d.getVar('baselib').replace('lib', '')} \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 43 | " | 
| Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 44 | EXTRA_OECMAKE:append:libc-musl = " \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 45 | -DHAVE_LOCALE_T=OFF \ | 
|  | 46 | " | 
|  | 47 |  | 
| Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 48 | PACKAGECONFIG ?= "gtk ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 49 |  | 
|  | 50 | # Note on toolkit-PACKAGECONFIGs: select exactly one of 'no_gui' / 'gtk' / 'qt' | 
| Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 51 | PACKAGECONFIG[no_gui] = "-DwxUSE_GUI=OFF,,,,,qt gtk opengl" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 52 | PACKAGECONFIG[gtk] = "-DwxBUILD_TOOLKIT=gtk3 -DwxUSE_GUI=ON,,gtk+3,,,no_gui qt" | 
|  | 53 | PACKAGECONFIG[qt] = "-DwxBUILD_TOOLKIT=qt  -DwxUSE_GUI=ON,,qtbase,,,no_gui gtk" | 
|  | 54 | python () { | 
|  | 55 | pkgconfig = d.getVar('PACKAGECONFIG') | 
|  | 56 | if (not 'no_gui' in pkgconfig) and (not 'gtk' in pkgconfig) and (not 'qt' in pkgconfig): | 
|  | 57 | bb.error("PACKAGECONFIG must select a toolkit. Add one of no_gui / gtk / qt!") | 
|  | 58 | } | 
|  | 59 |  | 
|  | 60 | # Notes on other PACKAGECONFIGs: | 
|  | 61 | # * 'no_gui' overrides some configs below so they are marked as conflicting | 
|  | 62 | #   with 'no_gui' to avoid surprises | 
|  | 63 | # * qt+gstreamer is broken due to incorrect references on glib-2.0 -> mark | 
|  | 64 | #   as conflicting | 
|  | 65 | # * wxUSE_LIBGNOMEVFS is for gtk2 (see init.cmake) which we don't support | 
|  | 66 | #   -> no gvfs PACKAGECONFIG | 
|  | 67 | # * libmspack is in meta-security | 
|  | 68 | PACKAGECONFIG[gstreamer] = "-DwxUSE_MEDIACTRL=ON,-DwxUSE_MEDIACTRL=OFF,gstreamer1.0-plugins-base,,,no_gui qt" | 
|  | 69 | PACKAGECONFIG[libsecret] = "-DwxUSE_SECRETSTORE=ON,-DwxUSE_SECRETSTORE=OFF,libsecret,,,no_gui" | 
|  | 70 | PACKAGECONFIG[lzma] = "-DwxUSE_LIBLZMA=ON,-DwxUSE_LIBLZMA=OFF,xz" | 
|  | 71 | PACKAGECONFIG[mspack] = "-DwxUSE_LIBMSPACK=ON,-DwxUSE_LIBMSPACK=OFF,libmspack" | 
| Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 72 | PACKAGECONFIG[opengl] = ",,libglu" | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 73 | PACKAGECONFIG[sdl_audio] = "-DwxUSE_LIBSDL=ON,-DwxUSE_LIBSDL=OFF,libsdl2" | 
|  | 74 | PACKAGECONFIG[webkit] = "-DwxUSE_WEBVIEW_WEBKIT=ON,-DwxUSE_WEBVIEW_WEBKIT=OFF,webkitgtk,,,no_gui" | 
|  | 75 |  | 
| Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | do_compile:append() { | 
| Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 77 | # if not at re-compile | 
|  | 78 | if [ -L ${B}/wx-config ]; then | 
|  | 79 | # ${B}/wx-config is a symlink for build and not needed after compile | 
|  | 80 | # So for our purposes do: | 
|  | 81 | # 1. make a file out of wx-config so that binconfig.bbclass detects it | 
|  | 82 | # 2. make sure we do not move the file used for compiling into sysroot | 
|  | 83 | cp --remove-destination `readlink ${B}/wx-config | sed 's:inplace-::'` ${B}/wx-config | 
|  | 84 | fi | 
|  | 85 | # 3. Set full sysroot paths so sstate can translate them when setting | 
|  | 86 | #    up wxwidgets's consumer sysroots | 
|  | 87 | sed -i \ | 
|  | 88 | -e 's,^includedir=.*,includedir="${STAGING_INCDIR}",g' \ | 
|  | 89 | -e 's,^libdir=.*",libdir="${STAGING_LIBDIR}",g' \ | 
|  | 90 | -e 's,^bindir=.*",bindir="${STAGING_BINDIR}",g' \ | 
|  | 91 | ${B}/wx-config | 
|  | 92 | } | 
|  | 93 |  | 
| Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 94 | do_install:append() { | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 95 | # do not ship bindir if empty | 
|  | 96 | rmdir --ignore-fail-on-non-empty ${D}${bindir} | 
|  | 97 | } | 
|  | 98 |  | 
|  | 99 | # lib names are not canonical | 
|  | 100 | FILES_SOLIBSDEV = "" | 
|  | 101 |  | 
| Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 102 | FILES:${PN} += " \ | 
| Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 103 | ${libdir}/libwx_*.so \ | 
|  | 104 | ${libdir}/wx/ \ | 
|  | 105 | " | 
|  | 106 |  | 
| Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 107 | FILES:${PN}-dev += " \ | 
|  | 108 | ${libdir}/wx/include/ \ | 
|  | 109 | ${libdir}/wx/config/ \ | 
|  | 110 | " |