mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
post merge fixes
This commit is contained in:
parent
187d51e501
commit
20f222d19e
@ -48,13 +48,8 @@ class openssl extends BSDLibraryBase
|
||||
$ex_lib = trim($zlib->getStaticLibFiles() . ' ' . $ex_lib);
|
||||
}
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv([
|
||||
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||
'LIBS' => $this->getLibExtraLibs() . " {$ex_lib}",
|
||||
])
|
||||
->execWithEnv(
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec(
|
||||
"./Configure no-shared {$extra} " .
|
||||
'--prefix=/ ' . // use prefix=/
|
||||
"--libdir={$lib} " .
|
||||
|
||||
@ -17,13 +17,8 @@ class icu extends LinuxLibraryBase
|
||||
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -DPIC -fPIC"';
|
||||
$cxxflags = 'CXXFLAGS="-std=c++17 -DPIC -fPIC -fno-ident"';
|
||||
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
|
||||
shell()->cd($this->source_dir . '/source')
|
||||
->setEnv([
|
||||
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||
'LIBS' => $this->getLibExtraLibs(),
|
||||
])
|
||||
->execWithEnv(
|
||||
shell()->cd($this->source_dir . '/source')->initializeEnv($this)
|
||||
->exec(
|
||||
"{$cppflags} {$cxxflags} {$ldflags} " .
|
||||
'./runConfigureICU Linux ' .
|
||||
'--enable-static ' .
|
||||
@ -38,9 +33,9 @@ class icu extends LinuxLibraryBase
|
||||
'--enable-samples=no ' .
|
||||
'--prefix=' . BUILD_ROOT_PATH
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||
->execWithEnv('make install');
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
|
||||
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
|
||||
FileSystem::removeDir(BUILD_LIB_PATH . '/icu');
|
||||
|
||||
@ -55,9 +55,9 @@ class libpng extends LinuxLibraryBase
|
||||
$optimizations .
|
||||
'--prefix='
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I{$this->source_dir} -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la")
|
||||
->execWithEnv('make install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH);
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I{$this->source_dir} -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la")
|
||||
->exec('make install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['libpng16.pc'], PKGCONF_PATCH_PREFIX);
|
||||
$this->cleanLaFiles();
|
||||
}
|
||||
|
||||
@ -8,16 +8,11 @@ trait libsodium
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv([
|
||||
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||
'LIBS' => $this->getLibExtraLibs(),
|
||||
])
|
||||
->execWithEnv('./configure --with-pic --enable-static --disable-shared --prefix=')
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec('./configure --with-pic --enable-static --disable-shared --prefix=')
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
|
||||
$this->patchPkgconfPrefix(['libsodium.pc'], PKGCONF_PATCH_PREFIX);
|
||||
}
|
||||
|
||||
@ -86,9 +86,8 @@ trait postgresql
|
||||
'LIBS' => $this->getLibExtraLibs(),
|
||||
];
|
||||
// configure
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->setEnv($env)
|
||||
->execWithEnv(
|
||||
shell()->cd($this->source_dir . '/build')->initializeEnv($this)
|
||||
->exec(
|
||||
"{$envs} ../configure " .
|
||||
"--prefix={$builddir} " .
|
||||
($this->builder->getOption('enable-zts') ? '--enable-thread-safety ' : '--disable-thread-safety ') .
|
||||
@ -108,11 +107,11 @@ trait postgresql
|
||||
'--without-bonjour ' .
|
||||
'--without-tcl '
|
||||
)
|
||||
->execWithEnv($envs . ' make -C src/bin/pg_config install')
|
||||
->execWithEnv($envs . ' make -C src/include install')
|
||||
->execWithEnv($envs . ' make -C src/common install')
|
||||
->execWithEnv($envs . ' make -C src/port install')
|
||||
->execWithEnv($envs . ' make -C src/interfaces/libpq install');
|
||||
->exec($envs . ' make -C src/bin/pg_config install')
|
||||
->exec($envs . ' make -C src/include install')
|
||||
->exec($envs . ' make -C src/common install')
|
||||
->exec($envs . ' make -C src/port install')
|
||||
->exec($envs . ' make -C src/interfaces/libpq install');
|
||||
|
||||
// remove dynamic libs
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
|
||||
@ -15,13 +15,8 @@ trait unixodbc
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv([
|
||||
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||
'LIBS' => $this->getLibExtraLibs(),
|
||||
])
|
||||
->execWithEnv(
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec(
|
||||
'./configure ' .
|
||||
'--enable-static --disable-shared ' .
|
||||
'--disable-debug ' .
|
||||
@ -32,9 +27,9 @@ trait unixodbc
|
||||
'--enable-gui=no ' .
|
||||
'--prefix='
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
|
||||
$this->cleanLaFiles();
|
||||
}
|
||||
|
||||
@ -15,13 +15,8 @@ trait xz
|
||||
*/
|
||||
public function build(): void
|
||||
{
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv([
|
||||
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||
'LIBS' => $this->getLibExtraLibs(),
|
||||
])
|
||||
->execWithEnv(
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec(
|
||||
'./configure ' .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
@ -31,9 +26,9 @@ trait xz
|
||||
'--with-libiconv ' .
|
||||
'--prefix='
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['liblzma.pc']);
|
||||
$this->patchLaDependencyPrefix(['liblzma.la']);
|
||||
}
|
||||
|
||||
@ -75,24 +75,4 @@ class WindowsCmd
|
||||
$this->env = array_merge($this->env, $env);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function execWithEnv(string $cmd): WindowsCmd
|
||||
{
|
||||
if ($this->getEnvString() !== '') {
|
||||
return $this->exec($this->getEnvString() . "call {$cmd}");
|
||||
}
|
||||
return $this->exec($cmd);
|
||||
}
|
||||
|
||||
private function getEnvString(): string
|
||||
{
|
||||
$str = '';
|
||||
foreach ($this->env as $k => $v) {
|
||||
$str .= 'set ' . $k . '=' . $v . ' && ';
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user