-
-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-20600 build icu-data-bin files #1048
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#!/bin/bash | ||
# Copyright (C) 2020 and later: Unicode, Inc. and others. | ||
|
||
# set VERSION to the ICU version. set top_srcdir to the parent of icurc | ||
# Note: You need to set LD_LIBRARY_PATH/etc before calling this script. | ||
export LD_LIBRARY_PATH=./lib:${LD_LIBRARY_PATH-/lib:/usr/lib:/usr/local/lib} | ||
export DYLD_LIBRARY_PATH=./lib:${DYLD_LIBRARY_PATH-/lib:/usr/lib:/usr/local/lib} | ||
|
||
if [ ! -d "${top_srcdir}" ] | ||
then | ||
echo >&2 "$0: please set 'top_srcdir' to the icu/icu4c/source dir" | ||
exit 1 | ||
fi | ||
LICENSE=${LICENSE-${top_srcdir}/../LICENSE} | ||
|
||
if [ ! -f "${LICENSE}" ] | ||
then | ||
echo >&2 "$0: could not load license file ${LICENSE}" | ||
exit 1 | ||
fi | ||
|
||
DATFILE=${DATFILE-$(ls data/out/tmp/icudt*.dat| head -1)} | ||
|
||
if [ ! -f "${DATFILE}" ] | ||
then | ||
echo >&2 "$0: could not find DATFILE ${DATFILE}" | ||
exit 1 | ||
fi | ||
|
||
VERS=$(echo ${DATFILE} | tr -d a-z/.) | ||
VERSION=${VERSION-unknown} | ||
|
||
if [[ "${VERSION}" = "unknown" ]]; | ||
then | ||
VERSION=${VERS}.0 | ||
echo "$0: VERSION not set, using ${VERSION}" | ||
else | ||
if [[ "${VERS}" != $(echo ${VERSION} | cut -d. -f1) ]] | ||
then | ||
echo >&2 "$0: Warning: Expected version ${VERSION} to start with ${VERS}..." | ||
fi | ||
fi | ||
|
||
# yeah, override ENDIANS if you want a different flavor. | ||
#ENDIANS="b l e" | ||
ENDIANS=${ENDIANS-"b l"} | ||
DISTY_DIR=${DISTY_DIR-./dist/} | ||
|
||
if [ ! -x ./bin/icupkg ] | ||
then | ||
echo >&2 "$0: could not find executable ./bin/icupkg" | ||
exit 1 | ||
fi | ||
|
||
echo "# Packing ${DATFILE} into data zips in dist/ for version ${VERSION}" | ||
mkdir -p ${DISTY_DIR}/tmp | ||
|
||
for endian in $ENDIANS; | ||
do | ||
base=icu4c-${VERSION}-data-bin-${endian}.zip | ||
filename=icudt${VERS}${endian}.dat | ||
if [ -f ${DISTY_DIR}/${base} ]; | ||
then | ||
echo ${DISTY_DIR}/${base} exists, skipping | ||
continue | ||
fi | ||
rm -f ${DISTY_DIR}/tmp/${filename} | ||
echo ./bin/icupkg -t${endian} ${DATFILE} ${DISTY_DIR}/tmp/${filename} | ||
./bin/icupkg -t${endian} ${DATFILE} ${DISTY_DIR}/tmp/${filename} | ||
README=icu4c-${VERSION}-data-bin-${endian}-README.md | ||
cat >> ${DISTY_DIR}/tmp/${README} <<EOF | ||
# ICU Data Zip for ${VERSION} | ||
|
||
For information on Unicode ICU, see [http://icu-project.org](http://icu-project.org) | ||
|
||
## Contents | ||
|
||
This .zip file contains: | ||
|
||
- this README | ||
- [LICENSE](./LICENSE) | ||
- ${filename} | ||
|
||
## How to use this file | ||
|
||
This file contains prebuilt data in form **${endian}**. | ||
("l" for Little Endian, "b" for Big Endian, "e" for EBCDIC.) | ||
It may be used to simplify build and installation of ICU. | ||
See [http://icu-project.org](http://icu-project.org) for further information. | ||
|
||
## License | ||
|
||
See [LICENSE](./LICENSE). | ||
|
||
> Copyright © 2016 and later Unicode, Inc. and others. All Rights Reserved. | ||
Unicode and the Unicode Logo are registered trademarks | ||
of Unicode, Inc. in the U.S. and other countries. | ||
[Terms of Use and License](http://www.unicode.org/copyright.html) | ||
|
||
EOF | ||
zip -v -j ${DISTY_DIR}/${base} \ | ||
${LICENSE} \ | ||
${DISTY_DIR}/tmp/${README} \ | ||
${DISTY_DIR}/tmp/${filename} | ||
ls -lh ${DISTY_DIR}/${base} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could/should add a build bot that does
make dist
just to exercise this...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that would be [ICU-20605] but yeah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point, should probably be another ticket. :)