|
6 | 6 | return function (Preprocessor $p) { |
7 | 7 | $freetype_prefix = FREETYPE_PREFIX; |
8 | 8 | $bzip2_prefix = BZIP2_PREFIX; |
| 9 | + $zlib_prefix = ZLIB_PREFIX; |
| 10 | + $libpng_prefix = PNG_PREFIX; |
| 11 | + $brotli_prefix = BROTLI_PREFIX; |
9 | 12 | $p->addLibrary( |
10 | 13 | (new Library('freetype')) |
11 | 14 | ->withHomePage('https://freetype.org/') |
|
14 | 17 | 'https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/docs/GPLv2.TXT', |
15 | 18 | Library::LICENSE_GPL |
16 | 19 | ) |
17 | | - ->withUrl('https://sourceforge.net/projects/freetype/files/freetype2/2.13.2/freetype-2.13.2.tar.gz') |
18 | | - ->withMd5sum('d99447cf00c5f2679918f66f2b5771f6') |
19 | | - ->withFileHash('md5', 'd99447cf00c5f2679918f66f2b5771f6') |
| 20 | + ->withUrl('https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-2.tar.gz') |
| 21 | + ->withFile('freetype-2.13.2.tar.gz') |
| 22 | + ->withMd5sum('dcd1af080e43fe0c984c34bf3e7d5e16') |
| 23 | + ->withFileHash('md5', 'dcd1af080e43fe0c984c34bf3e7d5e16') |
20 | 24 | ->withPrefix($freetype_prefix) |
21 | | - ->withConfigure( |
| 25 | + ->withBuildCached(false) |
| 26 | + ->withBuildScript( |
22 | 27 | <<<EOF |
23 | | - ./configure --help |
24 | | - PACKAGES='zlib libpng libbrotlicommon libbrotlienc libbrotlidec ' |
25 | | - BZIP2_CFLAGS="-I{$bzip2_prefix}/include" \ |
26 | | - BZIP2_LIBS="-L{$bzip2_prefix}/lib -lbz2" \ |
27 | | - CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES)" \ |
28 | | - LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES)" \ |
29 | | - LIBS="$(pkg-config --libs-only-l --static \$PACKAGES)" \ |
30 | | - CFLAGS="-std=gnu11" \ |
31 | | - ./configure \ |
32 | | - --prefix={$freetype_prefix} \ |
33 | | - --enable-shared=no \ |
34 | | - --enable-static=yes \ |
35 | | - --with-zlib=yes \ |
36 | | - --with-bzip2=yes \ |
37 | | - --with-png=yes \ |
38 | | - --with-harfbuzz=no \ |
39 | | - --with-brotli=yes \ |
40 | | - --enable-freetype-config |
| 28 | + mkdir -p build |
| 29 | + cd build |
| 30 | + cmake .. \ |
| 31 | + -DCMAKE_INSTALL_PREFIX={$freetype_prefix} \ |
| 32 | + -DCMAKE_BUILD_TYPE=Release \ |
| 33 | + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ |
| 34 | + -DBUILD_SHARED_LIBS=OFF \ |
| 35 | + -DBUILD_STATIC_LIBS=ON \ |
| 36 | + -DFT_REQUIRE_ZLIB=TRUE \ |
| 37 | + -DFT_REQUIRE_BZIP2=TRUE \ |
| 38 | + -DFT_REQUIRE_BROTLI=TRUE \ |
| 39 | + -DFT_REQUIRE_PNG=TRUE \ |
| 40 | + -DFT_DISABLE_HARFBUZZ=TRUE \ |
| 41 | + -DCMAKE_PREFIX_PATH="{$zlib_prefix};{$bzip2_prefix};{$libpng_prefix};{$brotli_prefix}" |
41 | 42 |
|
| 43 | + cmake --build . --target install |
42 | 44 | EOF |
43 | 45 | ) |
44 | 46 | ->withPkgName('freetype2') |
|
0 commit comments