@@ -18,20 +18,21 @@ trait freetype
18
18
*/
19
19
protected function build (): void
20
20
{
21
- $ extra_libs = $ this ->builder ->getLib ('libpng ' ) ? '--with-png ' : '--without-png ' ;
22
- $ extra_libs .= ' ' ;
23
- $ extra_libs .= $ this ->builder ->getLib ('bzip2 ' ) ? ('--with-bzip2= ' . BUILD_ROOT_PATH ) : '--without-bzip2 ' ;
24
- $ extra_libs .= ' ' ;
25
- $ extra_libs .= $ this ->builder ->getLib ('brotli ' ) ? ('--with-brotli= ' . BUILD_ROOT_PATH ) : '--without-brotli ' ;
26
- $ extra_libs .= ' ' ;
27
-
28
- shell ()->cd ($ this ->source_dir )
21
+ $ extra_libs = $ this ->builder ->getLib ('libpng ' ) ? '-DFT_DISABLE_PNG=OFF ' : '-DFT_DISABLE_PNG=ON ' ;
22
+ $ extra_libs .= $ this ->builder ->getLib ('bzip2 ' ) ? '-DFT_DISABLE_BZIP2=OFF ' : '-DFT_DISABLE_BZIP2=ON ' ;
23
+ $ extra_libs .= $ this ->builder ->getLib ('brotli ' ) ? '-DFT_DISABLE_BROTLI=OFF ' : '-DFT_DISABLE_BROTLI=ON ' ;
24
+ FileSystem::resetDir ($ this ->source_dir . '/build ' );
25
+ shell ()->cd ($ this ->source_dir . '/build ' )
29
26
->setEnv (['CFLAGS ' => $ this ->getLibExtraCFlags (), 'LDFLAGS ' => $ this ->getLibExtraLdFlags (), 'LIBS ' => $ this ->getLibExtraLibs ()])
30
- ->execWithEnv ('./autogen.sh ' )
31
- ->execWithEnv ('./configure --without-harfbuzz --prefix= ' . $ extra_libs )
27
+ ->execWithEnv (
28
+ "cmake {$ this ->builder ->makeCmakeArgs ()} -DFT_DISABLE_HARFBUZZ=ON " .
29
+ '-DBUILD_SHARED_LIBS=OFF ' .
30
+ "{$ extra_libs }.. "
31
+ )
32
32
->execWithEnv ('make clean ' )
33
33
->execWithEnv ("make -j {$ this ->builder ->concurrency }" )
34
- ->execWithEnv ('make install DESTDIR= ' . BUILD_ROOT_PATH );
34
+ ->execWithEnv ('make install ' );
35
+
35
36
$ this ->patchPkgconfPrefix (['freetype2.pc ' ]);
36
37
FileSystem::replaceFileStr (
37
38
BUILD_ROOT_PATH . '/lib/pkgconfig/freetype2.pc ' ,
0 commit comments