Commit 5949a80b authored by sbalikondwar's avatar sbalikondwar Committed by Commit Bot

Add Weston to third_party.

This CL brings Weston to third_party. Weston is a reference Wayland
compositor that we are going to use as part of our ozone/Wayland effort.
To ensure rich and stable functionality, we need to run all the
available test suites with the Wayland backend natively.
Currently, the bot we use (linux-ozone-rel) runs X11 by default and is
not capable of running Wayland.

To be able to build weston within Chromium infrastructure, it
was migrated from meson to GN. It didn't make sense to migrate
everything, and, thus, I migrated only those bits that we need
to run tests with Weston successfully.

Bug: 1029241
Change-Id: I9a19eba26fae172c3f7f5d4be78d07042bc5c5c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962128
Commit-Queue: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Reviewed-by: default avatarDarin Fisher <darin@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741079}
parent 29d4c827
...@@ -1448,6 +1448,11 @@ deps = { ...@@ -1448,6 +1448,11 @@ deps = {
'src/third_party/wuffs/src': 'src/third_party/wuffs/src':
Var('skia_git') + '/external/github.com/google/wuffs.git' + '@' + Var('wuffs_revision'), Var('skia_git') + '/external/github.com/google/wuffs.git' + '@' + Var('wuffs_revision'),
'src/third_party/weston/src': {
'url': Var('chromium_git') + '/external/anongit.freedesktop.org/git/wayland/weston.git' + '@' + 'db905f467169f9f131c5ddc6038296f866d5daeb',
'condition': 'checkout_linux',
},
'src/third_party/xdg-utils': { 'src/third_party/xdg-utils': {
'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
'condition': 'checkout_linux', 'condition': 'checkout_linux',
......
...@@ -8,6 +8,14 @@ wayland_protocol("gtk_primary_selection_protocol") { ...@@ -8,6 +8,14 @@ wayland_protocol("gtk_primary_selection_protocol") {
sources = [ "unstable/gtk-primary-selection/gtk-primary-selection.xml" ] sources = [ "unstable/gtk-primary-selection/gtk-primary-selection.xml" ]
} }
wayland_protocol("input_method_protocol") {
sources = [ "src/unstable/input-method/input-method-unstable-v1.xml" ]
}
wayland_protocol("xdg_output_protocol") {
sources = [ "src/unstable/xdg-output/xdg-output-unstable-v1.xml" ]
}
wayland_protocol("xdg_shell_protocol") { wayland_protocol("xdg_shell_protocol") {
sources = [ sources = [
"src/stable/xdg-shell/xdg-shell.xml", "src/stable/xdg-shell/xdg-shell.xml",
......
This diff is collapsed.
Copyright © 2008-2012 Kristian Høgsberg
Copyright © 2010-2012 Intel Corporation
Copyright © 2010-2011 Benjamin Franzke
Copyright © 2011-2012 Collabora, Ltd.
Copyright © 2010 Red Hat <mjg@redhat.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
---
The above is the version of the MIT "Expat" License used by X.org:
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
msisov@igalia.com
thomasanderson@chromium.org
rjkroege@chromium.org
Name: Weston - reference Wayland compositor
Short Name: Weston
URL: https://gitlab.freedesktop.org/wayland/weston
Version: 6.0.91
License: MIT "Expat"
License File: LICENSE
Security Critical: no
Source: https://gitlab.freedesktop.org/wayland/weston
--[ DESCRIPTION ] ------------------
This contains the source to the reference Wayland compositor called Weston.
The LICENSE file is copied from src/COPYING
This code is only for running tests of Chromium for Wayland and is not compiled
into Chrome
--[ UPDATING ] -----------------
To update, change the commit hash with the most recent hash as mentioned on
the official repo inside the DEPS file.
You need to have clang (//third_party/llvm-build/Release+Asserts/bin),
and meson (https://github.com/mesonbuild/meson/releases) in your path.
Then do gclient sync which will align your local Weston folder with the most
recent one as mentioned in the hash. Then run the generate_configs.py script
to generate and update necessary config files. To compile weston, pass the
following GN arguments while generating build files, since gn gen is meant
to generate ninja files not gn ones.
use_ozone = true use_bundled_weston = true
Finally, compile-test the Weston target.
Steps to be followed:
gclient sync
python3 third_party/weston/generate_configs.py
autoninja out/build_dir weston
To update the weston to the version present upstream, change the commit hash
inside url in the 'src/third_party/weston/src' field with the most recent one in
DEPS file. Then follow the above steps to compile the updated weston.
\ No newline at end of file
/*
* Autogenerated by the Meson build system.
* Do not edit, your changes will be lost.
*/
#pragma once
#define BUILD_FBDEV_COMPOSITOR 1
#define BUILD_HEADLESS_COMPOSITOR 1
#define BUILD_WAYLAND_COMPOSITOR 1
#define BUILD_X11_COMPOSITOR 1
#define ENABLE_EGL 1
#define ENABLE_JUNIT_XML 1
#define HAVE_INITGROUPS 1
#define HAVE_LIBDRM_INTEL 1
#define HAVE_LINUX_SYNC_FILE_H 1
#define HAVE_MKOSTEMP 1
#define HAVE_PANGO 1
#define HAVE_POSIX_FALLOCATE 1
#define HAVE_STRCHRNUL 1
#define HAVE_XCB_XKB 1
#define HAVE_XKBCOMMON_COMPOSE 1
#define MAJOR_IN_SYSMACROS 1
#define PACKAGE_BUGREPORT \
"https://gitlab.freedesktop.org/wayland/weston/issues/"
#define PACKAGE_STRING "weston 6.0.91"
#define PACKAGE_URL "https://wayland.freedesktop.org"
#define PACKAGE_VERSION "6.0.91"
#define USE_RESIZE_POOL 1
#define VERSION "6.0.91"
#define WESTON_NATIVE_BACKEND "wayland-backend.so"
#define WESTON_SHELL_CLIENT "weston-desktop-shell"
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
__attribute__((visibility("default"))) int main(int argc, char* argv[]);
#!/usr/bin/python
#
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Creates config files for building Weston."""
from __future__ import print_function
import os
import re
import shutil
import subprocess
import sys
import tempfile
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
CHROMIUM_ROOT_DIR = os.path.abspath(os.path.join(BASE_DIR, '..', '..'))
sys.path.append(os.path.join(CHROMIUM_ROOT_DIR, 'build'))
import gn_helpers
MESON = ['meson']
DEFAULT_BUILD_ARGS = [
'-Dbuild_tests=false',
'--buildtype', 'release',
'-Dbackend-drm-screencast-vaapi=false',
'-Dbackend-rdp=false',
'-Dxwayland=false',
'-Dcolor-management-lcms=false',
'-Dpipewire=false',
'-Dcolor-management-colord=false',
'-Dremoting=false',
'-Dsimple-dmabuf-drm=auto',
'-Dshell-ivi=false',
'-Ddemo-clients=false',
'-Dsimple-clients=egl',
'-Dlauncher-logind=false',
'-Dweston-launch=false',
'-Dscreenshare=false',
'-Dsystemd=false',
'-Dimage-jpeg=false',
'-Dimage-webp=false',
'-Dbackend-drm=false',
'-Dbackend-default=wayland'
]
def PrintAndCheckCall(argv, *args, **kwargs):
print('\n-------------------------------------------------\nRunning %s' %
' '.join(argv))
c = subprocess.check_call(argv, *args, **kwargs)
def RewriteFile(path, search_replace):
with open(path) as f:
contents = f.read()
with open(path, 'w') as f:
for search, replace in search_replace:
contents = re.sub(search, replace, contents)
# Cleanup trailing newlines.
f.write(contents.strip() + '\n')
def AddAttributeInConfig(path):
with open(path) as f:
contents = f.read()
with open(path, 'w') as f:
f.write(contents.strip() + '\n')
f.write('\n' + '__attribute__((visibility("default"))) int main(int argc, char* argv[]);' + '\n')
def CopyConfigsAndCleanup(config_dir, dest_dir):
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
shutil.copy(os.path.join(config_dir, 'config.h'), dest_dir)
shutil.rmtree(config_dir)
def RewriteGitFile(path, data):
with open(path, 'w') as f:
contents = data
# Cleanup trailing newlines.
f.write(contents.strip() + '\n')
def CopyGitConfigsAndCleanup(config_dir, dest_dir):
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
shutil.copy(os.path.join(config_dir, 'git-version.h'), dest_dir)
shutil.rmtree(config_dir)
def GenerateGitConfig(config_dir, env, special_args=[]):
temp_dir = tempfile.mkdtemp()
PrintAndCheckCall(
MESON + DEFAULT_BUILD_ARGS + special_args + [temp_dir],
cwd='src',
env=env)
label = subprocess.check_output(["git", "describe", "--always"]).strip()
label = label.decode("utf-8")
RewriteGitFile(
os.path.join(temp_dir, 'git-version.h'),
"#define BUILD_ID \"{label}\"".format(label=label))
CopyGitConfigsAndCleanup(temp_dir, config_dir)
def GenerateConfig(config_dir, env, special_args=[]):
temp_dir = tempfile.mkdtemp()
PrintAndCheckCall(
MESON + DEFAULT_BUILD_ARGS + special_args + [temp_dir],
cwd='src',
env=env)
CopyConfigsAndCleanup(temp_dir, config_dir)
def ChangeConfigPath():
configfile = os.path.join(BASE_DIR, "config/config.h")
DIRS = ["BINDIR",
"DATADIR",
"LIBEXECDIR",
"LIBWESTON_MODULEDIR",
"MODULEDIR"]
for dir in DIRS:
pattern = "#define {dir} \"/[a-zA-Z0-9\\-_/]+\"".format(dir=dir)
RewriteFile(configfile, [(pattern, "")])
# Add attribute in config.h to suppress all undefined symbol(function) warnings
AddAttributeInConfig(configfile)
def GenerateWestonVersion():
dirname = os.path.join(BASE_DIR, "version/libweston")
if not os.path.exists(dirname):
os.makedirs(dirname)
version_op_file = os.path.join(BASE_DIR, "version/libweston/version.h")
configfile = os.path.join(BASE_DIR, "config/config.h")
version_in_file = os.path.join(BASE_DIR, "src/include/libweston/version.h.in")
version_number = "0.0.0"
with open(configfile, 'r') as f:
for line in f:
if "PACKAGE_VERSION" in line:
package_version_list = (line.strip("\n")).split(" ")
version_number = package_version_list[-1]
version_number_list = (version_number.strip('"\n"')).split(".")
version_number_list.append(version_number.strip("\"\""))
VERSIONS = ["@WESTON_VERSION_MAJOR@", "@WESTON_VERSION_MINOR@",
"@WESTON_VERSION_MICRO@", "@WESTON_VERSION@"]
with open(version_in_file) as f:
contents = f.read()
for version, version_number in zip(VERSIONS, version_number_list):
pattern = version
repl_string = version_number
with open(version_op_file, 'w') as f:
contents = re.sub(pattern, repl_string, contents)
# Cleanup trailing newlines.
f.write(contents.strip() + '\n')
print("Created version.h file from version.h.in\n")
def main():
env = os.environ
env['CC'] = 'clang'
GenerateGitConfig('version', env)
GenerateConfig('config', env)
ChangeConfigPath()
GenerateWestonVersion()
if __name__ == '__main__':
main()
This diff is collapsed.
This diff is collapsed.
#ifndef __gl2platform_h_
#define __gl2platform_h_
/*
** Copyright (c) 2017 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* Please contribute modifications back to Khronos as pull requests on the
* public github repository:
* https://github.com/KhronosGroup/OpenGL-Registry
*/
#include <KHR/khrplatform.h>
#ifndef GL_APICALL
#define GL_APICALL KHRONOS_APICALL
#endif
#ifndef GL_APIENTRY
#define GL_APIENTRY KHRONOS_APIENTRY
#endif
#endif /* __gl2platform_h_ */
#define BUILD_ID "96ace9c934e8"
/*
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef WESTON_VERSION_H
#define WESTON_VERSION_H
#define WESTON_VERSION_MAJOR 6
#define WESTON_VERSION_MINOR 0
#define WESTON_VERSION_MICRO 91
#define WESTON_VERSION "6.0.91"
/* This macro may not do what you expect. Weston doesn't guarantee
* a stable API between 1.X and 1.Y, and thus this macro will return
* FALSE on any WESTON_VERSION_AT_LEAST(1,X,0) if the actual version
* is 1.Y.0 and X != Y). In particular, it fails if X < Y, that is,
* 1.3.0 is considered to not be "at least" 1.4.0.
*
* If you want to test for the version number being 1.3.0 or above or
* maybe in a range (eg 1.2.0 to 1.4.0), just use the WESTON_VERSION_*
* defines above directly.
*/
#define WESTON_VERSION_AT_LEAST(major, minor, micro) \
(WESTON_VERSION_MAJOR == (major) && WESTON_VERSION_MINOR == (minor) && \
WESTON_VERSION_MICRO >= (micro))
#endif
...@@ -2416,7 +2416,7 @@ ...@@ -2416,7 +2416,7 @@
}, },
'ozone_linux': { 'ozone_linux': {
'gn_args': 'use_ozone=true ozone_platform="headless"', 'gn_args': 'use_ozone=true ozone_platform="headless" use_bundled_weston=true',
}, },
# Used to pass the list of files to instrument for coverage to the compile # Used to pass the list of files to instrument for coverage to the compile
......
...@@ -182,6 +182,10 @@ source_set("wayland") { ...@@ -182,6 +182,10 @@ source_set("wayland") {
] ]
} }
if (use_bundled_weston) {
data_deps = [ "//third_party/weston" ]
}
configs += [ configs += [
":wayland-egl", ":wayland-egl",
"//third_party/khronos:khronos_headers", "//third_party/khronos:khronos_headers",
......
...@@ -9,4 +9,7 @@ declare_args() { ...@@ -9,4 +9,7 @@ declare_args() {
# Checks if Wayland must be compiled with dmabuf/gbm feature, which allows a # Checks if Wayland must be compiled with dmabuf/gbm feature, which allows a
# multi-process hardware accelerated mode. # multi-process hardware accelerated mode.
use_wayland_gbm = true use_wayland_gbm = true
# Checks if Weston must be compiled
use_bundled_weston = false
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment