From f4548533967edc638f771ae0b39b3d955a555e30 Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Mon, 25 Apr 2022 17:19:13 +0200 Subject: [PATCH] remove php support Relates to #8749 Signed-off-by: Konrad Weihmann --- README.md | 2 +- classes/php-ext.bbclass | 35 ---------------- classes/phpcomposer.bbclass | 40 ------------------- conf/layer.conf | 2 - .../scatest/code-from-elsewhere/bad-php.bb | 18 --------- .../bad-php/deprecated-func.php | 38 ------------------ dynamic-layers/meta-oe/php_%.bbappend | 14 ------- recipes-php/composer/composer-native_2.3.5.bb | 26 ------------ recipes-php/php-ast/php-ast-native_1.0.16.bb | 27 ------------- 9 files changed, 1 insertion(+), 201 deletions(-) delete mode 100644 classes/php-ext.bbclass delete mode 100644 classes/phpcomposer.bbclass delete mode 100644 dynamic-distro/scatest/code-from-elsewhere/bad-php.bb delete mode 100644 dynamic-distro/scatest/code-from-elsewhere/bad-php/deprecated-func.php delete mode 100644 dynamic-layers/meta-oe/php_%.bbappend delete mode 100644 recipes-php/composer/composer-native_2.3.5.bb delete mode 100644 recipes-php/php-ast/php-ast-native_1.0.16.bb diff --git a/README.md b/README.md index 632c4f39e9..a78e56991c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # meta-sca -![https://img.shields.io/badge/Supported%20languages-C%2CC%2B%2B%2CGo%2CLua%2CPHP%2CPython%2CShell%2Cjs%2Cperl%2Cruby-informational](https://img.shields.io/badge/Supported%20languages-C%2CC%2B%2B%2CGo%2CLua%2CPHP%2CPython%2CShell%2Cjs%2Cperl%2Cruby-informational) +![https://img.shields.io/badge/Supported%20languages-C%2CC%2B%2B%2CGo%2CLua%2CPython%2CShell%2Cjs%2Cperl%2Cruby-informational](https://img.shields.io/badge/Supported%20languages-C%2CC%2B%2B%2CGo%2CLua%2CPython%2CShell%2Cjs%2Cperl%2Cruby-informational) [![Nightly](https://github.com/priv-kweihmann/meta-sca/workflows/[master]-nightly/badge.svg)](https://github.com/priv-kweihmann/meta-sca/actions) [![Lastest commit](https://github.com/priv-kweihmann/meta-sca/actions/workflows/push_staging.yml/badge.svg?branch=staging)](https://github.com/priv-kweihmann/meta-sca/actions/workflows/push_staging.yml) diff --git a/classes/php-ext.bbclass b/classes/php-ext.bbclass deleted file mode 100644 index b71223cffd..0000000000 --- a/classes/php-ext.bbclass +++ /dev/null @@ -1,35 +0,0 @@ -## SPDX-License-Identifier: BSD-2-Clause -## Copyright (c) 2019, Konrad Weihmann - -## This class add php-extensions to php.ini-file - -PHP_EXTENSION ?= "" -PHP_INI_FILE ?= "${STAGING_DIR_NATIVE}/${sysconfdir}/php/php.ini" - -python do_add_extension() { - import glob - import os - inifile = d.getVar("PHP_INI_FILE") - if os.path.exists(inifile): - content = "" - with open(inifile, "r") as i: - content = i.read() - if content.find("%SYSROOT%") != -1: - content = content.replace("%SYSROOT%", d.getVar("WORKDIR")) - for ext in [x for x in d.getVar("PHP_EXTENSION").split(" ") if x]: - if content.find("\nextension={}\n".format(ext)) == -1: - content += "extension={}\n".format(ext) - _extdir = [x for x in glob.glob(d.expand("${STAGING_DIR_NATIVE}/usr/lib/php*/extensions/no-debug-non-zts-*")) if os.path.isdir(x)] - if _extdir: - _extdir = _extdir[0] - else: - bb.error("Cannot find a PHP extention dir in sysroot") - # forcefully expand extension_dir to the right path - content += "extension_dir = " + _extdir + "\n" - with open(inifile, "w") as o: - o.write(content) -} - -do_devshell[prefuncs] += "do_add_extension" -do_pyshell[prefuncs] += "do_add_extension" -do_configure[prefuncs] += "do_add_extension" diff --git a/classes/phpcomposer.bbclass b/classes/phpcomposer.bbclass deleted file mode 100644 index 1b668e1213..0000000000 --- a/classes/phpcomposer.bbclass +++ /dev/null @@ -1,40 +0,0 @@ -## SPDX-License-Identifier: BSD-2-Clause -## Copyright (c) 2019, Konrad Weihmann - -inherit sca-nonet-sanity - -## Name of the package to be installed - if empty it looks for composer.json in S-dir -PHPCOMPOSER_PKGS_NAME ?= "${BPN}:${PV}" -## Install dir -PHPCOMPOSER_INSTALLDIR ?= "${bindir}/${BPN}" -## Additional args for composer require (see their man page for details) -PHPCOMPOSER_ADD_ARGS_REQUIRE ?= "--no-suggest" -## Cache dir -PHPCOMPOSER_CACHE_DIR_NAME ?= "composer_cache" -PHPCOMPOSER_CACHE_DIR_BASE ?= "${WORKDIR}" -PHPCOMPOSER_CACHE_DIR ?= "${WORKDIR}/${PHPCOMPOSER_CACHE_DIR_NAME}" - -DEPENDS += "composer-native" - -B = "${WORKDIR}/build" - -phpcomposer_do_configure() { - : -} - -phpcomposer_do_compile() { - rm -rf ${B}/* -} - -phpcomposer_do_install() { - cd ${B} - export COMPOSER_HOME=${STAGING_DATADIR_NATIVE}/composer - export COMPOSER_CACHE_DIR=${PHPCOMPOSER_CACHE_DIR} - composer.phar require -vv \ - ${PHPCOMPOSER_ADD_ARGS_REQUIRE} ${PHPCOMPOSER_PKGS_NAME} - cd - - mkdir -p ${D}${PHPCOMPOSER_INSTALLDIR} - cp -Ra ${B}/* ${D}${PHPCOMPOSER_INSTALLDIR}/ -} - -EXPORT_FUNCTIONS do_install do_configure do_compile diff --git a/conf/layer.conf b/conf/layer.conf index b0b6e33168..cf33f01f10 100755 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -11,8 +11,6 @@ BBFILES += "\ ${LAYERDIR}/recipes-nodejs/*.bbappend \ ${LAYERDIR}/recipes-perl/*/*.bb \ ${LAYERDIR}/recipes-perl/*/*.bbappend \ - ${LAYERDIR}/recipes-php/*/*.bb \ - ${LAYERDIR}/recipes-php/*/*.bbappend \ ${LAYERDIR}/recipes-python/*/*.bb \ ${LAYERDIR}/recipes-python/*/*.bbappend \ ${LAYERDIR}/recipes-ruby/*.bb \ diff --git a/dynamic-distro/scatest/code-from-elsewhere/bad-php.bb b/dynamic-distro/scatest/code-from-elsewhere/bad-php.bb deleted file mode 100644 index 82bd8802fb..0000000000 --- a/dynamic-distro/scatest/code-from-elsewhere/bad-php.bb +++ /dev/null @@ -1,18 +0,0 @@ -SUMMARY = "Bad php testcode" -DEFAULT_PREFERENCE = "${SCA_DEFAULT_PREFERENCE}" -LICENSE = "BSD-2-Clause" -LIC_FILES_CHKSUM = "file://${SCA_LAYERDIR}/LICENSE;md5=a4a2bbea1db029f21b3a328c7a059172" - -SRC_URI = "https://raw.githubusercontent.com/rickogden/insecure-php-example/0e8106cf133815fbc1a146925cc462a546004001/web/index.php;subdir=source;name=rickogden \ - https://gist.githubusercontent.com/jonathan-fulton/9adbebebcaaaabf9098b9705e044725b/raw/a0c49d884bdec9093a290d9b69cd5a7073c83a41/badsignupform.php;subdir=source;name=jonathanfulton \ - file://deprecated-func.php;subdir=source" - -SRC_URI[rickogden.md5sum] = "3fdbb702f827b8d4116bce62956b3b37" -SRC_URI[rickogden.sha256sum] = "bd47f2ea8c4d96aedad02260ad92dcd52a14392d494b5b4875a45e2be9ecf9ed" -SRC_URI[jonathanfulton.md5sum] = "e4a0ff1e1960b93abeeea1706230d682" -SRC_URI[jonathanfulton.sha256sum] = "1a4146c478584ecda6102468d7494822023de147af4e0c6ca0b239e48ab74f54" - -S = "${WORKDIR}/source" -B = "${WORKDIR}/source" - -inherit sca diff --git a/dynamic-distro/scatest/code-from-elsewhere/bad-php/deprecated-func.php b/dynamic-distro/scatest/code-from-elsewhere/bad-php/deprecated-func.php deleted file mode 100644 index 1f4f9ec35c..0000000000 --- a/dynamic-distro/scatest/code-from-elsewhere/bad-php/deprecated-func.php +++ /dev/null @@ -1,38 +0,0 @@ - diff --git a/dynamic-layers/meta-oe/php_%.bbappend b/dynamic-layers/meta-oe/php_%.bbappend deleted file mode 100644 index 5d5ef46f19..0000000000 --- a/dynamic-layers/meta-oe/php_%.bbappend +++ /dev/null @@ -1,14 +0,0 @@ -PACKAGECONFIG:class-native = "mbstring openssl zip" -PACKAGECONFIG[zip] = "--with-zip --with-zlib-dir=${STAGING_EXECPREFIXDIR},,libzip" -PACKAGECONFIG[mbstring] = "--enable-mbstring,," - -FILES:${PN}:class-native += "${sysconfdir}" - -do_install:append:class-native() { - install -d ${D}${sysconfdir}/php - extdir=$(${D}${bindir}/php-config --extension-dir) - cat ${S}/php.ini-production | \ - sed -e "s,;extension_dir = \"\./\",extension_dir = \"${extdir}\",g" | \ - sed -e "s#${WORKDIR}#%SYSROOT%#g" \ - > ${D}${sysconfdir}/php/php.ini -} diff --git a/recipes-php/composer/composer-native_2.3.5.bb b/recipes-php/composer/composer-native_2.3.5.bb deleted file mode 100644 index eba02b8c23..0000000000 --- a/recipes-php/composer/composer-native_2.3.5.bb +++ /dev/null @@ -1,26 +0,0 @@ -SUMMARY = "Dependency Manager for PHP" -HOMEPAGE = "https://github.com/composer/composer" - -DEFAULT_PREFERENCE = "${SCA_DEFAULT_PREFERENCE}" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=db4ebb1057458d039cb8f6edcc5d756e" - -DEPENDS += "php-native" - -SRC_URI = "git://github.com/composer/getcomposer.org.git;protocol=https;branch=main" -SRCREV = "650bee119e1f3b87be1b787fe69a826f73dbdfb9" - -UPSTREAM_CHECK_COMMITS = "1" - -S = "${WORKDIR}/git" - -inherit sca-nonet-sanity -inherit native - -do_install() { - export COMPOSER_HOME=${D}${datadir}/composer - install -d ${D}${bindir} - php ${S}/web/installer --version=${PV} --install-dir=${D}${bindir} -} - -FILES:${PN} += "${bindir} ${datadir}" diff --git a/recipes-php/php-ast/php-ast-native_1.0.16.bb b/recipes-php/php-ast/php-ast-native_1.0.16.bb deleted file mode 100644 index 5603930222..0000000000 --- a/recipes-php/php-ast/php-ast-native_1.0.16.bb +++ /dev/null @@ -1,27 +0,0 @@ -SUMMARY = "Extension exposing PHP 7 abstract syntax tree" -HOMEPAGE = "https://github.com/nikic/php-ast" - -DEFAULT_PREFERENCE = "${SCA_DEFAULT_PREFERENCE}" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=a5c6446acfd7f3170fa312948076b516" - -DEPENDS += "php-native" - -SRC_URI = "git://github.com/nikic/php-ast.git;branch=master;protocol=https" -SRCREV = "8f1e75f66e4d1746c11cf4d96a68181a6e8ff693" - -S = "${WORKDIR}/git" - -inherit autotools-brokensep -inherit native - -do_configure:prepend() { - phpize -} - -do_install() { - oe_runmake install INSTALL_ROOT=${D} -} - -FILES:${PN} += "${libdir}/php*/extensions/*/*.so" -FILES:${PN}-dbg += "${libdir}/php*/extensions/*/.debug"