diff --git a/config/lib.json b/config/lib.json index 4d656ae0..b64cc7c4 100644 --- a/config/lib.json +++ b/config/lib.json @@ -147,7 +147,8 @@ "libpng", "libjpeg", "libwebp", - "freetype" + "freetype", + "libtiff" ], "lib-suggests": [ "zstd", @@ -330,6 +331,12 @@ "zlib" ] }, + "libtiff": { + "source": "libtiff", + "static-libs-unix": [ + "libtiff.a" + ] + }, "libuv": { "source": "libuv", "static-libs-unix": [ diff --git a/config/source.json b/config/source.json index d59f5c54..37b5a7e0 100644 --- a/config/source.json +++ b/config/source.json @@ -325,6 +325,15 @@ "path": "COPYING" } }, + "libtiff": { + "type": "filelist", + "url": "https://download.osgeo.org/libtiff/", + "regex": "/href=\"(?tiff-(?[^\"]+)\\.tar\\.xz)\"/", + "license": { + "type": "file", + "path": "LICENSE.md" + } + }, "libuv": { "type": "ghtar", "repo": "libuv/libuv", diff --git a/src/SPC/builder/linux/library/libtiff.php b/src/SPC/builder/linux/library/libtiff.php new file mode 100644 index 00000000..fe3d15ad --- /dev/null +++ b/src/SPC/builder/linux/library/libtiff.php @@ -0,0 +1,12 @@ +cd($this->source_dir) + ->exec( + './configure ' . + '--enable-static --disable-shared ' . + '--disable-cxx ' . + '--prefix=' + ) + ->exec('make clean') + ->exec("make -j{$this->builder->concurrency}") + ->exec('make install DESTDIR=' . BUILD_ROOT_PATH); + $this->patchPkgconfPrefix(['libtiff-4.pc']); + } +} diff --git a/src/SPC/command/BuildCliCommand.php b/src/SPC/command/BuildCliCommand.php index 5105c43c..3c5c2276 100644 --- a/src/SPC/command/BuildCliCommand.php +++ b/src/SPC/command/BuildCliCommand.php @@ -37,12 +37,8 @@ public function configure(): void $this->addOption('with-suggested-exts', 'E', null, 'Build with suggested extensions for selected exts'); $this->addOption('with-added-patch', 'P', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Inject patch script outside'); $this->addOption('without-micro-ext-test', null, null, 'Disable phpmicro with extension test code'); - $this->addOption('with-upx-pack', null, null, 'Compress / pack binary using UPX tool (linux/windows only)'); - - if (PHP_OS_FAMILY === 'Windows') { - $this->addOption('with-micro-logo', null, InputOption::VALUE_REQUIRED, 'Use custom .ico for micro.sfx'); - } + $this->addOption('with-micro-logo', null, InputOption::VALUE_REQUIRED, 'Use custom .ico for micro.sfx (windows only)'); } public function handle(): int diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index d342e8f6..ba11efbb 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,13 +13,13 @@ // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'pgsql,pdo_pgsql', + 'Linux', 'Darwin' => 'imagick,zstd,bz2,zip,xml,dom', 'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi', }; // 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' => 'xz', 'Windows' => '', }; @@ -27,7 +27,7 @@ // 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' => 'common', + 'Linux', 'Darwin' => 'minimal', 'Windows' => 'none', }; @@ -62,6 +62,7 @@ function _getCombination(string $type = 'common'): string if (PHP_OS_FAMILY === 'Windows') { $final_extensions_cmd = '"' . $final_extensions . '"'; + $final_libs = $final_libs === '' ? '' : ('"' . $final_libs . '"'); } else { $final_extensions_cmd = $final_extensions; } @@ -69,7 +70,7 @@ function _getCombination(string $type = 'common'): string echo match ($argv[1]) { 'extensions' => $final_extensions, 'libs' => $final_libs, - 'libs_cmd' => ($final_libs === '' ? '' : (' --with-libs="' . $final_libs . '"')), - 'cmd' => $final_extensions_cmd . ($final_libs === '' ? '' : (' --with-libs="' . $final_libs . '"')), + 'libs_cmd' => ($final_libs === '' ? '' : (' --with-libs=' . $final_libs)), + 'cmd' => $final_extensions_cmd . ($final_libs === '' ? '' : (' --with-libs=' . $final_libs)), default => '', };