blob: 6b57cb54cb9099c5dc4d25ee22ba3f0879ade789 [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)}
Patrick Williamsde0582f2022-04-08 10:23:27 -050013inherit lib_package binconfig pkgconfig
Andrew Geissler82c905d2020-04-13 13:39:40 -050014
15DEPENDS += " \
16 jpeg \
17 libpng \
18 tiff \
19"
20
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050021SRC_URI = " \
Patrick Williamsde0582f2022-04-08 10:23:27 -050022 gitsm://github.com/wxWidgets/wxWidgets.git;branch=master;protocol=https \
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050023 file://0001-wx-config.in-Disable-cross-magic-it-does-not-work-fo.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000024 file://fix-libdir-for-multilib.patch \
25 file://respect-DESTDIR-when-create-link.patch \
Patrick Williams45852732022-04-02 08:58:32 -050026 file://not-append-system-name-to-lib-name.patch \
Patrick Williams58776372022-04-13 09:07:35 -050027 file://wx-config-fix-libdir-for-multilib.patch \
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050028"
Patrick Williams45852732022-04-02 08:58:32 -050029SRCREV= "9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1"
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 += " \
Patrick Williams45852732022-04-02 08:58:32 -050036 -DwxUSE_GLCANVAS_EGL=OFF \
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 -DwxUSE_LIBJPEG=sys \
38 -DwxUSE_LIBPNG=sys \
39 -DwxUSE_LIBTIFF=sys \
40 -DwxUSE_REGEX=builtin \
Andrew Geissler9aee5002022-03-30 16:27:02 +000041 -DwxPLATFORM_LIB_DIR=${@d.getVar('baselib').replace('lib', '')} \
Andrew Geissler82c905d2020-04-13 13:39:40 -050042"
Patrick Williams213cb262021-08-07 19:21:33 -050043EXTRA_OECMAKE:append:libc-musl = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050044 -DHAVE_LOCALE_T=OFF \
45"
Patrick Williams58776372022-04-13 09:07:35 -050046EXTRA_OECMAKE:append:class-target = ' -DEGREP="/bin/grep -E"'
Andrew Geissler82c905d2020-04-13 13:39:40 -050047
Patrick Williams58776372022-04-13 09:07:35 -050048# OpenGL support currently seems tied to using libglu, which requires x11
49PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', 'x11 wayland', 'gtk', 'no_gui', d)} \
50 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)} \
Patrick Williamsde0582f2022-04-08 10:23:27 -050051"
52
Patrick Williams45852732022-04-02 08:58:32 -050053PACKAGECONFIG:remove:class-native = "opengl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050054
55# Note on toolkit-PACKAGECONFIGs: select exactly one of 'no_gui' / 'gtk' / 'qt'
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050056PACKAGECONFIG[no_gui] = "-DwxUSE_GUI=OFF,,,,,qt gtk opengl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050057PACKAGECONFIG[gtk] = "-DwxBUILD_TOOLKIT=gtk3 -DwxUSE_GUI=ON,,gtk+3,,,no_gui qt"
58PACKAGECONFIG[qt] = "-DwxBUILD_TOOLKIT=qt -DwxUSE_GUI=ON,,qtbase,,,no_gui gtk"
59python () {
60 pkgconfig = d.getVar('PACKAGECONFIG')
61 if (not 'no_gui' in pkgconfig) and (not 'gtk' in pkgconfig) and (not 'qt' in pkgconfig):
62 bb.error("PACKAGECONFIG must select a toolkit. Add one of no_gui / gtk / qt!")
63}
64
65# Notes on other PACKAGECONFIGs:
66# * 'no_gui' overrides some configs below so they are marked as conflicting
67# with 'no_gui' to avoid surprises
68# * qt+gstreamer is broken due to incorrect references on glib-2.0 -> mark
69# as conflicting
70# * wxUSE_LIBGNOMEVFS is for gtk2 (see init.cmake) which we don't support
71# -> no gvfs PACKAGECONFIG
72# * libmspack is in meta-security
73PACKAGECONFIG[gstreamer] = "-DwxUSE_MEDIACTRL=ON,-DwxUSE_MEDIACTRL=OFF,gstreamer1.0-plugins-base,,,no_gui qt"
74PACKAGECONFIG[libsecret] = "-DwxUSE_SECRETSTORE=ON,-DwxUSE_SECRETSTORE=OFF,libsecret,,,no_gui"
75PACKAGECONFIG[lzma] = "-DwxUSE_LIBLZMA=ON,-DwxUSE_LIBLZMA=OFF,xz"
76PACKAGECONFIG[mspack] = "-DwxUSE_LIBMSPACK=ON,-DwxUSE_LIBMSPACK=OFF,libmspack"
Patrick Williams45852732022-04-02 08:58:32 -050077PACKAGECONFIG[opengl] = "-DwxUSE_OPENGL=ON,-DwxUSE_OPENGL=OFF,libglu"
Andrew Geissler82c905d2020-04-13 13:39:40 -050078PACKAGECONFIG[sdl_audio] = "-DwxUSE_LIBSDL=ON,-DwxUSE_LIBSDL=OFF,libsdl2"
79PACKAGECONFIG[webkit] = "-DwxUSE_WEBVIEW_WEBKIT=ON,-DwxUSE_WEBVIEW_WEBKIT=OFF,webkitgtk,,,no_gui"
Patrick Williams45852732022-04-02 08:58:32 -050080PACKAGECONFIG[curl] = "-DwxUSE_WEBREQUEST_CURL=ON,-DwxUSE_WEBREQUEST_CURL=OFF,curl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050081
Patrick Williams213cb262021-08-07 19:21:33 -050082do_compile:append() {
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050083 # if not at re-compile
84 if [ -L ${B}/wx-config ]; then
85 # ${B}/wx-config is a symlink for build and not needed after compile
86 # So for our purposes do:
87 # 1. make a file out of wx-config so that binconfig.bbclass detects it
88 # 2. make sure we do not move the file used for compiling into sysroot
89 cp --remove-destination `readlink ${B}/wx-config | sed 's:inplace-::'` ${B}/wx-config
90 fi
91 # 3. Set full sysroot paths so sstate can translate them when setting
92 # up wxwidgets's consumer sysroots
93 sed -i \
94 -e 's,^includedir=.*,includedir="${STAGING_INCDIR}",g' \
95 -e 's,^libdir=.*",libdir="${STAGING_LIBDIR}",g' \
96 -e 's,^bindir=.*",bindir="${STAGING_BINDIR}",g' \
97 ${B}/wx-config
98}
99
Patrick Williams213cb262021-08-07 19:21:33 -0500100do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500101 # do not ship bindir if empty
102 rmdir --ignore-fail-on-non-empty ${D}${bindir}
103}
104
105# lib names are not canonical
106FILES_SOLIBSDEV = ""
107
Patrick Williams213cb262021-08-07 19:21:33 -0500108FILES:${PN} += " \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500109 ${libdir}/libwx_*.so \
110 ${libdir}/wx/ \
111"
112
Andrew Geissler9aee5002022-03-30 16:27:02 +0000113FILES:${PN}-dev += " \
114 ${libdir}/wx/include/ \
115 ${libdir}/wx/config/ \
116"
Patrick Williams45852732022-04-02 08:58:32 -0500117
Patrick Williams58776372022-04-13 09:07:35 -0500118RDEPENDS:${PN}-dev += "grep"
119
Patrick Williams45852732022-04-02 08:58:32 -0500120BBCLASSEXTEND = "native"