1// Copyright (C) 2017 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17} 18 19license { 20 name: "external_wayland-protocols_freedesktop.org-MIT-license", 21 license_kinds: [ 22 "SPDX-license-identifier-MIT", 23 ], 24 license_text: ["freedesktop.org/COPYING"], 25} 26 27license { 28 name: "external_wayland-protocols_freedesktop.org-ISC-license", 29 license_kinds: [ 30 "SPDX-license-identifier-ISC", 31 ], 32 license_text: ["ISC_LICENSE.txt"], 33} 34 35license { 36 name: "external_wayland-protocols_chromium.org-license", 37 license_kinds: [ 38 "SPDX-license-identifier-MIT", 39 ], 40 license_text: ["chromium.org/LICENSE"], 41} 42 43// Build and use the "wayland_protocol_codegen" extension. This is just a bit 44// of glue code to invoke the wayland-scanner code generation tool provided by 45// the core Wayland code (external/wayland) from the Android build system. 46bootstrap_go_package { 47 name: "soong-wayland-protocol-codegen", 48 // licenses: ["Android-Apache-2.0"], 49 pkgPath: "android/soong/external/wayland-protocol", 50 deps: [ 51 "blueprint", 52 "blueprint-proptools", 53 "soong-android", 54 "soong-genrule", 55 ], 56 srcs: [ 57 "wayland_protocol_codegen.go", 58 ], 59 pluginFor: ["soong_build"], 60} 61 62// All the MIT licensed freedesktop.org defined extension protocols. 63filegroup { 64 name: "freedesktop.org-MIT-wayland_extension_protocols", 65 licenses: ["external_wayland-protocols_freedesktop.org-MIT-license"], 66 srcs: [ 67 "./freedesktop.org/stable/presentation-time/presentation-time.xml", 68 "./freedesktop.org/stable/viewporter/viewporter.xml", 69 "./freedesktop.org/stable/xdg-shell/xdg-shell.xml", 70 "./freedesktop.org/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml", 71 "./freedesktop.org/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml", 72 "./freedesktop.org/unstable/input-method/input-method-unstable-v1.xml", 73 "./freedesktop.org/unstable/input-timestamps/input-timestamps-unstable-v1.xml", 74 "./freedesktop.org/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml", 75 "./freedesktop.org/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml", 76 "./freedesktop.org/unstable/linux-explicit-synchronization/linux-explicit-synchronization-unstable-v1.xml", 77 "./freedesktop.org/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml", 78 "./freedesktop.org/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml", 79 "./freedesktop.org/unstable/primary-selection/primary-selection-unstable-v1.xml", 80 "./freedesktop.org/unstable/relative-pointer/relative-pointer-unstable-v1.xml", 81 "./freedesktop.org/unstable/tablet/tablet-unstable-v1.xml", 82 "./freedesktop.org/unstable/tablet/tablet-unstable-v2.xml", 83 "./freedesktop.org/unstable/text-input/text-input-unstable-v1.xml", 84 "./freedesktop.org/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml", 85 "./freedesktop.org/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml", 86 "./freedesktop.org/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml", 87 "./freedesktop.org/unstable/xdg-output/xdg-output-unstable-v1.xml", 88 // Note: Conflicts with freedesktop.org/stable/xdg-shell/xdg-shell.xml 89 // "./freedesktop.org/unstable/xdg-shell/xdg-shell-unstable-v5.xml", 90 "./freedesktop.org/unstable/xdg-shell/xdg-shell-unstable-v6.xml", 91 "./freedesktop.org/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml", 92 ], 93} 94 95// All the ISC licensed freedesktop.org defined extension protocols. 96filegroup { 97 name: "freedesktop.org-ISC-wayland_extension_protocols", 98 licenses: ["external_wayland-protocols_freedesktop.org-ISC-license"], 99 srcs: [ 100 "./freedesktop.org/unstable/text-input/text-input-unstable-v3.xml", 101 ], 102} 103 104// All the chromium.org defined extension protocols. 105filegroup { 106 name: "chromium.org-wayland_extension_protocols", 107 licenses: ["external_wayland-protocols_chromium.org-license"], 108 srcs: [ 109 "chromium.org/**/*.xml", 110 ], 111} 112 113// Allows for easy reference to all the extension protocols. 114filegroup { 115 name: "wayland_extension_protocols", 116 srcs: [ 117 ":freedesktop.org-MIT-wayland_extension_protocols", 118 ":freedesktop.org-ISC-wayland_extension_protocols", 119 ":chromium.org-wayland_extension_protocols", 120 ], 121} 122 123// Generate protocol source files used by both client and server 124wayland_protocol_codegen { 125 name: "wayland_extension_protocol_sources", 126 cmd: "$(location wayland_scanner) private-code < $(in) > $(out)", 127 suffix: ".c", 128 srcs: [":wayland_extension_protocols"], 129 tools: ["wayland_scanner"], 130} 131 132// Generate protocol header files used by the client 133wayland_protocol_codegen { 134 name: "wayland_extension_client_protocol_headers", 135 cmd: "$(location wayland_scanner) client-header < $(in) > $(out)", 136 suffix: "-client-protocol.h", 137 srcs: [":wayland_extension_protocols"], 138 tools: ["wayland_scanner"], 139} 140 141// Generate protocol header files used by the server 142wayland_protocol_codegen { 143 name: "wayland_extension_server_protocol_headers", 144 cmd: "$(location wayland_scanner) server-header < $(in) > $(out)", 145 suffix: "-server-protocol.h", 146 srcs: [":wayland_extension_protocols"], 147 tools: ["wayland_scanner"], 148} 149 150// Generate a library with the protocol files, configured to export the client 151// header files 152cc_library_static { 153 name: "libwayland_extension_client_protocols", 154 vendor_available: true, 155 cflags: [ 156 "-Wall", 157 "-Wextra", 158 "-Werror", 159 "-g", 160 "-fvisibility=hidden", 161 ], 162 static_libs: ["libwayland_client_static"], 163 generated_sources: ["wayland_extension_protocol_sources"], 164 generated_headers: ["wayland_extension_client_protocol_headers"], 165 export_generated_headers: ["wayland_extension_client_protocol_headers"], 166} 167 168// Generate a library with the protocol files, configured to export the server 169// header files 170cc_library_static { 171 name: "libwayland_extension_server_protocols", 172 vendor_available: true, 173 host_supported: true, 174 cflags: [ 175 "-Wall", 176 "-Wextra", 177 "-Werror", 178 "-g", 179 "-fvisibility=hidden", 180 ], 181 static_libs: ["libwayland_server"], 182 generated_sources: ["wayland_extension_protocol_sources"], 183 generated_headers: ["wayland_extension_server_protocol_headers"], 184 export_generated_headers: ["wayland_extension_server_protocol_headers"], 185} 186