1//# 2//# Copyright (C) 2012 The Android Open Source Project 3//# 4//# Licensed under the Apache License, Version 2.0 (the "License"); 5//# you may not use this file except in compliance with the License. 6//# You may obtain a copy of the License at 7//# 8//# http://www.apache.org/licenses/LICENSE-2.0 9//# 10//# Unless required by applicable law or agreed to in writing, software 11//# distributed under the License is distributed on an "AS IS" BASIS, 12//# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13//# See the License for the specific language governing permissions and 14//# limitations under the License. 15//# 16 17//############################################################ 18// Note: 19// 20// This file is used to build HarfBuzz within the Android 21// platform itself. If you need to compile HarfBuzz to 22// ship with your Android NDK app, you can use the autotools 23// build system to do so. To do that you need to install a 24// "standalone" toolchain with the NDK, eg: 25// 26// ndk/build/tools/make-standalone-toolchain.sh 27// --platform=android-18 28// --install-dir=/prefix 29// 30// Set PLATFORM_PREFIX eng var to that prefix and make sure 31// the cross-compile tools from PLATFORM_PREFIX are in path. 32// Configure and install HarfBuzz: 33// 34// ./configure --host=arm-linux-androideabi 35// --prefix=$PLATFORM_PREFIX 36// --enable-static 37// --with-freetype 38// PKG_CONFIG_LIBDIR=$PLATFORM_PREFIX/lib/pkgconfig 39// make install 40// 41// You can first build FreeType the same way: 42// 43// ./configure --host=arm-linux-androideabi 44// --prefix=$PLATFORM_PREFIX 45// --enable-stati 46// --without-png 47// PKG_CONFIG_LIBDIR=$PLATFORM_PREFIX/lib/pkgconfig 48// make install 49// 50 51//############################################################ 52// build the harfbuzz shared library 53// 54// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE 55// CONSULT THE OWNERS AND [email protected] BEFORE 56// DEPENDING ON IT IN YOUR PROJECT. *** 57package { 58 default_applicable_licenses: ["external_harfbuzz_ng_license"], 59} 60 61// Added automatically by a large-scale-change that took the approach of 62// 'apply every license found to every target'. While this makes sure we respect 63// every license restriction, it may not be entirely correct. 64// 65// e.g. GPL in an MIT project might only apply to the contrib/ directory. 66// 67// Please consider splitting the single license below into multiple licenses, 68// taking care not to lose any license_kind information, and overriding the 69// default license using the 'licenses: [...]' property on targets as needed. 70// 71// For unused files, consider creating a 'fileGroup' with "//visibility:private" 72// to attach the license to, and including a comment whether the files may be 73// used in the current project. 74// 75// large-scale-change included anything that looked like it might be a license 76// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. 77// 78// Please consider removing redundant or irrelevant files from 'license_text:'. 79// See: http://go/android-license-faq 80license { 81 name: "external_harfbuzz_ng_license", 82 visibility: [":__subpackages__"], 83 license_kinds: [ 84 // "SPDX-license-Identifier-MIT-Modern-Variant", 85 "SPDX-license-identifier-Apache-2.0", 86 "SPDX-license-identifier-ISC", // src/hb-ucd.cc 87 "SPDX-license-identifier-MIT", 88 "SPDX-license-identifier-OFL", // by exception only 89 "legacy_unencumbered", 90 ], 91 license_text: [ 92 "COPYING", 93 "NOTICE", 94 95 "LICENSE_APACHE2.TXT", 96 "LICENSE_ISC.TXT", 97 "LICENSE_OFL.TXT", 98 "src/ms-use/COPYING", // For MIT license 99 "LICENSE_MIT_MODERN_VARIANT.TXT", 100 ], 101} 102 103cc_library { 104 name: "libharfbuzz_subset", 105 106 host_supported: true, 107 108 srcs: [ 109 "src/hb-number.cc", 110 "src/hb-ot-cff1-table.cc", 111 "src/hb-ot-cff2-table.cc", 112 "src/hb-static.cc", 113 "src/hb-subset-cff-common.cc", 114 "src/hb-subset-cff1.cc", 115 "src/hb-subset-cff2.cc", 116 "src/hb-subset-input.cc", 117 "src/hb-subset-instancer-iup.cc", 118 "src/hb-subset-instancer-solver.cc", 119 "src/hb-subset-plan.cc", 120 "src/hb-subset-repacker.cc", 121 "src/hb-subset.cc", 122 "src/graph/gsubgpos-context.cc", 123 ], 124 target: { 125 windows: { 126 enabled: true, 127 }, 128 }, 129 shared_libs: [ 130 "libharfbuzz_ng", 131 ], 132 export_include_dirs: ["src"], 133 cflags: [ 134 "-DHAVE_PTHREAD", 135 "-DHB_NO_PRAGMA_GCC_DIAGNOSTIC", 136 "-DHAVE_OT", 137 "-DHAVE_ICU", 138 "-DHAVE_ICU_BUILTIN", 139 "-Werror", 140 "-Wno-unused-parameter", 141 "-Wno-missing-field-initializers", 142 "-Wno-implicit-fallthrough", 143 ], 144} 145 146cc_library { 147 name: "libharfbuzz_ng", 148 host_supported: true, 149 arch: { 150 arm: { 151 instruction_set: "arm", 152 }, 153 }, 154 srcs: [ 155 "src/hb-aat-layout.cc", 156 "src/hb-aat-map.cc", 157 "src/hb-blob.cc", 158 "src/hb-buffer-serialize.cc", 159 "src/hb-buffer-verify.cc", 160 "src/hb-buffer.cc", 161 "src/hb-common.cc", 162 "src/hb-draw.cc", 163 "src/hb-face-builder.cc", 164 "src/hb-face.cc", 165 "src/hb-fallback-shape.cc", 166 "src/hb-font.cc", 167 "src/hb-map.cc", 168 "src/hb-number.cc", 169 "src/hb-ot-cff1-table.cc", 170 "src/hb-ot-cff2-table.cc", 171 "src/hb-ot-color.cc", 172 "src/hb-ot-face.cc", 173 "src/hb-ot-font.cc", 174 "src/hb-ot-layout.cc", 175 "src/hb-ot-map.cc", 176 "src/hb-ot-math.cc", 177 "src/hb-ot-meta.cc", 178 "src/hb-ot-metrics.cc", 179 "src/hb-ot-name.cc", 180 "src/hb-ot-shape-fallback.cc", 181 "src/hb-ot-shape-normalize.cc", 182 "src/hb-ot-shape.cc", 183 "src/hb-ot-shaper-arabic.cc", 184 "src/hb-ot-shaper-default.cc", 185 "src/hb-ot-shaper-hangul.cc", 186 "src/hb-ot-shaper-hebrew.cc", 187 "src/hb-ot-shaper-indic-table.cc", 188 "src/hb-ot-shaper-indic.cc", 189 "src/hb-ot-shaper-khmer.cc", 190 "src/hb-ot-shaper-myanmar.cc", 191 "src/hb-ot-shaper-syllabic.cc", 192 "src/hb-ot-shaper-thai.cc", 193 "src/hb-ot-shaper-use.cc", 194 "src/hb-ot-shaper-vowel-constraints.cc", 195 "src/hb-ot-tag.cc", 196 "src/hb-ot-var.cc", 197 "src/hb-outline.cc", 198 "src/hb-paint-extents.cc", 199 "src/hb-paint.cc", 200 "src/hb-set.cc", 201 "src/hb-shape-plan.cc", 202 "src/hb-shape.cc", 203 "src/hb-shaper.cc", 204 "src/hb-static.cc", 205 "src/hb-style.cc", 206 "src/hb-ucd.cc", 207 "src/hb-unicode.cc", 208 ], 209 210 target: { 211 android: { 212 shared_libs: [ 213 "libcutils", 214 "libutils", 215 ], 216 }, 217 host: { 218 static_libs: [ 219 "libcutils", 220 "libutils", 221 ], 222 }, 223 windows: { 224 enabled: true, 225 }, 226 }, 227 228 shared_libs: [ 229 "libicu", 230 "liblog", 231 ], 232 233 export_include_dirs: ["src"], 234 cflags: [ 235 "-DHAVE_PTHREAD", 236 "-DHB_NO_PRAGMA_GCC_DIAGNOSTIC", 237 "-DHAVE_OT", 238 "-DHAVE_ICU", 239 "-DHAVE_ICU_BUILTIN", 240 "-Werror", 241 "-Wno-unused-parameter", 242 "-Wno-missing-field-initializers", 243 "-Wno-implicit-fallthrough", 244 ], 245 246 afdo: true, 247} 248 249///////////////////////////////////////////////////////////////////// 250// Following filegroups and licences are ones not used in Android. 251///////////////////////////////////////////////////////////////////// 252 253license { 254 name: "external_harfbuzz_license.unused.GPLv3", 255 visibility: ["//visibility:private"], 256 license_kinds: [ 257 "SPDX-license-identifier-GPL-3.0-with-autoconf-exception", 258 ], 259 license_text: [ 260 "LICENSE_GPLv3_WITH_AUTOCONF_EXCEPTION.TXT", 261 ], 262} 263 264license { 265 name: "external_harfbuzz_license.unused.GPLv2", 266 visibility: ["//visibility:private"], 267 license_kinds: [ 268 "SPDX-license-identifier-GPL-2.0", 269 ], 270 license_text: [ 271 "LICENSE_GPLv2.TXT", 272 ], 273} 274 275filegroup { 276 name: "external_harfbuzz.unused.GPLv2", 277 visibility: ["//visibility:private"], 278 licenses: ["external_harfbuzz_license.unused.GPLv2"], 279 srcs: [ 280 "test/shape/data/in-house/fonts/b895f8ff06493cc893ec44de380690ca0074edfa.ttf", 281 ], 282} 283 284license { 285 name: "external_harfbuzz_license.unused.LGPL", 286 visibility: ["//visibility:private"], 287 license_kinds: [ 288 "SPDX-license-identifier-LGPL-2.1", 289 ], 290 license_text: [ 291 "LICENSE_GPLv2_WITH_AUTOCONF_EXCEPTION.TXT", 292 ], 293} 294 295license { 296 name: "external_harfbuzz_license.unused.MIT", 297 visibility: ["//visibility:private"], 298 license_kinds: [ 299 "SPDX-license-identifier-MIT", 300 ], 301 license_text: [ 302 "src/ms-use/COPYING", 303 ], 304} 305 306filegroup { 307 name: "external_harfbuzz.unused.MIT", 308 visibility: ["//visibility:private"], 309 licenses: ["external_harfbuzz_license.unused.MIT"], 310 srcs: [ 311 "src/ms-use/*", 312 ], 313} 314 315license { 316 name: "external_harfbuzz_license.unused.FSFAP", 317 visibility: ["//visibility:private"], 318 license_kinds: [ 319 "SPDX-license-identifier-FSFAP", 320 ], 321 license_text: [ 322 "LICENSE_FSFAP.TXT", 323 ], 324} 325 326license { 327 name: "external_harfbuzz_license.unused.HPND-sell-variant", 328 visibility: ["//visibility:private"], 329 license_kinds: [ 330 // "SPDX-license-identifier-HPND-sell-variant", 331 ], 332 license_text: [ 333 "LICENSE_HPND_SELL_VARIANT.TXT", 334 ], 335} 336 337filegroup { 338 name: "external_harfbuzz.unused.HPND-sell-variant", 339 visibility: ["//visibility:private"], 340 licenses: ["external_harfbuzz_license.unused.HPND-sell-variant"], 341 srcs: [ 342 "util/hb-fc-list.c", 343 ], 344} 345 346license { 347 name: "external_harfbuzz_license.unused.Apache-2.0", 348 visibility: ["//visibility:private"], 349 license_kinds: [ 350 "SPDX-license-identifier-Apache-2.0", 351 ], 352 license_text: [ 353 "LICENSE_APACHE2.TXT", 354 ], 355} 356 357filegroup { 358 name: "external_harfbuzz.unused.Apache-2.0", 359 visibility: ["//visibility:private"], 360 licenses: ["external_harfbuzz_license.unused.Apache-2.0"], 361 srcs: [ 362 "perf/fonts/Roboto-Regular.ttf", 363 ], 364} 365 366license { 367 name: "external_harfbuzz_license.unused.OFL", 368 visibility: ["//visibility:private"], 369 license_kinds: [ 370 "SPDX-license-identifier-OFL", 371 ], 372 license_text: [ 373 "LICENSE_OFL.TXT", 374 ], 375} 376 377filegroup { 378 name: "external_harfbuzz.unused.OFL", 379 visibility: ["//visibility:private"], 380 licenses: ["external_harfbuzz_license.unused.OFL"], 381 srcs: [ 382 "perf/fonts/Amiri-Regular.ttf", 383 "perf/fonts/NotoNastaliqUrdu-Regular.ttf", 384 ], 385} 386 387license { 388 name: "external_harfbuzz_license.unused.tests", 389 visibility: ["//visibility:private"], 390 license_kinds: [ 391 // "SPDX-license-Identifier-MIT-Modern-Variant", 392 "SPDX-license-identifier-Apache-2.0", 393 "SPDX-license-identifier-MIT", 394 "SPDX-license-identifier-OFL", // by exception only 395 // Lots of font files used in tests directories are lack of license descriptions. 396 // The license of fuzzing payload is unknown. 397 "legacy_unencumbered", 398 ], 399 license_text: [ 400 "LICENSE_OFL.TXT", 401 "LICENSE_APACHE2.TXT", 402 "LICENSE_MIT_MODERN_VARIANT.TXT", 403 "src/ms-use/COPYING", // For MIT license 404 ], 405} 406 407filegroup { 408 name: "external_harfbuzz.unused.tests", 409 visibility: ["//visibility:private"], 410 licenses: ["external_harfbuzz_license.unused.tests"], 411 srcs: ["test/**/*"], 412 path: "test", 413} 414