Skip to content

Commit 3be6fac

Browse files
committed
Enable xdiff and crypto
1 parent 1b72e65 commit 3be6fac

File tree

4 files changed

+190
-1
lines changed

4 files changed

+190
-1
lines changed

config.full.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ wcli = Yes ; Windows CLI native support
8787
; bitset = Yes
8888
; bsdiff = Yes
8989
; brotli = Yes
90+
; crypto = Yes
9091
; csv = Yes
9192
; dbase = Yes
9293
; dio = Yes
@@ -117,6 +118,7 @@ wcli = Yes ; Windows CLI native support
117118
; translit = Yes
118119
; win32service = Yes
119120
; win32ps = Yes
121+
; xdiff = Yes
120122
; xhprof = Yes
121123
; yac = Yes
122124
; yaml = Yes
@@ -145,7 +147,6 @@ wcli = Yes ; Windows CLI native support
145147
; pdo-mssql
146148
; pdo-oci
147149
; pdo-firebird ; Missing static lib
148-
; xdiff ; From PECL
149150

150151

151152
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

libraries/install_cares.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
/**
4+
* ██████╗ █████╗ ██████╗ ███████╗███████╗
5+
* ██╔════╝ ██╔══██╗██╔══██╗██╔════╝██╔════╝
6+
* ██║█████╗███████║██████╔╝█████╗ ███████╗
7+
* ██║╚════╝██╔══██║██╔══██╗██╔══╝ ╚════██║
8+
* ╚██████╗ ██║ ██║██║ ██║███████╗███████║
9+
* ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝
10+
*/
11+
12+
13+
$path = ARCH_PATH . $lib->name . '-' . $lib->version . '\\';
14+
$careslog = LOG . 'c-ares.log';
15+
16+
17+
// Verify if libevent is installed
18+
if (is_dir($path) && is_file($path . 'build-win\lib\Release\cares.lib') && is_file(DEPS_PATH . 'lib\libcares_a.lib')) {
19+
draw_status($lib->name . '-' . $lib->version, "installed", Green);
20+
return;
21+
}
22+
23+
24+
// Download and unzip c-ares
25+
$tmpfile = TMP.pathinfo($lib->download_url, PATHINFO_BASENAME);
26+
if(!download_file($lib->download_url, $tmpfile, pathinfo($tmpfile, PATHINFO_BASENAME))) exit_error();
27+
if(!$firstdir = zip_first_dir($tmpfile)) exit_error("Invalid zip archive");
28+
if(!unzip($tmpfile, ARCH_PATH)) exit_error();
29+
if(!rename_wait(ARCH_PATH . $firstdir, $path)) exit_error("Can't rename library path");
30+
31+
32+
// Compile c-ares
33+
$label = "Compile " . $lib->name . '-' . $lib->version;
34+
draw_line($label, "running", Yellow);
35+
$bat = '@echo off'.RN;
36+
$bat .= 'cd ' . escapeshellarg($path).RN;
37+
$bat .= 'md build-win'.RN;
38+
$bat .= 'cd build-win'.RN;
39+
$bat .= 'cmake -G "Visual Studio 16 2019" -DCARES_STATIC=ON -DCARES_SHARED=OFF ..'.RN;
40+
$bat .= 'DEVENV "c-ares.sln" /rebuild "Release|x64" /project "c-ares"';
41+
$batfile = TMP . 'build_cares.bat';
42+
file_put_contents($batfile, $bat);
43+
$ret = shell_exec_vs16($batfile, true);
44+
file_put_contents($careslog, $ret);
45+
46+
47+
// Verify if the build works
48+
if(!is_file($path . 'build-win\lib\Release\cares.lib')) draw_status($label, "failed", Red, true, 'SEE: ' . $careslog);
49+
else draw_status($label, "complete", Green);
50+
51+
52+
// Install c-ares
53+
$label = "Install " . $lib->name . '-' . $lib->version;
54+
draw_line($label, "running", Yellow);
55+
$builddir = $path . 'build\\';
56+
57+
$files[$path . 'build-win\lib\Release\cares.lib'] = 'lib\libcares_a.lib';
58+
$files[$path . 'include\ares_build.h.dist'] = 'include\ares_build.h';
59+
60+
foreach(glob($path . 'include\*.h') as $file)
61+
$files[$file] = 'include\\' . basename($file);
62+
63+
if(!create_build($builddir, $files)) draw_status($label, "failed", Red, true);
64+
if(!install_deps($builddir)) draw_status($label, "failed", Red, true);
65+
else draw_status($label, "complete", Green);
66+
67+
delete_parent_deps($lib->name);

libraries/install_jsonc.php

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
/**
4+
* ██╗███████╗ ██████╗ ███╗ ██╗ ██████╗
5+
* ██║██╔════╝██╔═══██╗████╗ ██║ ██╔════╝
6+
* ██║███████╗██║ ██║██╔██╗ ██║█████╗██║
7+
* ██ ██║╚════██║██║ ██║██║╚██╗██║╚════╝██║
8+
* ╚█████╔╝███████║╚██████╔╝██║ ╚████║ ╚██████╗
9+
* ╚════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝
10+
*/
11+
12+
13+
$path = ARCH_PATH . $lib->name . '-' . $lib->version . '\\';
14+
$jsonclog = LOG . 'jsonc.log';
15+
16+
17+
// Verify if jsonc is installed
18+
if (is_dir($path) && is_file($path . 'build\lib\json-c.lib') && is_file(DEPS_PATH . 'lib\json-c.lib')) {
19+
draw_status($lib->name . '-' . $lib->version, "installed", Green);
20+
return;
21+
}
22+
23+
24+
// Download and unzip jsonc
25+
$tmpfile = TMP.pathinfo($lib->download_url, PATHINFO_BASENAME);
26+
if(!download_file($lib->download_url, $tmpfile, pathinfo($tmpfile, PATHINFO_BASENAME))) exit_error();
27+
if(!$firstdir = zip_first_dir($tmpfile)) exit_error("Invalid zip archive");
28+
if(!unzip($tmpfile, ARCH_PATH)) exit_error();
29+
if(!rename_wait(ARCH_PATH . $firstdir, $path)) exit_error("Can't rename library path");
30+
31+
32+
// Compile jsonc
33+
$label = "Compile " . $lib->name . '-' . $lib->version;
34+
draw_line($label, "running", Yellow);
35+
$bat = '@echo off'.RN;
36+
$bat .= 'cd ' . escapeshellarg($path).RN;
37+
$bat .= 'md build-win'.RN;
38+
$bat .= 'cd build-win'.RN;
39+
$bat .= 'cmake -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=release ..'.RN;
40+
$bat .= 'DEVENV "json-c.sln" /rebuild "Release|x64" /project "json-c"';
41+
$batfile = TMP . 'build_jsonc.bat';
42+
file_put_contents($batfile, $bat);
43+
$ret = shell_exec_vs16($batfile, true);
44+
file_put_contents($jsonclog, $ret);
45+
46+
47+
// Verify if the build works
48+
if(!is_file($path . 'build-win\Release\json-c.lib')) draw_status($label, "failed", Red, true, 'SEE: ' . $lelog);
49+
else draw_status($label, "complete", Green);
50+
51+
52+
// Install jsonc
53+
$label = "Install " . $lib->name . '-' . $lib->version;
54+
draw_line($label, "running", Yellow);
55+
$builddir = $path . 'build\\';
56+
57+
$files[$path . 'build-win\Release\json-c.lib'] = 'lib\json-c.lib';
58+
$files[$path . 'build-win\json.h'] = 'include\json-c\json.h';
59+
$files[$path . 'arraylist.h'] = 'include\json-c\json.h';
60+
$files[$path . 'debug.h'] = 'include\json-c\debug.h';
61+
$files[$path . 'json_c_version.h'] = 'include\json-c\json_c_version.h';
62+
$files[$path . 'json_object.h'] = 'include\json-c\json_object.h';
63+
$files[$path . 'json_object_iterator.h'] = 'include\json-c\json_object_iterator.h';
64+
$files[$path . 'json_patch.h'] = 'include\json-c\json_patch.h';
65+
$files[$path . 'json_pointer.h'] = 'include\json-c\json_pointer.h';
66+
$files[$path . 'json_tokener.h'] = 'include\json-c\json_tokener.h';
67+
$files[$path . 'json_util.h'] = 'include\json-c\json_util.h';
68+
$files[$path . 'linkhash.h'] = 'include\json-c\linkhash.h';
69+
70+
if(!create_build($builddir, $files)) draw_status($label, "failed", Red, true);
71+
if(!install_deps($builddir)) draw_status($label, "failed", Red, true);
72+
else draw_status($label, "complete", Green);
73+
74+
delete_parent_deps($lib->name);

matrix.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,28 @@
10101010
"switch": "--enable-zephir-parser",
10111011
"dependancies": [],
10121012
"libraries": []
1013+
},
1014+
{
1015+
"name": "xdiff",
1016+
"repo": "",
1017+
"url": "https://pecl.php.net/get/xdiff-2.1.1.tgz",
1018+
"version": "2.1.1",
1019+
"builtin": false,
1020+
"mandatory": false,
1021+
"switch": "--with-xdiff",
1022+
"dependancies": [],
1023+
"libraries": ["libxdiff"]
1024+
},
1025+
{
1026+
"name": "crypto",
1027+
"repo": "",
1028+
"url": "https://pecl.php.net/get/crypto-0.3.2.tgz",
1029+
"version": "0.3.2",
1030+
"builtin": false,
1031+
"mandatory": false,
1032+
"switch": "--with-crypto",
1033+
"dependancies": ["openssl"],
1034+
"libraries": ["openssl"]
10131035
}
10141036
],
10151037

@@ -1090,6 +1112,14 @@
10901112
"mandatory": false,
10911113
"dependancies": ["openssl", "zlib"]
10921114
},
1115+
{
1116+
"name": "c-ares",
1117+
"version": "1.29.0",
1118+
"download_url": "https://github.com/c-ares/c-ares/archive/refs/tags/cares-1_29_0.zip",
1119+
"install_script": "install_cares.php",
1120+
"mandatory": false,
1121+
"dependancies": []
1122+
},
10931123
{
10941124
"name": "curl",
10951125
"version": "8.8.0",
@@ -1449,6 +1479,23 @@
14491479
"install_script": "install_ip2proxy.php",
14501480
"mandatory": false,
14511481
"dependancies": []
1482+
},
1483+
{
1484+
"name": "jsonc",
1485+
"version": "0.17",
1486+
"download_url": "https://github.com/json-c/json-c/archive/refs/tags/json-c-0.17-20230812.zip",
1487+
"install_script": "install_jsonc.php",
1488+
"mandatory": false,
1489+
"dependancies": []
1490+
},
1491+
{
1492+
"name": "libxdiff",
1493+
"version": "0.23",
1494+
"download_url": "https://windows.php.net/downloads/pecl/deps/libxdiff-0.23-vs16-x64.zip",
1495+
"install_script": "install_library.php",
1496+
"install_check": "lib\\xdiff_a.lib",
1497+
"mandatory": false,
1498+
"dependancies": []
14521499
}
14531500
]
14541501
}

0 commit comments

Comments
 (0)