diff --git a/src/SPC/builder/unix/library/freetype.php b/src/SPC/builder/unix/library/freetype.php index 0f25ff6e..42e8f91c 100644 --- a/src/SPC/builder/unix/library/freetype.php +++ b/src/SPC/builder/unix/library/freetype.php @@ -18,20 +18,21 @@ trait freetype */ protected function build(): void { - $extra_libs = $this->builder->getLib('libpng') ? '--with-png' : '--without-png'; - $extra_libs .= ' '; - $extra_libs .= $this->builder->getLib('bzip2') ? ('--with-bzip2=' . BUILD_ROOT_PATH) : '--without-bzip2'; - $extra_libs .= ' '; - $extra_libs .= $this->builder->getLib('brotli') ? ('--with-brotli=' . BUILD_ROOT_PATH) : '--without-brotli'; - $extra_libs .= ' '; - - shell()->cd($this->source_dir) + $extra_libs = $this->builder->getLib('libpng') ? '-DFT_DISABLE_PNG=OFF ' : '-DFT_DISABLE_PNG=ON '; + $extra_libs .= $this->builder->getLib('bzip2') ? '-DFT_DISABLE_BZIP2=OFF ' : '-DFT_DISABLE_BZIP2=ON '; + $extra_libs .= $this->builder->getLib('brotli') ? '-DFT_DISABLE_BROTLI=OFF ' : '-DFT_DISABLE_BROTLI=ON '; + FileSystem::resetDir($this->source_dir . '/build'); + shell()->cd($this->source_dir . '/build') ->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()]) - ->execWithEnv('./autogen.sh') - ->execWithEnv('./configure --without-harfbuzz --prefix= ' . $extra_libs) + ->execWithEnv( + "cmake {$this->builder->makeCmakeArgs()} -DFT_DISABLE_HARFBUZZ=ON " . + '-DBUILD_SHARED_LIBS=OFF ' . + "{$extra_libs}.." + ) ->execWithEnv('make clean') ->execWithEnv("make -j{$this->builder->concurrency}") - ->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH); + ->execWithEnv('make install'); + $this->patchPkgconfPrefix(['freetype2.pc']); FileSystem::replaceFileStr( BUILD_ROOT_PATH . '/lib/pkgconfig/freetype2.pc', diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index d4c768c6..a42210b9 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -36,17 +36,17 @@ $no_strip = false; $upx = false; // prefer downloading pre-built packages to speed up the build process -$prefer_pre_built = true; +$prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'grpc', + 'Linux', 'Darwin' => 'gd', 'Windows' => 'bcmath', }; // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). $with_libs = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => '', + 'Linux', 'Darwin' => 'freetype', 'Windows' => '', }; @@ -54,7 +54,7 @@ $with_libs = match (PHP_OS_FAMILY) { // You can use `common`, `bulk`, `minimal` or `none`. // note: combination is only available for *nix platform. Windows must use `none` combination $base_combination = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'none', + 'Linux', 'Darwin' => 'minimal', 'Windows' => 'none', };