blob: 39b6a2bc7c2108e54ab867735ae5d822b346ff25 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "Cross-Plattform GUI Library"
2DESCRIPTION = "wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls."
3HOMEPAGE = "https://www.wxwidgets.org/"
4BUGTRACKER = "https://trac.wxwidgets.org/"
5
6# WXwindows 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 = "WXwindows"
10LIC_FILES_CHKSUM = "file://docs/licence.txt;md5=981f50a934828620b08f44d75db557c6"
11
12inherit ${@bb.utils.contains('PACKAGECONFIG', 'qt', 'cmake_qt5', 'cmake', d)}
13inherit lib_package binconfig pkgconfig
14
15DEPENDS += " \
16 jpeg \
17 libpng \
18 tiff \
19"
20
21SRC_URI = "gitsm://github.com/wxWidgets/wxWidgets.git;branch=3.2;protocol=https \
22 file://0001-wx-config.in-Disable-cross-magic-it-does-not-work-fo.patch \
23 file://fix-libdir-for-multilib.patch \
24 file://create-links-with-relative-path.patch \
25 file://not-append-system-name-to-lib-name.patch \
26 file://wx-config-fix-libdir-for-multilib.patch \
27 file://0001-locale-Avoid-using-glibc-specific-defines-on-musl.patch \
28 file://musl-locale-l.patch \
29 file://0001-Set-HAVE_LARGEFILE_SUPPORT-to-1-explicitly.patch \
30 "
31SRCREV= "97e99707c5d2271a70cb686720b48dbf34ced496"
32S = "${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_GLCANVAS_EGL=OFF \
39 -DwxUSE_LIBJPEG=sys \
40 -DwxUSE_LIBPNG=sys \
41 -DwxUSE_LIBTIFF=sys \
42 -DwxUSE_REGEX=builtin \
43"
44EXTRA_OECMAKE:append:class-target = ' -DEGREP="/bin/grep -E"'
45
46# OpenGL support currently seems tied to using libglu, which requires x11
47PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', 'x11 wayland', 'gtk', 'no_gui', d)} \
48 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)} \
49"
50
51PACKAGECONFIG:remove:class-native = "opengl"
52
53# Note on toolkit-PACKAGECONFIGs: select exactly one of 'no_gui' / 'gtk' / 'qt'
54PACKAGECONFIG[no_gui] = "-DwxUSE_GUI=OFF,,,,,qt gtk opengl"
55PACKAGECONFIG[gtk] = "-DwxBUILD_TOOLKIT=gtk3 -DwxUSE_GUI=ON -DwxUSE_PRIVATE_FONTS=ON,,gtk+3,,,no_gui qt"
56PACKAGECONFIG[qt] = "-DwxBUILD_TOOLKIT=qt -DwxUSE_GUI=ON,,qtbase,,,no_gui gtk"
57python () {
58 pkgconfig = d.getVar('PACKAGECONFIG')
59 if (not 'no_gui' in pkgconfig) and (not 'gtk' in pkgconfig) and (not 'qt' in pkgconfig):
60 bb.error("PACKAGECONFIG must select a toolkit. Add one of no_gui / gtk / qt!")
61}
62
63# Notes on other PACKAGECONFIGs:
64# * 'no_gui' overrides some configs below so they are marked as conflicting
65# with 'no_gui' to avoid surprises
66# * qt+gstreamer is broken due to incorrect references on glib-2.0 -> mark
67# as conflicting
68# * wxUSE_LIBGNOMEVFS is for gtk2 (see init.cmake) which we don't support
69# -> no gvfs PACKAGECONFIG
70# * libmspack is in meta-security
71PACKAGECONFIG[gstreamer] = "-DwxUSE_MEDIACTRL=ON,-DwxUSE_MEDIACTRL=OFF,gstreamer1.0-plugins-base,,,no_gui qt"
72PACKAGECONFIG[libsecret] = "-DwxUSE_SECRETSTORE=ON,-DwxUSE_SECRETSTORE=OFF,libsecret,,,no_gui"
73PACKAGECONFIG[lzma] = "-DwxUSE_LIBLZMA=ON,-DwxUSE_LIBLZMA=OFF,xz"
74PACKAGECONFIG[mspack] = "-DwxUSE_LIBMSPACK=ON,-DwxUSE_LIBMSPACK=OFF,libmspack"
75PACKAGECONFIG[opengl] = "-DwxUSE_OPENGL=ON,-DwxUSE_OPENGL=OFF,libglu"
76PACKAGECONFIG[sdl_audio] = "-DwxUSE_LIBSDL=ON,-DwxUSE_LIBSDL=OFF,libsdl2"
77PACKAGECONFIG[webkit] = "-DwxUSE_WEBVIEW_WEBKIT=ON,-DwxUSE_WEBVIEW_WEBKIT=OFF,webkitgtk,,,no_gui"
78PACKAGECONFIG[curl] = "-DwxUSE_WEBREQUEST_CURL=ON,-DwxUSE_WEBREQUEST_CURL=OFF,curl"
79
80# Support LFS unconditionally
81CXXFLAGS += "-D_FILE_OFFSET_BITS=64"
82
83do_compile:append() {
84 # if not at re-compile
85 if [ -L ${B}/wx-config ]; then
86 # ${B}/wx-config is a symlink for build and not needed after compile
87 # So for our purposes do:
88 # 1. make a file out of wx-config so that binconfig.bbclass detects it
89 # 2. make sure we do not move the file used for compiling into sysroot
90 cp --remove-destination `readlink ${B}/wx-config | sed 's:inplace-::'` ${B}/wx-config
91 fi
92 # 3. Set full sysroot paths so sstate can translate them when setting
93 # up wxwidgets's consumer sysroots
94 sed -i \
95 -e 's,^includedir=.*,includedir="${STAGING_INCDIR}",g' \
96 -e 's,^libdir=.*",libdir="${STAGING_LIBDIR}",g' \
97 -e 's,^bindir=.*",bindir="${STAGING_BINDIR}",g' \
98 ${B}/wx-config
99}
100
101do_install:append() {
102 # do not ship bindir if empty
103 rmdir --ignore-fail-on-non-empty ${D}${bindir}
104
105 # fix host contamination
106 sed -i -e "s#${STAGING_DIR_NATIVE}##g" \
107 -e "s#${STAGING_DIR_TARGET}##g" \
108 ${D}${libdir}/wx/config/*-unicode-3.2 \
109 ${D}${libdir}/cmake/wxWidgets/wxWidgetsTargets.cmake
110}
111
112FILES:${PN} += " \
113 ${libdir}/wx/ \
114"
115
116FILES:${PN}-dev += " \
117 ${libdir}/wx/include/ \
118 ${libdir}/wx/config/ \
119"
120
121RDEPENDS:${PN}-dev += "grep"
122
123BBCLASSEXTEND = "native"