blob: b4420a18eacf4730676828d40b367c5c59e4c118 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Cross-Plattform GUI Library"
Andrew Geisslereafcbb82020-06-05 17:59:17 -05002DESCRIPTION = "wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls."
Andrew Geissler82c905d2020-04-13 13:39:40 -05003HOMEPAGE = "https://www.wxwidgets.org/"
4BUGTRACKER = "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.
9LICENSE = "wxWidgets"
10LIC_FILES_CHKSUM = "file://docs/licence.txt;md5=981f50a934828620b08f44d75db557c6"
11
12inherit ${@bb.utils.contains('PACKAGECONFIG', 'qt', 'cmake_qt5', 'cmake', d)}
Andrew Geissler5199d832021-09-24 16:47:35 -050013inherit features_check lib_package binconfig pkgconfig
Andrew Geissler82c905d2020-04-13 13:39:40 -050014
15# All toolkit-configs except 'no_gui' require x11 explicitly (see toolkit.cmake)
16REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('PACKAGECONFIG', 'no_gui', '', 'x11', d)}"
17
18DEPENDS += " \
19 jpeg \
20 libpng \
21 tiff \
22"
23
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050024SRC_URI = " \
Andrew Geissler595f6302022-01-24 19:11:47 +000025 git://github.com/wxWidgets/wxWidgets.git;branch=master;protocol=https \
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050026 file://0001-wx-config.in-Disable-cross-magic-it-does-not-work-fo.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000027 file://fix-libdir-for-multilib.patch \
28 file://respect-DESTDIR-when-create-link.patch \
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050029"
30PV = "3.1.4"
31SRCREV= "6cdaedd42ba59331b3dc4ead50e0bac76ae14c19"
Andrew Geissler82c905d2020-04-13 13:39:40 -050032S = "${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)
37EXTRA_OECMAKE += " \
38 -DwxUSE_LIBJPEG=sys \
39 -DwxUSE_LIBPNG=sys \
40 -DwxUSE_LIBTIFF=sys \
41 -DwxUSE_REGEX=builtin \
Andrew Geissler9aee5002022-03-30 16:27:02 +000042 -DwxPLATFORM_LIB_DIR=${@d.getVar('baselib').replace('lib', '')} \
Andrew Geissler82c905d2020-04-13 13:39:40 -050043"
Patrick Williams213cb262021-08-07 19:21:33 -050044EXTRA_OECMAKE:append:libc-musl = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050045 -DHAVE_LOCALE_T=OFF \
46"
47
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050048PACKAGECONFIG ?= "gtk ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050049
50# Note on toolkit-PACKAGECONFIGs: select exactly one of 'no_gui' / 'gtk' / 'qt'
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050051PACKAGECONFIG[no_gui] = "-DwxUSE_GUI=OFF,,,,,qt gtk opengl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050052PACKAGECONFIG[gtk] = "-DwxBUILD_TOOLKIT=gtk3 -DwxUSE_GUI=ON,,gtk+3,,,no_gui qt"
53PACKAGECONFIG[qt] = "-DwxBUILD_TOOLKIT=qt -DwxUSE_GUI=ON,,qtbase,,,no_gui gtk"
54python () {
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
68PACKAGECONFIG[gstreamer] = "-DwxUSE_MEDIACTRL=ON,-DwxUSE_MEDIACTRL=OFF,gstreamer1.0-plugins-base,,,no_gui qt"
69PACKAGECONFIG[libsecret] = "-DwxUSE_SECRETSTORE=ON,-DwxUSE_SECRETSTORE=OFF,libsecret,,,no_gui"
70PACKAGECONFIG[lzma] = "-DwxUSE_LIBLZMA=ON,-DwxUSE_LIBLZMA=OFF,xz"
71PACKAGECONFIG[mspack] = "-DwxUSE_LIBMSPACK=ON,-DwxUSE_LIBMSPACK=OFF,libmspack"
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050072PACKAGECONFIG[opengl] = ",,libglu"
Andrew Geissler82c905d2020-04-13 13:39:40 -050073PACKAGECONFIG[sdl_audio] = "-DwxUSE_LIBSDL=ON,-DwxUSE_LIBSDL=OFF,libsdl2"
74PACKAGECONFIG[webkit] = "-DwxUSE_WEBVIEW_WEBKIT=ON,-DwxUSE_WEBVIEW_WEBKIT=OFF,webkitgtk,,,no_gui"
75
Patrick Williams213cb262021-08-07 19:21:33 -050076do_compile:append() {
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050077 # 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 Williams213cb262021-08-07 19:21:33 -050094do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050095 # do not ship bindir if empty
96 rmdir --ignore-fail-on-non-empty ${D}${bindir}
97}
98
99# lib names are not canonical
100FILES_SOLIBSDEV = ""
101
Patrick Williams213cb262021-08-07 19:21:33 -0500102FILES:${PN} += " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500103 ${libdir}/libwx_*.so \
104 ${libdir}/wx/ \
105"
106
Andrew Geissler9aee5002022-03-30 16:27:02 +0000107FILES:${PN}-dev += " \
108 ${libdir}/wx/include/ \
109 ${libdir}/wx/config/ \
110"