blob: f9349b02abf7f71088ba695444fa94f8eb146b1c [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
Patrick Williams45852732022-04-02 08:58:32 -05006# WXwindows licence is a modified version of LGPL explicitly allowing not
Andrew Geissler82c905d2020-04-13 13:39:40 -05007# distributing the sources of an application using the library even in the
8# case of static linking.
Patrick Williams45852732022-04-02 08:58:32 -05009LICENSE = "WXwindows"
Andrew Geissler82c905d2020-04-13 13:39:40 -050010LIC_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 \
Patrick Williams45852732022-04-02 08:58:32 -050029 file://not-append-system-name-to-lib-name.patch \
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050030"
Patrick Williams45852732022-04-02 08:58:32 -050031SRCREV= "9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1"
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 += " \
Patrick Williams45852732022-04-02 08:58:32 -050038 -DwxUSE_GLCANVAS_EGL=OFF \
Andrew Geissler82c905d2020-04-13 13:39:40 -050039 -DwxUSE_LIBJPEG=sys \
40 -DwxUSE_LIBPNG=sys \
41 -DwxUSE_LIBTIFF=sys \
42 -DwxUSE_REGEX=builtin \
Andrew Geissler9aee5002022-03-30 16:27:02 +000043 -DwxPLATFORM_LIB_DIR=${@d.getVar('baselib').replace('lib', '')} \
Andrew Geissler82c905d2020-04-13 13:39:40 -050044"
Patrick Williams213cb262021-08-07 19:21:33 -050045EXTRA_OECMAKE:append:libc-musl = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050046 -DHAVE_LOCALE_T=OFF \
47"
48
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050049PACKAGECONFIG ?= "gtk ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
Patrick Williams45852732022-04-02 08:58:32 -050050PACKAGECONFIG:remove:class-native = "opengl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050051
52# Note on toolkit-PACKAGECONFIGs: select exactly one of 'no_gui' / 'gtk' / 'qt'
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050053PACKAGECONFIG[no_gui] = "-DwxUSE_GUI=OFF,,,,,qt gtk opengl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050054PACKAGECONFIG[gtk] = "-DwxBUILD_TOOLKIT=gtk3 -DwxUSE_GUI=ON,,gtk+3,,,no_gui qt"
55PACKAGECONFIG[qt] = "-DwxBUILD_TOOLKIT=qt -DwxUSE_GUI=ON,,qtbase,,,no_gui gtk"
56python () {
57 pkgconfig = d.getVar('PACKAGECONFIG')
58 if (not 'no_gui' in pkgconfig) and (not 'gtk' in pkgconfig) and (not 'qt' in pkgconfig):
59 bb.error("PACKAGECONFIG must select a toolkit. Add one of no_gui / gtk / qt!")
60}
61
62# Notes on other PACKAGECONFIGs:
63# * 'no_gui' overrides some configs below so they are marked as conflicting
64# with 'no_gui' to avoid surprises
65# * qt+gstreamer is broken due to incorrect references on glib-2.0 -> mark
66# as conflicting
67# * wxUSE_LIBGNOMEVFS is for gtk2 (see init.cmake) which we don't support
68# -> no gvfs PACKAGECONFIG
69# * libmspack is in meta-security
70PACKAGECONFIG[gstreamer] = "-DwxUSE_MEDIACTRL=ON,-DwxUSE_MEDIACTRL=OFF,gstreamer1.0-plugins-base,,,no_gui qt"
71PACKAGECONFIG[libsecret] = "-DwxUSE_SECRETSTORE=ON,-DwxUSE_SECRETSTORE=OFF,libsecret,,,no_gui"
72PACKAGECONFIG[lzma] = "-DwxUSE_LIBLZMA=ON,-DwxUSE_LIBLZMA=OFF,xz"
73PACKAGECONFIG[mspack] = "-DwxUSE_LIBMSPACK=ON,-DwxUSE_LIBMSPACK=OFF,libmspack"
Patrick Williams45852732022-04-02 08:58:32 -050074PACKAGECONFIG[opengl] = "-DwxUSE_OPENGL=ON,-DwxUSE_OPENGL=OFF,libglu"
Andrew Geissler82c905d2020-04-13 13:39:40 -050075PACKAGECONFIG[sdl_audio] = "-DwxUSE_LIBSDL=ON,-DwxUSE_LIBSDL=OFF,libsdl2"
76PACKAGECONFIG[webkit] = "-DwxUSE_WEBVIEW_WEBKIT=ON,-DwxUSE_WEBVIEW_WEBKIT=OFF,webkitgtk,,,no_gui"
Patrick Williams45852732022-04-02 08:58:32 -050077PACKAGECONFIG[curl] = "-DwxUSE_WEBREQUEST_CURL=ON,-DwxUSE_WEBREQUEST_CURL=OFF,curl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050078
Patrick Williams213cb262021-08-07 19:21:33 -050079do_compile:append() {
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050080 # if not at re-compile
81 if [ -L ${B}/wx-config ]; then
82 # ${B}/wx-config is a symlink for build and not needed after compile
83 # So for our purposes do:
84 # 1. make a file out of wx-config so that binconfig.bbclass detects it
85 # 2. make sure we do not move the file used for compiling into sysroot
86 cp --remove-destination `readlink ${B}/wx-config | sed 's:inplace-::'` ${B}/wx-config
87 fi
88 # 3. Set full sysroot paths so sstate can translate them when setting
89 # up wxwidgets's consumer sysroots
90 sed -i \
91 -e 's,^includedir=.*,includedir="${STAGING_INCDIR}",g' \
92 -e 's,^libdir=.*",libdir="${STAGING_LIBDIR}",g' \
93 -e 's,^bindir=.*",bindir="${STAGING_BINDIR}",g' \
94 ${B}/wx-config
95}
96
Patrick Williams213cb262021-08-07 19:21:33 -050097do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050098 # do not ship bindir if empty
99 rmdir --ignore-fail-on-non-empty ${D}${bindir}
100}
101
102# lib names are not canonical
103FILES_SOLIBSDEV = ""
104
Patrick Williams213cb262021-08-07 19:21:33 -0500105FILES:${PN} += " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500106 ${libdir}/libwx_*.so \
107 ${libdir}/wx/ \
108"
109
Andrew Geissler9aee5002022-03-30 16:27:02 +0000110FILES:${PN}-dev += " \
111 ${libdir}/wx/include/ \
112 ${libdir}/wx/config/ \
113"
Patrick Williams45852732022-04-02 08:58:32 -0500114
115BBCLASSEXTEND = "native"