Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: scripts/make_data.sh

Issue 1639543006: ICU 56 step 6: Check in the pre-built ICU data (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@56local_patches
Patch Set: address review comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « scripts/euckr_gen.sh ('k') | scripts/make_mac_assembly.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 # This script is tested ONLY on Linux. It may not work correctly on
7 # Mac OS X.
8
9 TOPSRC="$(dirname "$0")/.."
10 source "${TOPSRC}/scripts/data_common.sh"
11
12 function check_build {
13 if [[ ! -x bin/icupkg || ! -x bin/pkgdata || ! -r lib/libicuuc.so ]]; then
14 echo "ICU has not been built. Configure and build ICU first by running" >&2
15 echo "${TOPSRC}/source/runConfigureICU Linux --disable-layout && make" >&2
16 exit 3
17 fi
18 }
19
20 # Rewrite data/Makefile to regenerate string pool bundles (pool.res)
21 # optimized for our trimmed data (after running trim_data.sh or
22 # android/patch_locale.sh)
23 # See http://site.icu-project.org/processes/release/tasks/build
24 # http://bugs.icu-project.org/trac/ticket/8101
25 # http://bugs.icu-project.org/trac/ticket/12069
26 function rewrite_data_makefile {
27 echo "Creating Makefile to regenerate pool bundles..."
28 sed -i.orig -e \
29 ' /usePoolBundle/ {
30 s/usePoolBundle/writePoolBundle/
31 s/\(\$(UNITSRCDIR.*\)\$(<F)$/\1$(UNIT_SRC)/
32 s/\(\$(REGIONSRCDIR.*\)\$(<F)$/\1$(REGION_SRC)/
33 s/\(\$(CURRSRCDIR.*\)\$(<F)$/\1$(CURR_SRC)/
34 s/\(\$(LANGSRCDIR.*\)\$(<F)$/\1$(LANG_SRC)/
35 s/\(\$(ZONESRCDIR.*\)\$(<F)$/\1$(ZONE_SRC)/
36 s/\(\$(LOCSRCDIR.*\)\$(<F)$/\1$(RES_SRC)/
37 }' Makefile
38 }
39
40 # Rebuild the ICU data. 'make' has to be run twice because of
41 # http://bugs.icu-project.org/trac/ticket/10570
42 function build_data {
43 make clean
44 make
45 sed -i 's/css3transform.res/root.res/' out/tmp/icudata.lst
46 make
47 }
48
49 # Copy a single pool.res to the source tree and emit the sizes
50 # before and after.
51 function copy_pool_bundle {
52 echo "copying pool.res for $3"
53 echo "original: $(ls -l $2/pool.res | awk '{print $5;}')"
54 echo "optimized: $(ls -l $1 | awk '{print $5;}')"
55 cp "$1" "$2"
56 }
57
58 function copy_pool_bundles {
59 echo "Copying optimized pool bundles to the ${TOPSRC}/source/data ..."
60 POOLROOT="out/build/icudt${VERSION}l"
61 SRCDATA="${TOPSRC}/source/data"
62
63 copy_pool_bundle "${POOLROOT}/pool.res" "${SRCDATA}/locales" locales
64
65 for c in lang region zone curr unit; do
66 copy_pool_bundle "${POOLROOT}/${c}/pool.res" "${SRCDATA}/${c}" "${c}"
67 done
68 }
69
70 function clean_up_src {
71 echo "Cleaning up the source tree. Removing optimize pool bundles ..."
72 cd "${TOPSRC}/source/data"
73 for c in locales lang region zone curr unit; do
74 git checkout -- "${c}/pool.res"
75 done
76 }
77
78 function main() {
79 check_build
80 cd data
81 rewrite_data_makefile
82 echo "PASS1: Building the ICU data to generate custom pool bundles ..."
83 build_data
84
85 copy_pool_bundles
86
87 echo "Restoring the original Makefile"
88 mv Makefile.orig Makefile
89
90 echo "PASS2: Building the final ICU data with custom pool bundles"
91 build_data
92 ls -l out/tmp/icudt*l.dat
93
94 clean_up_src
95
96 echo "Done."
97 }
98
99 main "$@"
OLDNEW
« no previous file with comments | « scripts/euckr_gen.sh ('k') | scripts/make_mac_assembly.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698