blob: f1e87ba220e5e17a49caa2fd3dfff1e454eedb68 [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 Geisslerbbbd5f42020-10-30 15:42:48 -050013inherit features_check lib_package binconfig
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 = " \
25 git://github.com/wxWidgets/wxWidgets.git \
26 file://0001-wx-config.in-Disable-cross-magic-it-does-not-work-fo.patch \
27"
28PV = "3.1.4"
29SRCREV= "6cdaedd42ba59331b3dc4ead50e0bac76ae14c19"
Andrew Geissler82c905d2020-04-13 13:39:40 -050030S = "${WORKDIR}/git"
31
32# These can be either 'builtin' or 'sys' and builtin means cloned soures are
33# build. So these cannot be PACKAGECONFIGs and let's use libs where we can (see
34# DEPENDS)
35EXTRA_OECMAKE += " \
36 -DwxUSE_LIBJPEG=sys \
37 -DwxUSE_LIBPNG=sys \
38 -DwxUSE_LIBTIFF=sys \
39 -DwxUSE_REGEX=builtin \
40"
Patrick Williams213cb262021-08-07 19:21:33 -050041EXTRA_OECMAKE:append:libc-musl = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050042 -DHAVE_LOCALE_T=OFF \
43"
44
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050045PACKAGECONFIG ?= "gtk ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050046
47# Note on toolkit-PACKAGECONFIGs: select exactly one of 'no_gui' / 'gtk' / 'qt'
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050048PACKAGECONFIG[no_gui] = "-DwxUSE_GUI=OFF,,,,,qt gtk opengl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050049PACKAGECONFIG[gtk] = "-DwxBUILD_TOOLKIT=gtk3 -DwxUSE_GUI=ON,,gtk+3,,,no_gui qt"
50PACKAGECONFIG[qt] = "-DwxBUILD_TOOLKIT=qt -DwxUSE_GUI=ON,,qtbase,,,no_gui gtk"
51python () {
52 pkgconfig = d.getVar('PACKAGECONFIG')
53 if (not 'no_gui' in pkgconfig) and (not 'gtk' in pkgconfig) and (not 'qt' in pkgconfig):
54 bb.error("PACKAGECONFIG must select a toolkit. Add one of no_gui / gtk / qt!")
55}
56
57# Notes on other PACKAGECONFIGs:
58# * 'no_gui' overrides some configs below so they are marked as conflicting
59# with 'no_gui' to avoid surprises
60# * qt+gstreamer is broken due to incorrect references on glib-2.0 -> mark
61# as conflicting
62# * wxUSE_LIBGNOMEVFS is for gtk2 (see init.cmake) which we don't support
63# -> no gvfs PACKAGECONFIG
64# * libmspack is in meta-security
65PACKAGECONFIG[gstreamer] = "-DwxUSE_MEDIACTRL=ON,-DwxUSE_MEDIACTRL=OFF,gstreamer1.0-plugins-base,,,no_gui qt"
66PACKAGECONFIG[libsecret] = "-DwxUSE_SECRETSTORE=ON,-DwxUSE_SECRETSTORE=OFF,libsecret,,,no_gui"
67PACKAGECONFIG[lzma] = "-DwxUSE_LIBLZMA=ON,-DwxUSE_LIBLZMA=OFF,xz"
68PACKAGECONFIG[mspack] = "-DwxUSE_LIBMSPACK=ON,-DwxUSE_LIBMSPACK=OFF,libmspack"
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050069PACKAGECONFIG[opengl] = ",,libglu"
Andrew Geissler82c905d2020-04-13 13:39:40 -050070PACKAGECONFIG[sdl_audio] = "-DwxUSE_LIBSDL=ON,-DwxUSE_LIBSDL=OFF,libsdl2"
71PACKAGECONFIG[webkit] = "-DwxUSE_WEBVIEW_WEBKIT=ON,-DwxUSE_WEBVIEW_WEBKIT=OFF,webkitgtk,,,no_gui"
72
Patrick Williams213cb262021-08-07 19:21:33 -050073do_compile:append() {
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050074 # if not at re-compile
75 if [ -L ${B}/wx-config ]; then
76 # ${B}/wx-config is a symlink for build and not needed after compile
77 # So for our purposes do:
78 # 1. make a file out of wx-config so that binconfig.bbclass detects it
79 # 2. make sure we do not move the file used for compiling into sysroot
80 cp --remove-destination `readlink ${B}/wx-config | sed 's:inplace-::'` ${B}/wx-config
81 fi
82 # 3. Set full sysroot paths so sstate can translate them when setting
83 # up wxwidgets's consumer sysroots
84 sed -i \
85 -e 's,^includedir=.*,includedir="${STAGING_INCDIR}",g' \
86 -e 's,^libdir=.*",libdir="${STAGING_LIBDIR}",g' \
87 -e 's,^bindir=.*",bindir="${STAGING_BINDIR}",g' \
88 ${B}/wx-config
89}
90
Patrick Williams213cb262021-08-07 19:21:33 -050091do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050092 # do not ship bindir if empty
93 rmdir --ignore-fail-on-non-empty ${D}${bindir}
94}
95
96# lib names are not canonical
97FILES_SOLIBSDEV = ""
98
Patrick Williams213cb262021-08-07 19:21:33 -050099FILES:${PN} += " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500100 ${libdir}/libwx_*.so \
101 ${libdir}/wx/ \
102"
103
Patrick Williams213cb262021-08-07 19:21:33 -0500104FILES:${PN}-dev += "${libdir}/wx/include/"