forked from dixyes/lwmbs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3778f24
commit 7cbf02e
Showing
3 changed files
with
151 additions
and
0 deletions.
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,74 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (c) 2022 Yun Dou <[email protected]> | ||
* | ||
* lwmbs is licensed under Mulan PSL v2. You can use this | ||
* software according to the terms and conditions of the | ||
* Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: | ||
* | ||
* http://license.coscl.org.cn/MulanPSL2 | ||
* | ||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | ||
* | ||
* See the Mulan PSL v2 for more details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
class Libicu extends Library | ||
{ | ||
use LinuxLibraryTrait; | ||
protected string $name = 'icu'; | ||
protected array $depNames = []; | ||
protected array $staticLibs = [ | ||
"libicui18n.a", | ||
"libicuio.a", | ||
"libicuuc.a", | ||
"libicudata.a" | ||
]; | ||
|
||
|
||
|
||
|
||
|
||
protected array $headers = []; | ||
protected array $pkgconfs = []; | ||
|
||
protected function build(): void | ||
{ | ||
Log::i("building {$this->name}"); | ||
$ret = 0; | ||
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1"'; | ||
$cxxflags = 'CXXFLAGS="-std=c++11"'; | ||
$ldflags = 'LDFLAGS="-static"'; | ||
passthru( | ||
$this->config->setX . ' && ' . | ||
"cd {$this->sourceDir} && " . | ||
"{$this->config->configureEnv} " . | ||
"{$cppflags} {$cxxflags} {$ldflags} " . | ||
' ./runConfigureICU Linux ' . | ||
'--enable-static ' . | ||
'--disable-shared ' . | ||
'--with-data-packaging=static ' . | ||
'--enable-release=yes ' . | ||
'--enable-extras=yes ' . | ||
'--enable-icuio=yes ' . | ||
'--enable-dyload=no ' . | ||
'--enable-tools=yes ' . | ||
'--enable-tests=no ' . | ||
'--enable-samples=no ' . | ||
'--prefix= && ' . | ||
"make clean && " . | ||
"make -j{$this->config->concurrency} && " . | ||
'make install DESTDIR=' . realpath('.'), | ||
$ret | ||
); | ||
if ($ret !== 0) { | ||
throw new Exception("failed to build {$this->name}"); | ||
} | ||
} | ||
} |
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,65 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (c) 2022 Yun Dou <[email protected]> | ||
* | ||
* lwmbs is licensed under Mulan PSL v2. You can use this | ||
* software according to the terms and conditions of the | ||
* Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: | ||
* | ||
* http://license.coscl.org.cn/MulanPSL2 | ||
* | ||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | ||
* | ||
* See the Mulan PSL v2 for more details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
class Libicu extends Library | ||
{ | ||
use LinuxLibraryTrait; | ||
protected string $name = 'icu'; | ||
protected array $depNames = []; | ||
protected array $staticLibs = [ | ||
"libicui18n.a", | ||
"libicuio.a", | ||
"libicuuc.a", | ||
"libicudata.a" | ||
]; | ||
|
||
|
||
|
||
|
||
|
||
protected array $headers = []; | ||
protected array $pkgconfs = []; | ||
|
||
protected function build(): void | ||
{ | ||
Log::i("building {$this->name}"); | ||
$ret = 0; | ||
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1"'; | ||
$cxxflags = 'CXXFLAGS="-std=c++11"'; | ||
$ldflags = 'LDFLAGS="-static"'; | ||
passthru( | ||
$this->config->setX . ' && ' . | ||
"cd {$this->sourceDir} && " . | ||
"{$this->config->configureEnv} " . | ||
' ./runConfigureICU MacOSX ' . | ||
'--enable-static ' . | ||
'--disable-shared ' . | ||
'--prefix= && ' . | ||
"make clean && " . | ||
"make -j{$this->config->concurrency} && " . | ||
'make install DESTDIR=' . realpath('.'), | ||
$ret | ||
); | ||
if ($ret !== 0) { | ||
throw new Exception("failed to build {$this->name}"); | ||
} | ||
} | ||
} |
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