From 9c602d90d61cea9fe83c596c68a99e383ee15f73 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 28 Oct 2022 22:00:05 +0100 Subject: gentoo auto-resync : 28:10:2022 - 22:00:04 --- dev-lang/Manifest.gz | Bin 19375 -> 19375 bytes dev-lang/jsonnet/Manifest | 5 +- dev-lang/jsonnet/files/jsonnet-0.18.0-gcc-13.patch | 18 + dev-lang/jsonnet/jsonnet-0.18.0-r1.ebuild | 1 + dev-lang/jsonnet/jsonnet-0.19.1.ebuild | 107 +++ dev-lang/php/Manifest | 8 +- dev-lang/php/php-8.0.25.ebuild | 759 +++++++++++++++++++++ dev-lang/php/php-8.1.12.ebuild | 757 ++++++++++++++++++++ dev-lang/php/php-8.2.0_rc3.ebuild | 758 -------------------- dev-lang/php/php-8.2.0_rc5.ebuild | 759 +++++++++++++++++++++ dev-lang/squirrel/Manifest | 5 + .../files/squirrel-3.2-CVE-2022-30292.patch | 12 + dev-lang/squirrel/files/squirrel.pc.in | 12 + dev-lang/squirrel/squirrel-3.2.ebuild | 63 ++ 14 files changed, 2503 insertions(+), 761 deletions(-) create mode 100644 dev-lang/jsonnet/files/jsonnet-0.18.0-gcc-13.patch create mode 100644 dev-lang/jsonnet/jsonnet-0.19.1.ebuild create mode 100644 dev-lang/php/php-8.0.25.ebuild create mode 100644 dev-lang/php/php-8.1.12.ebuild delete mode 100644 dev-lang/php/php-8.2.0_rc3.ebuild create mode 100644 dev-lang/php/php-8.2.0_rc5.ebuild create mode 100644 dev-lang/squirrel/files/squirrel-3.2-CVE-2022-30292.patch create mode 100644 dev-lang/squirrel/files/squirrel.pc.in create mode 100644 dev-lang/squirrel/squirrel-3.2.ebuild (limited to 'dev-lang') diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz index 89c75e198a39..43512249d24b 100644 Binary files a/dev-lang/Manifest.gz and b/dev-lang/Manifest.gz differ diff --git a/dev-lang/jsonnet/Manifest b/dev-lang/jsonnet/Manifest index 0da736e38385..aa0466692515 100644 --- a/dev-lang/jsonnet/Manifest +++ b/dev-lang/jsonnet/Manifest @@ -2,9 +2,12 @@ AUX jsonnet-0.12.1-dont-call-make-from-setuppy.patch 387 BLAKE2B 8c0223b10cf1b61 AUX jsonnet-0.14.0-makefile.patch 752 BLAKE2B 5acf8e07cd0f1b9af658015e6ee560f31a25b4b17402e0516bc8a861db4f31d9cb23e86943389d36f0885f4afc179b433764a331aea7a0164368e3561490da61 SHA512 18230b761ec3d3d106e06d02680b54229eb20c681b7591209dbb7d5ee138edc3a5015d1e53d3238dd9c86753bcc3f5ef3352a733e9a950fca4b37af8d83c9888 AUX jsonnet-0.16.0-cp-var.patch 824 BLAKE2B 111fff8e8b897864e14defa677c1a9b8589ef6a859b2344b24e16a940d90cdeff1affde6cd53c0a1a443a82553ee90d554990160f07c49e98c15a5fc7ea3e03a SHA512 96ecfb8a6b49d31e6a827ed401566b5eef39deb8a3542a6f1b3a5df148bfd93479038468585dc47a76fbb9e7953bf9a6c7161abc7acaff7b81cb8dffe3de2f6d AUX jsonnet-0.16.0-libdir.patch 963 BLAKE2B c4b71c01230710bf81fca03b1411bbd21ee02d9957b12997f629c9b4c8e543889658308868d48fe20e0bb9647848bd1b1fa2100c58426785bab1c9bfbbaa8bcb SHA512 9a85c5b8d80f6975ddd3e3c369adb44f6f49382a1e50e9848129c53f81846e69f60a44f401a8a1042657a03f94daaaeb5747632414fa7cb0dc9e2f014ec17a1d +AUX jsonnet-0.18.0-gcc-13.patch 533 BLAKE2B 02d0b945f4a2fd9db923debff2c50f9f9ce3387f911022bba887fef42300b253cf006414351e77b931902cbe6a62a72ec0576621920e7fb0f611eda544386e8a SHA512 5926f6d15e5b2fd3a4db5787974ca26e7e7f59a3e3b30d49510d7ee47cb043bce220633c89c65b6be958c07874331e2d7484effd948ecffdd5e742b1936f61f0 AUX jsonnet-0.18.0-unbundle.patch 2564 BLAKE2B 8945b6b17af162a99b7d561a68a48c218d0d939ba74784f35eaa8f8dbafe568e9b4db258d45cf9ce5d87504e3d265697f074d4202c8210e878daf07b56514ef5 SHA512 5bae8d02062ecd29d9650c2b623631e7f7a172148be052620a47ef42788ee272f795011ecc98df9d2000947f0ced4c76776e09f5143058b030cc61a54355bbbf DIST jsonnet-0.18.0.tar.gz 22472162 BLAKE2B 4f931a44b0cbeea0dc7705c28ca49817e2b3abe19ba4fdcd550d5df1ce9ad6b06b1b740a9306d36caa3970c88df9d31700373e4997dd52c6c2219cdd9bf125c1 SHA512 08a64a4b132df1519292378cef93deb3c60d21636b2a71bce6c13e29cfd93cab465cad77e11f000fb984c5c75a4ca1c92504654fd2e5201343df767ea0e610d1 DIST jsonnet-0.19.0.tar.gz 22478380 BLAKE2B 0a1612ca0525342763099e70921181578fcf7ab25c2a3811ffede944953e4ce114f1949642038d6147c96d52193cf701473fab8581d50c3e74036139fbd5c19a SHA512 f4e30d977df7840a4f13c7ba75614badd964a5c4484fb264d7b05d6de04aa2a2d3c4c5161523d6fa6559460ea94b94562b07ea6590a34876545c529474c4b9fa -EBUILD jsonnet-0.18.0-r1.ebuild 2076 BLAKE2B 84ce1cd4819f2fddfa26271f9311a1eb57e66936822c9e9dd94201935e985101a7e11e4a660db95178891053e99ba5079548a7584ef5f8896d15717bb03fff90 SHA512 41e4ddfc52a89de20852f91f0d615a1a01e47ea34f99a7ead2ad43a7e3e0210f67f8eb017a8922274db60334cfcd6681d8a023075dfc09a7508bf329da417350 +DIST jsonnet-0.19.1.tar.gz 22480685 BLAKE2B 7d86bc963f5ced622e91adf015c250b8cae2e817b6af5d60820d8731e04caecc1b2b8142d320414d253ef1fa3558d61aeb1b59480eab0823915d2b15c5d87aab SHA512 21312de71f63f4a74005f563290d67fcc2d220f043291a123af2fc834f4118f8bbc311ea8acc5dd52b13eff8c32f026a5ce6bfe3d88b4c6c770e585dd1f0b688 +EBUILD jsonnet-0.18.0-r1.ebuild 2119 BLAKE2B 38f132f1ec652aaca2280fe5f9e12094ef47b8b670373a5783a46932b5d1629b5d9cc1c5ab4f03baeb2ccbf64bcf5213ffa512d5571ad06da455ab5d4ff67dd1 SHA512 1125926a054884fcd213d5917288f65f19de60966bd2a9f6468de47046ead25fcb50ec4e0f097d771f90cd43d7b739577fd798c5cc2b32644c6e19fe9ce6b266 EBUILD jsonnet-0.19.0-r1.ebuild 2128 BLAKE2B a4ff0c29853483e5093b469bb811305f7955561bff84349682cce40fcf9e31c4d03d7b974bf3d0227f3e6fcd308ade37911271df1464190c01c973eba0df64f8 SHA512 574237bf6c1992845d83749d00fb7c74bb01c42ae02e7e2b3fd1872a8a9c453117ecab0e81a2a6ff5210a4156ad456797f524cd0da71f5cf7f1a9b3e7365e79b +EBUILD jsonnet-0.19.1.ebuild 2132 BLAKE2B a22914221574b5844057fb3718998187b15076def31ee6932efb3df954af3597c2c7a3c5fe366f14f4e75e302e9bfd64b4a79d2d1810eb5f732bf3dbfabdd607 SHA512 5a9c1b69fbd19f8c54247f42a801f1e2ba3adef7c6a419627abf3395fc1cf5e1f3be9094b41b26bb6cbfe1664e363b18b3967b2341fe1943a42e8f4713efb32b MISC metadata.xml 636 BLAKE2B b4f30bead9e90492366ba9d8fd393cfa6610efcb1dbe7cf11307445f2b7aa596585b576e550aa0df3bcfd14c7a8b068d09040ea94dc815db76d6d15e0f09fccb SHA512 a106617bce041fc24e1fab61d08add74f450742e7c1be14633cd49b5137c86cf52bd5baf9ea8f5f2f51a90619c7dfad7e6bf749894d8e4df8063857f29a0492a diff --git a/dev-lang/jsonnet/files/jsonnet-0.18.0-gcc-13.patch b/dev-lang/jsonnet/files/jsonnet-0.18.0-gcc-13.patch new file mode 100644 index 000000000000..b2adca81a351 --- /dev/null +++ b/dev-lang/jsonnet/files/jsonnet-0.18.0-gcc-13.patch @@ -0,0 +1,18 @@ +https://github.com/google/jsonnet/pull/1020 +From: WANG Xuerui +Date: Thu, 6 Oct 2022 15:04:47 +0800 +Subject: [PATCH] Add #include for gcc-13 builds + +See https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes. + +This fixes Gentoo bug https://bugs.gentoo.org/875569. +--- a/include/libjsonnet++.h ++++ b/include/libjsonnet++.h +@@ -17,6 +17,7 @@ limitations under the License. + #ifndef CPP_JSONNET_H_ + #define CPP_JSONNET_H_ + ++#include + #include + #include + #include diff --git a/dev-lang/jsonnet/jsonnet-0.18.0-r1.ebuild b/dev-lang/jsonnet/jsonnet-0.18.0-r1.ebuild index 9411530afa9b..5d8c0d156382 100644 --- a/dev-lang/jsonnet/jsonnet-0.18.0-r1.ebuild +++ b/dev-lang/jsonnet/jsonnet-0.18.0-r1.ebuild @@ -42,6 +42,7 @@ PATCHES=( "${FILESDIR}/jsonnet-0.16.0-libdir.patch" "${FILESDIR}/jsonnet-0.16.0-cp-var.patch" "${FILESDIR}/jsonnet-0.18.0-unbundle.patch" + "${FILESDIR}/jsonnet-0.18.0-gcc-13.patch" ) distutils_enable_tests unittest diff --git a/dev-lang/jsonnet/jsonnet-0.19.1.ebuild b/dev-lang/jsonnet/jsonnet-0.19.1.ebuild new file mode 100644 index 000000000000..586f1b3b4915 --- /dev/null +++ b/dev-lang/jsonnet/jsonnet-0.19.1.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( pypy3 python3_{8..11} ) + +inherit cmake toolchain-funcs flag-o-matic distutils-r1 + +DESCRIPTION="A data templating language for app and tool developers" +HOMEPAGE="https://jsonnet.org/" +SRC_URI="https://github.com/google/jsonnet/archive/v${PV}.tar.gz -> ${P}.tar.gz" +IUSE="custom-optimization doc examples python test" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +RDEPEND=" + dev-cpp/rapidyaml:= + dev-cpp/nlohmann_json:= + python? ( ${PYTHON_DEPS} ) +" + +DEPEND=" + ${RDEPEND} + test? ( dev-cpp/gtest ) +" + +BDEPEND=" + python? ( + ${PYTHON_DEPS} + ${DISTUTILS_DEPS} + dev-python/setuptools[${PYTHON_USEDEP}] + ) +" +RESTRICT="!test? ( test )" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +PATCHES=( + "${FILESDIR}/jsonnet-0.12.1-dont-call-make-from-setuppy.patch" + "${FILESDIR}/jsonnet-0.16.0-libdir.patch" + "${FILESDIR}/jsonnet-0.16.0-cp-var.patch" + "${FILESDIR}/jsonnet-0.18.0-unbundle.patch" +) + +distutils_enable_tests unittest + +src_prepare() { + cmake_src_prepare + use python && distutils-r1_src_prepare +} + +src_configure() { + use custom-optimization || replace-flags '-O*' -O3 + tc-export CC CXX + + local mycmakeargs=( + -DUSE_SYSTEM_JSON=ON + -DBUILD_STATIC_LIBS=OFF + ) + + if use test; then + mycmakeargs+=( + -DBUILD_TESTS=ON + -DUSE_SYSTEM_GTEST=ON + ) + else + mycmakeargs+=( + -DBUILD_TESTS=OFF + ) + fi + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + use python && CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_compile +} + +src_test() { + cmake_src_test + use python && CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_test +} + +python_test() { + LD_LIBRARY_PATH="${CMAKE_BUILD_DIR}" "${EPYTHON}" -m unittest python._jsonnet_test -v \ + || die "Tests failed with ${EPYTHON}" +} + +src_install() { + cmake_src_install + use python && distutils-r1_src_install + + if use doc; then + find doc -name '.gitignore' -delete || die + docinto html + dodoc -r doc/. + fi + if use examples; then + docinto examples + dodoc -r examples/. + fi +} diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest index 00703e73ffc2..e7f14c5432c4 100644 --- a/dev-lang/php/Manifest +++ b/dev-lang/php/Manifest @@ -6,10 +6,14 @@ AUX php-iodbc-header-location.patch 481 BLAKE2B 9ea6a5d529dc7a8c78eeee800900372b AUX php80-firebird-warnings.patch 1949 BLAKE2B ab1b693afe26b6529aab8628f9a614478c388ed23603ad1dd4d17b63154d535a3e4c2db04fe27fb22a3d7e1335e368ffd383ed24647ac53ac05170ec3e1beb75 SHA512 d37815ea529167d4959aef056a3a0be6902ee4cda809a48c24299b05ff6477ee82e8ed8dcf49051b8e74ba5c31e3985454591ea751d4550df3d2e3639ec0d616 DIST php-7.4.32.tar.xz 10419092 BLAKE2B 7657360e661274a34ab17e0e5a103e037d83876187b5413f020c246a91f02b00ac4f0cf34848729d0ccb86d8b9830e5a0ba8a85cc030ec9bd61ec7d4d1a07f5e SHA512 052fbb6120b9943927685f736574871bc2b0c60d4ef18b54ec3f3d92398842286189fd426647c3c91eec38b11ce607090c4cd339040c92bda852574b96c36f67 DIST php-8.0.24.tar.xz 10895332 BLAKE2B efdf65b8d715ed9dd817437beac4949de54d3d96d2289bfcaac5cf7cfaa4015d8e507b7dc43f02760afb5f0be5a5b146abb19324e37a6331e18d5db8ca3cde9d SHA512 f4922c03b613aae35005b6b39630c0de7c25929b7f4edd9c5062a747a747df065ae9b52c17c34433ecb801bc54fce2fa34ae46165deb527f0fe2c86e5da73400 +DIST php-8.0.25.tar.xz 10802888 BLAKE2B c1f283613c43551cccd52955deaae364781fffd4f73befa5e103211ed2b972272189973639d840ef1839b038e1872a6a28424939ea133f0bf86d82b56bb591fb SHA512 43bb0637e424e2a637e05f3faf0ca2c5309f2d9cc03def9fc9af9b756003ea6efe730b608c70177c3c1b9cb03cef31c27cd6507cca9d9f0fd854aadb5e51aee3 DIST php-8.1.11.tar.xz 11797016 BLAKE2B d9e3839931370cb833692b7829d98d29a3e942368ed656777303766cfb931ef94e10a44782f0232ef0610b8170c0ffb3fe3320fca0ec7081e4b5dfc19861495d SHA512 2a9eb4642b4077077f6551ca9a40fd2c48272cc1ee443117362331259efbec88bad0141b09f7a9ff710cde044f9463e1e668f7066b2429ea4274dec7291725cc -DIST php-8.2.0RC3.tar.xz 12013188 BLAKE2B 4d3caf32858d8a42ee229d793ea2b9238ec56ccd8dea2cead3eb5fd1660391968a399e6178d8d2da9a2c5a749055fdc97848bb629fc3ffbda4d640d91bf84e11 SHA512 f0efde3cc30563d1e30a72f368b1dca483d8fe7ebd65c54ee86212d9476f260aed993bd62a2685f50c53a599174b91cb2f0d10f1e83fc68b4403f715a7045f35 +DIST php-8.1.12.tar.xz 11747176 BLAKE2B 0505794826fb0fc92b04be5f7162af8aa92d782bb228243348d85b46866cd47089fcb7febd6886a8179babf64cb227bcdbf5d5f60d44dfefe1c947a3a708e3c1 SHA512 437b6a8146b58479f4d1acb7b35d68954f1f7bc13a8f3dddc66e1677d7e9b6a11154861f9e894cbd59b9c28d4df3fd5422f9b5553004e9fc8d0320ab59b9f907 +DIST php-8.2.0RC5.tar.xz 12018772 BLAKE2B b06248998af682afd934f92a86dc94f53a8406f67817c3268319a48b250b96a4112b9a15c79de3b76f55960abf5e9de63fba7ebcf57c80f83073ec9f8defb31a SHA512 7840cea3efef5de7be062c149335acd78daea27733a093b0fce8ace9781c4b8feb64936480cc5a1a5030ae88b658668c7ffc25a94bcccc5e3c068877644e58fc EBUILD php-7.4.32.ebuild 21336 BLAKE2B d47b39aba8e40665101d8f1cbff76c2dcf46cf7a3049e1cb2619b7fa927ac59a010c16f5ebf49c8880d78ab24476bc950289bea9d6bd1e5072af41dca5e5d02e SHA512 ca94a122871dd267e899b3a4f2fccc0b7e18c4b9043ba9d7b5eb1a275cbca454b2458a2c4b1b7906ed84739efff1e6d432ede0597ef7254396fb3b83f270487e EBUILD php-8.0.24.ebuild 21845 BLAKE2B 9bbc8fcd79a39502a50257ba00eb68abaa8313306d2554e3ade270203bd872fa66083a57fc10f6d4e7e46c8930efbfcf6de7c6562d2499dc262fb690db1aeb7d SHA512 af251c56145df7af13bbbcb73dce4f311af742245e5558cf062a6505526c77e45637adc99454471f5d30791ced2a9fd96438191bce71a1275df2137b85043c5c +EBUILD php-8.0.25.ebuild 21865 BLAKE2B 4eb9d041487fad140d00633426684433ce357d385d6f9567dcfdd4cac536564d33c82001a680a6ee8a9022fcdbc3278c22ca7895f9ff87dab2481b334816d659 SHA512 49a63a3332b979828c125fee868c96cf4accd173e0d7da390fd0f4d8217ff2af71f99d15c83c3f168c2043eeb2fa6f492dee7af87ff91a25273c8a4fc1cd6ddd EBUILD php-8.1.11.ebuild 21802 BLAKE2B 3c440783310cc43ecea65725d6df5877ba9e66d295faaba0fb4d22bb5f2c538e0ec7fbc4a88e760f8c613de3c0cc7cb4e8c469a2ccb4eee0daf5a53c069ce3ae SHA512 c91499df986e64060dbbf0eeaf68fcf94d7838cbca67904abc7f83b4accdb8c25d6d6391406d57de19bc586424a11be19f202afb658cb1790ee36c4205b2a8f9 -EBUILD php-8.2.0_rc3.ebuild 21919 BLAKE2B e35848335391acb488644442eb544472122afdcedb3eb05f372505b7f8d5d61b66ac8ee678b61618d41cce07ec0ec63cca4bb83ed0b46548309721b75ea276d6 SHA512 830af8ec6aae20d330932005aa5a7cb49ce1dd509cd0c7742eb34c7e062d1c9b0af1603101144d448fcf0ae03f46d7e097d20a645eff7d546fc00994e64e9b9e +EBUILD php-8.1.12.ebuild 21822 BLAKE2B ed8192edd4b20602a243ac762cee927ca03057c31ab4ae508b128dc4dccadb6acccf7984aeffe5b63937b96ca2934a8baa973937f8f4aca15f4be463f9f8a320 SHA512 954da51ade6601e0016f9a02bd1a130de13bbe8481b4d75f12e49c42af510f72762996fefbee2ed5535e264b567c5df9dd3ff2485fc899d7e4b5bcb5c59c4216 +EBUILD php-8.2.0_rc5.ebuild 21929 BLAKE2B 4179ca69a70e7d04e313e3c9f33bf9b12798b1a831ab95729fce97cd792f3af95fa67ba5ec9085b2470dd14da6884fab4d6131d25293b07895909a2b9105b76a SHA512 13a68d3eb5ce5a27cb794fc893d40b0e6a4aead00ab633ed3cb09fec3cb0489bd370d0c8eaa1472c71ea5009a456c18b1861479ff1e8a7c58fcec2c693096f87 MISC metadata.xml 3230 BLAKE2B 215062835c9f7ae9d570a40b3a6e59c7a2b7fb51e0fb9b89cd51888f54e2cbee1cbcf571b8ccfef3ed1970949dcac81bb411ca6536e972875b184caee688cb12 SHA512 03d948a300d3a29a113248b371be92fa9c1c4feb371886a9cab335e956a2ff9958cb9b5449aab88a5306bcafed42161ac88655115a1e286fa9e876920ad1d59a diff --git a/dev-lang/php/php-8.0.25.ebuild b/dev-lang/php/php-8.0.25.ebuild new file mode 100644 index 000000000000..6ab4042b4d70 --- /dev/null +++ b/dev-lang/php/php-8.0.25.ebuild @@ -0,0 +1,759 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +WANT_AUTOMAKE="none" + +inherit flag-o-matic systemd autotools + +MY_PV=${PV/_rc/rc} +DESCRIPTION="The PHP language runtime engine" +HOMEPAGE="https://www.php.net/" +SRC_URI="https://www.php.net/distributions/${P}.tar.xz" + +LICENSE="PHP-3.01 + BSD + Zend-2.0 + bcmath? ( LGPL-2.1+ ) + fpm? ( BSD-2 ) + gd? ( gd ) + unicode? ( BSD-2 LGPL-2.1 )" + +SLOT="$(ver_cut 1-2)" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" + +S="${WORKDIR}/${PN}-${MY_PV}" + +# We can build the following SAPIs in the given order +SAPIS="embed cli cgi fpm apache2 phpdbg" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk + coverage +ctype curl debug + enchant exif ffi +fileinfo +filter firebird + +flatfile ftp gd gdbm gmp +iconv imap inifile + intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb + mhash mssql mysql mysqli nls + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm + readline selinux +session session-mm sharedmem + +simplexml snmp soap sockets sodium spell sqlite ssl + sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp + +xml xmlreader xmlwriter xpm xslt zip zlib" + +# Without USE=readline or libedit, the interactive "php -a" CLI will hang. +# The Oracle instant client provides its own incompatible ldap library. +REQUIRED_USE=" + || ( cli cgi fpm apache2 embed phpdbg ) + cli? ( ^^ ( readline libedit ) ) + !cli? ( ?? ( readline libedit ) ) + truetype? ( gd zlib ) + webp? ( gd zlib ) + cjk? ( gd zlib ) + exif? ( gd zlib ) + xpm? ( gd zlib ) + gd? ( zlib ) + simplexml? ( xml ) + soap? ( xml ) + xmlreader? ( xml ) + xmlwriter? ( xml ) + xslt? ( xml ) + ldap-sasl? ( ldap ) + oci8-instant-client? ( !ldap ) + qdbm? ( !gdbm ) + session-mm? ( session !threads ) + mysql? ( || ( mysqli pdo ) ) + firebird? ( pdo ) + mssql? ( pdo ) +" + +RESTRICT="!test? ( test )" + +# The supported (that is, autodetected) versions of BDB are listed in +# the ./configure script. Other versions *work*, but we need to stick to +# the ones that can be detected to avoid a repeat of bug #564824. +COMMON_DEPEND=" + >=app-eselect/eselect-php-0.9.7[apache2?,fpm?] + >=dev-libs/libpcre2-10.30[jit?,unicode] + fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) ) + apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) + argon2? ( app-crypt/argon2:= ) + berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) ) + bzip2? ( app-arch/bzip2:0= ) + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) + coverage? ( dev-util/lcov ) + curl? ( >=net-misc/curl-7.29.0 ) + enchant? ( app-text/enchant:2 ) + ffi? ( >=dev-libs/libffi-3.0.11:= ) + firebird? ( dev-db/firebird ) + gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= ) + gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) + gmp? ( dev-libs/gmp:0= ) + iconv? ( virtual/libiconv ) + imap? ( net-libs/c-client[kerberos=,ssl=] ) + intl? ( dev-libs/icu:= ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11:= ) + ldap-sasl? ( dev-libs/cyrus-sasl ) + libedit? ( dev-libs/libedit ) + lmdb? ( dev-db/lmdb:= ) + mssql? ( dev-db/freetds[mssql] ) + nls? ( sys-devel/gettext ) + oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) + odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) + postgres? ( >=dev-db/postgresql-9.1:* ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline:0= ) + session-mm? ( dev-libs/mm ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + sodium? ( dev-libs/libsodium:=[-minimal] ) + spell? ( >=app-text/aspell-0.50 ) + sqlite? ( >=dev-db/sqlite-3.7.6.3 ) + ssl? ( >=dev-libs/openssl-1.0.1:0= ) + tidy? ( app-text/htmltidy ) + tokyocabinet? ( dev-db/tokyocabinet ) + truetype? ( =media-libs/freetype-2* ) + unicode? ( dev-libs/oniguruma:= ) + webp? ( media-libs/libwebp:0= ) + xml? ( >=dev-libs/libxml2-2.9.0 ) + xpm? ( x11-libs/libXpm ) + xslt? ( dev-libs/libxslt ) + zip? ( >=dev-libs/libzip-1.2.0:= ) + zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) +" + +RDEPEND="${COMMON_DEPEND} + virtual/mta + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +# Bison isn't actually needed when building from a release tarball +# However, the configure script will warn if it's absent or if you +# have an incompatible version installed. See bug 593278. +DEPEND="${COMMON_DEPEND} + app-arch/xz-utils + >=sys-devel/bison-3.0.1" + +BDEPEND="virtual/pkgconfig" + +PHP_MV="$(ver_cut 1)" + +PATCHES=( + "${FILESDIR}/php-iodbc-header-location.patch" + "${FILESDIR}/php80-firebird-warnings.patch" +) + +php_install_ini() { + local phpsapi="${1}" + + # work out where we are installing the ini file + php_set_ini_dir "${phpsapi}" + + # Always install the production INI file, bug 611214. + local phpinisrc="php.ini-production-${phpsapi}" + cp php.ini-production "${phpinisrc}" || die + + # default to /tmp for save_path, bug #282768 + sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die + + # Set the extension dir + sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ + -i "${phpinisrc}" || die + + # Set the include path to point to where we want to find PEAR packages + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die + + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${phpinisrc}" php.ini + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + if use opcache; then + elog "Adding opcache to $PHP_EXT_INI_DIR" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ + "${D}/${PHP_EXT_INI_DIR}"/opcache.ini + dosym "../ext/opcache.ini" \ + "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" + fi + + # SAPI-specific handling + if [[ "${sapi}" == "fpm" ]] ; then + einfo "Installing FPM config files php-fpm.conf and www.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + doins sapi/fpm/php-fpm.conf + insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" + doins sapi/fpm/www.conf + fi + + dodoc php.ini-{development,production} +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +src_prepare() { + default + + # In php-7.x, the FPM pool configuration files have been split off + # of the main config. By default the pool config files go in + # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the + # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later + # we'll install the pool configuration file "www.conf" there. + php_set_ini_dir fpm + sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ + sapi/fpm/php-fpm.conf.in \ + || die 'failed to move the include directory in php-fpm.conf' + + # Emulate buildconf to support cross-compilation + rm -fr aclocal.m4 autom4te.cache config.cache \ + configure main/php_config.h.in || die + eautoconf --force + eautoheader + + # Remove false positive test failures + # stream_isatty fails due to portage redirects + # curl tests here fail for network sandbox issues + # session tests here fail because we set the session directory to $T + rm tests/output/stream_isatty_err.phpt \ + tests/output/stream_isatty_out-err.phpt \ + tests/output/stream_isatty_out.phpt \ + ext/curl/tests/bug76675.phpt \ + ext/curl/tests/bug77535.phpt \ + ext/curl/tests/curl_error_basic.phpt \ + ext/session/tests/bug74514.phpt \ + ext/session/tests/bug74936.phpt || die + +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" + + # The php-fpm config file wants localstatedir to be ${EPREFIX}/var + # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. + local our_conf=( + --prefix="${PHP_DESTDIR}" + --mandir="${PHP_DESTDIR}/man" + --infodir="${PHP_DESTDIR}/info" + --libdir="${PHP_DESTDIR}/lib" + --with-libdir="$(get_libdir)" + --localstatedir="${EPREFIX}/var" + --without-pear + --without-valgrind + $(use_enable threads zts) + ) + + our_conf+=( + $(use_with apparmor fpm-apparmor) + $(use_with argon2 password-argon2 "${EPREFIX}/usr") + $(use_enable bcmath) + $(use_with bzip2 bz2 "${EPREFIX}/usr") + $(use_enable calendar) + $(use_enable coverage gcov) + $(use_enable ctype) + $(use_with curl) + $(use_enable xml dom) + $(use_with enchant) + $(use_enable exif) + $(use_with ffi) + $(use_enable fileinfo) + $(use_enable filter) + $(use_enable ftp) + $(use_with nls gettext "${EPREFIX}/usr") + $(use_with gmp gmp "${EPREFIX}/usr") + $(use_with mhash mhash "${EPREFIX}/usr") + $(use_with iconv iconv \ + $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) + $(use_enable intl) + $(use_enable ipv6) + $(use_with kerberos) + $(use_with xml libxml) + $(use_enable unicode mbstring) + $(use_with ssl openssl) + $(use_enable pcntl) + $(use_enable phar) + $(use_enable pdo) + $(use_enable opcache) + $(use_with postgres pgsql "${EPREFIX}/usr") + $(use_enable posix) + $(use_with spell pspell "${EPREFIX}/usr") + $(use_enable simplexml) + $(use_enable sharedmem shmop) + $(use_with snmp snmp "${EPREFIX}/usr") + $(use_enable soap) + $(use_enable sockets) + $(use_with sodium) + $(use_with sqlite sqlite3) + $(use_enable sysvipc sysvmsg) + $(use_enable sysvipc sysvsem) + $(use_enable sysvipc sysvshm) + $(use_with tidy tidy "${EPREFIX}/usr") + $(use_enable tokenizer) + $(use_enable xml) + $(use_enable xmlreader) + $(use_enable xmlwriter) + $(use_with xslt xsl) + $(use_with zip) + $(use_with zlib zlib "${EPREFIX}/usr") + $(use_enable debug) + ) + + # DBA support + if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ + || use qdbm || use lmdb || use tokyocabinet ; then + our_conf+=( "--enable-dba" ) + fi + + # DBA drivers support + our_conf+=( + $(use_with cdb) + $(use_with berkdb db4 "${EPREFIX}/usr") + $(use_enable flatfile) + $(use_with gdbm gdbm "${EPREFIX}/usr") + $(use_enable inifile) + $(use_with qdbm qdbm "${EPREFIX}/usr") + $(use_with tokyocabinet tcadb "${EPREFIX}/usr") + $(use_with lmdb lmdb "${EPREFIX}/usr") + ) + + # Support for the GD graphics library + our_conf+=( + $(use_with truetype freetype) + $(use_enable cjk gd-jis-conv) + $(use_with gd jpeg) + $(use_with xpm) + $(use_with webp) + ) + # enable gd last, so configure can pick up the previous settings + our_conf+=( $(use_enable gd) ) + + # IMAP support + if use imap ; then + our_conf+=( + $(use_with imap imap "${EPREFIX}/usr") + $(use_with ssl imap-ssl "${EPREFIX}/usr") + ) + fi + + # LDAP support + if use ldap ; then + our_conf+=( + $(use_with ldap ldap "${EPREFIX}/usr") + $(use_with ldap-sasl) + ) + fi + + # MySQL support + local mysqllib="mysqlnd" + local mysqlilib="mysqlnd" + + our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) + + local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" + if use mysql || use mysqli ; then + our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) + fi + + # ODBC support + if use odbc && use iodbc ; then + our_conf+=( + --without-unixODBC + --with-iodbc + $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") + ) + elif use odbc ; then + our_conf+=( + --with-unixODBC="${EPREFIX}/usr" + --without-iodbc + $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") + ) + else + our_conf+=( + --without-unixODBC + --without-iodbc + --without-pdo-odbc + ) + fi + + # Oracle support + our_conf+=( $(use_with oci8-instant-client oci8) ) + + # PDO support + if use pdo ; then + our_conf+=( + $(use_with mssql pdo-dblib "${EPREFIX}/usr") + $(use_with mysql pdo-mysql "${mysqllib}") + $(use_with postgres pdo-pgsql) + $(use_with sqlite pdo-sqlite) + $(use_with firebird pdo-firebird "${EPREFIX}/usr") + $(use_with oci8-instant-client pdo-oci) + ) + fi + + # readline/libedit support + our_conf+=( + $(use_with readline readline "${EPREFIX}/usr") + $(use_with libedit) + ) + + # Session support + if use session ; then + our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) + else + our_conf+=( $(use_enable session) ) + fi + + # Use pic for shared modules such as apache2's mod_php + our_conf+=( --with-pic ) + + # we use the system copy of pcre + # --with-external-pcre affects ext/pcre + our_conf+=( + --with-external-pcre + $(use_with jit pcre-jit) + ) + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # Cache the ./configure test results between SAPIs. + our_conf+=( --cache-file="${T}/config.cache" ) + + # Support user-passed configuration parameters + our_conf+=( ${EXTRA_ECONF:-} ) + + # Support the Apache2 extras, they must be set globally for all + # SAPIs to work correctly, especially for external PHP extensions + + local one_sapi + local sapi + mkdir -p "${WORKDIR}/sapis-build" || die + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + # The BUILD_DIR variable is used to determine where to output + # the files that autotools creates. This was all originally + # based on the autotools-utils eclass. + BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" + cp -a "${S}" "${BUILD_DIR}" || die + cd "${BUILD_DIR}" || die + + local sapi_conf=( + --with-config-file-path="${PHP_INI_DIR}" + --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" + ) + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm|phpdbg) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( "--enable-${sapi}" ) + if [[ "fpm" == "${sapi}" ]] ; then + sapi_conf+=( + $(use_with acl fpm-acl) + $(use_with systemd fpm-systemd) + ) + fi + else + sapi_conf+=( "--disable-${sapi}" ) + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) + else + sapi_conf+=( --without-apxs2 ) + fi + ;; + esac + done + + # Construct the $myeconfargs array by concatenating $our_conf + # (the common args) and $sapi_conf (the SAPI-specific args). + local myeconfargs=( "${our_conf[@]}" ) + myeconfargs+=( "${sapi_conf[@]}" ) + + pushd "${BUILD_DIR}" > /dev/null || die + econf "${myeconfargs[@]}" + popd > /dev/null || die + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + local sapi + for sapi in ${SAPIS} ; do + if use "${sapi}"; then + cd "${WORKDIR}/sapis-build/$sapi" || \ + die "Failed to change dir to ${WORKDIR}/sapis-build/$1" + emake + fi + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index #nowarn + + # grab the first SAPI that got built and install common files from there + local first_sapi="", sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + cd "${WORKDIR}/sapis-build/$first_sapi" || die + emake INSTALL_ROOT="${D}" \ + install-build install-headers install-programs + + local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" + + # Create the directory where we'll put version-specific php scripts + keepdir "/usr/share/php${PHP_MV}" + + local file="" + local sapi_list="" + + for sapi in ${SAPIS}; do + if use "${sapi}" ; then + einfo "Installing SAPI: ${sapi}" + cd "${WORKDIR}/sapis-build/${sapi}" || die + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp$(get_libname)" \ + "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + case "$sapi" in + cli) + source="sapi/cli/php" + # Install the "phar" archive utility. + if use phar ; then + emake INSTALL_ROOT="${D}" install-pharcmd + dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" + fi + ;; + cgi) + source="sapi/cgi/php-cgi" + ;; + fpm) + source="sapi/fpm/php-fpm" + ;; + embed) + source="libs/libphp$(get_libname)" + ;; + phpdbg) + source="sapi/phpdbg/phpdbg" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" + else + dobin "${source}" + local name="$(basename ${source})" + dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + fi + + php_install_ini "${sapi}" + + # construct correct SAPI string for php-config + # thanks to ferringb for the bash voodoo + if [[ "${sapi}" == "apache2" ]]; then + sapi_list="${sapi_list:+${sapi_list} }apache2handler" + else + sapi_list="${sapi_list:+${sapi_list} }${sapi}" + fi + fi + done + + # Installing opcache module + if use opcache ; then + into "${PHP_DESTDIR#${EPREFIX}}" + dolib.so "modules/opcache$(get_libname)" + fi + + # Install env.d files + newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" + sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" \ + "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ + "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" + if [[ ! -x "${PHP_BIN}" ]] ; then + ewarn "Test phase requires USE=cli, skipping" + return + else + export TEST_PHP_EXECUTABLE="${PHP_BIN}" + fi + + if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then + export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" + fi + + if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then + export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" + fi + + SKIP_ONLINE_TESTS=1 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ + "session.save_path=${T}" \ + "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ + "session.save_path=${T}" + + for name in ${EXPECTED_TEST_FAILURES}; do + mv "${name}.out" "${name}.out.orig" 2>/dev/null || die + done + + local failed="$(find -name '*.out')" + if [[ ${failed} != "" ]] ; then + ewarn "The following test cases failed unexpectedly:" + for name in ${failed}; do + ewarn " ${name/.out/}" + done + else + einfo "No unexpected test failures, all fine" + fi + + if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then + local passed="" + for name in ${EXPECTED_TEST_FAILURES}; do + [[ -f "${name}.diff" ]] && continue + passed="${passed} ${name}" + done + if [[ ${passed} != "" ]] ; then + einfo "The following test cases passed unexpectedly:" + for name in ${passed}; do + ewarn " ${passed}" + done + else + einfo "None of the known-to-fail tests passed, all fine" + fi + fi +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + elog + elog "To enable PHP in apache, you will need to add \"-D PHP\" to" + elog "your apache2 command. OpenRC users can append that string to" + elog "APACHE2_OPTS in /etc/conf.d/apache2." + elog + elog "The apache module configuration file 70_mod_php.conf is" + elog "provided (and maintained) by eselect-php." + elog + fi + + # Create the symlinks for php + local m + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} || die + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + # Remove dead symlinks for SAPIs that were just disabled. For + # example, if the user has the cgi SAPI enabled, then he has an + # eselect-php symlink for it. If he later reinstalls PHP with + # USE="-cgi", that symlink will break. This call to eselect is + # supposed to remove that dead link per bug 572436. + eselect php cleanup || die + + if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then + elog "To build extensions for this version of PHP, you will need to" + elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." + elog + fi + + # Warn about the removal of PHP_INI_VERSION if the user has it set. + if [[ -n "${PHP_INI_VERSION}" ]]; then + ewarn 'The PHP_INI_VERSION variable has been phased out. You may' + ewarn 'remove it from your configuration at your convenience. See' + ewarn + ewarn ' https://bugs.gentoo.org/611214' + ewarn + ewarn 'for more information.' + fi + + elog "For details on how version slotting works, please see" + elog "the wiki:" + elog + elog " https://wiki.gentoo.org/wiki/PHP" + elog +} + +pkg_postrm() { + # This serves two purposes. First, if we have just removed the last + # installed version of PHP, then this will remove any dead symlinks + # belonging to eselect-php. Second, if a user upgrades slots from + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update + # his existing symlinks to point to the new 7.0 installation. The + # latter is bug 432962. + # + # Note: the eselect-php package may not be installed at this point, + # so we can't die() if this command fails. + eselect php cleanup +} diff --git a/dev-lang/php/php-8.1.12.ebuild b/dev-lang/php/php-8.1.12.ebuild new file mode 100644 index 000000000000..bdf85e055446 --- /dev/null +++ b/dev-lang/php/php-8.1.12.ebuild @@ -0,0 +1,757 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +WANT_AUTOMAKE="none" + +inherit flag-o-matic systemd autotools + +MY_PV=${PV/_rc/RC} +DESCRIPTION="The PHP language runtime engine" +HOMEPAGE="https://www.php.net/" +SRC_URI="https://www.php.net/distributions/${P}.tar.xz" + +LICENSE="PHP-3.01 + BSD + Zend-2.0 + bcmath? ( LGPL-2.1+ ) + fpm? ( BSD-2 ) + gd? ( gd ) + unicode? ( BSD-2 LGPL-2.1 )" + +SLOT="$(ver_cut 1-2)" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" + +S="${WORKDIR}/${PN}-${MY_PV}" + +# We can build the following SAPIs in the given order +SAPIS="embed cli cgi fpm apache2 phpdbg" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk + coverage +ctype curl debug + enchant exif ffi +fileinfo +filter firebird + +flatfile ftp gd gdbm gmp +iconv imap inifile + intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb + mhash mssql mysql mysqli nls + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm + readline selinux +session session-mm sharedmem + +simplexml snmp soap sockets sodium spell sqlite ssl + sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp + +xml xmlreader xmlwriter xpm xslt zip zlib" + +# Without USE=readline or libedit, the interactive "php -a" CLI will hang. +# The Oracle instant client provides its own incompatible ldap library. +REQUIRED_USE=" + || ( cli cgi fpm apache2 embed phpdbg ) + cli? ( ^^ ( readline libedit ) ) + !cli? ( ?? ( readline libedit ) ) + truetype? ( gd zlib ) + webp? ( gd zlib ) + cjk? ( gd zlib ) + exif? ( gd zlib ) + xpm? ( gd zlib ) + gd? ( zlib ) + simplexml? ( xml ) + soap? ( xml ) + xmlreader? ( xml ) + xmlwriter? ( xml ) + xslt? ( xml ) + ldap-sasl? ( ldap ) + oci8-instant-client? ( !ldap ) + qdbm? ( !gdbm ) + session-mm? ( session !threads ) + mysql? ( || ( mysqli pdo ) ) + firebird? ( pdo ) + mssql? ( pdo ) +" + +RESTRICT="!test? ( test )" + +# The supported (that is, autodetected) versions of BDB are listed in +# the ./configure script. Other versions *work*, but we need to stick to +# the ones that can be detected to avoid a repeat of bug #564824. +COMMON_DEPEND=" + >=app-eselect/eselect-php-0.9.7[apache2?,fpm?] + >=dev-libs/libpcre2-10.30[jit?,unicode] + fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) ) + apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) + argon2? ( app-crypt/argon2:= ) + berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) ) + bzip2? ( app-arch/bzip2:0= ) + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) + coverage? ( dev-util/lcov ) + curl? ( >=net-misc/curl-7.29.0 ) + enchant? ( app-text/enchant:2 ) + ffi? ( >=dev-libs/libffi-3.0.11:= ) + firebird? ( dev-db/firebird ) + gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= ) + gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) + gmp? ( dev-libs/gmp:0= ) + iconv? ( virtual/libiconv ) + imap? ( net-libs/c-client[kerberos=,ssl=] ) + intl? ( dev-libs/icu:= ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11:= ) + ldap-sasl? ( dev-libs/cyrus-sasl ) + libedit? ( dev-libs/libedit ) + lmdb? ( dev-db/lmdb:= ) + mssql? ( dev-db/freetds[mssql] ) + nls? ( sys-devel/gettext ) + oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) + odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) + postgres? ( >=dev-db/postgresql-9.1:* ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline:0= ) + session-mm? ( dev-libs/mm ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + sodium? ( dev-libs/libsodium:=[-minimal] ) + spell? ( >=app-text/aspell-0.50 ) + sqlite? ( >=dev-db/sqlite-3.7.6.3 ) + ssl? ( >=dev-libs/openssl-1.0.2:0= ) + tidy? ( app-text/htmltidy ) + tokyocabinet? ( dev-db/tokyocabinet ) + truetype? ( =media-libs/freetype-2* ) + unicode? ( dev-libs/oniguruma:= ) + webp? ( media-libs/libwebp:0= ) + xml? ( >=dev-libs/libxml2-2.9.0 ) + xpm? ( x11-libs/libXpm ) + xslt? ( dev-libs/libxslt ) + zip? ( >=dev-libs/libzip-1.2.0:= ) + zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) +" + +IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]" + +RDEPEND="${COMMON_DEPEND} + virtual/mta + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +# Bison isn't actually needed when building from a release tarball +# However, the configure script will warn if it's absent or if you +# have an incompatible version installed. See bug 593278. +DEPEND="${COMMON_DEPEND} + app-arch/xz-utils + >=sys-devel/bison-3.0.1" + +BDEPEND="virtual/pkgconfig" + +PHP_MV="$(ver_cut 1)" + +PATCHES=( + "${FILESDIR}/php-iodbc-header-location.patch" +) + +php_install_ini() { + local phpsapi="${1}" + + # work out where we are installing the ini file + php_set_ini_dir "${phpsapi}" + + # Always install the production INI file, bug 611214. + local phpinisrc="php.ini-production-${phpsapi}" + cp php.ini-production "${phpinisrc}" || die + + # default to /tmp for save_path, bug #282768 + sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die + + # Set the extension dir + sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ + -i "${phpinisrc}" || die + + # Set the include path to point to where we want to find PEAR packages + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die + + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${phpinisrc}" php.ini + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + if use opcache; then + elog "Adding opcache to $PHP_EXT_INI_DIR" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ + "${D}/${PHP_EXT_INI_DIR}"/opcache.ini + dosym "../ext/opcache.ini" \ + "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" + fi + + # SAPI-specific handling + if [[ "${sapi}" == "fpm" ]] ; then + einfo "Installing FPM config files php-fpm.conf and www.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + doins sapi/fpm/php-fpm.conf + insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" + doins sapi/fpm/www.conf + fi + + dodoc php.ini-{development,production} +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +src_prepare() { + default + + # In php-7.x, the FPM pool configuration files have been split off + # of the main config. By default the pool config files go in + # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the + # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later + # we'll install the pool configuration file "www.conf" there. + php_set_ini_dir fpm + sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ + sapi/fpm/php-fpm.conf.in \ + || die 'failed to move the include directory in php-fpm.conf' + + # Emulate buildconf to support cross-compilation + rm -fr aclocal.m4 autom4te.cache config.cache \ + configure main/php_config.h.in || die + eautoconf --force + eautoheader + + # Remove false positive test failures + # stream_isatty fails due to portage redirects + # curl tests here fail for network sandbox issues + # session tests here fail because we set the session directory to $T + rm tests/output/stream_isatty_err.phpt \ + tests/output/stream_isatty_out-err.phpt \ + tests/output/stream_isatty_out.phpt \ + ext/curl/tests/bug76675.phpt \ + ext/curl/tests/bug77535.phpt \ + ext/curl/tests/curl_error_basic.phpt \ + ext/session/tests/bug74514.phpt \ + ext/session/tests/bug74936.phpt || die + +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" + + # The php-fpm config file wants localstatedir to be ${EPREFIX}/var + # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. + local our_conf=( + --prefix="${PHP_DESTDIR}" + --mandir="${PHP_DESTDIR}/man" + --infodir="${PHP_DESTDIR}/info" + --libdir="${PHP_DESTDIR}/lib" + --with-libdir="$(get_libdir)" + --localstatedir="${EPREFIX}/var" + --without-pear + --without-valgrind + $(use_enable threads zts) + ) + + our_conf+=( + $(use_with apparmor fpm-apparmor) + $(use_with argon2 password-argon2 "${EPREFIX}/usr") + $(use_enable bcmath) + $(use_with bzip2 bz2 "${EPREFIX}/usr") + $(use_enable calendar) + $(use_enable coverage gcov) + $(use_enable ctype) + $(use_with curl) + $(use_enable xml dom) + $(use_with enchant) + $(use_enable exif) + $(use_with ffi) + $(use_enable fileinfo) + $(use_enable filter) + $(use_enable ftp) + $(use_with nls gettext "${EPREFIX}/usr") + $(use_with gmp gmp "${EPREFIX}/usr") + $(use_with mhash mhash "${EPREFIX}/usr") + $(use_with iconv iconv \ + $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) + $(use_enable intl) + $(use_enable ipv6) + $(use_with kerberos) + $(use_with xml libxml) + $(use_enable unicode mbstring) + $(use_with ssl openssl) + $(use_enable pcntl) + $(use_enable phar) + $(use_enable pdo) + $(use_enable opcache) + $(use_with postgres pgsql "${EPREFIX}/usr") + $(use_enable posix) + $(use_with spell pspell "${EPREFIX}/usr") + $(use_enable simplexml) + $(use_enable sharedmem shmop) + $(use_with snmp snmp "${EPREFIX}/usr") + $(use_enable soap) + $(use_enable sockets) + $(use_with sodium) + $(use_with sqlite sqlite3) + $(use_enable sysvipc sysvmsg) + $(use_enable sysvipc sysvsem) + $(use_enable sysvipc sysvshm) + $(use_with tidy tidy "${EPREFIX}/usr") + $(use_enable tokenizer) + $(use_enable xml) + $(use_enable xmlreader) + $(use_enable xmlwriter) + $(use_with xslt xsl) + $(use_with zip) + $(use_with zlib zlib "${EPREFIX}/usr") + $(use_enable debug) + ) + + # DBA support + if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ + || use qdbm || use lmdb || use tokyocabinet ; then + our_conf+=( "--enable-dba" ) + fi + + # DBA drivers support + our_conf+=( + $(use_with cdb) + $(use_with berkdb db4 "${EPREFIX}/usr") + $(use_enable flatfile) + $(use_with gdbm gdbm "${EPREFIX}/usr") + $(use_enable inifile) + $(use_with qdbm qdbm "${EPREFIX}/usr") + $(use_with tokyocabinet tcadb "${EPREFIX}/usr") + $(use_with lmdb lmdb "${EPREFIX}/usr") + ) + + # Support for the GD graphics library + our_conf+=( + $(use_with truetype freetype) + $(use_enable cjk gd-jis-conv) + $(use_with gd jpeg) + $(use_with xpm) + $(use_with webp) + ) + # enable gd last, so configure can pick up the previous settings + our_conf+=( $(use_enable gd) ) + + # IMAP support + if use imap ; then + our_conf+=( + $(use_with imap imap "${EPREFIX}/usr") + $(use_with ssl imap-ssl "${EPREFIX}/usr") + ) + fi + + # LDAP support + if use ldap ; then + our_conf+=( + $(use_with ldap ldap "${EPREFIX}/usr") + $(use_with ldap-sasl) + ) + fi + + # MySQL support + our_conf+=( $(use_with mysqli mysqli "mysqlnd") ) + + local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" + if use mysql || use mysqli ; then + our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) + fi + + # ODBC support + if use odbc && use iodbc ; then + our_conf+=( + --without-unixODBC + --with-iodbc + $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") + ) + elif use odbc ; then + our_conf+=( + --with-unixODBC="${EPREFIX}/usr" + --without-iodbc + $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") + ) + else + our_conf+=( + --without-unixODBC + --without-iodbc + --without-pdo-odbc + ) + fi + + # Oracle support + our_conf+=( $(use_with oci8-instant-client oci8) ) + + # PDO support + if use pdo ; then + our_conf+=( + $(use_with mssql pdo-dblib "${EPREFIX}/usr") + $(use_with mysql pdo-mysql "mysqlnd") + $(use_with postgres pdo-pgsql) + $(use_with sqlite pdo-sqlite) + $(use_with firebird pdo-firebird "${EPREFIX}/usr") + $(use_with oci8-instant-client pdo-oci) + ) + fi + + # readline/libedit support + our_conf+=( + $(use_with readline readline "${EPREFIX}/usr") + $(use_with libedit) + ) + + # Session support + if use session ; then + our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) + else + our_conf+=( $(use_enable session) ) + fi + + # Use pic for shared modules such as apache2's mod_php + our_conf+=( --with-pic ) + + # we use the system copy of pcre + # --with-external-pcre affects ext/pcre + our_conf+=( + --with-external-pcre + $(use_with jit pcre-jit) + ) + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # Cache the ./configure test results between SAPIs. + our_conf+=( --cache-file="${T}/config.cache" ) + + # Support user-passed configuration parameters + our_conf+=( ${EXTRA_ECONF:-} ) + + # Support the Apache2 extras, they must be set globally for all + # SAPIs to work correctly, especially for external PHP extensions + + local one_sapi + local sapi + mkdir -p "${WORKDIR}/sapis-build" || die + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + # The BUILD_DIR variable is used to determine where to output + # the files that autotools creates. This was all originally + # based on the autotools-utils eclass. + BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" + cp -a "${S}" "${BUILD_DIR}" || die + cd "${BUILD_DIR}" || die + + local sapi_conf=( + --with-config-file-path="${PHP_INI_DIR}" + --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" + ) + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm|phpdbg) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( "--enable-${sapi}" ) + if [[ "fpm" == "${sapi}" ]] ; then + sapi_conf+=( + $(use_with acl fpm-acl) + $(use_with systemd fpm-systemd) + ) + fi + else + sapi_conf+=( "--disable-${sapi}" ) + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) + else + sapi_conf+=( --without-apxs2 ) + fi + ;; + esac + done + + # Construct the $myeconfargs array by concatenating $our_conf + # (the common args) and $sapi_conf (the SAPI-specific args). + local myeconfargs=( "${our_conf[@]}" ) + myeconfargs+=( "${sapi_conf[@]}" ) + + pushd "${BUILD_DIR}" > /dev/null || die + econf "${myeconfargs[@]}" + popd > /dev/null || die + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + local sapi + for sapi in ${SAPIS} ; do + if use "${sapi}"; then + cd "${WORKDIR}/sapis-build/$sapi" || \ + die "Failed to change dir to ${WORKDIR}/sapis-build/$1" + emake + fi + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index #nowarn + + # grab the first SAPI that got built and install common files from there + local first_sapi="", sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + cd "${WORKDIR}/sapis-build/$first_sapi" || die + emake INSTALL_ROOT="${D}" \ + install-build install-headers install-programs + + local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" + + # Create the directory where we'll put version-specific php scripts + keepdir "/usr/share/php${PHP_MV}" + + local file="" + local sapi_list="" + + for sapi in ${SAPIS}; do + if use "${sapi}" ; then + einfo "Installing SAPI: ${sapi}" + cd "${WORKDIR}/sapis-build/${sapi}" || die + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp$(get_libname)" \ + "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + case "$sapi" in + cli) + source="sapi/cli/php" + # Install the "phar" archive utility. + if use phar ; then + emake INSTALL_ROOT="${D}" install-pharcmd + dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" + fi + ;; + cgi) + source="sapi/cgi/php-cgi" + ;; + fpm) + source="sapi/fpm/php-fpm" + ;; + embed) + source="libs/libphp$(get_libname)" + ;; + phpdbg) + source="sapi/phpdbg/phpdbg" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" + else + dobin "${source}" + local name="$(basename ${source})" + dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + fi + + php_install_ini "${sapi}" + + # construct correct SAPI string for php-config + # thanks to ferringb for the bash voodoo + if [[ "${sapi}" == "apache2" ]]; then + sapi_list="${sapi_list:+${sapi_list} }apache2handler" + else + sapi_list="${sapi_list:+${sapi_list} }${sapi}" + fi + fi + done + + # Installing opcache module + if use opcache ; then + into "${PHP_DESTDIR#${EPREFIX}}" + dolib.so "modules/opcache$(get_libname)" + fi + + # Install env.d files + newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" + sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" \ + "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ + "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" + if [[ ! -x "${PHP_BIN}" ]] ; then + ewarn "Test phase requires USE=cli, skipping" + return + else + export TEST_PHP_EXECUTABLE="${PHP_BIN}" + fi + + if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then + export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" + fi + + if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then + export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" + fi + + SKIP_ONLINE_TESTS=1 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ + "session.save_path=${T}" \ + "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ + "session.save_path=${T}" + + for name in ${EXPECTED_TEST_FAILURES}; do + mv "${name}.out" "${name}.out.orig" 2>/dev/null || die + done + + local failed="$(find -name '*.out')" + if [[ ${failed} != "" ]] ; then + ewarn "The following test cases failed unexpectedly:" + for name in ${failed}; do + ewarn " ${name/.out/}" + done + else + einfo "No unexpected test failures, all fine" + fi + + if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then + local passed="" + for name in ${EXPECTED_TEST_FAILURES}; do + [[ -f "${name}.diff" ]] && continue + passed="${passed} ${name}" + done + if [[ ${passed} != "" ]] ; then + einfo "The following test cases passed unexpectedly:" + for name in ${passed}; do + ewarn " ${passed}" + done + else + einfo "None of the known-to-fail tests passed, all fine" + fi + fi +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + elog + elog "To enable PHP in apache, you will need to add \"-D PHP\" to" + elog "your apache2 command. OpenRC users can append that string to" + elog "APACHE2_OPTS in /etc/conf.d/apache2." + elog + elog "The apache module configuration file 70_mod_php.conf is" + elog "provided (and maintained) by eselect-php." + elog + fi + + # Create the symlinks for php + local m + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} || die + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + # Remove dead symlinks for SAPIs that were just disabled. For + # example, if the user has the cgi SAPI enabled, then he has an + # eselect-php symlink for it. If he later reinstalls PHP with + # USE="-cgi", that symlink will break. This call to eselect is + # supposed to remove that dead link per bug 572436. + eselect php cleanup || die + + if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then + elog "To build extensions for this version of PHP, you will need to" + elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." + elog + fi + + # Warn about the removal of PHP_INI_VERSION if the user has it set. + if [[ -n "${PHP_INI_VERSION}" ]]; then + ewarn 'The PHP_INI_VERSION variable has been phased out. You may' + ewarn 'remove it from your configuration at your convenience. See' + ewarn + ewarn ' https://bugs.gentoo.org/611214' + ewarn + ewarn 'for more information.' + fi + + elog "For details on how version slotting works, please see" + elog "the wiki:" + elog + elog " https://wiki.gentoo.org/wiki/PHP" + elog +} + +pkg_postrm() { + # This serves two purposes. First, if we have just removed the last + # installed version of PHP, then this will remove any dead symlinks + # belonging to eselect-php. Second, if a user upgrades slots from + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update + # his existing symlinks to point to the new 7.0 installation. The + # latter is bug 432962. + # + # Note: the eselect-php package may not be installed at this point, + # so we can't die() if this command fails. + eselect php cleanup +} diff --git a/dev-lang/php/php-8.2.0_rc3.ebuild b/dev-lang/php/php-8.2.0_rc3.ebuild deleted file mode 100644 index 84430f30f486..000000000000 --- a/dev-lang/php/php-8.2.0_rc3.ebuild +++ /dev/null @@ -1,758 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="8" - -WANT_AUTOMAKE="none" - -inherit flag-o-matic systemd autotools - -MY_PV=${PV/_rc/RC} -DESCRIPTION="The PHP language runtime engine" -HOMEPAGE="https://www.php.net/" -#SRC_URI="https://www.php.net/distributions/${P}.tar.xz" -SRC_URI="https://downloads.php.net/~pierrick/php-${MY_PV}.tar.xz" - -LICENSE="PHP-3.01 - BSD - Zend-2.0 - bcmath? ( LGPL-2.1+ ) - fpm? ( BSD-2 ) - gd? ( gd ) - unicode? ( BSD-2 LGPL-2.1 )" - -SLOT="$(ver_cut 1-2)" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" - -S="${WORKDIR}/${PN}-${MY_PV}" - -# We can build the following SAPIs in the given order -SAPIS="embed cli cgi fpm apache2 phpdbg" - -# SAPIs and SAPI-specific USE flags (cli SAPI is default on): -IUSE="${IUSE} - ${SAPIS/cli/+cli} - threads" - -IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk - coverage +ctype curl debug - enchant exif ffi +fileinfo +filter firebird - +flatfile ftp gd gdbm gmp +iconv imap inifile - intl iodbc ipv6 +jit kerberos ldap ldap-sasl libedit lmdb - mhash mssql mysql mysqli nls - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm - readline selinux +session session-mm sharedmem - +simplexml snmp soap sockets sodium spell sqlite ssl - sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp - +xml xmlreader xmlwriter xpm xslt zip zlib" - -# Without USE=readline or libedit, the interactive "php -a" CLI will hang. -# The Oracle instant client provides its own incompatible ldap library. -REQUIRED_USE=" - || ( cli cgi fpm apache2 embed phpdbg ) - cli? ( ^^ ( readline libedit ) ) - !cli? ( ?? ( readline libedit ) ) - truetype? ( gd zlib ) - webp? ( gd zlib ) - cjk? ( gd zlib ) - exif? ( gd zlib ) - xpm? ( gd zlib ) - gd? ( zlib ) - simplexml? ( xml ) - soap? ( xml ) - xmlreader? ( xml ) - xmlwriter? ( xml ) - xslt? ( xml ) - ldap-sasl? ( ldap ) - oci8-instant-client? ( !ldap ) - qdbm? ( !gdbm ) - session-mm? ( session !threads ) - mysql? ( || ( mysqli pdo ) ) - firebird? ( pdo ) - mssql? ( pdo ) -" - -RESTRICT="!test? ( test )" - -# The supported (that is, autodetected) versions of BDB are listed in -# the ./configure script. Other versions *work*, but we need to stick to -# the ones that can be detected to avoid a repeat of bug #564824. -COMMON_DEPEND=" - >=app-eselect/eselect-php-0.9.7[apache2?,fpm?] - >=dev-libs/libpcre2-10.30[jit?,unicode] - fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) selinux? ( sys-libs/libselinux ) ) - apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) - argon2? ( app-crypt/argon2:= ) - berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) ) - bzip2? ( app-arch/bzip2:0= ) - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) - coverage? ( dev-util/lcov ) - curl? ( >=net-misc/curl-7.29.0 ) - enchant? ( app-text/enchant:2 ) - ffi? ( >=dev-libs/libffi-3.0.11:= ) - firebird? ( dev-db/firebird ) - gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= ) - gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) - gmp? ( dev-libs/gmp:0= ) - iconv? ( virtual/libiconv ) - imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] ) - intl? ( dev-libs/icu:= ) - kerberos? ( virtual/krb5 ) - ldap? ( >=net-nds/openldap-1.2.11:= ) - ldap-sasl? ( dev-libs/cyrus-sasl ) - libedit? ( dev-libs/libedit ) - lmdb? ( dev-db/lmdb:= ) - mssql? ( dev-db/freetds[mssql] ) - nls? ( sys-devel/gettext ) - oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) - odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) - postgres? ( >=dev-db/postgresql-9.1:* ) - qdbm? ( dev-db/qdbm ) - readline? ( sys-libs/readline:0= ) - session-mm? ( dev-libs/mm ) - snmp? ( >=net-analyzer/net-snmp-5.2 ) - sodium? ( dev-libs/libsodium:=[-minimal] ) - spell? ( >=app-text/aspell-0.50 ) - sqlite? ( >=dev-db/sqlite-3.7.6.3 ) - ssl? ( >=dev-libs/openssl-1.0.2:0= ) - tidy? ( app-text/htmltidy ) - tokyocabinet? ( dev-db/tokyocabinet ) - truetype? ( =media-libs/freetype-2* ) - unicode? ( dev-libs/oniguruma:= ) - webp? ( media-libs/libwebp:0= ) - xml? ( >=dev-libs/libxml2-2.9.0 ) - xpm? ( x11-libs/libXpm ) - xslt? ( dev-libs/libxslt ) - zip? ( >=dev-libs/libzip-1.2.0:= ) - zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) -" - -IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]" - -RDEPEND="${COMMON_DEPEND} - virtual/mta - fpm? ( - selinux? ( sec-policy/selinux-phpfpm ) - systemd? ( sys-apps/systemd ) )" - -# Bison isn't actually needed when building from a release tarball -# However, the configure script will warn if it's absent or if you -# have an incompatible version installed. See bug 593278. -DEPEND="${COMMON_DEPEND} - app-arch/xz-utils - >=sys-devel/bison-3.0.1" - -BDEPEND="virtual/pkgconfig" - -PHP_MV="$(ver_cut 1)" - -PATCHES=( - "${FILESDIR}/php-iodbc-header-location.patch" -) - -php_install_ini() { - local phpsapi="${1}" - - # work out where we are installing the ini file - php_set_ini_dir "${phpsapi}" - - # Always install the production INI file, bug 611214. - local phpinisrc="php.ini-production-${phpsapi}" - cp php.ini-production "${phpinisrc}" || die - - # default to /tmp for save_path, bug #282768 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die - - # Set the extension dir - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ - -i "${phpinisrc}" || die - - # Set the include path to point to where we want to find PEAR packages - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die - - insinto "${PHP_INI_DIR#${EPREFIX}}" - newins "${phpinisrc}" php.ini - - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" - elog - - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" - - if use opcache; then - elog "Adding opcache to $PHP_EXT_INI_DIR" - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini - dosym "../ext/opcache.ini" \ - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" - fi - - # SAPI-specific handling - if [[ "${sapi}" == "fpm" ]] ; then - einfo "Installing FPM config files php-fpm.conf and www.conf" - insinto "${PHP_INI_DIR#${EPREFIX}}" - doins sapi/fpm/php-fpm.conf - insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" - doins sapi/fpm/www.conf - fi - - dodoc php.ini-{development,production} -} - -php_set_ini_dir() { - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" -} - -src_prepare() { - default - - # In php-7.x, the FPM pool configuration files have been split off - # of the main config. By default the pool config files go in - # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the - # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later - # we'll install the pool configuration file "www.conf" there. - php_set_ini_dir fpm - sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ - sapi/fpm/php-fpm.conf.in \ - || die 'failed to move the include directory in php-fpm.conf' - - # Emulate buildconf to support cross-compilation - rm -fr aclocal.m4 autom4te.cache config.cache \ - configure main/php_config.h.in || die - eautoconf --force - eautoheader - - # Remove false positive test failures - # stream_isatty fails due to portage redirects - # curl tests here fail for network sandbox issues - # session tests here fail because we set the session directory to $T - rm tests/output/stream_isatty_err.phpt \ - tests/output/stream_isatty_out-err.phpt \ - tests/output/stream_isatty_out.phpt \ - ext/curl/tests/bug76675.phpt \ - ext/curl/tests/bug77535.phpt \ - ext/curl/tests/curl_error_basic.phpt \ - ext/session/tests/bug74514.phpt \ - ext/session/tests/bug74936.phpt || die - -} - -src_configure() { - addpredict /usr/share/snmp/mibs/.index #nowarn - addpredict /var/lib/net-snmp/mib_indexes #nowarn - - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" - - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. - local our_conf=( - --prefix="${PHP_DESTDIR}" - --mandir="${PHP_DESTDIR}/man" - --infodir="${PHP_DESTDIR}/info" - --libdir="${PHP_DESTDIR}/lib" - --with-libdir="$(get_libdir)" - --localstatedir="${EPREFIX}/var" - --without-pear - $(use_enable threads zts) - ) - - our_conf+=( - $(use_with apparmor fpm-apparmor) - $(use_with argon2 password-argon2 "${EPREFIX}/usr") - $(use_enable bcmath) - $(use_with bzip2 bz2 "${EPREFIX}/usr") - $(use_enable calendar) - $(use_enable coverage gcov) - $(use_enable ctype) - $(use_with curl) - $(use_enable xml dom) - $(use_with enchant) - $(use_enable exif) - $(use_with ffi) - $(use_enable fileinfo) - $(use_enable filter) - $(use_enable ftp) - $(use_with nls gettext "${EPREFIX}/usr") - $(use_with gmp gmp "${EPREFIX}/usr") - $(use_with mhash mhash "${EPREFIX}/usr") - $(use_with iconv iconv \ - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) - $(use_enable intl) - $(use_enable ipv6) - $(use_with kerberos) - $(use_with xml libxml) - $(use_enable unicode mbstring) - $(use_with ssl openssl) - $(use_enable pcntl) - $(use_enable phar) - $(use_enable pdo) - $(use_enable opcache) - $(use_with postgres pgsql "${EPREFIX}/usr") - $(use_enable posix) - $(use_with selinux fpm-selinux) - $(use_with spell pspell "${EPREFIX}/usr") - $(use_enable simplexml) - $(use_enable sharedmem shmop) - $(use_with snmp snmp "${EPREFIX}/usr") - $(use_enable soap) - $(use_enable sockets) - $(use_with sodium) - $(use_with sqlite sqlite3) - $(use_enable sysvipc sysvmsg) - $(use_enable sysvipc sysvsem) - $(use_enable sysvipc sysvshm) - $(use_with tidy tidy "${EPREFIX}/usr") - $(use_enable tokenizer) - $(use_enable xml) - $(use_enable xmlreader) - $(use_enable xmlwriter) - $(use_with xslt xsl) - $(use_with zip) - $(use_with zlib zlib "${EPREFIX}/usr") - $(use_enable debug) - ) - - # DBA support - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ - || use qdbm || use lmdb || use tokyocabinet ; then - our_conf+=( "--enable-dba" ) - fi - - # DBA drivers support - our_conf+=( - $(use_with cdb) - $(use_with berkdb db4 "${EPREFIX}/usr") - $(use_enable flatfile) - $(use_with gdbm gdbm "${EPREFIX}/usr") - $(use_enable inifile) - $(use_with qdbm qdbm "${EPREFIX}/usr") - $(use_with tokyocabinet tcadb "${EPREFIX}/usr") - $(use_with lmdb lmdb "${EPREFIX}/usr") - ) - - # Support for the GD graphics library - our_conf+=( - $(use_with truetype freetype) - $(use_enable cjk gd-jis-conv) - $(use_with gd jpeg) - $(use_with xpm) - $(use_with webp) - ) - # enable gd last, so configure can pick up the previous settings - our_conf+=( $(use_enable gd) ) - - # IMAP support - if use imap ; then - our_conf+=( - $(use_with imap imap "${EPREFIX}/usr") - $(use_with ssl imap-ssl "${EPREFIX}/usr") - ) - fi - - # LDAP support - if use ldap ; then - our_conf+=( - $(use_with ldap ldap "${EPREFIX}/usr") - $(use_with ldap-sasl) - ) - fi - - # MySQL support - our_conf+=( $(use_with mysqli) ) - - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" - if use mysql || use mysqli ; then - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) - fi - - # ODBC support - if use odbc && use iodbc ; then - our_conf+=( - --without-unixODBC - --with-iodbc - $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") - ) - elif use odbc ; then - our_conf+=( - --with-unixODBC="${EPREFIX}/usr" - --without-iodbc - $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") - ) - else - our_conf+=( - --without-unixODBC - --without-iodbc - --without-pdo-odbc - ) - fi - - # Oracle support - our_conf+=( $(use_with oci8-instant-client oci8) ) - - # PDO support - if use pdo ; then - our_conf+=( - $(use_with mssql pdo-dblib "${EPREFIX}/usr") - $(use_with mysql pdo-mysql "mysqlnd") - $(use_with postgres pdo-pgsql) - $(use_with sqlite pdo-sqlite) - $(use_with firebird pdo-firebird "${EPREFIX}/usr") - $(use_with oci8-instant-client pdo-oci) - ) - fi - - # readline/libedit support - our_conf+=( - $(use_with readline readline "${EPREFIX}/usr") - $(use_with libedit) - ) - - # Session support - if use session ; then - our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) - else - our_conf+=( $(use_enable session) ) - fi - - # Use pic for shared modules such as apache2's mod_php - our_conf+=( --with-pic ) - - # we use the system copy of pcre - # --with-external-pcre affects ext/pcre - our_conf+=( - --with-external-pcre - $(use_with jit pcre-jit) - ) - - # Catch CFLAGS problems - # Fixes bug #14067. - # Changed order to run it in reverse for bug #32022 and #12021. - replace-cpu-flags "k6*" "i586" - - # Cache the ./configure test results between SAPIs. - our_conf+=( --cache-file="${T}/config.cache" ) - - # Support user-passed configuration parameters - our_conf+=( ${EXTRA_ECONF:-} ) - - # Support the Apache2 extras, they must be set globally for all - # SAPIs to work correctly, especially for external PHP extensions - - local one_sapi - local sapi - mkdir -p "${WORKDIR}/sapis-build" || die - for one_sapi in $SAPIS ; do - use "${one_sapi}" || continue - php_set_ini_dir "${one_sapi}" - - # The BUILD_DIR variable is used to determine where to output - # the files that autotools creates. This was all originally - # based on the autotools-utils eclass. - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" - cp -a "${S}" "${BUILD_DIR}" || die - cd "${BUILD_DIR}" || die - - local sapi_conf=( - --with-config-file-path="${PHP_INI_DIR}" - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" - ) - - for sapi in $SAPIS ; do - case "$sapi" in - cli|cgi|embed|fpm|phpdbg) - if [[ "${one_sapi}" == "${sapi}" ]] ; then - sapi_conf+=( "--enable-${sapi}" ) - if [[ "fpm" == "${sapi}" ]] ; then - sapi_conf+=( - $(use_with acl fpm-acl) - $(use_with systemd fpm-systemd) - ) - fi - else - sapi_conf+=( "--disable-${sapi}" ) - fi - ;; - - apache2) - if [[ "${one_sapi}" == "${sapi}" ]] ; then - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) - else - sapi_conf+=( --without-apxs2 ) - fi - ;; - esac - done - - # Construct the $myeconfargs array by concatenating $our_conf - # (the common args) and $sapi_conf (the SAPI-specific args). - local myeconfargs=( "${our_conf[@]}" ) - myeconfargs+=( "${sapi_conf[@]}" ) - - pushd "${BUILD_DIR}" > /dev/null || die - econf "${myeconfargs[@]}" - popd > /dev/null || die - done -} - -src_compile() { - # snmp seems to run during src_compile, too (bug #324739) - addpredict /usr/share/snmp/mibs/.index #nowarn - addpredict /var/lib/net-snmp/mib_indexes #nowarn - - local sapi - for sapi in ${SAPIS} ; do - if use "${sapi}"; then - cd "${WORKDIR}/sapis-build/$sapi" || \ - die "Failed to change dir to ${WORKDIR}/sapis-build/$1" - emake - fi - done -} - -src_install() { - # see bug #324739 for what happens when we don't have that - addpredict /usr/share/snmp/mibs/.index #nowarn - - # grab the first SAPI that got built and install common files from there - local first_sapi="", sapi="" - for sapi in $SAPIS ; do - if use $sapi ; then - first_sapi=$sapi - break - fi - done - - # Makefile forgets to create this before trying to write to it... - dodir "${PHP_DESTDIR#${EPREFIX}}/bin" - - # Install php environment (without any sapis) - cd "${WORKDIR}/sapis-build/$first_sapi" || die - emake INSTALL_ROOT="${D}" \ - install-build install-headers install-programs - - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" - - # Create the directory where we'll put version-specific php scripts - keepdir "/usr/share/php${PHP_MV}" - - local file="" - local sapi_list="" - - for sapi in ${SAPIS}; do - if use "${sapi}" ; then - einfo "Installing SAPI: ${sapi}" - cd "${WORKDIR}/sapis-build/${sapi}" || die - - if [[ "${sapi}" == "apache2" ]] ; then - # We're specifically not using emake install-sapi as libtool - # may cause unnecessary relink failures (see bug #351266) - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" - newins ".libs/libphp$(get_libname)" \ - "libphp${PHP_MV}$(get_libname)" - keepdir "/usr/$(get_libdir)/apache2/modules" - else - # needed each time, php_install_ini would reset it - local dest="${PHP_DESTDIR#${EPREFIX}}" - into "${dest}" - case "$sapi" in - cli) - source="sapi/cli/php" - # Install the "phar" archive utility. - if use phar ; then - emake INSTALL_ROOT="${D}" install-pharcmd - dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" - fi - ;; - cgi) - source="sapi/cgi/php-cgi" - ;; - fpm) - source="sapi/fpm/php-fpm" - ;; - embed) - source="libs/libphp$(get_libname)" - ;; - phpdbg) - source="sapi/phpdbg/phpdbg" - ;; - *) - die "unhandled sapi in src_install" - ;; - esac - - if [[ "${source}" == *"$(get_libname)" ]]; then - dolib.so "${source}" - else - dobin "${source}" - local name="$(basename ${source})" - dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" - fi - fi - - php_install_ini "${sapi}" - - # construct correct SAPI string for php-config - # thanks to ferringb for the bash voodoo - if [[ "${sapi}" == "apache2" ]]; then - sapi_list="${sapi_list:+${sapi_list} }apache2handler" - else - sapi_list="${sapi_list:+${sapi_list} }${sapi}" - fi - fi - done - - # Installing opcache module - if use opcache ; then - into "${PHP_DESTDIR#${EPREFIX}}" - dolib.so "modules/opcache$(get_libname)" - fi - - # Install env.d files - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die - - # set php-config variable correctly (bug #278439) - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die - - if use fpm ; then - if use systemd; then - systemd_newunit "${FILESDIR}/php-fpm_at.service" \ - "php-fpm@${SLOT}.service" - else - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ - "php-fpm@${SLOT}.service" - fi - fi -} - -src_test() { - echo ">>> Test phase [test]: ${CATEGORY}/${PF}" - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" - if [[ ! -x "${PHP_BIN}" ]] ; then - ewarn "Test phase requires USE=cli, skipping" - return - else - export TEST_PHP_EXECUTABLE="${PHP_BIN}" - fi - - if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" - fi - - if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then - export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" - fi - - SKIP_ONLINE_TESTS=1 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ - "session.save_path=${T}" \ - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ - "session.save_path=${T}" - - for name in ${EXPECTED_TEST_FAILURES}; do - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die - done - - local failed="$(find -name '*.out')" - if [[ ${failed} != "" ]] ; then - ewarn "The following test cases failed unexpectedly:" - for name in ${failed}; do - ewarn " ${name/.out/}" - done - else - einfo "No unexpected test failures, all fine" - fi - - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then - local passed="" - for name in ${EXPECTED_TEST_FAILURES}; do - [[ -f "${name}.diff" ]] && continue - passed="${passed} ${name}" - done - if [[ ${passed} != "" ]] ; then - einfo "The following test cases passed unexpectedly:" - for name in ${passed}; do - ewarn " ${passed}" - done - else - einfo "None of the known-to-fail tests passed, all fine" - fi - fi -} - -pkg_postinst() { - # Output some general info to the user - if use apache2 ; then - elog - elog "To enable PHP in apache, you will need to add \"-D PHP\" to" - elog "your apache2 command. OpenRC users can append that string to" - elog "APACHE2_OPTS in /etc/conf.d/apache2." - elog - elog "The apache module configuration file 70_mod_php.conf is" - elog "provided (and maintained) by eselect-php." - elog - fi - - # Create the symlinks for php - local m - for m in ${SAPIS}; do - [[ ${m} == 'embed' ]] && continue; - if use $m ; then - local ci=$(eselect php show $m) - if [[ -z $ci ]]; then - eselect php set $m php${SLOT} || die - einfo "Switched ${m} to use php:${SLOT}" - einfo - elif [[ $ci != "php${SLOT}" ]] ; then - elog "To switch $m to use php:${SLOT}, run" - elog " eselect php set $m php${SLOT}" - elog - fi - fi - done - - # Remove dead symlinks for SAPIs that were just disabled. For - # example, if the user has the cgi SAPI enabled, then he has an - # eselect-php symlink for it. If he later reinstalls PHP with - # USE="-cgi", that symlink will break. This call to eselect is - # supposed to remove that dead link per bug 572436. - eselect php cleanup || die - - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then - elog "To build extensions for this version of PHP, you will need to" - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." - elog - fi - - # Warn about the removal of PHP_INI_VERSION if the user has it set. - if [[ -n "${PHP_INI_VERSION}" ]]; then - ewarn 'The PHP_INI_VERSION variable has been phased out. You may' - ewarn 'remove it from your configuration at your convenience. See' - ewarn - ewarn ' https://bugs.gentoo.org/611214' - ewarn - ewarn 'for more information.' - fi - - elog "For details on how version slotting works, please see" - elog "the wiki:" - elog - elog " https://wiki.gentoo.org/wiki/PHP" - elog -} - -pkg_postrm() { - # This serves two purposes. First, if we have just removed the last - # installed version of PHP, then this will remove any dead symlinks - # belonging to eselect-php. Second, if a user upgrades slots from - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update - # his existing symlinks to point to the new 7.0 installation. The - # latter is bug 432962. - # - # Note: the eselect-php package may not be installed at this point, - # so we can't die() if this command fails. - eselect php cleanup -} diff --git a/dev-lang/php/php-8.2.0_rc5.ebuild b/dev-lang/php/php-8.2.0_rc5.ebuild new file mode 100644 index 000000000000..07c1880a3098 --- /dev/null +++ b/dev-lang/php/php-8.2.0_rc5.ebuild @@ -0,0 +1,759 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +WANT_AUTOMAKE="none" + +inherit flag-o-matic systemd autotools + +MY_PV=${PV/_rc/RC} +DESCRIPTION="The PHP language runtime engine" +HOMEPAGE="https://www.php.net/" +#SRC_URI="https://www.php.net/distributions/${P}.tar.xz" +SRC_URI="https://downloads.php.net/~pierrick/php-${MY_PV}.tar.xz" + +LICENSE="PHP-3.01 + BSD + Zend-2.0 + bcmath? ( LGPL-2.1+ ) + fpm? ( BSD-2 ) + gd? ( gd ) + unicode? ( BSD-2 LGPL-2.1 )" + +SLOT="$(ver_cut 1-2)" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" + +S="${WORKDIR}/${PN}-${MY_PV}" + +# We can build the following SAPIs in the given order +SAPIS="embed cli cgi fpm apache2 phpdbg" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} acl apparmor argon2 bcmath berkdb bzip2 calendar cdb cjk + coverage +ctype curl debug + enchant exif ffi +fileinfo +filter firebird + +flatfile ftp gd gdbm gmp +iconv imap inifile + intl iodbc +jit kerberos ldap ldap-sasl libedit lmdb + mhash mssql mysql mysqli nls + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm + readline selinux +session session-mm sharedmem + +simplexml snmp soap sockets sodium spell sqlite ssl + sysvipc systemd test tidy +tokenizer tokyocabinet truetype unicode webp + +xml xmlreader xmlwriter xpm xslt zip zlib" + +# Without USE=readline or libedit, the interactive "php -a" CLI will hang. +# The Oracle instant client provides its own incompatible ldap library. +REQUIRED_USE=" + || ( cli cgi fpm apache2 embed phpdbg ) + cli? ( ^^ ( readline libedit ) ) + !cli? ( ?? ( readline libedit ) ) + truetype? ( gd zlib ) + webp? ( gd zlib ) + cjk? ( gd zlib ) + exif? ( gd zlib ) + xpm? ( gd zlib ) + gd? ( zlib ) + simplexml? ( xml ) + soap? ( xml ) + xmlreader? ( xml ) + xmlwriter? ( xml ) + xslt? ( xml ) + ldap-sasl? ( ldap ) + oci8-instant-client? ( !ldap ) + qdbm? ( !gdbm ) + session-mm? ( session !threads ) + mysql? ( || ( mysqli pdo ) ) + firebird? ( pdo ) + mssql? ( pdo ) +" + +RESTRICT="!test? ( test )" + +# The supported (that is, autodetected) versions of BDB are listed in +# the ./configure script. Other versions *work*, but we need to stick to +# the ones that can be detected to avoid a repeat of bug #564824. +COMMON_DEPEND=" + >=app-eselect/eselect-php-0.9.7[apache2?,fpm?] + >=dev-libs/libpcre2-10.30[jit?,unicode] + fpm? ( acl? ( sys-apps/acl ) apparmor? ( sys-libs/libapparmor ) selinux? ( sys-libs/libselinux ) ) + apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) + argon2? ( app-crypt/argon2:= ) + berkdb? ( || ( sys-libs/db:5.3 sys-libs/db:4.8 ) ) + bzip2? ( app-arch/bzip2:0= ) + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) + coverage? ( dev-util/lcov ) + curl? ( >=net-misc/curl-7.29.0 ) + enchant? ( app-text/enchant:2 ) + ffi? ( >=dev-libs/libffi-3.0.11:= ) + firebird? ( dev-db/firebird ) + gd? ( media-libs/libjpeg-turbo:0= media-libs/libpng:0= ) + gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) + gmp? ( dev-libs/gmp:0= ) + iconv? ( virtual/libiconv ) + imap? ( net-libs/c-client[kerberos=,ssl=] ) + intl? ( dev-libs/icu:= ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11:= ) + ldap-sasl? ( dev-libs/cyrus-sasl ) + libedit? ( dev-libs/libedit ) + lmdb? ( dev-db/lmdb:= ) + mssql? ( dev-db/freetds[mssql] ) + nls? ( sys-devel/gettext ) + oci8-instant-client? ( dev-db/oracle-instantclient[sdk] ) + odbc? ( iodbc? ( dev-db/libiodbc ) !iodbc? ( >=dev-db/unixODBC-1.8.13 ) ) + postgres? ( >=dev-db/postgresql-9.1:* ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline:0= ) + session-mm? ( dev-libs/mm ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + sodium? ( dev-libs/libsodium:=[-minimal] ) + spell? ( >=app-text/aspell-0.50 ) + sqlite? ( >=dev-db/sqlite-3.7.6.3 ) + ssl? ( >=dev-libs/openssl-1.0.2:0= ) + tidy? ( app-text/htmltidy ) + tokyocabinet? ( dev-db/tokyocabinet ) + truetype? ( =media-libs/freetype-2* ) + unicode? ( dev-libs/oniguruma:= ) + webp? ( media-libs/libwebp:0= ) + xml? ( >=dev-libs/libxml2-2.9.0 ) + xpm? ( x11-libs/libXpm ) + xslt? ( dev-libs/libxslt ) + zip? ( >=dev-libs/libzip-1.2.0:= ) + zlib? ( >=sys-libs/zlib-1.2.0.4:0= ) +" + +IDEPEND=">=app-eselect/eselect-php-0.9.7[apache2?,fpm?]" + +RDEPEND="${COMMON_DEPEND} + virtual/mta + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +# Bison isn't actually needed when building from a release tarball +# However, the configure script will warn if it's absent or if you +# have an incompatible version installed. See bug 593278. +DEPEND="${COMMON_DEPEND} + app-arch/xz-utils + >=sys-devel/bison-3.0.1" + +BDEPEND="virtual/pkgconfig" + +PHP_MV="$(ver_cut 1)" + +PATCHES=( + "${FILESDIR}/php-iodbc-header-location.patch" +) + +php_install_ini() { + local phpsapi="${1}" + + # work out where we are installing the ini file + php_set_ini_dir "${phpsapi}" + + # Always install the production INI file, bug 611214. + local phpinisrc="php.ini-production-${phpsapi}" + cp php.ini-production "${phpinisrc}" || die + + # default to /tmp for save_path, bug #282768 + sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die + + # Set the extension dir + sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ + -i "${phpinisrc}" || die + + # Set the include path to point to where we want to find PEAR packages + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die + + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${phpinisrc}" php.ini + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + if use opcache; then + elog "Adding opcache to $PHP_EXT_INI_DIR" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ + "${D}/${PHP_EXT_INI_DIR}"/opcache.ini + dosym "../ext/opcache.ini" \ + "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" + fi + + # SAPI-specific handling + if [[ "${sapi}" == "fpm" ]] ; then + einfo "Installing FPM config files php-fpm.conf and www.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + doins sapi/fpm/php-fpm.conf + insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" + doins sapi/fpm/www.conf + fi + + dodoc php.ini-{development,production} +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +src_prepare() { + default + + # In php-7.x, the FPM pool configuration files have been split off + # of the main config. By default the pool config files go in + # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the + # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later + # we'll install the pool configuration file "www.conf" there. + php_set_ini_dir fpm + sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ + sapi/fpm/php-fpm.conf.in \ + || die 'failed to move the include directory in php-fpm.conf' + + # Emulate buildconf to support cross-compilation + rm -fr aclocal.m4 autom4te.cache config.cache \ + configure main/php_config.h.in || die + eautoconf --force + eautoheader + + # Remove false positive test failures + # stream_isatty fails due to portage redirects + # curl tests here fail for network sandbox issues + # session tests here fail because we set the session directory to $T + rm tests/output/stream_isatty_err.phpt \ + tests/output/stream_isatty_out-err.phpt \ + tests/output/stream_isatty_out.phpt \ + ext/curl/tests/bug76675.phpt \ + ext/curl/tests/bug77535.phpt \ + ext/curl/tests/curl_error_basic.phpt \ + ext/session/tests/bug74514.phpt \ + ext/session/tests/bug74936.phpt || die + +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" + + # The php-fpm config file wants localstatedir to be ${EPREFIX}/var + # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. + local our_conf=( + --prefix="${PHP_DESTDIR}" + --mandir="${PHP_DESTDIR}/man" + --infodir="${PHP_DESTDIR}/info" + --libdir="${PHP_DESTDIR}/lib" + --with-libdir="$(get_libdir)" + --localstatedir="${EPREFIX}/var" + --without-pear + --without-valgrind + --enable-ipv6 + $(use_enable threads zts) + ) + + our_conf+=( + $(use_with apparmor fpm-apparmor) + $(use_with argon2 password-argon2 "${EPREFIX}/usr") + $(use_enable bcmath) + $(use_with bzip2 bz2 "${EPREFIX}/usr") + $(use_enable calendar) + $(use_enable coverage gcov) + $(use_enable ctype) + $(use_with curl) + $(use_enable xml dom) + $(use_with enchant) + $(use_enable exif) + $(use_with ffi) + $(use_enable fileinfo) + $(use_enable filter) + $(use_enable ftp) + $(use_with nls gettext "${EPREFIX}/usr") + $(use_with gmp gmp "${EPREFIX}/usr") + $(use_with mhash mhash "${EPREFIX}/usr") + $(use_with iconv iconv \ + $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) + $(use_enable intl) + $(use_with kerberos) + $(use_with xml libxml) + $(use_enable unicode mbstring) + $(use_with ssl openssl) + $(use_enable pcntl) + $(use_enable phar) + $(use_enable pdo) + $(use_enable opcache) + $(use_with postgres pgsql "${EPREFIX}/usr") + $(use_enable posix) + $(use_with selinux fpm-selinux) + $(use_with spell pspell "${EPREFIX}/usr") + $(use_enable simplexml) + $(use_enable sharedmem shmop) + $(use_with snmp snmp "${EPREFIX}/usr") + $(use_enable soap) + $(use_enable sockets) + $(use_with sodium) + $(use_with sqlite sqlite3) + $(use_enable sysvipc sysvmsg) + $(use_enable sysvipc sysvsem) + $(use_enable sysvipc sysvshm) + $(use_with tidy tidy "${EPREFIX}/usr") + $(use_enable tokenizer) + $(use_enable xml) + $(use_enable xmlreader) + $(use_enable xmlwriter) + $(use_with xslt xsl) + $(use_with zip) + $(use_with zlib zlib "${EPREFIX}/usr") + $(use_enable debug) + ) + + # DBA support + if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ + || use qdbm || use lmdb || use tokyocabinet ; then + our_conf+=( "--enable-dba" ) + fi + + # DBA drivers support + our_conf+=( + $(use_with cdb) + $(use_with berkdb db4 "${EPREFIX}/usr") + $(use_enable flatfile) + $(use_with gdbm gdbm "${EPREFIX}/usr") + $(use_enable inifile) + $(use_with qdbm qdbm "${EPREFIX}/usr") + $(use_with tokyocabinet tcadb "${EPREFIX}/usr") + $(use_with lmdb lmdb "${EPREFIX}/usr") + ) + + # Support for the GD graphics library + our_conf+=( + $(use_with truetype freetype) + $(use_enable cjk gd-jis-conv) + $(use_with gd jpeg) + $(use_with xpm) + $(use_with webp) + ) + # enable gd last, so configure can pick up the previous settings + our_conf+=( $(use_enable gd) ) + + # IMAP support + if use imap ; then + our_conf+=( + $(use_with imap imap "${EPREFIX}/usr") + $(use_with ssl imap-ssl "${EPREFIX}/usr") + ) + fi + + # LDAP support + if use ldap ; then + our_conf+=( + $(use_with ldap ldap "${EPREFIX}/usr") + $(use_with ldap-sasl) + ) + fi + + # MySQL support + our_conf+=( $(use_with mysqli) ) + + local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" + if use mysql || use mysqli ; then + our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) + fi + + # ODBC support + if use odbc && use iodbc ; then + our_conf+=( + --without-unixODBC + --with-iodbc + $(use_with pdo pdo-odbc "iODBC,${EPREFIX}/usr") + ) + elif use odbc ; then + our_conf+=( + --with-unixODBC="${EPREFIX}/usr" + --without-iodbc + $(use_with pdo pdo-odbc "unixODBC,${EPREFIX}/usr") + ) + else + our_conf+=( + --without-unixODBC + --without-iodbc + --without-pdo-odbc + ) + fi + + # Oracle support + our_conf+=( $(use_with oci8-instant-client oci8) ) + + # PDO support + if use pdo ; then + our_conf+=( + $(use_with mssql pdo-dblib "${EPREFIX}/usr") + $(use_with mysql pdo-mysql "mysqlnd") + $(use_with postgres pdo-pgsql) + $(use_with sqlite pdo-sqlite) + $(use_with firebird pdo-firebird "${EPREFIX}/usr") + $(use_with oci8-instant-client pdo-oci) + ) + fi + + # readline/libedit support + our_conf+=( + $(use_with readline readline "${EPREFIX}/usr") + $(use_with libedit) + ) + + # Session support + if use session ; then + our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) + else + our_conf+=( $(use_enable session) ) + fi + + # Use pic for shared modules such as apache2's mod_php + our_conf+=( --with-pic ) + + # we use the system copy of pcre + # --with-external-pcre affects ext/pcre + our_conf+=( + --with-external-pcre + $(use_with jit pcre-jit) + ) + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # Cache the ./configure test results between SAPIs. + our_conf+=( --cache-file="${T}/config.cache" ) + + # Support user-passed configuration parameters + our_conf+=( ${EXTRA_ECONF:-} ) + + # Support the Apache2 extras, they must be set globally for all + # SAPIs to work correctly, especially for external PHP extensions + + local one_sapi + local sapi + mkdir -p "${WORKDIR}/sapis-build" || die + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + # The BUILD_DIR variable is used to determine where to output + # the files that autotools creates. This was all originally + # based on the autotools-utils eclass. + BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" + cp -a "${S}" "${BUILD_DIR}" || die + cd "${BUILD_DIR}" || die + + local sapi_conf=( + --with-config-file-path="${PHP_INI_DIR}" + --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" + ) + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm|phpdbg) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( "--enable-${sapi}" ) + if [[ "fpm" == "${sapi}" ]] ; then + sapi_conf+=( + $(use_with acl fpm-acl) + $(use_with systemd fpm-systemd) + ) + fi + else + sapi_conf+=( "--disable-${sapi}" ) + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) + else + sapi_conf+=( --without-apxs2 ) + fi + ;; + esac + done + + # Construct the $myeconfargs array by concatenating $our_conf + # (the common args) and $sapi_conf (the SAPI-specific args). + local myeconfargs=( "${our_conf[@]}" ) + myeconfargs+=( "${sapi_conf[@]}" ) + + pushd "${BUILD_DIR}" > /dev/null || die + econf "${myeconfargs[@]}" + popd > /dev/null || die + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + local sapi + for sapi in ${SAPIS} ; do + if use "${sapi}"; then + cd "${WORKDIR}/sapis-build/$sapi" || \ + die "Failed to change dir to ${WORKDIR}/sapis-build/$1" + emake + fi + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index #nowarn + + # grab the first SAPI that got built and install common files from there + local first_sapi="", sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + cd "${WORKDIR}/sapis-build/$first_sapi" || die + emake INSTALL_ROOT="${D}" \ + install-build install-headers install-programs + + local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" + + # Create the directory where we'll put version-specific php scripts + keepdir "/usr/share/php${PHP_MV}" + + local file="" + local sapi_list="" + + for sapi in ${SAPIS}; do + if use "${sapi}" ; then + einfo "Installing SAPI: ${sapi}" + cd "${WORKDIR}/sapis-build/${sapi}" || die + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp$(get_libname)" \ + "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + case "$sapi" in + cli) + source="sapi/cli/php" + # Install the "phar" archive utility. + if use phar ; then + emake INSTALL_ROOT="${D}" install-pharcmd + dosym "..${dest#/usr}/bin/phar" "/usr/bin/phar${SLOT}" + fi + ;; + cgi) + source="sapi/cgi/php-cgi" + ;; + fpm) + source="sapi/fpm/php-fpm" + ;; + embed) + source="libs/libphp$(get_libname)" + ;; + phpdbg) + source="sapi/phpdbg/phpdbg" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" + else + dobin "${source}" + local name="$(basename ${source})" + dosym "..${dest#/usr}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + fi + + php_install_ini "${sapi}" + + # construct correct SAPI string for php-config + # thanks to ferringb for the bash voodoo + if [[ "${sapi}" == "apache2" ]]; then + sapi_list="${sapi_list:+${sapi_list} }apache2handler" + else + sapi_list="${sapi_list:+${sapi_list} }${sapi}" + fi + fi + done + + # Installing opcache module + if use opcache ; then + into "${PHP_DESTDIR#${EPREFIX}}" + dolib.so "modules/opcache$(get_libname)" + fi + + # Install env.d files + newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" + sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" \ + "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ + "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" + if [[ ! -x "${PHP_BIN}" ]] ; then + ewarn "Test phase requires USE=cli, skipping" + return + else + export TEST_PHP_EXECUTABLE="${PHP_BIN}" + fi + + if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then + export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" + fi + + if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then + export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" + fi + + SKIP_ONLINE_TESTS=1 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ + "session.save_path=${T}" \ + "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ + "session.save_path=${T}" + + for name in ${EXPECTED_TEST_FAILURES}; do + mv "${name}.out" "${name}.out.orig" 2>/dev/null || die + done + + local failed="$(find -name '*.out')" + if [[ ${failed} != "" ]] ; then + ewarn "The following test cases failed unexpectedly:" + for name in ${failed}; do + ewarn " ${name/.out/}" + done + else + einfo "No unexpected test failures, all fine" + fi + + if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then + local passed="" + for name in ${EXPECTED_TEST_FAILURES}; do + [[ -f "${name}.diff" ]] && continue + passed="${passed} ${name}" + done + if [[ ${passed} != "" ]] ; then + einfo "The following test cases passed unexpectedly:" + for name in ${passed}; do + ewarn " ${passed}" + done + else + einfo "None of the known-to-fail tests passed, all fine" + fi + fi +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + elog + elog "To enable PHP in apache, you will need to add \"-D PHP\" to" + elog "your apache2 command. OpenRC users can append that string to" + elog "APACHE2_OPTS in /etc/conf.d/apache2." + elog + elog "The apache module configuration file 70_mod_php.conf is" + elog "provided (and maintained) by eselect-php." + elog + fi + + # Create the symlinks for php + local m + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} || die + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + # Remove dead symlinks for SAPIs that were just disabled. For + # example, if the user has the cgi SAPI enabled, then he has an + # eselect-php symlink for it. If he later reinstalls PHP with + # USE="-cgi", that symlink will break. This call to eselect is + # supposed to remove that dead link per bug 572436. + eselect php cleanup || die + + if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then + elog "To build extensions for this version of PHP, you will need to" + elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." + elog + fi + + # Warn about the removal of PHP_INI_VERSION if the user has it set. + if [[ -n "${PHP_INI_VERSION}" ]]; then + ewarn 'The PHP_INI_VERSION variable has been phased out. You may' + ewarn 'remove it from your configuration at your convenience. See' + ewarn + ewarn ' https://bugs.gentoo.org/611214' + ewarn + ewarn 'for more information.' + fi + + elog "For details on how version slotting works, please see" + elog "the wiki:" + elog + elog " https://wiki.gentoo.org/wiki/PHP" + elog +} + +pkg_postrm() { + # This serves two purposes. First, if we have just removed the last + # installed version of PHP, then this will remove any dead symlinks + # belonging to eselect-php. Second, if a user upgrades slots from + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update + # his existing symlinks to point to the new 7.0 installation. The + # latter is bug 432962. + # + # Note: the eselect-php package may not be installed at this point, + # so we can't die() if this command fails. + eselect php cleanup +} diff --git a/dev-lang/squirrel/Manifest b/dev-lang/squirrel/Manifest index 7f88ba2e3e5a..7664f60b9a30 100644 --- a/dev-lang/squirrel/Manifest +++ b/dev-lang/squirrel/Manifest @@ -1,3 +1,8 @@ +AUX squirrel-3.2-CVE-2022-30292.patch 520 BLAKE2B 9c069837aa7c3981f5b14ddb717db217e9aa45e0411c00258df59361b87f44166d3363576d0615dff0789e4772cb44749fef7bb38f36dc3b105fb602b61d738a SHA512 8a9a5990cb9826771d3ce285194c957ed06df0846b7194d0f136e252427d6f9eeb7fb1550ac9932d864d72bf36da88b4862a21f650e5232f72030734115dfab4 +AUX squirrel.pc.in 223 BLAKE2B f6b6f909e53a59573b1d6e6ac1f902da20c139d69ae62d585c7631450dccac8316b55779f9a570cd59228750d024cda1481476e8447b09d040b7827fe5d198f5 SHA512 a9124dca1e013f55c0498b743230df626cebbd7fd793603303d88e2973ad50ff64a2b7f7f37a773b3aceaea65420e7570efb68554228328542ca0b230bbb515e DIST squirrel-3.1_p20200612.tar.gz 181047 BLAKE2B f6965b5e721919c6c33426843a9b73fb27f39b7341763c2ff01421e6b6dce6cb86c6a02df65af9cb2266e8a63d6612c0e857456c4bb6e2546760f937d1979990 SHA512 e9853c92c151ca35e137a91ba4e3c9ad9c4c6d95a22c3686ebbae74cea7c1bf704ec5274d610f9d8158d8662a2b1b1445664f3f33c11689553cfc090a957b204 +DIST squirrel-3.2.tar.gz 620486 BLAKE2B c03cee0dffc12ff48caa4a7c9c0fffec32cdfb23306f265b8475454b0b9f14a3d2ec620b0f2183de8e8bc83e4921d6853105ac1a8d37bf3f2d97e914a001c4fd SHA512 e488ccc07b851e1707f3fde923f691747b18dc2fcc4748d2a68f2590ab84a3c0db647c8ac9ee775796984d2302a3d3686459556ea0c49a0b96b1354fcb8a6c74 +DIST squirrel-config.cmake.in_3.2 143 BLAKE2B e9e795a4f855f41206c5aca89b949c279f35dce06dad73c9153a9c03701f1721d831bdc29e3a399a2a6b2cf6e97d3a966008d81dfe955b2f5412c818d5a054bc SHA512 4820835a233b2beb5768b39e6b3ce5f06f1f9bc57c4c19df2c4f7ce2b03e67c18554c3084259317092d1eb0fee7d909bdbc56a9fc556f57ed61ef8b0f181996d EBUILD squirrel-3.1_p20200612.ebuild 969 BLAKE2B 4e3862e00b94df35203c37e6ce4435b91a25af06bae774a777796ec05c5f3531eaa4ada5e02dee16bb53166829a33a9bce2fa0961d86f1ba506c79f777bfc2f9 SHA512 51194be28d9ef6bd7c8d2c3cd374369ddf4fc61112867abeb31655f9d889febd36d938684ea83b80ebbf3faddbbb24240a4d35f56597a4a25baae507f45027ca +EBUILD squirrel-3.2.ebuild 1545 BLAKE2B 4a57cebc54d95d7a26d913506b98fb0777dcb227a4788d765502aa49539621accc6a999a81c295534eb47ed115da93a1c63a3e7bd4870d32070e19c430b27922 SHA512 569bc9108b3b6edd9c91820176b8d5f40ce7e8f7a0bd0712911563288b088bf9ae5e2b2b8f4b9c9103729abbca4c6ff1c28850b75d443737380b3d24e911b1bb MISC metadata.xml 312 BLAKE2B c2cfcb7ffff475030a29560dcac42917662a733e7a6ab37b9224fa0967bec0bf7d517d6c47a9686b30940a80a6e05465b87be918c28622681ef6f596c889b23a SHA512 4f3f5a13638a29c21555a43e22bbb41b2c58708043d7b6eb9cb0eb549f1dfb383adc8c0a0ade1491f1a037fc93a4f057dd5572d258c060fee8023c97e67e0c1b diff --git a/dev-lang/squirrel/files/squirrel-3.2-CVE-2022-30292.patch b/dev-lang/squirrel/files/squirrel-3.2-CVE-2022-30292.patch new file mode 100644 index 000000000000..3ba274b3270c --- /dev/null +++ b/dev-lang/squirrel/files/squirrel-3.2-CVE-2022-30292.patch @@ -0,0 +1,12 @@ +diff --git a/squirrel/sqbaselib.cpp b/squirrel/sqbaselib.cpp +index e2f248e..308d2cc 100644 +--- a/squirrel/sqbaselib.cpp ++++ b/squirrel/sqbaselib.cpp +@@ -1149,6 +1149,7 @@ static SQInteger thread_call(HSQUIRRELVM v) + SQObjectPtr o = stack_get(v,1); + if(sq_type(o) == OT_THREAD) { + SQInteger nparams = sq_gettop(v); ++ sq_reservestack(_thread(o), nparams + 3); + _thread(o)->Push(_thread(o)->_roottable); + for(SQInteger i = 2; i<(nparams+1); i++) + sq_move(_thread(o),v,i); diff --git a/dev-lang/squirrel/files/squirrel.pc.in b/dev-lang/squirrel/files/squirrel.pc.in new file mode 100644 index 000000000000..4dc26b906ad2 --- /dev/null +++ b/dev-lang/squirrel/files/squirrel.pc.in @@ -0,0 +1,12 @@ +prefix=/usr +exec_prefix=/usr +libdir=/usr/@libdir@ +includedir=/usr/include/squirrel + +Name: squirrel +Description: squirrel library +Version: @version@ + +Requires: +Libs: -L${libdir} -lsquirrel -lsqstdlib +Cflags: -I${includedir} diff --git a/dev-lang/squirrel/squirrel-3.2.ebuild b/dev-lang/squirrel/squirrel-3.2.ebuild new file mode 100644 index 000000000000..02c8bcc6a1d4 --- /dev/null +++ b/dev-lang/squirrel/squirrel-3.2.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="A interpreted language mainly used for games" +HOMEPAGE="http://squirrel-lang.org/" +# Missing file in the tarball, do the same as Mageia +SRC_URI="https://download.sourceforge.net/squirrel/${PN}_${PV/./_}_stable.tar.gz -> ${P}.tar.gz + https://raw.githubusercontent.com/albertodemichelis/squirrel/v${PV}/squirrel-config.cmake.in -> squirrel-config.cmake.in_${PV}" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="examples static-libs" + +RDEPEND="" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${PN}3" + +PATCHES=( + # Fixed in master + "${FILESDIR}/${P}-CVE-2022-30292.patch" +) + +src_prepare() { + cp "${DISTDIR}/squirrel-config.cmake.in_${PV}" "${S}/squirrel-config.cmake.in" || die + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + $(usex static-libs '' -DDISABLE_STATIC=YES) + # /usr/bin/sq is used by app-text/ispell + # /usr/lib/libsquirrel.so is used by app-shells/squirrelsh + -DLONG_OUTPUT_NAMES=YES + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + dodoc HISTORY + + if use examples; then + docompress -x /usr/share/doc/${PF}/samples + dodoc -r samples + fi + + # Add pkgconfig file, needed for some reverse deps (follows Mageia + # one) + # https://github.com/albertodemichelis/squirrel/issues/259 + dodir /usr/$(get_libdir)/pkgconfig + sed \ + -e "s/@libdir@/$(get_libdir)/" \ + -e "s/@version@/${PV}/" \ + "${FILESDIR}/${PN}.pc.in" > "${ED}/usr/$(get_libdir)/pkgconfig/${PN}.pc" || die +} -- cgit v1.2.3