Skip to content

Commit 20f222d

Browse files
committed
post merge fixes
1 parent 187d51e commit 20f222d

File tree

8 files changed

+32
-78
lines changed

8 files changed

+32
-78
lines changed

src/SPC/builder/freebsd/library/openssl.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,8 @@ protected function build(): void
4848
$ex_lib = trim($zlib->getStaticLibFiles() . ' ' . $ex_lib);
4949
}
5050

51-
shell()->cd($this->source_dir)
52-
->setEnv([
53-
'CFLAGS' => $this->getLibExtraCFlags(),
54-
'LDFLAGS' => $this->getLibExtraLdFlags(),
55-
'LIBS' => $this->getLibExtraLibs() . " {$ex_lib}",
56-
])
57-
->execWithEnv(
51+
shell()->cd($this->source_dir)->initializeEnv($this)
52+
->exec(
5853
"./Configure no-shared {$extra} " .
5954
'--prefix=/ ' . // use prefix=/
6055
"--libdir={$lib} " .

src/SPC/builder/linux/library/icu.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ protected function build(): void
1717
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -DPIC -fPIC"';
1818
$cxxflags = 'CXXFLAGS="-std=c++17 -DPIC -fPIC -fno-ident"';
1919
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
20-
shell()->cd($this->source_dir . '/source')
21-
->setEnv([
22-
'CFLAGS' => $this->getLibExtraCFlags(),
23-
'LDFLAGS' => $this->getLibExtraLdFlags(),
24-
'LIBS' => $this->getLibExtraLibs(),
25-
])
26-
->execWithEnv(
20+
shell()->cd($this->source_dir . '/source')->initializeEnv($this)
21+
->exec(
2722
"{$cppflags} {$cxxflags} {$ldflags} " .
2823
'./runConfigureICU Linux ' .
2924
'--enable-static ' .
@@ -38,9 +33,9 @@ protected function build(): void
3833
'--enable-samples=no ' .
3934
'--prefix=' . BUILD_ROOT_PATH
4035
)
41-
->execWithEnv('make clean')
42-
->execWithEnv("make -j{$this->builder->concurrency}")
43-
->execWithEnv('make install');
36+
->exec('make clean')
37+
->exec("make -j{$this->builder->concurrency}")
38+
->exec('make install');
4439

4540
$this->patchPkgconfPrefix(['icu-i18n.pc', 'icu-io.pc', 'icu-uc.pc'], PKGCONF_PATCH_PREFIX);
4641
FileSystem::removeDir(BUILD_LIB_PATH . '/icu');

src/SPC/builder/linux/library/libpng.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public function build(): void
5555
$optimizations .
5656
'--prefix='
5757
)
58-
->execWithEnv('make clean')
59-
->execWithEnv("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I{$this->source_dir} -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la")
60-
->execWithEnv('make install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH);
58+
->exec('make clean')
59+
->exec("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I{$this->source_dir} -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la")
60+
->exec('make install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH);
6161
$this->patchPkgconfPrefix(['libpng16.pc'], PKGCONF_PATCH_PREFIX);
6262
$this->cleanLaFiles();
6363
}

src/SPC/builder/unix/library/libsodium.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,11 @@ trait libsodium
88
{
99
protected function build(): void
1010
{
11-
shell()->cd($this->source_dir)
12-
->setEnv([
13-
'CFLAGS' => $this->getLibExtraCFlags(),
14-
'LDFLAGS' => $this->getLibExtraLdFlags(),
15-
'LIBS' => $this->getLibExtraLibs(),
16-
])
17-
->execWithEnv('./configure --with-pic --enable-static --disable-shared --prefix=')
18-
->execWithEnv('make clean')
19-
->execWithEnv("make -j{$this->builder->concurrency}")
20-
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
11+
shell()->cd($this->source_dir)->initializeEnv($this)
12+
->exec('./configure --with-pic --enable-static --disable-shared --prefix=')
13+
->exec('make clean')
14+
->exec("make -j{$this->builder->concurrency}")
15+
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
2116

2217
$this->patchPkgconfPrefix(['libsodium.pc'], PKGCONF_PATCH_PREFIX);
2318
}

src/SPC/builder/unix/library/postgresql.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ protected function build(): void
8686
'LIBS' => $this->getLibExtraLibs(),
8787
];
8888
// configure
89-
shell()->cd($this->source_dir . '/build')
90-
->setEnv($env)
91-
->execWithEnv(
89+
shell()->cd($this->source_dir . '/build')->initializeEnv($this)
90+
->exec(
9291
"{$envs} ../configure " .
9392
"--prefix={$builddir} " .
9493
($this->builder->getOption('enable-zts') ? '--enable-thread-safety ' : '--disable-thread-safety ') .
@@ -108,11 +107,11 @@ protected function build(): void
108107
'--without-bonjour ' .
109108
'--without-tcl '
110109
)
111-
->execWithEnv($envs . ' make -C src/bin/pg_config install')
112-
->execWithEnv($envs . ' make -C src/include install')
113-
->execWithEnv($envs . ' make -C src/common install')
114-
->execWithEnv($envs . ' make -C src/port install')
115-
->execWithEnv($envs . ' make -C src/interfaces/libpq install');
110+
->exec($envs . ' make -C src/bin/pg_config install')
111+
->exec($envs . ' make -C src/include install')
112+
->exec($envs . ' make -C src/common install')
113+
->exec($envs . ' make -C src/port install')
114+
->exec($envs . ' make -C src/interfaces/libpq install');
116115

117116
// remove dynamic libs
118117
shell()->cd($this->source_dir . '/build')

src/SPC/builder/unix/library/unixodbc.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@ trait unixodbc
1515
*/
1616
protected function build(): void
1717
{
18-
shell()->cd($this->source_dir)
19-
->setEnv([
20-
'CFLAGS' => $this->getLibExtraCFlags(),
21-
'LDFLAGS' => $this->getLibExtraLdFlags(),
22-
'LIBS' => $this->getLibExtraLibs(),
23-
])
24-
->execWithEnv(
18+
shell()->cd($this->source_dir)->initializeEnv($this)
19+
->exec(
2520
'./configure ' .
2621
'--enable-static --disable-shared ' .
2722
'--disable-debug ' .
@@ -32,9 +27,9 @@ protected function build(): void
3227
'--enable-gui=no ' .
3328
'--prefix='
3429
)
35-
->execWithEnv('make clean')
36-
->execWithEnv("make -j{$this->builder->concurrency}")
37-
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
30+
->exec('make clean')
31+
->exec("make -j{$this->builder->concurrency}")
32+
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
3833
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
3934
$this->cleanLaFiles();
4035
}

src/SPC/builder/unix/library/xz.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@ trait xz
1515
*/
1616
public function build(): void
1717
{
18-
shell()->cd($this->source_dir)
19-
->setEnv([
20-
'CFLAGS' => $this->getLibExtraCFlags(),
21-
'LDFLAGS' => $this->getLibExtraLdFlags(),
22-
'LIBS' => $this->getLibExtraLibs(),
23-
])
24-
->execWithEnv(
18+
shell()->cd($this->source_dir)->initializeEnv($this)
19+
->exec(
2520
'./configure ' .
2621
'--enable-static ' .
2722
'--disable-shared ' .
@@ -31,9 +26,9 @@ public function build(): void
3126
'--with-libiconv ' .
3227
'--prefix='
3328
)
34-
->execWithEnv('make clean')
35-
->execWithEnv("make -j{$this->builder->concurrency}")
36-
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
29+
->exec('make clean')
30+
->exec("make -j{$this->builder->concurrency}")
31+
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
3732
$this->patchPkgconfPrefix(['liblzma.pc']);
3833
$this->patchLaDependencyPrefix(['liblzma.la']);
3934
}

src/SPC/util/WindowsCmd.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,4 @@ public function setEnv(array $env): WindowsCmd
7575
$this->env = array_merge($this->env, $env);
7676
return $this;
7777
}
78-
79-
/**
80-
* @throws RuntimeException
81-
*/
82-
public function execWithEnv(string $cmd): WindowsCmd
83-
{
84-
if ($this->getEnvString() !== '') {
85-
return $this->exec($this->getEnvString() . "call {$cmd}");
86-
}
87-
return $this->exec($cmd);
88-
}
89-
90-
private function getEnvString(): string
91-
{
92-
$str = '';
93-
foreach ($this->env as $k => $v) {
94-
$str .= 'set ' . $k . '=' . $v . ' && ';
95-
}
96-
return $str;
97-
}
9878
}

0 commit comments

Comments
 (0)