summaryrefslogtreecommitdiffstats
path: root/recipes-webruntime/webkitforwayland/webkitforwayland_git.bb
blob: 24f6055b6499d110be352e4802c83fad871f0d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
SUMMARY = "WebKit for Wayland port pairs the WebKit engine with the Wayland display protocol, \
           allowing embedders to create simple and performant systems based on Web platform technologies. \
           It is designed with hardware acceleration in mind, relying on EGL, the Wayland EGL platform, and OpenGL ES."
HOMEPAGE = "http://www.webkitforwayland.org/"
LICENSE = "BSD & LGPLv2+"
LIC_FILES_CHKSUM = "file://Source/WebCore/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 "

# you need harfbuzz with icu enabled, you can add this to your config:
# PACKAGECONFIG_append_pn-harfbuzz = " icu" if you are having problems
# with the do_configure step and harfbuzz.
DEPENDS = "zlib enchant libsoup-2.4 curl libxml2 cairo libxslt libidn gnutls \
           gtk+3 gstreamer1.0 gstreamer1.0-plugins-base flex-native icu \
           gperf-native perl-native ruby-native sqlite3 \
           libwebp harfbuzz virtual/libgles2 wayland weston mesa"


REQUIRED_DISTRO_FEATURES = "wayland"

inherit cmake pkgconfig perlnative pythonnative

#
# We download a tarball from github instead of cloning the git repository because
# requires less resources (network bandwidth and disk space) on the build machine.
#
# PV is the release or tag version (from https://github.com/WebKitForWayland/webkit/releases)
PV = "wpe-20160519"
S = "${WORKDIR}/webkit-${PV}/"

SRC_URI = "\
   https://github.com/WebKitForWayland/webkit/archive/${PV}.tar.gz \
"

SRC_URI[md5sum] = "2b5f254c426ec74d62a72e136cf5e274"
SRC_URI[sha256sum] = "f4f5076b2f7e17e86976bb14dffc750b446392b1e68946eea9dd0d733ec5f5f2"

EXTRA_OECMAKE = " \
                 -DPORT=WPE \
                 -DCMAKE_BUILD_TYPE=Release \
                "

# Javascript JIT is not supported on powerpc
EXTRA_OECMAKE_append_powerpc = " -DENABLE_JIT=OFF "
EXTRA_OECMAKE_append_powerpc64 = " -DENABLE_JIT=OFF "

# ARM JIT code does not build on ARMv5/6 anymore, apparently they test only on v7 onwards
EXTRA_OECMAKE_append_armv5 = " -DENABLE_JIT=OFF "
EXTRA_OECMAKE_append_armv6 = " -DENABLE_JIT=OFF "

# binutils 2.25.1 has a bug on aarch64:
# https://sourceware.org/bugzilla/show_bug.cgi?id=18430
EXTRA_OECMAKE_append_aarch64 = " -DUSE_LD_GOLD=OFF "

# JIT not supported on MIPS either
EXTRA_OECMAKE_append_mips = " -DENABLE_JIT=OFF "
EXTRA_OECMAKE_append_mips64 = " -DENABLE_JIT=OFF "

# We manually set the includes files for the binary and dev package here,
# (overriding the default settings) because some libraries (libWPE and
# libWPEWebInspectorResources) are not versioned, so we must include
# the .so file in the binary package instead of the dev one.
FILES_${PN}-dev = " \
${includedir} \
${libdir}/libWPE.so \
${libdir}/libWPEWebKit.so \
${libdir}/pkgconfig \
"
FILES_${PN} = " \
${bindir} \
${libdir}/libWPE.so.* \
${libdir}/libWPEWebInspectorResources.so \
${libdir}/libWPEWebKit.so.* \
"

RRECOMMENDS_${PN} += "ca-certificates"
int logmask = DEFAULT_LOGMASK | MINIMAL_LOGMASK; void (*verbose_observer)(int loglevel, const char *file, int line, const char *function, const char *fmt, va_list args); #define CROP_LOGLEVEL(x) \ ((x) < Log_Level_Emergency ? Log_Level_Emergency \ : (x) > Log_Level_Debug ? Log_Level_Debug : (x)) #if defined(VERBOSE_WITH_SYSLOG) #include <syslog.h> static void _vverbose_(int loglevel, const char *file, int line, const char *function, const char *fmt, va_list args) { char *p; if (file == NULL || vasprintf(&p, fmt, args) < 0) vsyslog(loglevel, fmt, args); else { syslog(CROP_LOGLEVEL(loglevel), "%s [%s:%d, %s]", p, file, line, function?:"?"); free(p); } } void verbose_set_name(const char *name, int authority) { openlog(name, LOG_PERROR, authority ? LOG_AUTH : LOG_USER); } #elif defined(VERBOSE_WITH_SYSTEMD) #define SD_JOURNAL_SUPPRESS_LOCATION #include <systemd/sd-journal.h> static const char *appname; static int appauthority; static void _vverbose_(int loglevel, const char *file, int line, const char *function, const char *fmt, va_list args) { char lino[20]; if (file == NULL) { sd_journal_printv(loglevel, fmt, args); } else { sprintf(lino, "%d", line); sd_journal_printv_with_location(loglevel, file, lino, function, fmt, args); } } void verbose_set_name(const char *name, int authority) { appname = name; appauthority = authority; } #else #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/uio.h> #include <pthread.h> static const char *appname; static int appauthority; static const char *prefixes[] = { "<0> EMERGENCY", "<1> ALERT", "<2> CRITICAL", "<3> ERROR", "<4> WARNING", "<5> NOTICE", "<6> INFO", "<7> DEBUG" }; static int tty; static const char chars[] = { '\n', '?', ':', ' ', '[', ',', ']' }; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static void _vverbose_(int loglevel, const char *file, int line, const char *function, const char *fmt, va_list args) { char buffer[4000]; char lino[40]; int saverr, n, rc; struct iovec iov[20]; /* save errno */ saverr = errno; /* check if tty (2) or not (1) */ if (!tty) tty = 1 + isatty(STDERR_FILENO); /* prefix */ iov[0].iov_base = (void*)prefixes[CROP_LOGLEVEL(loglevel)] + (tty - 1 ? 4 : 0); iov[0].iov_len = strlen(iov[0].iov_base); /* " " */ iov[1].iov_base = (void*)&chars[2]; iov[1].iov_len = 2; n = 2; if (fmt) { iov[n].iov_base = buffer; errno = saverr; rc = vsnprintf(buffer, sizeof buffer, fmt, args); if (rc < 0) rc = 0; else if ((size_t)rc > sizeof buffer) { /* if too long, ellipsis the end with ... */ rc = (int)sizeof buffer; buffer[rc - 1] = buffer[rc - 2] = buffer[rc - 3] = '.'; } iov[n++].iov_len = (size_t)rc; } if (file && (!fmt || tty == 1 || loglevel <= Log_Level_Warning)) { /* "[" (!fmt) or " [" (fmt) */ iov[n].iov_base = (void*)&chars[3 + !fmt]; iov[n++].iov_len = 2 - !fmt; /* file */ iov[n].iov_base = (void*)file; iov[n++].iov_len = strlen(file); /* ":" */ iov[n].iov_base = (void*)&chars[2]; iov[n++].iov_len = 1; if (line) { /* line number */ iov[n].iov_base = lino; iov[n++].iov_len = snprintf(lino, sizeof lino, "%d", line); } else { /* "?" */ iov[n].iov_base = (void*)&chars[1]; iov[n++].iov_len = 1; } /* "," */ iov[n].iov_base = (void*)&chars[5]; iov[n++].iov_len = 1; if (function) { /* function name */ iov[n].iov_base = (void*)function; iov[n++].iov_len = strlen(function); } else { /* "?" */ iov[n].iov_base = (void*)&chars[1]; iov[n++].iov_len = 1; } iov[n].iov_base = (void*)&chars[6]; iov[n++].iov_len = 1; } if (n == 2) { /* "?" */ iov[n].iov_base = (void*)&chars[1]; iov[n++].iov_len = 1; } /* "\n" */ iov[n].iov_base = (void*)&chars[0]; iov[n++].iov_len = 1; /* emit the message */ pthread_mutex_lock(&mutex); writev(STDERR_FILENO, iov, n); pthread_mutex_unlock(&mutex); /* restore errno */ errno = saverr; } void verbose_set_name(const char *name, int authority) { appname = name; appauthority = authority; } #endif void vverbose(int loglevel, const char *file, int line, const char *function, const char *fmt, va_list args) { void (*observer)(int loglevel, const char *file, int line, const char *function, const char *fmt, va_list args) = verbose_observer; if (!observer) _vverbose_(loglevel, file, line, function, fmt, args); else { va_list ap; va_copy(ap, args); _vverbose_(loglevel, file, line, function, fmt, args); observer(loglevel, file, line, function, fmt, ap); va_end(ap); } } void verbose(int loglevel, const char *file, int line, const char *function, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vverbose(loglevel, file, line, function, fmt, ap); va_end(ap); } void set_logmask(int lvl) { logmask = lvl | MINIMAL_LOGMASK; } void verbose_add(int level) { set_logmask(logmask | MASKOF(level)); } void verbose_sub(int level) { set_logmask(logmask & ~MASKOF(level)); } void verbose_clear() { set_logmask(0); } void verbose_dec() { verbosity_set(verbosity_get() - 1); } void verbose_inc() { verbosity_set(verbosity_get() + 1); } int verbosity_to_mask(int verbo) { int x = verbo + Log_Level_Error; int l = CROP_LOGLEVEL(x); return (1 << (l + 1)) - 1; } int verbosity_from_mask(int mask) { int v = 0; while (mask > verbosity_to_mask(v)) v++; return v; } void verbosity_set(int verbo) { set_logmask(verbosity_to_mask(verbo)); } int verbosity_get() { return verbosity_from_mask(logmask); } int verbose_level_of_name(const char *name) { int c, i, r, l = 0, u = sizeof names / sizeof * names; while (l < u) { i = (l + u) >> 1; r = (int)asort[i]; c = strcasecmp(names[r], name); if (!c) return r; if (c < 0) l = i + 1; else u = i; } return -1; } const char *verbose_name_of_level(int level) { return level == CROP_LOGLEVEL(level) ? names[level] : NULL; }