Compare commits

..

7 Commits
2.4.2 ... 2.4.3

Author SHA1 Message Date
Jerry Ma
4b16631d45 Fix openssl missing cert bug for Linux & macOS (#581)
* Fix openssl missing cert bug for linux

* Fix openssl missing cert bug for macOS
2024-12-24 22:06:31 +08:00
Jerry Ma
944f4af914 Update FUNDING.yml 2024-12-23 11:05:21 +08:00
Jerry Ma
4865c1c124 Update README.md 2024-12-23 11:04:46 +08:00
Jerry Ma
78aea56de4 Add aom patch for alpine linux (#579) 2024-12-20 12:18:34 +08:00
Jerry Ma
adbe2e80f3 Update ConsoleApplication.php 2024-12-19 12:28:49 +08:00
Jerry Ma
192c8cde87 Add libaom, libde265, libheif support, for imagick AVIF format support (#575)
* Add libaom, libde265, libheif support, for imagick AVIF format support

* Fix aom optimization

* Fix aom build command

* Fix libheif build command

* Fix libheif build

* cs fix
2024-12-19 12:23:39 +08:00
Adam
d4ec366c5f Update SQLite to 3.45 (#574)
* Force SQLite 3.45 build from source.

* Update SQLite to 3.45.

* Sort config.

* Minimize changes.
2024-12-15 20:03:48 +08:00
22 changed files with 354 additions and 56 deletions

4
.github/FUNDING.yml vendored
View File

@@ -1,9 +1,9 @@
# These are supported funding model platforms # These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] github: [crazywhalecc]# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username open_collective: # Replace with a single Open Collective username
ko_fi: crazywhalecc # Replace with a single Ko-fi username # ko_fi: crazywhalecc # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username liberapay: # Replace with a single Liberapay username

View File

@@ -313,7 +313,7 @@ Now there is a [static-php](https://github.com/static-php) organization, which i
## Sponsor this project ## Sponsor this project
You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md). A portion of your donation will be used to maintain the **static-php.dev** server. You can sponsor me or my project from [GitHub Sponsor](https://github.com/crazywhalecc). A portion of your donation will be used to maintain the **static-php.dev** server.
## Open-Source License ## Open-Source License

View File

@@ -560,6 +560,19 @@
"source": "rar", "source": "rar",
"cpp-extension": true "cpp-extension": true
}, },
"rdkafka": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "external",
"source": "ext-rdkafka",
"arg-type": "custom",
"cpp-extension": true,
"lib-depends": [
"librdkafka"
]
},
"readline": { "readline": {
"support": { "support": {
"Windows": "wip", "Windows": "wip",
@@ -708,19 +721,6 @@
"zlib" "zlib"
] ]
}, },
"rdkafka": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "external",
"source": "ext-rdkafka",
"arg-type": "custom",
"cpp-extension": true,
"lib-depends": [
"librdkafka"
]
},
"swoole": { "swoole": {
"support": { "support": {
"Windows": "no", "Windows": "no",

View File

@@ -176,7 +176,8 @@
"libjpeg", "libjpeg",
"libwebp", "libwebp",
"freetype", "freetype",
"libtiff" "libtiff",
"libheif"
], ],
"lib-suggests": [ "lib-suggests": [
"zstd", "zstd",
@@ -208,6 +209,13 @@
"libsodium" "libsodium"
] ]
}, },
"libaom": {
"source": "libaom",
"static-libs-unix": [
"libaom.a"
],
"cpp-library": true
},
"libargon2": { "libargon2": {
"source": "libargon2", "source": "libargon2",
"static-libs-unix": [ "static-libs-unix": [
@@ -235,6 +243,13 @@
"ares_rules.h" "ares_rules.h"
] ]
}, },
"libde265": {
"source": "libde265",
"static-libs-unix": [
"libde265.a"
],
"cpp-library": true
},
"libevent": { "libevent": {
"source": "libevent", "source": "libevent",
"static-libs-unix": [ "static-libs-unix": [
@@ -276,6 +291,19 @@
"fficonfig.h" "fficonfig.h"
] ]
}, },
"libheif": {
"source": "libheif",
"static-libs-unix": [
"libheif.a"
],
"lib-depends": [
"libde265",
"libwebp",
"libaom",
"zlib",
"brotli"
]
},
"libiconv": { "libiconv": {
"source": "libiconv", "source": "libiconv",
"static-libs-unix": [ "static-libs-unix": [
@@ -355,6 +383,18 @@
"openssl" "openssl"
] ]
}, },
"librdkafka": {
"source": "librdkafka",
"static-libs-unix": [
"librdkafka.a",
"librdkafka++.a",
"librdkafka-static.a"
],
"cpp-library": true,
"lib-suggests": [
"zstd"
]
},
"libsodium": { "libsodium": {
"source": "libsodium", "source": "libsodium",
"static-libs-unix": [ "static-libs-unix": [
@@ -558,18 +598,6 @@
"pkg-config": { "pkg-config": {
"source": "pkg-config" "source": "pkg-config"
}, },
"librdkafka": {
"source": "librdkafka",
"static-libs-unix": [
"librdkafka.a",
"librdkafka++.a",
"librdkafka-static.a"
],
"cpp-library": true,
"lib-suggests": [
"zstd"
]
},
"postgresql": { "postgresql": {
"source": "postgresql", "source": "postgresql",
"static-libs-unix": [ "static-libs-unix": [

View File

@@ -69,23 +69,6 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"librdkafka": {
"type": "ghtar",
"repo": "confluentinc/librdkafka",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-rdkafka": {
"type": "ghtar",
"repo": "arnaud-lb/php-rdkafka",
"path": "php-src/ext/rdkafka",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-event": { "ext-event": {
"type": "url", "type": "url",
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz", "url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
@@ -145,6 +128,15 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"ext-rdkafka": {
"type": "ghtar",
"repo": "arnaud-lb/php-rdkafka",
"path": "php-src/ext/rdkafka",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-simdjson": { "ext-simdjson": {
"type": "url", "type": "url",
"url": "https://pecl.php.net/get/simdjson", "url": "https://pecl.php.net/get/simdjson",
@@ -311,6 +303,16 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"libaom": {
"type": "git",
"rev": "main",
"url": "https://aomedia.googlesource.com/aom",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libargon2": { "libargon2": {
"type": "git", "type": "git",
"rev": "master", "rev": "master",
@@ -346,6 +348,17 @@
"path": "LICENSE.md" "path": "LICENSE.md"
} }
}, },
"libde265": {
"type": "ghrel",
"repo": "strukturag/libde265",
"match": "libde265-.+\\.tar\\.gz",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"libevent": { "libevent": {
"type": "ghrel", "type": "ghrel",
"repo": "libevent/libevent", "repo": "libevent/libevent",
@@ -376,6 +389,17 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"libheif": {
"type": "ghrel",
"repo": "strukturag/libheif",
"match": "libheif-.+\\.tar\\.gz",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"libiconv": { "libiconv": {
"type": "filelist", "type": "filelist",
"url": "https://ftp.gnu.org/gnu/libiconv/", "url": "https://ftp.gnu.org/gnu/libiconv/",
@@ -442,6 +466,14 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"librdkafka": {
"type": "ghtar",
"repo": "confluentinc/librdkafka",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libsodium": { "libsodium": {
"type": "ghrel", "type": "ghrel",
"repo": "jedisct1/libsodium", "repo": "jedisct1/libsodium",
@@ -751,7 +783,7 @@
}, },
"sqlite": { "sqlite": {
"type": "url", "type": "url",
"url": "https://www.sqlite.org/2023/sqlite-autoconf-3430200.tar.gz", "url": "https://www.sqlite.org/2024/sqlite-autoconf-3450200.tar.gz",
"provide-pre-built": true, "provide-pre-built": true,
"license": { "license": {
"type": "text", "type": "text",

View File

@@ -31,7 +31,7 @@ use Symfony\Component\Console\Application;
*/ */
final class ConsoleApplication extends Application final class ConsoleApplication extends Application
{ {
public const VERSION = '2.4.2'; public const VERSION = '2.4.3';
public function __construct() public function __construct()
{ {

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class libaom extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libaom;
public const NAME = 'libaom';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class libde265 extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libde265;
public const NAME = 'libde265';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class libheif extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libheif;
public const NAME = 'libheif';
}

View File

@@ -69,6 +69,7 @@ class openssl extends LinuxLibraryBase
"{$env} ./Configure no-shared {$extra} " . "{$env} ./Configure no-shared {$extra} " .
'--prefix=/ ' . '--prefix=/ ' .
'--libdir=lib ' . '--libdir=lib ' .
'--openssldir=/etc/ssl ' .
'-static ' . '-static ' .
"{$zlib_extra}" . "{$zlib_extra}" .
'no-legacy ' . 'no-legacy ' .

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class libaom extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libaom;
public const NAME = 'libaom';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class libde265 extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libde265;
public const NAME = 'libde265';
}

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
use SPC\store\FileSystem;
class libheif extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libheif;
public const NAME = 'libheif';
public function patchBeforeBuild(): bool
{
if (!str_contains(file_get_contents($this->source_dir . '/CMakeLists.txt'), 'libbrotlienc')) {
FileSystem::replaceFileStr(
$this->source_dir . '/CMakeLists.txt',
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")',
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc")'
);
return true;
}
return false;
}
}

View File

@@ -54,7 +54,7 @@ class openssl extends MacOSLibraryBase
"./Configure no-shared {$extra} " . "./Configure no-shared {$extra} " .
'--prefix=/ ' . // use prefix=/ '--prefix=/ ' . // use prefix=/
"--libdir={$lib} " . "--libdir={$lib} " .
'--openssldir=/System/Library/OpenSSL ' . '--openssldir=/etc/ssl ' .
"darwin64-{$this->builder->getOption('arch')}-cc" "darwin64-{$this->builder->getOption('arch')}-cc"
) )
->exec('make clean') ->exec('make clean')

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
trait libaom
{
/**
* @throws RuntimeException
* @throws FileSystemException
*/
protected function build(): void
{
// CMake needs a clean build directory
FileSystem::resetDir($this->source_dir . '/builddir');
// Start build
shell()->cd($this->source_dir . '/builddir')
->exec(
'cmake ' .
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
'-DCMAKE_BUILD_TYPE=Release ' .
'-DBUILD_SHARED_LIBS=OFF ' .
'-DAOM_TARGET_CPU=generic ' .
'..'
)
->exec("cmake --build . -j {$this->builder->concurrency}")
->exec('make install');
$this->patchPkgconfPrefix(['aom.pc']);
}
}

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
trait libde265
{
/**
* @throws RuntimeException
* @throws FileSystemException
*/
protected function build(): void
{
// CMake needs a clean build directory
FileSystem::resetDir($this->source_dir . '/build');
// Start build
shell()->cd($this->source_dir . '/build')
->exec(
'cmake ' .
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
'-DCMAKE_BUILD_TYPE=Release ' .
'-DBUILD_SHARED_LIBS=OFF ' .
'-DENABLE_SDL=OFF ' . // Disable SDL, currently not supported
'..'
)
->exec("cmake --build . -j {$this->builder->concurrency}")
->exec('make install');
$this->patchPkgconfPrefix(['libde265.pc']);
}
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
trait libheif
{
/**
* @throws RuntimeException
* @throws FileSystemException
*/
protected function build(): void
{
// CMake needs a clean build directory
FileSystem::resetDir($this->source_dir . '/build');
// Start build
shell()->cd($this->source_dir . '/build')
->exec(
'cmake ' .
'--preset=release ' .
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
'-DCMAKE_BUILD_TYPE=Release ' .
'-DBUILD_SHARED_LIBS=OFF ' .
'-DWITH_EXAMPLES=OFF ' .
'-DWITH_GDK_PIXBUF=OFF ' .
'-DBUILD_TESTING=OFF ' .
'-DWITH_LIBSHARPYUV=ON ' . // optional: libwebp
'-DENABLE_PLUGIN_LOADING=OFF ' .
'..'
)
->exec("cmake --build . -j {$this->builder->concurrency}")
->exec('make install');
$this->patchPkgconfPrefix(['libheif.pc']);
}
}

View File

@@ -6,6 +6,7 @@ namespace SPC\store;
use SPC\builder\BuilderBase; use SPC\builder\BuilderBase;
use SPC\builder\linux\LinuxBuilder; use SPC\builder\linux\LinuxBuilder;
use SPC\builder\linux\SystemUtil;
use SPC\builder\unix\UnixBuilderBase; use SPC\builder\unix\UnixBuilderBase;
use SPC\exception\FileSystemException; use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException; use SPC\exception\RuntimeException;
@@ -27,6 +28,7 @@ class SourcePatcher
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']); FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']); FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']);
FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']); FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']);
FileSystem::addSourceExtractHook('libaom', [SourcePatcher::class, 'patchLibaomForAlpine']);
} }
/** /**
@@ -393,6 +395,15 @@ class SourcePatcher
return true; return true;
} }
public static function patchLibaomForAlpine(): bool
{
if (PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist()) {
SourcePatcher::patchFile('libaom_posix_implict.patch', SOURCE_PATH . '/libaom');
return true;
}
return false;
}
/** /**
* Patch cli SAPI Makefile for Windows. * Patch cli SAPI Makefile for Windows.
* *

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
assert(class_exists('Imagick'));
assert(Imagick::queryFormats('AVIF') !== []);
assert(Imagick::queryFormats('HEIF') !== []);
assert(Imagick::queryFormats('HEIC') !== []);
assert(Imagick::queryFormats('WEBP') !== []);
assert(Imagick::queryFormats('JPEG') !== []);
assert(Imagick::queryFormats('PNG') !== []);
assert(Imagick::queryFormats('TIFF') !== []);

View File

@@ -4,3 +4,4 @@ declare(strict_types=1);
assert(function_exists('openssl_digest')); assert(function_exists('openssl_digest'));
assert(openssl_digest('123456', 'md5') === 'e10adc3949ba59abbe56e057f20f883e'); assert(openssl_digest('123456', 'md5') === 'e10adc3949ba59abbe56e057f20f883e');
assert(file_get_contents('https://example.com/') !== false);

View File

@@ -0,0 +1,13 @@
https://bugs.gentoo.org/869419
POSIX_C_SOURCE is needed for ftello.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -269,6 +269,7 @@ add_library(aom_rtcd OBJECT ${AOM_RTCD_SOURCES})
add_dependencies(aom_rtcd aom_version)
if(ENABLE_EXAMPLES)
+ add_definitions(-D_POSIX_C_SOURCE=200112L)
add_library(aom_encoder_stats OBJECT ${AOM_ENCODER_STATS_SOURCES})
set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_encoder_stats)
endif()

View File

@@ -21,9 +21,9 @@ $test_php_version = [
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available) // test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
$test_os = [ $test_os = [
// 'macos-14', 'macos-14',
'macos-13', // 'macos-13',
// 'ubuntu-latest', 'ubuntu-latest',
]; ];
// whether enable thread safe // whether enable thread safe
@@ -35,12 +35,12 @@ $no_strip = false;
$upx = false; $upx = false;
// prefer downloading pre-built packages to speed up the build process // 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`). // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) { $extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'rdkafka', 'Linux', 'Darwin' => 'openssl',
'Windows' => 'zlib', 'Windows' => 'openssl',
}; };
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
@@ -53,7 +53,7 @@ $with_libs = match (PHP_OS_FAMILY) {
// You can use `common`, `bulk`, `minimal` or `none`. // You can use `common`, `bulk`, `minimal` or `none`.
// note: combination is only available for *nix platform. Windows must use `none` combination // note: combination is only available for *nix platform. Windows must use `none` combination
$base_combination = match (PHP_OS_FAMILY) { $base_combination = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'bulk', 'Linux', 'Darwin' => 'minimal',
'Windows' => 'none', 'Windows' => 'none',
}; };