Skip to content

Commit

Permalink
Fix libtiff dependencies, avoid using system libraries (#588)
Browse files Browse the repository at this point in the history
* Remove tmate debugger

* Bump version to 2.4.4

* Fix libtiff dependencies may wrongly added

* Add matrix tests

* Add tmate debug

* Disable libdeflate for libtiff

* Remove ssh debugger
  • Loading branch information
crazywhalecc authored Jan 25, 2025
1 parent 4bd3a2a commit 36b4ef3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ jobs:
run: ${{ needs.define-build.outputs.download }}
- name: "Build PHP"
run: ${{ needs.define-build.outputs.build }}
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
#- name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3

# Upload cli executable
- if: ${{ inputs.build-cli == true }}
Expand Down
4 changes: 4 additions & 0 deletions config/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@
"source": "libtiff",
"static-libs-unix": [
"libtiff.a"
],
"lib-depends": [
"zlib",
"libjpeg"
]
},
"libuuid": {
Expand Down
2 changes: 1 addition & 1 deletion src/SPC/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
final class ConsoleApplication extends Application
{
public const VERSION = '2.4.3';
public const VERSION = '2.4.4';

public function __construct()
{
Expand Down
8 changes: 8 additions & 0 deletions src/SPC/builder/unix/library/libtiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ trait libtiff
*/
protected function build(): void
{
// zlib
$extra_libs = '--enable-zlib --with-zlib-include-dir=' . BUILD_ROOT_PATH . '/include --with-zlib-lib-dir=' . BUILD_ROOT_PATH . '/lib';
// libjpeg
$extra_libs .= ' --enable-jpeg --disable-old-jpeg --disable-jpeg12 --with-jpeg-include-dir=' . BUILD_ROOT_PATH . '/include --with-jpeg-lib-dir=' . BUILD_ROOT_PATH . '/lib';
// We disabled lzma, zstd, webp, libdeflate by default to reduce the size of the binary
$extra_libs .= ' --disable-lzma --disable-zstd --disable-webp --disable-libdeflate';

$shell = shell()->cd($this->source_dir)
->exec(
'./configure ' .
'--enable-static --disable-shared ' .
"{$extra_libs} " .
'--disable-cxx ' .
'--prefix='
);
Expand Down
7 changes: 2 additions & 5 deletions src/globals/test-extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@

// test php version
$test_php_version = [
'8.1',
'8.2',
'8.3',
'8.4',
];

// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
$test_os = [
'macos-14',
// 'macos-13',
'macos-13',
'ubuntu-latest',
'windows-latest',
];

// whether enable thread safe
Expand All @@ -40,7 +37,7 @@

// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'ast',
'Linux', 'Darwin' => 'imagick',
'Windows' => 'ast',
};

Expand Down

0 comments on commit 36b4ef3

Please sign in to comment.