Add support for phpy (#964)

pull/965/head
Michele Locati 2024-08-20 12:28:09 +02:00 committed by GitHub
parent caa12a3846
commit 71ecd5d0ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 57 additions and 0 deletions

View File

@ -6,6 +6,7 @@ lz4 !jessie
memprof !alpine3.9 !alpine3.10 !alpine3.11 !alpine3.12 !alpine3.13 !alpine3.14 !alpine3.15 memprof !alpine3.9 !alpine3.10 !alpine3.11 !alpine3.12 !alpine3.13 !alpine3.14 !alpine3.15
parallel zts parallel zts
parle !jessie parle !jessie
phpy !buster
pthreads zts pthreads zts
saxon !alpine saxon !alpine
simdjson !jessie !stretch simdjson !jessie !stretch

View File

@ -82,6 +82,7 @@ pdo_pgsql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
pdo_sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 pdo_sqlsrv 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
pgsql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 pgsql 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
php_trie 7.3 7.4 8.0 8.1 8.2 8.3 8.4 php_trie 7.3 7.4 8.0 8.1 8.2 8.3 8.4
phpy 8.1 8.2 8.3 8.4
pkcs11 7.4 8.0 8.1 8.2 8.3 8.4 pkcs11 7.4 8.0 8.1 8.2 8.3 8.4
pq 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 pq 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
propro 5.5 5.6 7.0 7.1 7.2 7.3 7.4 propro 5.5 5.6 7.0 7.1 7.2 7.3 7.4

View File

@ -1218,6 +1218,20 @@ buildRequiredPackageLists() {
php_trie@alpine) php_trie@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
;; ;;
phpy@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent python3"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev"
;;
phpy@debian)
if test $DISTRO_VERSION_NUMBER -ge 12; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.11"
elif test $DISTRO_VERSION_NUMBER -ge 11; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.9"
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpython3.7"
fi
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile python3-dev"
;;
pkcs11@alpine) pkcs11@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent softhsm"
;; ;;

41
scripts/tests/phpy Executable file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env php
<?php
require_once __DIR__ . '/_bootstrap.php';
try {
$rc = 0;
if (!class_exists('PyCore', false)) {
throw new RuntimeException("PyCore class doesn't exist");
}
$os = PyCore::import('os');
$osType = gettype($os);
if ($osType !== 'object') {
throw new RuntimeException("PyCore::import() should return an object, not {$osType}");
}
$osClass = get_class($os);
if ($osClass !== 'PyModule') {
throw new RuntimeException("PyCore::import() should return a PyModule instance, not {$osClass}");
}
$uname = $os->uname();
$unameType = gettype($uname);
if ($unameType !== 'object') {
throw new RuntimeException("os::uname() should return an object, not {$unameType}");
}
$unameClass = get_class($uname);
if ($unameClass !== 'PyTuple') {
throw new RuntimeException("os::uname() should return a PyTuple instance, not {$unameClass}");
}
if ($uname->count() < 5) {
throw new RuntimeException('os::uname() should return a PyTuple with at leasd 5 elements');
}
$sysname = (string) $uname[0];
$sysNames = ['Linux'];
if (!in_array($sysname, $sysNames, true)) {
throw new RuntimeException("os::uname()[0] should be '" . implode("' or '", $sysNames) . "', '{$sysname}' received");
}
} catch (RuntimeException $x) {
fwrite(STDERR, rtrim($x->getMessage()) . "\n");
exit(1);
}
echo "phpy seems ok.\n";