Compare commits

..

2 Commits
2.5.1 ... vcpkg

Author SHA1 Message Date
DubbleClick
3f3767e4a4 fix libheif problem by turning off the option that failed 2025-03-24 17:31:35 +07:00
DubbleClick
fe2bc9e4e1 WIP on vcpkg integration 2025-03-24 14:35:10 +07:00
10 changed files with 123 additions and 75 deletions

View File

@@ -426,17 +426,6 @@
},
"notes": true
},
"odbc": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "builtin",
"arg-type-unix": "custom",
"lib-depends-unix": [
"unixodbc"
]
},
"opcache": {
"type": "builtin",
"arg-type-unix": "custom"
@@ -503,20 +492,6 @@
"mysqlnd"
]
},
"pdo_odbc": {
"support": {
"BSD": "wip"
},
"type": "builtin",
"arg-type": "custom",
"lib-depends-unix": [
"unixodbc"
],
"ext-depends": [
"pdo",
"odbc"
]
},
"pdo_pgsql": {
"support": {
"Windows": "wip",

View File

@@ -1,17 +0,0 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('odbc')]
class odbc extends Extension
{
public function getUnixConfigureArg(): string
{
return '--with-unixODBC=' . BUILD_ROOT_PATH;
}
}

View File

@@ -1,29 +0,0 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('pdo_odbc')]
class pdo_odbc extends Extension
{
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/pdo_odbc/config.m4', 'PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags', 'PDO_ODBC_LDFLAGS="-liconv $pdo_odbc_def_ldflags');
return true;
}
public function getUnixConfigureArg(): string
{
return '--with-pdo-odbc=unixODBC,' . BUILD_ROOT_PATH;
}
public function getWindowsConfigureArg(): string
{
return '--with-pdo-odbc';
}
}

View File

@@ -21,8 +21,8 @@ $test_php_version = [
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
$test_os = [
'macos-13',
'macos-14',
// 'macos-13',
// 'macos-14',
'ubuntu-latest',
'windows-latest',
];
@@ -40,8 +40,8 @@ $prefer_pre_built = false;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'odbc,pdo_odbc',
'Windows' => 'odbc,pdo_odbc',
'Linux', 'Darwin' => '',
'Windows' => 'mbstring,tokenizer,phar,curl,openssl',
};
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).

14
vcpkg-configuration.json Normal file
View File

@@ -0,0 +1,14 @@
{
"default-registry": {
"kind": "git",
"baseline": "a76b33254af4092ff45f08ec5adcd9fd06468b43",
"repository": "https://github.com/microsoft/vcpkg"
},
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
"name": "microsoft"
}
]
}

View File

@@ -0,0 +1,7 @@
set(CMAKE_C_COMPILER /usr/bin/gcc)
set(CMAKE_CXX_COMPILER /usr/bin/g++)
set(CMAKE_AR /usr/bin/ar)
set(CMAKE_LINKER /usr/bin/ld.gold)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(ENV{CFLAGS} "-fPIC -fPIE")
set(ENV{CXXFLAGS} "-fPIC -fPIE")

View File

@@ -0,0 +1,17 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_BUILD_TYPE release)
set(VCPKG_C_FLAGS "-fPIC -fPIE")
set(VCPKG_CXX_FLAGS "-fPIC -fPIE")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS
-DBUILD_SHARED_LIBS=OFF
-DWITH_EXAMPLES=OFF
-DWITH_GDK_PIXBUF=OFF
-DBUILD_TESTING=OFF
)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/x64-linux-glibc-toolchain.cmake")

View File

@@ -0,0 +1,5 @@
set(CMAKE_C_COMPILER /usr/local/musl/bin/x86_64-linux-musl-gcc)
set(CMAKE_CXX_COMPILER /usr/local/musl/bin/x86_64-linux-musl-g++)
set(CMAKE_AR /usr/local/musl/bin/x86_64-linux-musl-ar)
set(CMAKE_LINKER /usr/local/musl/bin/x86_64-linux-musl-ld.gold)
set(CMAKE_CROSSCOMPILING TRUE)

View File

@@ -0,0 +1,10 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_BUILD_TYPE release)
set(VCPKG_C_FLAGS "-fPIC -fPIE -static")
set(VCPKG_CXX_FLAGS "-fPIC -fPIE -static")
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/x64-linux-musl-toolchain.cmake")

66
vcpkg.json Normal file
View File

@@ -0,0 +1,66 @@
{
"dependencies": [
"acl",
"aom",
"argon2",
"brotli",
"bzip2",
"c-ares",
"curl",
"freetype",
"gettext",
"gmp",
"grpc",
"icu",
"libavif",
"libde265",
"libevent",
"libffi",
{
"name": "libgd",
"features": [
"fontconfig",
"freetype",
"jpeg",
"png",
"tiff",
"webp"
]
},
{
"name": "libheif",
"features": [
"aom",
"jpeg",
"hevc"
]
},
"libiconv",
"libpng",
"librabbitmq",
"librdkafka",
"libsodium",
"libssh2",
"libuuid",
"libuv",
"libwebp",
"libxml2",
"libxslt",
"libyaml",
"libzip",
"lz4",
"mimalloc",
"ncurses",
"nghttp2",
"nghttp3",
"openldap",
"pkgconf",
"readline",
"snappy",
"sqlite3",
"tidy-html5",
"tiff",
"zlib",
"zstd"
]
}