post merge fixes

This commit is contained in:
DubbleClick 2025-06-09 14:48:05 +07:00
parent 187d51e501
commit 20f222d19e
8 changed files with 32 additions and 78 deletions

View File

@ -48,13 +48,8 @@ class openssl extends BSDLibraryBase
$ex_lib = trim($zlib->getStaticLibFiles() . ' ' . $ex_lib); $ex_lib = trim($zlib->getStaticLibFiles() . ' ' . $ex_lib);
} }
shell()->cd($this->source_dir) shell()->cd($this->source_dir)->initializeEnv($this)
->setEnv([ ->exec(
'CFLAGS' => $this->getLibExtraCFlags(),
'LDFLAGS' => $this->getLibExtraLdFlags(),
'LIBS' => $this->getLibExtraLibs() . " {$ex_lib}",
])
->execWithEnv(
"./Configure no-shared {$extra} " . "./Configure no-shared {$extra} " .
'--prefix=/ ' . // use prefix=/ '--prefix=/ ' . // use prefix=/
"--libdir={$lib} " . "--libdir={$lib} " .

View File

@ -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"'; $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"'; $cxxflags = 'CXXFLAGS="-std=c++17 -DPIC -fPIC -fno-ident"';
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : ''; $ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
shell()->cd($this->source_dir . '/source') shell()->cd($this->source_dir . '/source')->initializeEnv($this)
->setEnv([ ->exec(
'CFLAGS' => $this->getLibExtraCFlags(),
'LDFLAGS' => $this->getLibExtraLdFlags(),
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv(
"{$cppflags} {$cxxflags} {$ldflags} " . "{$cppflags} {$cxxflags} {$ldflags} " .
'./runConfigureICU Linux ' . './runConfigureICU Linux ' .
'--enable-static ' . '--enable-static ' .
@ -38,9 +33,9 @@ class icu extends LinuxLibraryBase
'--enable-samples=no ' . '--enable-samples=no ' .
'--prefix=' . BUILD_ROOT_PATH '--prefix=' . BUILD_ROOT_PATH
) )
->execWithEnv('make clean') ->exec('make clean')
->execWithEnv("make -j{$this->builder->concurrency}") ->exec("make -j{$this->builder->concurrency}")
->execWithEnv('make install'); ->exec('make install');
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX); $this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
FileSystem::removeDir(BUILD_LIB_PATH . '/icu'); FileSystem::removeDir(BUILD_LIB_PATH . '/icu');

View File

@ -55,9 +55,9 @@ class libpng extends LinuxLibraryBase
$optimizations . $optimizations .
'--prefix=' '--prefix='
) )
->execWithEnv('make clean') ->exec('make clean')
->execWithEnv("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I{$this->source_dir} -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la") ->exec("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 install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['libpng16.pc'], PKGCONF_PATCH_PREFIX); $this->patchPkgconfPrefix(['libpng16.pc'], PKGCONF_PATCH_PREFIX);
$this->cleanLaFiles(); $this->cleanLaFiles();
} }

View File

@ -8,16 +8,11 @@ trait libsodium
{ {
protected function build(): void protected function build(): void
{ {
shell()->cd($this->source_dir) shell()->cd($this->source_dir)->initializeEnv($this)
->setEnv([ ->exec('./configure --with-pic --enable-static --disable-shared --prefix=')
'CFLAGS' => $this->getLibExtraCFlags(), ->exec('make clean')
'LDFLAGS' => $this->getLibExtraLdFlags(), ->exec("make -j{$this->builder->concurrency}")
'LIBS' => $this->getLibExtraLibs(), ->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
])
->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);
$this->patchPkgconfPrefix(['libsodium.pc'], PKGCONF_PATCH_PREFIX); $this->patchPkgconfPrefix(['libsodium.pc'], PKGCONF_PATCH_PREFIX);
} }

View File

@ -86,9 +86,8 @@ trait postgresql
'LIBS' => $this->getLibExtraLibs(), 'LIBS' => $this->getLibExtraLibs(),
]; ];
// configure // configure
shell()->cd($this->source_dir . '/build') shell()->cd($this->source_dir . '/build')->initializeEnv($this)
->setEnv($env) ->exec(
->execWithEnv(
"{$envs} ../configure " . "{$envs} ../configure " .
"--prefix={$builddir} " . "--prefix={$builddir} " .
($this->builder->getOption('enable-zts') ? '--enable-thread-safety ' : '--disable-thread-safety ') . ($this->builder->getOption('enable-zts') ? '--enable-thread-safety ' : '--disable-thread-safety ') .
@ -108,11 +107,11 @@ trait postgresql
'--without-bonjour ' . '--without-bonjour ' .
'--without-tcl ' '--without-tcl '
) )
->execWithEnv($envs . ' make -C src/bin/pg_config install') ->exec($envs . ' make -C src/bin/pg_config install')
->execWithEnv($envs . ' make -C src/include install') ->exec($envs . ' make -C src/include install')
->execWithEnv($envs . ' make -C src/common install') ->exec($envs . ' make -C src/common install')
->execWithEnv($envs . ' make -C src/port install') ->exec($envs . ' make -C src/port install')
->execWithEnv($envs . ' make -C src/interfaces/libpq install'); ->exec($envs . ' make -C src/interfaces/libpq install');
// remove dynamic libs // remove dynamic libs
shell()->cd($this->source_dir . '/build') shell()->cd($this->source_dir . '/build')

View File

@ -15,13 +15,8 @@ trait unixodbc
*/ */
protected function build(): void protected function build(): void
{ {
shell()->cd($this->source_dir) shell()->cd($this->source_dir)->initializeEnv($this)
->setEnv([ ->exec(
'CFLAGS' => $this->getLibExtraCFlags(),
'LDFLAGS' => $this->getLibExtraLdFlags(),
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv(
'./configure ' . './configure ' .
'--enable-static --disable-shared ' . '--enable-static --disable-shared ' .
'--disable-debug ' . '--disable-debug ' .
@ -32,9 +27,9 @@ trait unixodbc
'--enable-gui=no ' . '--enable-gui=no ' .
'--prefix=' '--prefix='
) )
->execWithEnv('make clean') ->exec('make clean')
->execWithEnv("make -j{$this->builder->concurrency}") ->exec("make -j{$this->builder->concurrency}")
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH); ->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']); $this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
$this->cleanLaFiles(); $this->cleanLaFiles();
} }

View File

@ -15,13 +15,8 @@ trait xz
*/ */
public function build(): void public function build(): void
{ {
shell()->cd($this->source_dir) shell()->cd($this->source_dir)->initializeEnv($this)
->setEnv([ ->exec(
'CFLAGS' => $this->getLibExtraCFlags(),
'LDFLAGS' => $this->getLibExtraLdFlags(),
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv(
'./configure ' . './configure ' .
'--enable-static ' . '--enable-static ' .
'--disable-shared ' . '--disable-shared ' .
@ -31,9 +26,9 @@ trait xz
'--with-libiconv ' . '--with-libiconv ' .
'--prefix=' '--prefix='
) )
->execWithEnv('make clean') ->exec('make clean')
->execWithEnv("make -j{$this->builder->concurrency}") ->exec("make -j{$this->builder->concurrency}")
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH); ->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['liblzma.pc']); $this->patchPkgconfPrefix(['liblzma.pc']);
$this->patchLaDependencyPrefix(['liblzma.la']); $this->patchLaDependencyPrefix(['liblzma.la']);
} }

View File

@ -75,24 +75,4 @@ class WindowsCmd
$this->env = array_merge($this->env, $env); $this->env = array_merge($this->env, $env);
return $this; 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;
}
} }