• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 opensource-licensing@google.com 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-solver.cc",
118        "src/hb-subset-plan.cc",
119        "src/hb-subset-repacker.cc",
120        "src/hb-subset.cc",
121        "src/graph/gsubgpos-context.cc",
122    ],
123    target: {
124        windows: {
125            enabled: true,
126        },
127    },
128    shared_libs: [
129        "libharfbuzz_ng",
130    ],
131    export_include_dirs: ["src"],
132    cflags: [
133        "-DHAVE_PTHREAD",
134        "-DHB_NO_PRAGMA_GCC_DIAGNOSTIC",
135        "-DHAVE_OT",
136        "-DHAVE_ICU",
137        "-DHAVE_ICU_BUILTIN",
138        "-Werror",
139        "-Wno-unused-parameter",
140        "-Wno-missing-field-initializers",
141    ],
142}
143
144cc_library {
145    name: "libharfbuzz_ng",
146    host_supported: true,
147    arch: {
148        arm: {
149            instruction_set: "arm",
150        },
151    },
152    srcs: [
153        "src/hb-aat-layout.cc",
154        "src/hb-aat-map.cc",
155        "src/hb-blob.cc",
156        "src/hb-buffer-serialize.cc",
157        "src/hb-buffer-verify.cc",
158        "src/hb-buffer.cc",
159        "src/hb-common.cc",
160        "src/hb-draw.cc",
161        "src/hb-face-builder.cc",
162        "src/hb-face.cc",
163        "src/hb-fallback-shape.cc",
164        "src/hb-font.cc",
165        "src/hb-map.cc",
166        "src/hb-number.cc",
167        "src/hb-ot-cff1-table.cc",
168        "src/hb-ot-cff2-table.cc",
169        "src/hb-ot-color.cc",
170        "src/hb-ot-face.cc",
171        "src/hb-ot-font.cc",
172        "src/hb-ot-layout.cc",
173        "src/hb-ot-map.cc",
174        "src/hb-ot-math.cc",
175        "src/hb-ot-meta.cc",
176        "src/hb-ot-metrics.cc",
177        "src/hb-ot-name.cc",
178        "src/hb-ot-shape-fallback.cc",
179        "src/hb-ot-shape-normalize.cc",
180        "src/hb-ot-shape.cc",
181        "src/hb-ot-shaper-arabic.cc",
182        "src/hb-ot-shaper-default.cc",
183        "src/hb-ot-shaper-hangul.cc",
184        "src/hb-ot-shaper-hebrew.cc",
185        "src/hb-ot-shaper-indic-table.cc",
186        "src/hb-ot-shaper-indic.cc",
187        "src/hb-ot-shaper-khmer.cc",
188        "src/hb-ot-shaper-myanmar.cc",
189        "src/hb-ot-shaper-syllabic.cc",
190        "src/hb-ot-shaper-thai.cc",
191        "src/hb-ot-shaper-use.cc",
192        "src/hb-ot-shaper-vowel-constraints.cc",
193        "src/hb-ot-tag.cc",
194        "src/hb-ot-var.cc",
195        "src/hb-outline.cc",
196        "src/hb-paint-extents.cc",
197        "src/hb-paint.cc",
198        "src/hb-set.cc",
199        "src/hb-shape-plan.cc",
200        "src/hb-shape.cc",
201        "src/hb-shaper.cc",
202        "src/hb-static.cc",
203        "src/hb-style.cc",
204        "src/hb-ucd.cc",
205        "src/hb-unicode.cc",
206    ],
207
208    target: {
209        android: {
210            shared_libs: [
211                "libcutils",
212                "libutils",
213            ],
214        },
215        host: {
216            static_libs: [
217                "libcutils",
218                "libutils",
219            ],
220        },
221        windows: {
222            enabled: true,
223        },
224    },
225
226    shared_libs: [
227        "libicu",
228        "liblog",
229    ],
230
231    export_include_dirs: ["src"],
232    cflags: [
233        "-DHAVE_PTHREAD",
234        "-DHB_NO_PRAGMA_GCC_DIAGNOSTIC",
235        "-DHAVE_OT",
236        "-DHAVE_ICU",
237        "-DHAVE_ICU_BUILTIN",
238        "-Werror",
239        "-Wno-unused-parameter",
240        "-Wno-missing-field-initializers",
241    ],
242
243    afdo: true,
244}
245
246/////////////////////////////////////////////////////////////////////
247// Following filegroups and licences are ones not used in Android.
248/////////////////////////////////////////////////////////////////////
249
250license {
251    name: "external_harfbuzz_license.unused.GPLv3",
252    visibility: ["//visibility:private"],
253    license_kinds: [
254        "SPDX-license-identifier-GPL-3.0-with-autoconf-exception",
255    ],
256    license_text: [
257        "LICENSE_GPLv3_WITH_AUTOCONF_EXCEPTION.TXT",
258    ],
259}
260
261filegroup {
262    name: "external_harfbuzz.unused.GPLv3",
263    visibility: ["//visibility:private"],
264    licenses: ["external_harfbuzz_license.unused.GPLv3"],
265    srcs: [
266        "m4/ax_check_link_flag.m4",
267        "m4/ax_pthread.m4",
268    ],
269}
270
271license {
272    name: "external_harfbuzz_license.unused.GPLv2",
273    visibility: ["//visibility:private"],
274    license_kinds: [
275        "SPDX-license-identifier-GPL-2.0",
276    ],
277    license_text: [
278        "LICENSE_GPLv2.TXT",
279    ],
280}
281
282filegroup {
283    name: "external_harfbuzz.unused.GPLv2",
284    visibility: ["//visibility:private"],
285    licenses: ["external_harfbuzz_license.unused.GPLv2"],
286    srcs: [
287        "test/shape/data/in-house/fonts/b895f8ff06493cc893ec44de380690ca0074edfa.ttf"
288    ],
289}
290
291license {
292    name: "external_harfbuzz_license.unused.LGPL",
293    visibility: ["//visibility:private"],
294    license_kinds: [
295        "SPDX-license-identifier-LGPL-2.1",
296    ],
297    license_text: [
298        "LICENSE_GPLv2_WITH_AUTOCONF_EXCEPTION.TXT",
299    ],
300}
301
302filegroup {
303    name: "external_harfbuzz.unused.LGPL",
304    visibility: ["//visibility:private"],
305    licenses: ["external_harfbuzz_license.unused.LGPL"],
306    srcs: ["m4/ax_code_coverage.m4"],
307}
308
309license {
310    name: "external_harfbuzz_license.unused.MIT",
311    visibility: ["//visibility:private"],
312    license_kinds: [
313        "SPDX-license-identifier-MIT",
314    ],
315    license_text: [
316        "src/ms-use/COPYING",
317    ],
318}
319
320filegroup {
321    name: "external_harfbuzz.unused.MIT",
322    visibility: ["//visibility:private"],
323    licenses: ["external_harfbuzz_license.unused.MIT"],
324    srcs: [
325        "src/ms-use/*",
326    ],
327}
328
329license {
330    name: "external_harfbuzz_license.unused.FSFAP",
331    visibility: ["//visibility:private"],
332    license_kinds: [
333        "SPDX-license-identifier-FSFAP",
334    ],
335    license_text: [
336        "LICENSE_FSFAP.TXT",
337    ],
338}
339
340filegroup {
341    name: "external_harfbuzz.unused.FSFAP",
342    visibility: ["//visibility:private"],
343    licenses: ["external_harfbuzz_license.unused.FSFAP"],
344    srcs: [
345        "git.mk",
346        "m4/ax_cxx_compile_stdcxx.m4",
347    ],
348}
349
350license {
351    name: "external_harfbuzz_license.unused.HPND-sell-variant",
352    visibility: ["//visibility:private"],
353    license_kinds: [
354        // "SPDX-license-identifier-HPND-sell-variant",
355    ],
356    license_text: [
357        "LICENSE_HPND_SELL_VARIANT.TXT"
358    ],
359}
360
361filegroup {
362    name: "external_harfbuzz.unused.HPND-sell-variant",
363    visibility: ["//visibility:private"],
364    licenses: ["external_harfbuzz_license.unused.HPND-sell-variant"],
365    srcs: [
366        "util/hb-fc-list.c",
367    ],
368}
369
370license {
371    name: "external_harfbuzz_license.unused.Apache-2.0",
372    visibility: ["//visibility:private"],
373    license_kinds: [
374        "SPDX-license-identifier-Apache-2.0",
375    ],
376    license_text: [
377        "LICENSE_APACHE2.TXT",
378    ],
379}
380
381filegroup {
382    name: "external_harfbuzz.unused.Apache-2.0",
383    visibility: ["//visibility:private"],
384    licenses: ["external_harfbuzz_license.unused.Apache-2.0"],
385    srcs: [
386        "perf/fonts/Roboto-Regular.ttf"
387    ],
388}
389
390license {
391    name: "external_harfbuzz_license.unused.OFL",
392    visibility: ["//visibility:private"],
393    license_kinds: [
394        "SPDX-license-identifier-OFL",
395    ],
396    license_text: [
397        "LICENSE_OFL.TXT",
398    ],
399}
400
401filegroup {
402    name: "external_harfbuzz.unused.OFL",
403    visibility: ["//visibility:private"],
404    licenses: ["external_harfbuzz_license.unused.OFL"],
405    srcs: [
406        "perf/fonts/Amiri-Regular.ttf",
407        "perf/fonts/NotoNastaliqUrdu-Regular.ttf",
408    ],
409}
410
411license {
412    name: "external_harfbuzz_license.unused.tests",
413    visibility: ["//visibility:private"],
414    license_kinds: [
415        // "SPDX-license-Identifier-MIT-Modern-Variant",
416        "SPDX-license-identifier-Apache-2.0",
417        "SPDX-license-identifier-MIT",
418        "SPDX-license-identifier-OFL", // by exception only
419        // Lots of font files used in tests directories are lack of license descriptions.
420        // The license of fuzzing payload is unknown.
421        "legacy_unencumbered",
422    ],
423    license_text: [
424        "LICENSE_OFL.TXT",
425        "LICENSE_APACHE2.TXT",
426        "LICENSE_MIT_MODERN_VARIANT.TXT",
427        "src/ms-use/COPYING",  // For MIT license
428    ],
429}
430
431filegroup {
432    name: "external_harfbuzz.unused.tests",
433    visibility: ["//visibility:private"],
434    licenses: ["external_harfbuzz_license.unused.tests"],
435    srcs: [ "test/**/*" ],
436    path: "test"
437}
438
439