[Intl] Improved the bundle compilation process
This commit is contained in:
parent
f47e60a6c6
commit
dd2d013d6e
@ -24,16 +24,20 @@ use Symfony\Component\Filesystem\Filesystem;
|
|||||||
require_once __DIR__ . '/common.php';
|
require_once __DIR__ . '/common.php';
|
||||||
require_once __DIR__ . '/autoload.php';
|
require_once __DIR__ . '/autoload.php';
|
||||||
|
|
||||||
if ($GLOBALS['argc'] > 2) {
|
if ($GLOBALS['argc'] > 3) {
|
||||||
bailout(<<<MESSAGE
|
bailout(<<<MESSAGE
|
||||||
Usage: php update-icu-component.php <path/to/icu/source>
|
Usage: php update-icu-component.php <path/to/icu/source> <path/to/icu/build>
|
||||||
|
|
||||||
Updates the ICU data for Symfony2 to the latest version of the ICU version
|
Updates the ICU data for Symfony2 to the latest version of the ICU version
|
||||||
included in the intl extension. For example, if your intl extension includes
|
included in the intl extension. For example, if your intl extension includes
|
||||||
ICU 4.8, the script will download the latest data available for ICU 4.8.
|
ICU 4.8, the script will download the latest data available for ICU 4.8.
|
||||||
|
|
||||||
If you downloaded the SVN repository before, you can pass the path to the
|
If you downloaded the SVN repository before, you can pass the path to the
|
||||||
repository in the first optional argument.
|
repository source in the first optional argument.
|
||||||
|
|
||||||
|
If you also built the repository before, you can pass the directory where that
|
||||||
|
build is stored in the second parameter. The build directory needs to contain
|
||||||
|
the subdirectories bin/ and lib/.
|
||||||
|
|
||||||
For running this script, the intl extension must be loaded and all vendors
|
For running this script, the intl extension must be loaded and all vendors
|
||||||
must have been installed through composer:
|
must have been installed through composer:
|
||||||
@ -75,7 +79,7 @@ foreach ($urls as $urlVersion => $url) {
|
|||||||
echo " $urlVersion\n";
|
echo " $urlVersion\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (2 === $GLOBALS['argc']) {
|
if ($GLOBALS['argc'] >= 2) {
|
||||||
$sourceDir = $GLOBALS['argv'][1];
|
$sourceDir = $GLOBALS['argv'][1];
|
||||||
$svn = new SvnRepository($sourceDir);
|
$svn = new SvnRepository($sourceDir);
|
||||||
|
|
||||||
@ -89,6 +93,9 @@ if (2 === $GLOBALS['argc']) {
|
|||||||
echo "SVN checkout to {$sourceDir} complete.\n";
|
echo "SVN checkout to {$sourceDir} complete.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($GLOBALS['argc'] >= 3) {
|
||||||
|
$buildDir = $GLOBALS['argv'][2];
|
||||||
|
} else {
|
||||||
// Always build genrb so that we can determine the ICU version of the
|
// Always build genrb so that we can determine the ICU version of the
|
||||||
// download by running genrb --version
|
// download by running genrb --version
|
||||||
echo "Building genrb.\n";
|
echo "Building genrb.\n";
|
||||||
@ -106,31 +113,50 @@ run('./configure --prefix=' . $buildDir . ' 2>&1');
|
|||||||
|
|
||||||
echo "Running make...\n";
|
echo "Running make...\n";
|
||||||
|
|
||||||
echo "libicudata.so\n";
|
// If the directory "lib" does not exist in the download, create it or we
|
||||||
|
// will run into problems when building libicuuc.so.
|
||||||
|
$filesystem->mkdir($sourceDir . '/lib');
|
||||||
|
|
||||||
|
// If the directory "bin" does not exist in the download, create it or we
|
||||||
|
// will run into problems when building genrb.
|
||||||
|
$filesystem->mkdir($sourceDir . '/bin');
|
||||||
|
|
||||||
|
echo "[1/5] libicudata.so...";
|
||||||
|
|
||||||
cd($sourceDir . '/stubdata');
|
cd($sourceDir . '/stubdata');
|
||||||
run('make 2>&1 && make install 2>&1');
|
run('make 2>&1 && make install 2>&1');
|
||||||
|
|
||||||
echo "libicuuc.so\n";
|
echo " ok.\n";
|
||||||
|
|
||||||
|
echo "[2/5] libicuuc.so...";
|
||||||
|
|
||||||
cd($sourceDir . '/common');
|
cd($sourceDir . '/common');
|
||||||
run('make 2>&1 && make install 2>&1');
|
run('make 2>&1 && make install 2>&1');
|
||||||
|
|
||||||
echo "libicui18n.so\n";
|
echo " ok.\n";
|
||||||
|
|
||||||
|
echo "[3/5] libicui18n.so...";
|
||||||
|
|
||||||
cd($sourceDir . '/i18n');
|
cd($sourceDir . '/i18n');
|
||||||
run('make 2>&1 && make install 2>&1');
|
run('make 2>&1 && make install 2>&1');
|
||||||
|
|
||||||
echo "libicutu.so\n";
|
echo " ok.\n";
|
||||||
|
|
||||||
|
echo "[4/5] libicutu.so...";
|
||||||
|
|
||||||
cd($sourceDir . '/tools/toolutil');
|
cd($sourceDir . '/tools/toolutil');
|
||||||
run('make 2>&1 && make install 2>&1');
|
run('make 2>&1 && make install 2>&1');
|
||||||
|
|
||||||
echo "genrb\n";
|
echo " ok.\n";
|
||||||
|
|
||||||
|
echo "[5/5] genrb...";
|
||||||
|
|
||||||
cd($sourceDir . '/tools/genrb');
|
cd($sourceDir . '/tools/genrb');
|
||||||
run('make 2>&1 && make install 2>&1');
|
run('make 2>&1 && make install 2>&1');
|
||||||
|
|
||||||
|
echo " ok.\n";
|
||||||
|
}
|
||||||
|
|
||||||
$genrb = $buildDir . '/bin/genrb';
|
$genrb = $buildDir . '/bin/genrb';
|
||||||
$genrbEnv = 'LD_LIBRARY_PATH=' . $buildDir . '/lib ';
|
$genrbEnv = 'LD_LIBRARY_PATH=' . $buildDir . '/lib ';
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ if ($shortIcuVersionInIntlComponent !== $shortIcuVersionInIcuComponent) {
|
|||||||
|
|
||||||
$icuVersionInIcuComponent = IcuData::getVersion();
|
$icuVersionInIcuComponent = IcuData::getVersion();
|
||||||
|
|
||||||
echo "Compiling stubs for ICU version $icuVersionInIcuComponent.";
|
echo "Compiling stubs for ICU version $icuVersionInIcuComponent.\n";
|
||||||
|
|
||||||
echo "Preparing stub creation...\n";
|
echo "Preparing stub creation...\n";
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class SvnRepository
|
|||||||
|
|
||||||
$filesystem = new Filesystem();
|
$filesystem = new Filesystem();
|
||||||
|
|
||||||
if (!$filesystem->exists($targetDir)) {
|
if (!$filesystem->exists($targetDir . '/.svn')) {
|
||||||
$filesystem->remove($targetDir);
|
$filesystem->remove($targetDir);
|
||||||
$filesystem->mkdir($targetDir);
|
$filesystem->mkdir($targetDir);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user