From 025bdf5ab5d943eb92180de25753401954bb88b8 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 12 Jan 2022 17:22:51 +0200 Subject: Added the current setup --- acct-group/plugdev/Manifest | 2 + acct-group/plugdev/metadata.xml | 8 + acct-group/plugdev/plugdev-0-r1.ebuild | 9 + dev-cpp/gulrak-filesystem/Manifest | 3 + .../gulrak-filesystem-1.5.10.ebuild | 35 + dev-cpp/gulrak-filesystem/metadata.xml | 11 + dev-lang/python/Manifest | 7 + dev-lang/python/files/pydoc.conf | 6 + dev-lang/python/files/pydoc.init | 278 ++++ dev-lang/python/metadata.xml | 15 + dev-lang/python/python-3.8.12_p1-r1.ebuild | 340 +++++ dev-libs/libratbag/Manifest | 6 + dev-libs/libratbag/files/ratbagd.init | 13 + dev-libs/libratbag/libratbag-0.15.ebuild | 94 ++ dev-libs/libratbag/libratbag-0.16.ebuild | 94 ++ dev-libs/libratbag/metadata.xml | 268 ++++ dev-python/packaging/Manifest | 3 + dev-python/packaging/metadata.xml | 13 + dev-python/packaging/packaging-21.3-r1.ebuild | 37 + dev-python/python-evdev/Manifest | 3 + dev-python/python-evdev/metadata.xml | 8 + dev-python/python-evdev/python-evdev-1.4.0.ebuild | 30 + dev-python/setuptools/Manifest | 4 + dev-python/setuptools/metadata.xml | 14 + dev-python/setuptools/setuptools-59.8.0.ebuild | 87 ++ dev-util/vulkan-headers/Manifest | 2 + .../vulkan-headers/vulkan-headers-1.2.198.0.ebuild | 24 + eclass/autotools.eclass | 678 ++++++++++ eclass/eapi8-dosym.eclass | 108 ++ eclass/flag-o-matic.eclass | 851 ++++++++++++ eclass/meson-multilib.eclass | 132 ++ eclass/multiprocessing.eclass | 109 ++ eclass/pax-utils.eclass | 200 +++ eclass/python-any-r1.eclass | 380 ++++++ eclass/python-utils-r1.eclass | 1351 ++++++++++++++++++++ eclass/toolchain-funcs.eclass | 1147 +++++++++++++++++ eclass/verify-sig.eclass | 346 +++++ media-libs/libplacebo/Manifest | 3 + media-libs/libplacebo/libplacebo-3.120.3.ebuild | 73 ++ media-libs/libplacebo/metadata.xml | 14 + metadata/layout.conf | 1 + sys-devel/automake/Manifest | 25 + sys-devel/automake/automake-1.11.6-r3.ebuild | 98 ++ sys-devel/automake/automake-1.11.6-r3.ebuild.1 | 98 ++ sys-devel/automake/automake-1.13.4-r2.ebuild | 90 ++ sys-devel/automake/automake-1.15.1-r2.ebuild | 111 ++ sys-devel/automake/automake-1.16.3-r1.ebuild | 131 ++ sys-devel/automake/automake-1.16.4.ebuild | 131 ++ sys-devel/automake/automake-1.16.5.ebuild | 131 ++ sys-devel/automake/automake-9999.ebuild | 130 ++ .../automake/files/automake-1.10-perl-5.16.patch | 128 ++ ....11-install-sh-avoid-low-risk-race-in-tmp.patch | 77 ++ .../files/automake-1.13-dyn-ithreads.patch | 59 + .../automake-1.13-hash-order-workaround.patch | 14 + ...utomake-1.13-perl-escape-curly-bracket-r1.patch | 37 + ....14-install-sh-avoid-low-risk-race-in-tmp.patch | 77 ++ ....15-install-sh-avoid-low-risk-race-in-tmp.patch | 82 ++ ...tomake-1.16.2-fix-instmany-python.sh-test.patch | 26 + ...ake-1.16.2-fix-py-compile-basedir.sh-test.patch | 26 + .../files/automake-1.16.2-py3-compile.patch | 73 ++ sys-devel/automake/metadata.xml | 11 + virtual/libcrypt/Manifest | 3 + virtual/libcrypt/libcrypt-1-r1.ebuild | 20 + virtual/libcrypt/libcrypt-2.ebuild | 20 + virtual/libcrypt/metadata.xml | 9 + x11-misc/barrier/Manifest | 4 + x11-misc/barrier/barrier-2.4.0.ebuild | 82 ++ .../barrier/files/barrier-2.4.0-includes.patch | 39 + x11-misc/barrier/metadata.xml | 11 + 69 files changed, 8550 insertions(+) create mode 100644 acct-group/plugdev/Manifest create mode 100644 acct-group/plugdev/metadata.xml create mode 100644 acct-group/plugdev/plugdev-0-r1.ebuild create mode 100644 dev-cpp/gulrak-filesystem/Manifest create mode 100644 dev-cpp/gulrak-filesystem/gulrak-filesystem-1.5.10.ebuild create mode 100644 dev-cpp/gulrak-filesystem/metadata.xml create mode 100644 dev-lang/python/Manifest create mode 100644 dev-lang/python/files/pydoc.conf create mode 100644 dev-lang/python/files/pydoc.init create mode 100644 dev-lang/python/metadata.xml create mode 100644 dev-lang/python/python-3.8.12_p1-r1.ebuild create mode 100644 dev-libs/libratbag/Manifest create mode 100644 dev-libs/libratbag/files/ratbagd.init create mode 100644 dev-libs/libratbag/libratbag-0.15.ebuild create mode 100644 dev-libs/libratbag/libratbag-0.16.ebuild create mode 100644 dev-libs/libratbag/metadata.xml create mode 100644 dev-python/packaging/Manifest create mode 100644 dev-python/packaging/metadata.xml create mode 100644 dev-python/packaging/packaging-21.3-r1.ebuild create mode 100644 dev-python/python-evdev/Manifest create mode 100644 dev-python/python-evdev/metadata.xml create mode 100644 dev-python/python-evdev/python-evdev-1.4.0.ebuild create mode 100644 dev-python/setuptools/Manifest create mode 100644 dev-python/setuptools/metadata.xml create mode 100644 dev-python/setuptools/setuptools-59.8.0.ebuild create mode 100644 dev-util/vulkan-headers/Manifest create mode 100644 dev-util/vulkan-headers/vulkan-headers-1.2.198.0.ebuild create mode 100644 eclass/autotools.eclass create mode 100644 eclass/eapi8-dosym.eclass create mode 100644 eclass/flag-o-matic.eclass create mode 100644 eclass/meson-multilib.eclass create mode 100644 eclass/multiprocessing.eclass create mode 100644 eclass/pax-utils.eclass create mode 100644 eclass/python-any-r1.eclass create mode 100644 eclass/python-utils-r1.eclass create mode 100644 eclass/toolchain-funcs.eclass create mode 100644 eclass/verify-sig.eclass create mode 100644 media-libs/libplacebo/Manifest create mode 100644 media-libs/libplacebo/libplacebo-3.120.3.ebuild create mode 100644 media-libs/libplacebo/metadata.xml create mode 100644 metadata/layout.conf create mode 100644 sys-devel/automake/Manifest create mode 100644 sys-devel/automake/automake-1.11.6-r3.ebuild create mode 100644 sys-devel/automake/automake-1.11.6-r3.ebuild.1 create mode 100644 sys-devel/automake/automake-1.13.4-r2.ebuild create mode 100644 sys-devel/automake/automake-1.15.1-r2.ebuild create mode 100644 sys-devel/automake/automake-1.16.3-r1.ebuild create mode 100644 sys-devel/automake/automake-1.16.4.ebuild create mode 100644 sys-devel/automake/automake-1.16.5.ebuild create mode 100644 sys-devel/automake/automake-9999.ebuild create mode 100644 sys-devel/automake/files/automake-1.10-perl-5.16.patch create mode 100644 sys-devel/automake/files/automake-1.11-install-sh-avoid-low-risk-race-in-tmp.patch create mode 100644 sys-devel/automake/files/automake-1.13-dyn-ithreads.patch create mode 100644 sys-devel/automake/files/automake-1.13-hash-order-workaround.patch create mode 100644 sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch create mode 100644 sys-devel/automake/files/automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch create mode 100644 sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch create mode 100644 sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch create mode 100644 sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch create mode 100644 sys-devel/automake/files/automake-1.16.2-py3-compile.patch create mode 100644 sys-devel/automake/metadata.xml create mode 100644 virtual/libcrypt/Manifest create mode 100644 virtual/libcrypt/libcrypt-1-r1.ebuild create mode 100644 virtual/libcrypt/libcrypt-2.ebuild create mode 100644 virtual/libcrypt/metadata.xml create mode 100644 x11-misc/barrier/Manifest create mode 100644 x11-misc/barrier/barrier-2.4.0.ebuild create mode 100644 x11-misc/barrier/files/barrier-2.4.0-includes.patch create mode 100644 x11-misc/barrier/metadata.xml diff --git a/acct-group/plugdev/Manifest b/acct-group/plugdev/Manifest new file mode 100644 index 0000000..5f9b71d --- /dev/null +++ b/acct-group/plugdev/Manifest @@ -0,0 +1,2 @@ +EBUILD plugdev-0-r1.ebuild 209 BLAKE2B 680ffebfbb8aa140a1cc83b909f60f9832c695994a3505a59d822a365170e8b96f66cd57833670f587463900102062836b835e7a44c34f26211daaab1827e392 SHA512 0403744e2f993bfb6003c8c86f2d1ad798cc20361952634fef55ee0fc31c3a916c1af39c03487bca6ddacf0c411d33e3e0c6c02334bd781bd52f652036f23224 +MISC metadata.xml 248 BLAKE2B f308d2aa052d11e427850af58bbebf95e7773f5562ed221f39043474b4c3827d724d49667edf1874272a5586a13201159f40e8f5eafb7e400e79c6566e1a6ac2 SHA512 b875c838394523483ae7d93585207eb3c642a345bbb08e1dcef3ceb737c813fa779e2f5479d48cdcc30732b8a0a9e6ecc648df940def6731e4dff43b23786e6d diff --git a/acct-group/plugdev/metadata.xml b/acct-group/plugdev/metadata.xml new file mode 100644 index 0000000..076793e --- /dev/null +++ b/acct-group/plugdev/metadata.xml @@ -0,0 +1,8 @@ + + + + + mgorny@gentoo.org + Michał Górny + + diff --git a/acct-group/plugdev/plugdev-0-r1.ebuild b/acct-group/plugdev/plugdev-0-r1.ebuild new file mode 100644 index 0000000..66735a7 --- /dev/null +++ b/acct-group/plugdev/plugdev-0-r1.ebuild @@ -0,0 +1,9 @@ +# Copyright 2019-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit acct-group + +DESCRIPTION="Group controlling access to removable media" +ACCT_GROUP_ID=272 diff --git a/dev-cpp/gulrak-filesystem/Manifest b/dev-cpp/gulrak-filesystem/Manifest new file mode 100644 index 0000000..dca2506 --- /dev/null +++ b/dev-cpp/gulrak-filesystem/Manifest @@ -0,0 +1,3 @@ +DIST gulrak-filesystem-1.5.10.tar.gz 176873 BLAKE2B 0c9ccfd918ede195c65a25a361c9d3a7acca99d2e5e917911a5dcd7e74c989c291f37e962943771860ea8b14f26d066863faea4dd17cb25d44aa9061913d5e5c SHA512 470dd9e1c4358f9d8d9f531d8c3c6716cdd156c815315748436a1dc3caf095d320e58eae2274df8c15e293cc96170752fb00aed8ad2210d417b174c13297fbac +EBUILD gulrak-filesystem-1.5.10.ebuild 740 BLAKE2B 40fe1f3d586ec7fdfe0a5782b2668077fcb534745789bebcdd31f717763d2c02ba9f0072ada0c1cd9303183c63379328b9cce4d5fac558924b073a7e573151a4 SHA512 83b2b4c5fe819672e8b38b21760a42607325bbae9568a5e5e3cfba569e5d5376aae66cf8031e35c450a54bd3d620ad9986e48f39b1478e97e0678f71870b8f8e +MISC metadata.xml 330 BLAKE2B 00186bf8c44c6d7268ff44a6914530d56ef344300d10285a84b3a705e9f463e74aabcdb8bd4375d5e094e662565dbeeca882d33e72f24ae35392c63b7d63377f SHA512 9e84dee6929db5525f13d961bdf17b2db795f5f8cb4211aed4b1d3286207b8935e9a4276a7c0ebe09317347f64e8a54a835d2f607ae47b737462bdf9dbfc1c79 diff --git a/dev-cpp/gulrak-filesystem/gulrak-filesystem-1.5.10.ebuild b/dev-cpp/gulrak-filesystem/gulrak-filesystem-1.5.10.ebuild new file mode 100644 index 0000000..4ca983d --- /dev/null +++ b/dev-cpp/gulrak-filesystem/gulrak-filesystem-1.5.10.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="Header-only single-file std::filesystem compatible helper library" +HOMEPAGE="https://github.com/gulrak/filesystem" +SRC_URI="https://github.com/gulrak/filesystem/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="examples test" +RESTRICT="!test? ( test )" + +S="${WORKDIR}/${P#*-}" + +src_configure() { + local mycmakeargs=( + -DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF + -DGHC_FILESYSTEM_BUILD_TESTING=$(usex test) + -DGHC_FILESYSTEM_WITH_INSTALL=ON + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + docinto examples + use examples && dodoc examples/*.cpp +} diff --git a/dev-cpp/gulrak-filesystem/metadata.xml b/dev-cpp/gulrak-filesystem/metadata.xml new file mode 100644 index 0000000..e567ba1 --- /dev/null +++ b/dev-cpp/gulrak-filesystem/metadata.xml @@ -0,0 +1,11 @@ + + + + + chewi@gentoo.org + James Le Cuirot + + + gulrak/filesystem + + diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest new file mode 100644 index 0000000..80db4e2 --- /dev/null +++ b/dev-lang/python/Manifest @@ -0,0 +1,7 @@ +AUX pydoc.conf 169 BLAKE2B ce40bb3d5f858bd7a8d9ef5bf215a8ab592568a724f0e08aea219da014dac12fdfcbcf5fb168bb9aa57be110f74d656aed46179ffe11e3c992d84a647e442b7b SHA512 30d0776a4004cd641e6f283658c3c24915a21ea15fe40e506ff2c3a5f95936aa00c9490b04ab25f29e9b7ac65cd88fd54ca0b08e000e73820b13c7c57c0bf5b2 +AUX pydoc.init 18356 BLAKE2B 8ec51539d5f1f85ccfa5b55f8840da9a2146f68fc2de6b96d5d9169465b52bd3e7e7d5922b801838da81701741c6e76db8f0405d893548e1f4a48b9d65d16616 SHA512 a69948cdc5f456950639c3a6e4b8e4197f1c7139cec770005a36f3ddd86da3ebbafebaf4d0ed84752148abb936124e6b085117fad6a895384f3ac85b60a991ff +DIST Python-3.8.12.tar.xz 18443568 BLAKE2B 73413aee7a31347ac4342718a54d23d4036220262c4cd41cd50b06c3b1698d52d11cf7ac2c781b919f2cdb0dcb6397d623c463dcdcd1edca99abbbce239a3c6e SHA512 2f93fe5ff83f470c7b6a1b7f29f499a2a010fabd649e9fe65ad3fbfa21b6e1966e77c9b7ac012d978159bc3fe63fec2d64bc6982fc2ee1714d3fa0e47631f279 +DIST Python-3.8.12.tar.xz.asc 833 BLAKE2B 33f59aa667555832ee510d2a7295079f34a3983dfa84beab20b33ec691ea3eecfcc4a62591fe233fc30622d0236ee69a3d41b8922ee2f4c632df3523d565c3ec SHA512 ef552b716a721f410abb14387594c8b0ddc65ce4b8a6ae6bf920c1db2ea9ddf6bbf547e93d3716495ae31848eb1049aae4257016e888393681bbfb6f6529bc12 +DIST python-gentoo-patches-3.8.12_p1.tar.xz 16632 BLAKE2B cce7a41d020af1ffc55a01ef67b20bcb16c68adbccc1e44ef166d1707e817ed6c3bae70f84c56553f27bca449015e273014c0be73bc2f9b4e25844ddce385486 SHA512 4621727c2e9cc1c5519e021210e16a97e7167ea831445dfdd07f5b0ed642b5919834244111708a971ce098b10b439797e1c76827eccab803f801052c671f1ae6 +EBUILD python-3.8.12_p1-r1.ebuild 9938 BLAKE2B af641dd352b65814ec8b54d3d205f89174ac4d1ca11d8c6138c2d00bb1918ef982bbb82a0e15dedbb9ba43a2f9f3b63d853cc49cd0cb399a469b5ca1a6825ec7 SHA512 5c6b45639b13d5cc5fd97aebad52f1ee5832d646857510dc5909e0f0afd7cd0dc848dbf78a7e12838d072c3b036ef93cfe11bee528d42bda43afddad0b1e03db +MISC metadata.xml 740 BLAKE2B 31abd8d03440517adf39f29f36e87f821dbf029602f40d4b252b1ec8e6a52955ad9325fe66a9a3bd2e9c4436e6c6865853f75c3169016c7a44327a06b07694df SHA512 b601a773d5fe4e29d43e9ce5d857bb525b706b95745056a74a2476a37f182075363cb44814f9d6f73b8be08a63d75ec322b608463796c6eef7aa8d636a2350b8 diff --git a/dev-lang/python/files/pydoc.conf b/dev-lang/python/files/pydoc.conf new file mode 100644 index 0000000..3c6920c --- /dev/null +++ b/dev-lang/python/files/pydoc.conf @@ -0,0 +1,6 @@ +# /etc/init.d/pydoc.conf + +# This file contains the configuration for pydoc's internal webserver. + +# Default port for Python's pydoc server. +@PYDOC_PORT_VARIABLE@="7464" diff --git a/dev-lang/python/files/pydoc.init b/dev-lang/python/files/pydoc.init new file mode 100644 index 0000000..62326ec --- /dev/null +++ b/dev-lang/python/files/pydoc.init @@ -0,0 +1,278 @@ + + + +pydoc.init « files « python « dev-lang - repo/gentoo.git - Official Gentoo ebuild repository + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
+ + + + +
+summaryrefslogtreecommitdiff
+ + + +
+
+
blob: f8e05636da4ed1970e196aa65ff063b761656ba9 (plain) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public Licence v2
+
+start() {
+	local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}"
+
+	if [ -z "${pydoc_port}" ]; then
+		eerror "Port not set"
+		return 1
+	fi
+
+	ebegin "Starting pydoc server on port ${pydoc_port}" 
+	start-stop-daemon --start --background --make-pidfile \
+			  --pidfile /var/run/@PYDOC@.pid \
+			  --exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}"
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping pydoc server"
+	start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid
+	eend $?
+}
+
+
+
+
+
+
+
+ + + + + + + + + diff --git a/dev-lang/python/metadata.xml b/dev-lang/python/metadata.xml new file mode 100644 index 0000000..54c2aa9 --- /dev/null +++ b/dev-lang/python/metadata.xml @@ -0,0 +1,15 @@ + + + + + python@gentoo.org + Python + + + Build Bluetooth protocol support in socket module + Link readline extension against dev-libs/libedit instead of sys-libs/readline. + Optimize the build using Profile Guided Optimization (PGO) + Optimize the build using Link Time Optimization (LTO) + Install Windows executables required to create an executable installer for MS Windows. + + diff --git a/dev-lang/python/python-3.8.12_p1-r1.ebuild b/dev-lang/python/python-3.8.12_p1-r1.ebuild new file mode 100644 index 0000000..5c31c44 --- /dev/null +++ b/dev-lang/python/python-3.8.12_p1-r1.ebuild @@ -0,0 +1,340 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" +WANT_LIBTOOL="none" + +inherit autotools flag-o-matic multiprocessing pax-utils \ + python-utils-r1 toolchain-funcs verify-sig + +MY_PV=${PV/_rc/rc} +MY_P="Python-${MY_PV%_p*}" +PYVER=$(ver_cut 1-2) +PATCHSET="python-gentoo-patches-${MY_PV}" + +DESCRIPTION="An interpreted, interactive, object-oriented programming language" +HOMEPAGE="https://www.python.org/" +SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz + https://dev.gentoo.org/~floppym/python/${PATCHSET}.tar.xz + verify-sig? ( + https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc + )" +S="${WORKDIR}/${MY_P}" + +LICENSE="PSF-2" +SLOT="${PYVER}" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" +IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml" +RESTRICT="!test? ( test )" + +# Do not add a dependency on dev-lang/python to this ebuild. +# If you need to apply a patch which requires python for bootstrapping, please +# run the bootstrap code on your dev box and include the results in the +# patchset. See bug 447752. + +RDEPEND="app-arch/bzip2:= + app-arch/xz-utils:= + dev-lang/python-exec[python_targets_python3_8(-)] + dev-libs/libffi:= + sys-apps/util-linux:= + >=sys-libs/zlib-1.1.3:= + virtual/libcrypt:= + virtual/libintl + gdbm? ( sys-libs/gdbm:=[berkdb] ) + ncurses? ( >=sys-libs/ncurses-5.2:= ) + readline? ( >=sys-libs/readline-4.1:= ) + sqlite? ( >=dev-db/sqlite-3.3.8:3= ) + ssl? ( >=dev-libs/openssl-1.1.1:= ) + tk? ( + >=dev-lang/tcl-8.0:= + >=dev-lang/tk-8.0:= + dev-tcltk/blt:= + dev-tcltk/tix + ) + xml? ( >=dev-libs/expat-2.1:= )" +# bluetooth requires headers from bluez +DEPEND="${RDEPEND} + bluetooth? ( net-wireless/bluez ) + test? ( app-arch/xz-utils[extra-filters(+)] )" +BDEPEND=" + virtual/awk + virtual/pkgconfig + sys-devel/autoconf-archive + verify-sig? ( sec-keys/openpgp-keys-python ) + !sys-devel/gcc[libffi(-)]" +RDEPEND+=" !build? ( app-misc/mime-types )" + +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} + fi + default +} + +src_prepare() { + # Ensure that internal copies of expat, libffi and zlib are not used. + rm -fr Modules/expat || die + rm -fr Modules/_ctypes/libffi* || die + rm -fr Modules/zlib || die + + local PATCHES=( + "${WORKDIR}/${PATCHSET}" + ) + + default + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" + + # force correct number of jobs + # https://bugs.gentoo.org/737660 + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") + sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die + sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die + + eautoreconf +} + +src_configure() { + local disable + # disable automagic bluetooth headers detection + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no + use gdbm || disable+=" gdbm" + use ncurses || disable+=" _curses _curses_panel" + use readline || disable+=" readline" + use sqlite || disable+=" _sqlite3" + use ssl || export PYTHON_DISABLE_SSL="1" + use tk || disable+=" _tkinter" + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. + export PYTHON_DISABLE_MODULES="${disable}" + + if ! use xml; then + ewarn "You have configured Python without XML support." + ewarn "This is NOT a recommended configuration as you" + ewarn "may face problems parsing any XML documents." + fi + + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" + fi + + if [[ "$(gcc-major-version)" -ge 4 ]]; then + append-flags -fwrapv + fi + + filter-flags -malign-double + + # https://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flagq -O3; then + is-flagq -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi + + # https://bugs.gentoo.org/700012 + if is-flagq -flto || is-flagq '-flto=*'; then + append-cflags $(test-flags-CC -ffat-lto-objects) + fi + + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. + tc-export CXX + + # Fix implicit declarations on cross and prefix builds. Bug #674070. + use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw + + local dbmliborder + if use gdbm; then + dbmliborder+="${dbmliborder:+:}gdbm" + fi + + local myeconfargs=( + # glibc-2.30 removes it; since we can't cleanly force-rebuild + # Python on glibc upgrade, remove it proactively to give + # a chance for users rebuilding python before glibc + ac_cv_header_stropts_h=no + + --enable-shared + --enable-ipv6 + --infodir='${prefix}/share/info' + --mandir='${prefix}/share/man' + --with-computed-gotos + --with-dbmliborder="${dbmliborder}" + --with-libc= + --enable-loadable-sqlite-extensions + --without-ensurepip + --with-system-expat + --with-system-ffi + ) + + OPT="" econf "${myeconfargs[@]}" + + if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then + eerror "configure has detected that the sem_open function is broken." + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." + die "Broken sem_open function (bug 496328)" + fi +} + +src_compile() { + # Ensure sed works as expected + # https://bugs.gentoo.org/594768 + local -x LC_ALL=C + # Prevent using distutils bundled by setuptools. + # https://bugs.gentoo.org/823728 + export SETUPTOOLS_USE_DISTUTILS=stdlib + + emake CPPFLAGS= CFLAGS= LDFLAGS= + + # Work around bug 329499. See also bug 413751 and 457194. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E python + else + pax-mark m python + fi +} + +src_test() { + # Tests will not work when cross compiling. + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + # Skip failing tests. + local skipped_tests="gdb" + + for test in ${skipped_tests}; do + mv "${S}"/Lib/test/test_${test}.py "${T}" + done + + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") + + emake test EXTRATESTOPTS="-u-network -j${jobs}" \ + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty + local result=$? + + for test in ${skipped_tests}; do + mv "${T}/test_${test}.py" "${S}"/Lib/test + done + + elog "The following tests have been skipped:" + for test in ${skipped_tests}; do + elog "test_${test}.py" + done + + elog "If you would like to run them, you may:" + elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" + elog "and run the tests separately." + + if [[ ${result} -ne 0 ]]; then + die "emake test failed" + fi +} + +src_install() { + local libdir=${ED}/usr/lib/python${PYVER} + + emake DESTDIR="${D}" altinstall + + # Remove static library + rm "${ED}"/usr/$(get_libdir)/libpython*.a || die + + sed \ + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ + -e "s/\(PY_LDFLAGS=\).*/\1/" \ + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" + + # Fix collisions between different slots of Python. + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die + + # Cheap hack to get version with ABIFLAGS + local abiver=$(cd "${ED}/usr/include"; echo python*) + if [[ ${abiver} != python${PYVER} ]]; then + # Replace python3.X with a symlink to python3.Xm + rm "${ED}/usr/bin/python${PYVER}" || die + dosym "${abiver}" "/usr/bin/python${PYVER}" + # Create python3.X-config symlink + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" + # Create python-3.5m.pc symlink + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" + fi + + # python seems to get rebuilt in src_install (bug 569908) + # Work around it for now. + if has_version dev-libs/libffi[pax-kernel]; then + pax-mark E "${ED}/usr/bin/${abiver}" + else + pax-mark m "${ED}/usr/bin/${abiver}" + fi + + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die + + use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die + + dodoc Misc/{ACKS,HISTORY,NEWS} + + if use examples; then + docinto examples + find Tools -name __pycache__ -exec rm -fr {} + || die + dodoc -r Tools + fi + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ + emake --no-print-directory -s -f - 2>/dev/null) + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py + + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} + sed \ + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ + -e "s:@PYDOC@:pydoc${PYVER}:" \ + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" + + local -x EPYTHON=python${PYVER} + # if not using a cross-compiler, use the fresh binary + if ! tc-is-cross-compiler; then + local -x PYTHON=./python + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} + else + local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} + fi + + echo "EPYTHON='${EPYTHON}'" > epython.py || die + python_domodule epython.py + + # python-exec wrapping support + local pymajor=${PYVER%.*} + local scriptdir=${D}$(python_get_scriptdir) + mkdir -p "${scriptdir}" || die + # python and pythonX + ln -s "../../../bin/${abiver}" \ + "${scriptdir}/python${pymajor}" || die + ln -s "python${pymajor}" "${scriptdir}/python" || die + # python-config and pythonX-config + # note: we need to create a wrapper rather than symlinking it due + # to some random dirname(argv[0]) magic performed by python-config + cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die + #!/bin/sh + exec "${abiver}-config" "\${@}" + EOF + chmod +x "${scriptdir}/python${pymajor}-config" || die + ln -s "python${pymajor}-config" \ + "${scriptdir}/python-config" || die + # 2to3, pydoc + ln -s "../../../bin/2to3-${PYVER}" \ + "${scriptdir}/2to3" || die + ln -s "../../../bin/pydoc${PYVER}" \ + "${scriptdir}/pydoc" || die + # idle + if use tk; then + ln -s "../../../bin/idle${PYVER}" \ + "${scriptdir}/idle" || die + fi +} diff --git a/dev-libs/libratbag/Manifest b/dev-libs/libratbag/Manifest new file mode 100644 index 0000000..21477bc --- /dev/null +++ b/dev-libs/libratbag/Manifest @@ -0,0 +1,6 @@ +AUX ratbagd.init 336 BLAKE2B c6f2ef095cd7d929c3097a18e912ae4b3615bd0ebbdfdaa9f4151b312614c016af2f3581c2fbb2853472cb70ce47d5f26f254772fb9f3dabba2ce93626b672b7 SHA512 3908b3481b49bcebc84e3023ff911dcbc1773e4322356def0067ed4aa426184cf43e12de702e98210157d17c2806d57c1cb4bc79ddb0b8660036a6fe3974607e +DIST libratbag-0.15.tar.gz 249492 BLAKE2B 0f5b35800cb9f82cb892dacd5e3b041843cf5513507ee4882ec5b3f8c8aec8a24594736f2eb1c8e373a0ee38ace1e6328cbd4816d6e5b2cd1f2154ebd803a5fa SHA512 add47a6b3d771de77c6307e128a549f5295e216059b5a2375aa6b2b6bbebcf9a93d7bf148181b3f39f855976e9b6f57072dd9198d07828bebe85409f4ad994aa +DIST libratbag-0.16.tar.gz 253080 BLAKE2B ede56838c822519b4fe4c6846f5d6d237104fc06f96fb17aa62b4c712965f00827973ebe732ee5ac9a16f101baf0b63eb445fbb97746df3b8ed24d6e085b34e1 SHA512 b3f2fee39ec85c0e08d257753241fb0e553de53eb7409a3b95f93a0fac3989a9411c53c915e72bef19bcfc5682fe9cdafaeb1f41f2718ab02766859f565415e3 +EBUILD libratbag-0.15.ebuild 1958 BLAKE2B e4bf7db7c49a78ac78abeffbf1afc38e6acdfd069db6e8812cf5e593f52d085f5d5cdfbb8f570774379ffc3cea6f6534faab6e60c339905df5588898f379e195 SHA512 76b0afa674f72cb36f08d8479735797fbdfb8cbb22f0cd22de065918e25beca60ac27886b0e8bfc40ce0a235ec3a0076fbb05cb0e2e21aa7c9c2bb477cfc381d +EBUILD libratbag-0.16.ebuild 1958 BLAKE2B e4bf7db7c49a78ac78abeffbf1afc38e6acdfd069db6e8812cf5e593f52d085f5d5cdfbb8f570774379ffc3cea6f6534faab6e60c339905df5588898f379e195 SHA512 76b0afa674f72cb36f08d8479735797fbdfb8cbb22f0cd22de065918e25beca60ac27886b0e8bfc40ce0a235ec3a0076fbb05cb0e2e21aa7c9c2bb477cfc381d +MISC metadata.xml 17145 BLAKE2B 580aa6833f2898b3b59b9f76f77641e7419dd8e2005a4fe1e8273a325b98dae4742b4e5aebea84affcd18d45c14568fadb2596cfc9b8213bb1f2595bcc46b8d4 SHA512 33188bcd4338528e1b8c23601f94aaf7798b4f52193ef0b5eae3c0614d52bdbcd373a09a6e4abb8015adb77f0149755ddcfd6bd380dedacfe3476608ee8e0e67 diff --git a/dev-libs/libratbag/files/ratbagd.init b/dev-libs/libratbag/files/ratbagd.init new file mode 100644 index 0000000..d3e7d08 --- /dev/null +++ b/dev-libs/libratbag/files/ratbagd.init @@ -0,0 +1,13 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="system daemon to introspect and modify configurable mice" +pidfile="/run/${SVCNAME}.pid" +command="/usr/bin/ratbagd" +start_stop_daemon_args="--quiet" +command_background="true" + +depend() { + need dbus +} diff --git a/dev-libs/libratbag/libratbag-0.15.ebuild b/dev-libs/libratbag/libratbag-0.15.ebuild new file mode 100644 index 0000000..b46974b --- /dev/null +++ b/dev-libs/libratbag/libratbag-0.15.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..9} ) + +inherit meson python-single-r1 systemd udev + +DESCRIPTION="Library to configure gaming mice" +HOMEPAGE="https://github.com/libratbag/libratbag" +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc elogind systemd test" +REQUIRED_USE=" + ${PYTHON_REQUIRED_USE} + ^^ ( elogind systemd ) +" +RESTRICT="!test? ( test )" + +BDEPEND=" + ${PYTHON_DEPS} + dev-lang/swig + virtual/pkgconfig + doc? ( app-doc/doxygen ) + test? ( + dev-libs/check + dev-libs/gobject-introspection + dev-util/valgrind + $(python_gen_cond_dep ' + dev-python/pygobject:3[${PYTHON_USEDEP}] + dev-python/python-evdev[${PYTHON_USEDEP}] + ') + ) +" +RDEPEND=" + ${PYTHON_DEPS} + acct-group/plugdev + dev-libs/json-glib + dev-libs/libevdev + virtual/libudev + $(python_gen_cond_dep ' + dev-python/pygobject:3[${PYTHON_USEDEP}] + dev-python/python-evdev[${PYTHON_USEDEP}] + ') + elogind? ( sys-auth/elogind ) + systemd? ( sys-apps/systemd ) +" +DEPEND=" + ${RDEPEND} + dev-libs/gobject-introspection +" + +src_prepare() { + default + + if use elogind ; then + # Fix systemd includes for elogind + sed -i -e 's@include + + +metadata.xml « libratbag « dev-libs - repo/gentoo.git - Official Gentoo ebuild repository + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
+ + + + +
+summaryrefslogtreecommitdiff
+ + + +
+
+
blob: 1829a7338338e8f3dffbf7b462c221f8c31c47a7 (plain) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person" proxied="yes">
+    <email>alex@1stleg.com</email>
+    <name>Alex Barker</name>
+  </maintainer>
+  <maintainer type="project" proxied="proxy">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+  <maintainer type="person" proxied="proxy">
+    <email>polynomial-c@gentoo.org</email>
+    <name>Lars Wendler</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">libratbag/libratbag</remote-id>
+  </upstream>
+</pkgmetadata>
+
+
+
+
+
+
+
+ +
+
+
+
+   +
+
+

Questions or comments?

+ Please feel free to contact us. +
+
+
+
+ +
+
+ © 2001–2021 Gentoo Foundation, Inc.
+ + Gentoo is a trademark of the Gentoo Foundation, Inc. + The contents of this document, unless otherwise expressly stated, are licensed under the + CC-BY-SA-4.0 license. + The Gentoo Name and Logo Usage Guidelines apply. + +
+
+
+
+ + + + + + + diff --git a/dev-python/packaging/Manifest b/dev-python/packaging/Manifest new file mode 100644 index 0000000..19e78db --- /dev/null +++ b/dev-python/packaging/Manifest @@ -0,0 +1,3 @@ +DIST packaging-21.3.gh.tar.gz 80471 BLAKE2B a16ba1e74f0c868816131a7cb07b7aa0c14760cf3ad4c3d6737ac30ef99276c33b1f018d29e710f28e8d0cfb0e3e6b91e375d1d17e2b7ec6302164377cd503d0 SHA512 8960deacda26877b73d98a3b632e760e902a16ec7a04707f84044980e4d4fb33e4f584db115c9008066aa876079f28633bafe37fbd5ce9a23830b6b89eb4ae7a +EBUILD packaging-21.3-r1.ebuild 958 BLAKE2B 6b8cff1a9479ec3e2529489a4c56de56b84cae71e253babbb98f5a7e4cb800cc0d0aad784a706859215863e9f92eb9df8780f4506bcb179820e155e4fc0d3c58 SHA512 8be4774229bebe45ee6935e1365c2c9c9de8a6ab8a833980738fb324fa066456e0d84e197abfe1e820a63448dc82e2e5425d3fe3f49278e64bab87afa1a544d2 +MISC metadata.xml 391 BLAKE2B 0d73ed3809b26e3069048116ab247ceeb9e2932e0d8d6063b97cc1f0ed8359e73a54b22035fedb169524e502b6a07b8203e6c35d801f738bbed685d90e12bf96 SHA512 eb4d1ca476a45232547fdd961a4e6715dda24c7ab82e1f1995ac977b9825793d5d10a2ac408b1ee0b7c8b8444f2c42be33d6fb1012461f96db9a71477cca67ae diff --git a/dev-python/packaging/metadata.xml b/dev-python/packaging/metadata.xml new file mode 100644 index 0000000..229a32e --- /dev/null +++ b/dev-python/packaging/metadata.xml @@ -0,0 +1,13 @@ + + + + + python@gentoo.org + Python + + + + packaging + pypa/packaging + + diff --git a/dev-python/packaging/packaging-21.3-r1.ebuild b/dev-python/packaging/packaging-21.3-r1.ebuild new file mode 100644 index 0000000..d39ba4b --- /dev/null +++ b/dev-python/packaging/packaging-21.3-r1.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# please keep this ebuild at EAPI 7 -- sys-apps/portage dep +EAPI=7 + +PYTHON_COMPAT=( python3_{8..10} pypy3 ) +inherit distutils-r1 + +DESCRIPTION="Core utilities for Python packages" +HOMEPAGE=" + https://github.com/pypa/packaging/ + https://pypi.org/project/packaging/" +SRC_URI=" + https://github.com/pypa/packaging/archive/${PV}.tar.gz -> ${P}.gh.tar.gz" + +SLOT="0" +LICENSE="|| ( Apache-2.0 BSD-2 )" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +RDEPEND=" + || ( + >=dev-python/pyparsing-3.0.6[${PYTHON_USEDEP}] + + + + + + evdev + + diff --git a/dev-python/python-evdev/python-evdev-1.4.0.ebuild b/dev-python/python-evdev/python-evdev-1.4.0.ebuild new file mode 100644 index 0000000..9dea3a6 --- /dev/null +++ b/dev-python/python-evdev/python-evdev-1.4.0.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..10} ) + +inherit distutils-r1 + +DESCRIPTION="Python library for evdev bindings" +HOMEPAGE="https://python-evdev.readthedocs.io/" +SRC_URI="https://github.com/gvalkov/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 ~arm ~x86" + +distutils_enable_tests pytest + +python_compile() { + distutils-r1_python_compile build_ecodes \ + --evdev-headers \ + "${SYSROOT}/usr/include/linux/input.h:${SYSROOT}/usr/include/linux/input-event-codes.h" +} + +python_test() { + # test_uinput requires write access to /dev/uinput + pytest -vv --deselect tests/test_uinput.py || + die "tests failed for ${EPYTHON}" +} diff --git a/dev-python/setuptools/Manifest b/dev-python/setuptools/Manifest new file mode 100644 index 0000000..03a400b --- /dev/null +++ b/dev-python/setuptools/Manifest @@ -0,0 +1,4 @@ +DIST python-gentoo-patches-3.10.0_p1.tar.xz 10068 BLAKE2B 1c9817b449831559f0a0b722c02a5f55d94b3dfde98e5882c1403fe24a4addf7074ab39c09b91cff6fd7ace2e4b6e8ed899d9a0b9ffd6612ce315c4c192bd309 SHA512 39aa41dbf17b6dc5255491c75031a3dae6962b44125e426dbfdce365a6533c5dae9856b1fff8016a189124b7cff72d2665ce99da344c2f9dff005ba685e8c2c4 +DIST setuptools-59.8.0.tar.gz 2282358 BLAKE2B 2f1b49285fc70420e24f958c4955200ef0407a7f3aa52fd581a165fd47c7bbde8366c26963f1bbb36f0f77797c12cbb9016fdc69e1a5cc696bb67aacca16d140 SHA512 d906558b498bda8abf28831224502c6f0290a4cdbf087fe07af8321dba3dfd1e19fa5b4a820033e54c4561b82ea8ec54c287b4fd657892ed28c2a7de91a9107e +EBUILD setuptools-59.8.0.ebuild 2933 BLAKE2B d5f4b008152d6a1324ea2a63da229f71fda4f6e20f1d7790f69257e9945ad98c02d765dc5c4e76fe44b476eeb19df6b21f582c684ab13e7b6452e280babfa0fb SHA512 e627a7c69f998d01dcd24c446efddf1af40e97065b13df3398e1c6e8c320f42cf1d5b04d2e84325f32298e0c91c8d789def20d4e947d6aca6e66ddda8058d14e +MISC metadata.xml 469 BLAKE2B 4a26769b09a3785586b22db850b7fc5c4818f31c3ace9cc94476d35df05e50edf6721f3c95ec615c3b2efe071ef284a54ea2d53566316ba653f7830bb48f80bf SHA512 dd682c4ad2e59a97094ebdabe4d1063e2319ed05e1fe9d8c2fafe069badb3b4cf8bb6d9f50e09d2128e2a081c1c69827407ac8aed644ebf70eb4ca1bc9a57319 diff --git a/dev-python/setuptools/metadata.xml b/dev-python/setuptools/metadata.xml new file mode 100644 index 0000000..46eeb10 --- /dev/null +++ b/dev-python/setuptools/metadata.xml @@ -0,0 +1,14 @@ + + + + + python@gentoo.org + Python + + + + setuptools + pypa/setuptools + cpe:/a:python:setuptools + + diff --git a/dev-python/setuptools/setuptools-59.8.0.ebuild b/dev-python/setuptools/setuptools-59.8.0.ebuild new file mode 100644 index 0000000..30b1a68 --- /dev/null +++ b/dev-python/setuptools/setuptools-59.8.0.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# please keep this ebuild at EAPI 7 -- sys-apps/portage dep +EAPI=7 + +# Set to 'manual' to avoid triggering install QA check +DISTUTILS_USE_SETUPTOOLS=manual +PYTHON_COMPAT=( python3_{8..10} pypy3 ) +PYTHON_REQ_USE="xml(+)" + +inherit distutils-r1 multiprocessing + +CPY_PATCHSET="python-gentoo-patches-3.10.0_p1" +DESCRIPTION="Collection of extensions to Distutils" +HOMEPAGE="https://github.com/pypa/setuptools https://pypi.org/project/setuptools/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz + https://dev.gentoo.org/~floppym/python/${CPY_PATCHSET}.tar.xz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + test? ( + $(python_gen_cond_dep ' + dev-python/jaraco-envs[${PYTHON_USEDEP}] + >=dev-python/jaraco-path-3.2.0[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/pip[${PYTHON_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pytest-fixture-config[${PYTHON_USEDEP}] + dev-python/pytest-virtualenv[${PYTHON_USEDEP}] + dev-python/pytest-xdist[${PYTHON_USEDEP}] + >=dev-python/virtualenv-20[${PYTHON_USEDEP}] + dev-python/wheel[${PYTHON_USEDEP}] + ' python3_{8..10} pypy3) + ) +" +PDEPEND=" + >=dev-python/certifi-2016.9.26[${PYTHON_USEDEP}] + dev-python/setuptools_scm[${PYTHON_USEDEP}]" + +# Force in-source build because build system modifies sources. +DISTUTILS_IN_SOURCE_BUILD=1 + +DOCS=( {CHANGES,README}.rst ) + +src_prepare() { + # apply distutils patches to the bundled distutils + pushd setuptools/_distutils >/dev/null || die + # TODO: distutils C++ patch? + eapply -p3 "${WORKDIR}/${CPY_PATCHSET}/0006-distutils-make-OO-enable-both-opt-1-and-opt-2-optimi.patch" + popd >/dev/null || die + + distutils-r1_src_prepare +} + +python_test() { + # keep in sync with python_gen_cond_dep above! + has "${EPYTHON}" python3.{8..10} pypy3 || continue + + distutils_install_for_testing + local EPYTEST_DESELECT=( + # network + setuptools/tests/test_distutils_adoption.py + 'setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[None]' + # unhappy with pytest-xdist? + setuptools/tests/test_easy_install.py::TestUserInstallTest::test_local_index + # TODO + setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_allow_hosts + setuptools/tests/test_test.py::test_tests_are_run_once + ) + + # test_easy_install raises a SandboxViolation due to ${HOME}/.pydistutils.cfg + # It tries to sandbox the test in a tempdir + HOME="${PWD}" epytest \ + -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" setuptools +} + +python_install() { + export DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT=1 + distutils-r1_python_install +} diff --git a/dev-util/vulkan-headers/Manifest b/dev-util/vulkan-headers/Manifest new file mode 100644 index 0000000..292f3c2 --- /dev/null +++ b/dev-util/vulkan-headers/Manifest @@ -0,0 +1,2 @@ +DIST vulkan-headers-1.2.198.0.tar.gz 1288092 BLAKE2B 27e776fa9b7491db8056527d4095274dfa4f1d822a436673bfd06cfd4b8aa912bf85de8d044c7d1c421db589f752c25632267de465cff8672371b3fd6d43ee90 SHA512 f9bff10ec0c2030c5ddc6b350154eb7cfc2eccb5f09f61b311557e480735355be2892e592b76b42760947cb87d154a2334069c89c0d89439c284e68cd72cc9ce +EBUILD vulkan-headers-1.2.198.0.ebuild 628 BLAKE2B bf5b298046662977242d3db22de10213bc559f55cd23b2232d5be302d1eeb2147f835e2ee2179881083f554831eaeccd91e5b3c37dabd938d133f90a2dec7504 SHA512 04c5352edc4cfca3438c6f1359f61ca188a478416bbc3d93e3efc2dccf50cd2e58909e5235483ada5423e65da21d86894d81b58795fef0dba65269eff9b64253 diff --git a/dev-util/vulkan-headers/vulkan-headers-1.2.198.0.ebuild b/dev-util/vulkan-headers/vulkan-headers-1.2.198.0.ebuild new file mode 100644 index 0000000..1a47e3d --- /dev/null +++ b/dev-util/vulkan-headers/vulkan-headers-1.2.198.0.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MY_PN=Vulkan-Headers +inherit cmake + +if [[ ${PV} == *9999* ]]; then + EGIT_REPO_URI="https://github.com/KhronosGroup/${MY_PN}.git" + inherit git-r3 +else + SRC_URI="https://github.com/KhronosGroup/${MY_PN}/archive/sdk-${PV}.0.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86" + S="${WORKDIR}"/${MY_PN}-sdk-${PV}.0 +fi + +DESCRIPTION="Vulkan Header files and API registry" +HOMEPAGE="https://github.com/KhronosGroup/Vulkan-Headers" + +LICENSE="Apache-2.0" +SLOT="0" + +BDEPEND=">=dev-util/cmake-3.10.2" diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass new file mode 100644 index 0000000..95c92cc --- /dev/null +++ b/eclass/autotools.eclass @@ -0,0 +1,678 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: autotools.eclass +# @MAINTAINER: +# base-system@gentoo.org +# @SUPPORTED_EAPIS: 5 6 7 8 +# @BLURB: Regenerates auto* build scripts +# @DESCRIPTION: +# This eclass is for safely handling autotooled software packages that need to +# regenerate their build scripts. All functions will abort in case of errors. + +# Note: We require GNU m4, as does autoconf. So feel free to use any features +# from the GNU version of m4 without worrying about other variants (i.e. BSD). + +if [[ ${__AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then + # See if we were included already, but someone changed the value + # of AUTOTOOLS_AUTO_DEPEND on us. We could reload the entire + # eclass at that point, but that adds overhead, and it's trivial + # to re-order inherit in eclasses/ebuilds instead. #409611 + if [[ ${__AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then + die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; please inherit ${ECLASS} first! ${__AUTOTOOLS_AUTO_DEPEND} -> ${AUTOTOOLS_AUTO_DEPEND}" + fi +fi + +if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then +_AUTOTOOLS_ECLASS=1 + +case ${EAPI} in + 5|6) + # Needed for eqawarn + inherit eutils + ;; + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; +esac + +inherit gnuconfig libtool + +# @ECLASS-VARIABLE: WANT_AUTOCONF +# @PRE_INHERIT +# @DESCRIPTION: +# The major version of autoconf your package needs +: ${WANT_AUTOCONF:=latest} + +# @ECLASS-VARIABLE: WANT_AUTOMAKE +# @PRE_INHERIT +# @DESCRIPTION: +# The major version of automake your package needs +: ${WANT_AUTOMAKE:=latest} + +# @ECLASS-VARIABLE: WANT_LIBTOOL +# @PRE_INHERIT +# @DESCRIPTION: +# Do you want libtool? Valid values here are "latest" and "none". +: ${WANT_LIBTOOL:=latest} + +# @ECLASS-VARIABLE: _LATEST_AUTOMAKE +# @INTERNAL +# @DESCRIPTION: +# CONSTANT! +# The latest major unstable and stable version/slot of automake available +# on each arch. +# Only add unstable version if it is in a different slot than latest stable +# version. +# List latest unstable version first to boost testing adoption rate because +# most package manager dependency resolver will pick the first suitable +# version. +# If a newer slot is stable on any arch, and is NOT reflected in this list, +# then circular dependencies may arise during emerge @system bootstraps. +# +# See bug #312315 and bug #465732 for further information and context. +# +# Do NOT change this variable in your ebuilds! +# If you want to force a newer minor version, you can specify the correct +# WANT value by using a colon: : +_LATEST_AUTOMAKE=( 1.16.2-r1:1.16 ) + +_automake_atom="sys-devel/automake" +_autoconf_atom="sys-devel/autoconf" +if [[ -n ${WANT_AUTOMAKE} ]] ; then + case ${WANT_AUTOMAKE} in + # Even if the package doesn't use automake, we still need to depend + # on it because we run aclocal to process m4 macros. This matches + # the autoreconf tool, so this requirement is correct, bug #401605. + none) ;; + latest) _automake_atom="|| ( `printf '>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )" ;; + *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*";; + esac + export WANT_AUTOMAKE +fi + +if [[ -n ${WANT_AUTOCONF} ]] ; then + case ${WANT_AUTOCONF} in + none) _autoconf_atom="" ;; # some packages don't require autoconf at all + 2.1) _autoconf_atom="~sys-devel/autoconf-2.13" ;; + # if you change the "latest" version here, change also autotools_env_setup + latest|2.5) _autoconf_atom=">=sys-devel/autoconf-2.69" ;; + *) die "Invalid WANT_AUTOCONF value '${WANT_AUTOCONF}'" ;; + esac + export WANT_AUTOCONF +fi + +_libtool_atom=">=sys-devel/libtool-2.4" +if [[ -n ${WANT_LIBTOOL} ]] ; then + case ${WANT_LIBTOOL} in + none) _libtool_atom="" ;; + latest) ;; + *) die "Invalid WANT_LIBTOOL value '${WANT_LIBTOOL}'" ;; + esac + export WANT_LIBTOOL +fi + +# @ECLASS-VARIABLE: AUTOTOOLS_DEPEND +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# Contains the combination of requested automake/autoconf/libtool +# versions in *DEPEND format. +AUTOTOOLS_DEPEND="${_automake_atom} + ${_autoconf_atom} + ${_libtool_atom}" +RDEPEND="" + +# @ECLASS-VARIABLE: AUTOTOOLS_AUTO_DEPEND +# @PRE_INHERIT +# @DESCRIPTION: +# Set to 'no' to disable automatically adding to DEPEND. This lets +# ebuilds form conditional depends by using ${AUTOTOOLS_DEPEND} in +# their own DEPEND string. +: ${AUTOTOOLS_AUTO_DEPEND:=yes} +if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then + case ${EAPI} in + 5|6) DEPEND=${AUTOTOOLS_DEPEND} ;; + *) BDEPEND=${AUTOTOOLS_DEPEND} ;; + esac +fi +__AUTOTOOLS_AUTO_DEPEND=${AUTOTOOLS_AUTO_DEPEND} # See top of eclass + +unset _automake_atom _autoconf_atom + +# @ECLASS-VARIABLE: AM_OPTS +# @DEFAULT_UNSET +# @DESCRIPTION: +# Additional options to pass to automake during +# eautoreconf call. +: ${AM_OPTS:=} + +# @ECLASS-VARIABLE: AT_NOEAUTOHEADER +# @DEFAULT_UNSET +# @DESCRIPTION: +# Don't run eautoheader command if set to 'yes'; only used to work around +# packages that don't want their headers being modified. +: ${AT_NOEAUTOHEADER:=} + +# @ECLASS-VARIABLE: AT_NOEAUTOMAKE +# @DEFAULT_UNSET +# @DESCRIPTION: +# Don't run eautomake command if set to 'yes'; only used to workaround +# broken packages. Generally you should, instead, fix the package to +# not call AM_INIT_AUTOMAKE if it doesn't actually use automake. +: ${AT_NOEAUTOMAKE:=} + +# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE +# @DEFAULT_UNSET +# @DESCRIPTION: +# Don't run elibtoolize command if set to 'yes', +# useful when elibtoolize needs to be ran with +# particular options +: ${AT_NOELIBTOOLIZE:=} + +# @ECLASS-VARIABLE: AT_M4DIR +# @DEFAULT_UNSET +# @DESCRIPTION: +# Additional director(y|ies) aclocal should search +: ${AT_M4DIR:=} + +# @ECLASS-VARIABLE: AT_SYS_M4DIR +# @DEFAULT_UNSET +# @INTERNAL +# @DESCRIPTION: +# For system integrators, a list of additional aclocal search paths. +# This variable gets eval-ed, so you can use variables in the definition +# that may not be valid until eautoreconf & friends are run. +: ${AT_SYS_M4DIR:=} + +# @FUNCTION: eautoreconf +# @DESCRIPTION: +# This function mimes the behavior of autoreconf, but uses the different +# eauto* functions to run the tools. It doesn't accept parameters, but +# the directory with include files can be specified with AT_M4DIR variable. +# +# Should do a full autoreconf - normally what most people will be interested in. +# Also should handle additional directories specified by AC_CONFIG_SUBDIRS. +eautoreconf() { + local x g + + # Subdirs often share a common build dir, bug #529404. If so, we can't safely + # run in parallel because many tools clobber the content in there. Libtool + # and automake both `rm && cp` while aclocal reads the output. We might be + # able to handle this if we split the steps and grab locks on the dirs the + # tools actually write to. Then we'd run all the common tools that use + # those inputs. Doing this in bash does not scale easily. + # If we do re-enable parallel support, make sure bug #426512 is handled. + if [[ -z ${AT_NO_RECURSIVE} ]] ; then + # Take care of subdirs + for x in $(autotools_check_macro_val AC_CONFIG_SUBDIRS) ; do + if [[ -d ${x} ]] ; then + pushd "${x}" >/dev/null + # Avoid unsafe nested multijob_finish_one for bug #426512. + AT_NOELIBTOOLIZE="yes" eautoreconf || die + popd >/dev/null + fi + done + fi + + einfo "Running eautoreconf in '${PWD}' ..." + + local m4dirs=$(autotools_check_macro_val AC_CONFIG_{AUX,MACRO}_DIR) + [[ -n ${m4dirs} ]] && mkdir -p ${m4dirs} + + # Run all the tools before aclocal so we can gather the .m4 files. + local i tools=( + # + glibgettext false "autotools_run_tool glib-gettextize --copy --force" + gettext false "autotools_run_tool --at-missing autopoint --force" + # intltool must come after autopoint. + intltool false "autotools_run_tool intltoolize --automake --copy --force" + gtkdoc false "autotools_run_tool --at-missing gtkdocize --copy" + gnomedoc false "autotools_run_tool --at-missing gnome-doc-prepare --copy --force" + libtool false "_elibtoolize --auto-ltdl --install --copy --force" + ) + for (( i = 0; i < ${#tools[@]}; i += 3 )) ; do + if _at_uses_${tools[i]} ; then + tools[i+1]=true + ${tools[i+2]} + fi + done + + # Generate aclocal.m4 with our up-to-date m4 files. + local rerun_aclocal=false + eaclocal + + # Check to see if we had macros expanded by other macros or in other + # m4 files that we couldn't detect early. This is uncommon, but some + # packages do this, so we have to handle it correctly. + for (( i = 0; i < ${#tools[@]}; i += 3 )) ; do + if ! ${tools[i+1]} && _at_uses_${tools[i]} ; then + ${tools[i+2]} + rerun_aclocal=true + fi + done + ${rerun_aclocal} && eaclocal + + if [[ ${WANT_AUTOCONF} == "2.1" ]] ; then + eautoconf + else + eautoconf --force + fi + [[ ${AT_NOEAUTOHEADER} != "yes" ]] && eautoheader + [[ ${AT_NOEAUTOMAKE} != "yes" ]] && FROM_EAUTORECONF="yes" eautomake ${AM_OPTS} + + if [[ ${AT_NOELIBTOOLIZE} != "yes" ]] ; then + # Call it here to prevent failures due to elibtoolize called _before_ + # eautoreconf. + elibtoolize --force "${PWD}" + fi + + return 0 +} + +# @FUNCTION: _at_uses_pkg +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# See if the specified macros are enabled. +_at_uses_pkg() { + if [[ -n $(autotools_check_macro "$@") ]] ; then + return 0 + else + # If the trace didn't find it (perhaps because aclocal.m4 hasn't + # been generated yet), cheat, but be conservative. + local macro args=() + for macro ; do + args+=( -e "^[[:space:]]*${macro}\>" ) + done + egrep -q "${args[@]}" configure.?? + fi +} +_at_uses_autoheader() { _at_uses_pkg A{C,M}_CONFIG_HEADER{S,}; } +_at_uses_automake() { _at_uses_pkg AM_INIT_AUTOMAKE; } +_at_uses_gettext() { _at_uses_pkg AM_GNU_GETTEXT_{,REQUIRE_}VERSION; } +_at_uses_glibgettext() { _at_uses_pkg AM_GLIB_GNU_GETTEXT; } +_at_uses_intltool() { _at_uses_pkg {AC,IT}_PROG_INTLTOOL; } +_at_uses_gtkdoc() { _at_uses_pkg GTK_DOC_CHECK; } +_at_uses_gnomedoc() { _at_uses_pkg GNOME_DOC_INIT; } +_at_uses_libtool() { _at_uses_pkg A{C,M}_PROG_LIBTOOL LT_INIT; } +_at_uses_libltdl() { _at_uses_pkg LT_CONFIG_LTDL_DIR; } + +# @FUNCTION: eaclocal_amflags +# @DESCRIPTION: +# Extract the ACLOCAL_AMFLAGS value from the Makefile.am and try to handle +# (most) of the crazy crap that people throw at us. +eaclocal_amflags() { + local aclocal_opts amflags_file + + for amflags_file in GNUmakefile.am Makefile.am GNUmakefile.in Makefile.in ; do + [[ -e ${amflags_file} ]] || continue + # setup the env in case the pkg does something crazy + # in their ACLOCAL_AMFLAGS. like run a shell script + # which turns around and runs autotools (bug #365401) + # or split across multiple lines (bug #383525) + autotools_env_setup + aclocal_opts=$(sed -n \ + "/^ACLOCAL_AMFLAGS[[:space:]]*=/{ \ + # match the first line + s:[^=]*=::p; \ + # then gobble up all escaped lines + : nextline /\\\\$/{ n; p; b nextline; } \ + }" ${amflags_file}) + eval aclocal_opts=\""${aclocal_opts}"\" + break + done + + echo ${aclocal_opts} +} + +# @FUNCTION: eaclocal +# @DESCRIPTION: +# These functions runs the autotools using autotools_run_tool with the +# specified parametes. The name of the tool run is the same of the function +# without e prefix. +# They also force installing the support files for safety. +# Respects AT_M4DIR for additional directories to search for macros. +eaclocal() { + [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ + autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) +} + +# @FUNCTION: _elibtoolize +# @DESCRIPTION: +# Runs libtoolize. +# +# Note the '_' prefix: avoid collision with elibtoolize() from libtool.eclass. +_elibtoolize() { + local LIBTOOLIZE=${LIBTOOLIZE:-$(type -P glibtoolize > /dev/null && echo glibtoolize || echo libtoolize)} + + if [[ ${1} == "--auto-ltdl" ]] ; then + shift + _at_uses_libltdl && set -- "$@" --ltdl + fi + + [[ -f GNUmakefile.am || -f Makefile.am ]] && set -- "$@" --automake + + autotools_run_tool ${LIBTOOLIZE} "$@" +} + +# @FUNCTION: eautoheader +# @DESCRIPTION: +# Runs autoheader. +eautoheader() { + _at_uses_autoheader || return 0 + autotools_run_tool --at-no-fail --at-m4flags autoheader "$@" +} + +# @FUNCTION: eautoconf +# @DESCRIPTION: +# Runs autoconf. +eautoconf() { + if [[ ! -f configure.ac && ! -f configure.in ]] ; then + echo + eerror "No configure.{ac,in} present in '${PWD}'!" + echo + die "No configure.{ac,in} present!" + fi + + + if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then + case ${EAPI:-0} in + 0|1|2|3|4|5|6|7) + eqawarn "This package has a configure.in file which has long been deprecated. Please" + eqawarn "update it to use configure.ac instead as newer versions of autotools will die" + eqawarn "when it finds this file. See https://bugs.gentoo.org/426262 for details." + ;; + *) + # Move configure file to the new location only on newer EAPIs to ensure + # checks are done rather than retroactively breaking ebuilds. + eqawarn "Moving configure.in to configure.ac (bug #426262)" + mv configure.{in,ac} || die + ;; + esac + fi + + # Install config.guess and config.sub which are required by many macros + # in autoconf >=2.70. + local _gnuconfig=$(gnuconfig_findnewest) + cp "${_gnuconfig}"/config.{guess,sub} . || die + + autotools_run_tool --at-m4flags autoconf "$@" +} + +# @FUNCTION: eautomake +# @DESCRIPTION: +# Runs automake. +eautomake() { + local extra_opts=() + local makefile_name + + # Run automake if: + # - a Makefile.am type file exists + # - the configure script is using the AM_INIT_AUTOMAKE directive + for makefile_name in {GNUmakefile,{M,m}akefile}.am "" ; do + [[ -f ${makefile_name} ]] && break + done + + _automake_version() { + autotools_run_tool --at-output automake --version 2>/dev/null | + sed -n -e '1{s:.*(GNU automake) ::p;q}' + } + + if [[ -z ${makefile_name} ]] ; then + _at_uses_automake || return 0 + + elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]] ; then + local used_automake + local installed_automake + + installed_automake=$(WANT_AUTOMAKE= _automake_version) + used_automake=$(head -n 1 < ${makefile_name%.am}.in | \ + sed -e 's:.*by automake \(.*\) from .*:\1:') + + if [[ ${installed_automake} != ${used_automake} ]] ; then + ewarn "Automake used for the package (${used_automake}) differs from" \ + "the installed version (${installed_automake})." + ewarn "Forcing a full rebuild of the autotools to workaround." + eautoreconf + return 0 + fi + fi + + [[ -f INSTALL && -f AUTHORS && -f ChangeLog && -f NEWS && -f README ]] \ + || extra_opts+=( --foreign ) + + # Older versions of automake do not support --force-missing. But we want + # to use this whenever possible to update random bundled files, bug #133489. + case $(_automake_version) in + 1.4|1.4[.-]*) ;; + *) extra_opts+=( --force-missing ) ;; + esac + + autotools_run_tool automake --add-missing --copy "${extra_opts[@]}" "$@" +} + +# @FUNCTION: eautopoint +# @DESCRIPTION: +# Runs autopoint (from the gettext package). +eautopoint() { + autotools_run_tool autopoint "$@" +} + +# @FUNCTION: config_rpath_update +# @USAGE: [destination] +# @DESCRIPTION: +# Some packages utilize the config.rpath helper script, but don't +# use gettext directly. So we have to copy it in manually since +# we can't let `autopoint` do it for us. +config_rpath_update() { + local dst src + + case ${EAPI} in + 5|6) + src="${EPREFIX}/usr/share/gettext/config.rpath" + ;; + *) + src="${BROOT}/usr/share/gettext/config.rpath" + ;; + esac + + [[ $# -eq 0 ]] && set -- $(find -name config.rpath) + [[ $# -eq 0 ]] && return 0 + + einfo "Updating all config.rpath files" + for dst in "$@" ; do + einfo " ${dst}" + cp "${src}" "${dst}" || die + done +} + +# @FUNCTION: autotools_env_setup +# @INTERNAL +# @DESCRIPTION: +# Process the WANT_AUTO{CONF,MAKE} flags. +autotools_env_setup() { + # We do the "latest" → version switch here because it solves + # possible order problems, see bug #270010 as an example. + if [[ ${WANT_AUTOMAKE} == "latest" ]] ; then + local pv + for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do + # Break on first hit to respect _LATEST_AUTOMAKE order. + local hv_args="" + case ${EAPI} in + 5|6) + hv_args="--host-root" + ;; + 7) + hv_args="-b" + ;; + esac + ROOT=/ has_version ${hv_args} "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" && break + done + [[ ${WANT_AUTOMAKE} == "latest" ]] && \ + die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}" + fi + [[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.5 +} + +# @FUNCTION: autotools_run_tool +# @USAGE: [--at-no-fail] [--at-m4flags] [--at-missing] [--at-output] [tool-specific flags] +# @INTERNAL +# @DESCRIPTION: +# Run the specified autotool helper, but do logging and error checking +# around it in the process. +autotools_run_tool() { + # Process our own internal flags first + local autofail=true m4flags=false missing_ok=false return_output=false + while [[ -n ${1} ]] ; do + case ${1} in + --at-no-fail) autofail=false ;; + --at-m4flags) m4flags=true ;; + --at-missing) missing_ok=true ;; + --at-output) return_output=true ;; + # whatever is left goes to the actual tool + *) break ;; + esac + shift + done + + if [[ ${EBUILD_PHASE_FUNC} != "src_unpack" && ${EBUILD_PHASE_FUNC} != "src_prepare" ]] ; then + eqawarn "Running '${1}' in ${EBUILD_PHASE_FUNC} phase" + fi + + if ${missing_ok} && ! type -P ${1} >/dev/null ; then + einfo "Skipping '$*' because '${1}' not installed" + return 0 + fi + + autotools_env_setup + + # Allow people to pass in full paths, bug #549268 + local STDERR_TARGET="${T}/${1##*/}.out" + # most of the time, there will only be one run, but if there are + # more, make sure we get unique log filenames + if [[ -e ${STDERR_TARGET} ]] ; then + local i=1 + while :; do + STDERR_TARGET="${T}/${1##*/}-${i}.out" + [[ -e ${STDERR_TARGET} ]] || break + : $(( i++ )) + done + fi + + if ${m4flags} ; then + set -- "${1}" $(autotools_m4dir_include) $(autotools_m4sysdir_include) "${@:2}" + fi + + # If the caller wants to probe something, then let them do it directly. + if ${return_output} ; then + "$@" + return + fi + + printf "***** ${1} *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}" + + ebegin "Running '$@'" + "$@" >> "${STDERR_TARGET}" 2>&1 + if ! eend $? && ${autofail} ; then + echo + eerror "Failed running '${1}'!" + eerror + eerror "Include in your bug report the contents of:" + eerror + eerror " ${STDERR_TARGET}" + echo + die "Failed running '${1}'!" + fi +} + +# Internal function to check for support + +# Keep a list of all the macros we might use so that we only +# have to run the trace code once. Order doesn't matter. +ALL_AUTOTOOLS_MACROS=( + A{C,M}_PROG_LIBTOOL LT_INIT LT_CONFIG_LTDL_DIR + A{C,M}_CONFIG_HEADER{S,} + AC_CONFIG_SUBDIRS + AC_CONFIG_AUX_DIR AC_CONFIG_MACRO_DIR + AM_INIT_AUTOMAKE + AM_GLIB_GNU_GETTEXT + AM_GNU_GETTEXT_{,REQUIRE_}VERSION + {AC,IT}_PROG_INTLTOOL + GTK_DOC_CHECK + GNOME_DOC_INIT +) +autotools_check_macro() { + [[ -f configure.ac || -f configure.in ]] || return 0 + + # We can run in multiple dirs, so we have to cache the trace + # data in $PWD rather than an env var. + local trace_file=".__autoconf_trace_data" + if [[ ! -e ${trace_file} ]] || [[ ! aclocal.m4 -ot ${trace_file} ]] ; then + WANT_AUTOCONF="2.5" autoconf \ + $(autotools_m4dir_include) \ + ${ALL_AUTOTOOLS_MACROS[@]/#/--trace=} > ${trace_file} 2>/dev/null + fi + + local macro args=() + for macro ; do + has ${macro} ${ALL_AUTOTOOLS_MACROS[@]} || die "internal error: add ${macro} to ALL_AUTOTOOLS_MACROS" + args+=( -e ":${macro}:" ) + done + grep "${args[@]}" ${trace_file} +} + +# @FUNCTION: autotools_check_macro_val +# @USAGE: [macros] +# @INTERNAL +# @DESCRIPTION: +# Look for a macro and extract its value. +autotools_check_macro_val() { + local macro scan_out + + for macro ; do + autotools_check_macro "${macro}" | \ + gawk -v macro="${macro}" \ + '($0 !~ /^[[:space:]]*(#|dnl)/) { + if (match($0, macro ":(.*)$", res)) + print res[1] + }' | uniq + done + + return 0 +} + +_autotools_m4dir_include() { + local x include_opts flag + + # Use the right flag to autoconf based on the version #448986 + [[ ${WANT_AUTOCONF} == "2.1" ]] \ + && flag="l" \ + || flag="I" + + for x in "$@" ; do + case ${x} in + # We handle it below + -${flag}) ;; + *) + [[ ! -d ${x} ]] && ewarn "${ECLASS}: '${x}' does not exist" + include_opts+=" -${flag} ${x}" + ;; + esac + done + + echo ${include_opts} +} +autotools_m4dir_include() { _autotools_m4dir_include ${AT_M4DIR} ; } +autotools_m4sysdir_include() { + # First try to use the paths the system integrator has set up. + local paths=( $(eval echo ${AT_SYS_M4DIR}) ) + + if [[ ${#paths[@]} -eq 0 && -n ${SYSROOT} ]] ; then + # If they didn't give us anything, then default to the SYSROOT. + # This helps when cross-compiling. + local path="${SYSROOT}/usr/share/aclocal" + [[ -d ${path} ]] && paths+=( "${path}" ) + fi + _autotools_m4dir_include "${paths[@]}" +} + +fi diff --git a/eclass/eapi8-dosym.eclass b/eclass/eapi8-dosym.eclass new file mode 100644 index 0000000..52f0ffe --- /dev/null +++ b/eclass/eapi8-dosym.eclass @@ -0,0 +1,108 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: eapi8-dosym.eclass +# @MAINTAINER: +# PMS team +# @AUTHOR: +# Ulrich Müller +# @SUPPORTED_EAPIS: 5 6 7 +# @BLURB: Testing implementation of EAPI 8 dosym -r option +# @DESCRIPTION: +# A stand-alone implementation of the dosym command aimed for EAPI 8. +# Intended to be used for wider testing of the proposed option and to +# allow ebuilds to switch to the new model early, with minimal change +# needed for actual EAPI 8. +# +# https://bugs.gentoo.org/708360 + +case ${EAPI} in + 5|6|7) ;; + *) die "${ECLASS}: EAPI=${EAPI:-0} not supported" ;; +esac + +# @FUNCTION: _dosym8_canonicalize +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Transparent bash-only replacement for GNU "realpath -m -s". +# Resolve references to "/./", "/../" and remove extra "/" characters +# from , without touching any actual file. +_dosym8_canonicalize() { + local path slash i prev out IFS=/ + + path=( $1 ) + [[ $1 == /* ]] && slash=/ + + while true; do + # Find first instance of non-".." path component followed by "..", + # or as a special case, "/.." at the beginning of the path. + # Also drop empty and "." path components as we go along. + prev= + for i in ${!path[@]}; do + if [[ -z ${path[i]} || ${path[i]} == . ]]; then + unset "path[i]" + elif [[ ${path[i]} != .. ]]; then + prev=${i} + elif [[ ${prev} || ${slash} ]]; then + # Found, remove path components and reiterate + [[ ${prev} ]] && unset "path[prev]" + unset "path[i]" + continue 2 + fi + done + # No (further) instance found, so we're done + break + done + + out="${slash}${path[*]}" + echo "${out:-.}" +} + +# @FUNCTION: dosym8 +# @USAGE: [-r] +# @DESCRIPTION: +# Create a symbolic link , pointing to . If the +# directory containing the new link does not exist, create it. +# +# If called with option -r, expand relative to the apparent +# path of the directory containing . For example, "dosym8 -r +# /bin/foo /usr/bin/foo" will create a link named "../../bin/foo". +dosym8() { + local option_r + + case $1 in + -r) option_r=t; shift ;; + esac + + [[ $# -eq 2 ]] || die "${FUNCNAME}: bad number of arguments" + + local target=$1 link=$2 + + if [[ ${option_r} ]]; then + local linkdir comp + + # Expansion makes sense only for an absolute target path + [[ ${target} == /* ]] \ + || die "${FUNCNAME}: -r specified but no absolute target path" + + target=$(_dosym8_canonicalize "${target}") + linkdir=$(_dosym8_canonicalize "/${link#/}") + linkdir=${linkdir%/*} # poor man's dirname(1) + linkdir=${linkdir:-/} # always keep the initial "/" + + local ifs_save=${IFS-$' \t\n'} IFS=/ + for comp in ${linkdir}; do + if [[ ${target%%/*} == "${comp}" ]]; then + target=${target#"${comp}"} + target=${target#/} + else + target=..${target:+/}${target} + fi + done + IFS=${ifs_save} + target=${target:-.} + fi + + dosym "${target}" "${link}" +} diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass new file mode 100644 index 0000000..32119cb --- /dev/null +++ b/eclass/flag-o-matic.eclass @@ -0,0 +1,851 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: flag-o-matic.eclass +# @MAINTAINER: +# toolchain@gentoo.org +# @SUPPORTED_EAPIS: 5 6 7 8 +# @BLURB: common functions to manipulate and query toolchain flags +# @DESCRIPTION: +# This eclass contains a suite of functions to help developers sanely +# and safely manage toolchain flags in their builds. + +case ${EAPI:-0} in + 0|1|2|3|4) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;; + 5|6|7|8) ;; + *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;; +esac + +if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then +_FLAG_O_MATIC_ECLASS=1 + +inherit toolchain-funcs + +[[ ${EAPI} == [567] ]] && inherit eutils + +# @FUNCTION: all-flag-vars +# @DESCRIPTION: +# Return all the flag variables that our high level funcs operate on. +all-flag-vars() { + echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS +} + +# @FUNCTION: setup-allowed-flags +# @INTERNAL +# @DESCRIPTION: +# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags +# Note: shell globs and character lists are allowed +setup-allowed-flags() { + [[ ${EAPI} == [567] ]] || + die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." + _setup-allowed-flags "$@" +} + +# @FUNCTION: _setup-allowed-flags +# @INTERNAL +# @DESCRIPTION: +# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags +# Note: shell globs and character lists are allowed +_setup-allowed-flags() { + ALLOWED_FLAGS=( + -pipe -O '-O[12sg]' -mcpu -march -mtune + '-fstack-protector*' + '-fsanitize*' '-fno-sanitize*' + '-fstack-check*' -fno-stack-check + -fbounds-check -fbounds-checking -fno-strict-overflow + -fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time + + # debugging symbols should generally be very safe to add + -g '-g[0-9]' + -ggdb '-ggdb[0-9]' + -gdwarf '-gdwarf-*' + -gstabs -gstabs+ + -gz + + -fno-ident -fpermissive -frecord-gcc-switches + '-fdiagnostics*' '-fplugin*' + '-W*' -w + + # CPPFLAGS and LDFLAGS + '-[DUILR]*' '-Wl,*' + + # Linker choice flag + '-fuse-ld' + ) + + # allow a bunch of flags that negate features / control ABI + ALLOWED_FLAGS+=( + '-fno-stack-protector*' '-fabi-version=*' + -fno-strict-aliasing -fno-bounds-check -fno-bounds-checking -fstrict-overflow + -fno-omit-frame-pointer '-fno-builtin*' + ) + ALLOWED_FLAGS+=( + -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse + -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 + -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt + -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt + -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu + -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe + -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat + -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi + -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel + -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi + -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 + -mfix-rm7000 -mno-fix-rm7000 -mfix-r10000 -mno-fix-r10000 + -mr10k-cache-barrier -mthumb -marm + + # gcc 4.5 + -mno-fma4 -mno-movbe -mno-xop -mno-lwp + # gcc 4.6 + -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm + # gcc 4.7 + -mno-avx2 -mno-bmi2 -mno-fma -mno-lzcnt + # gcc 4.8 + -mno-fxsr -mno-hle -mno-rtm -mno-xsave -mno-xsaveopt + # gcc 4.9 + -mno-avx512cd -mno-avx512er -mno-avx512f -mno-avx512pf -mno-sha + ) + + # Allow some safe individual flags. Should come along with the bug reference. + ALLOWED_FLAGS+=( + # Allow explicit stack realignment to run non-conformant + # binaries: bug #677852 + -mstackrealign + ) +} + +# @FUNCTION: _filter-hardened +# @INTERNAL +# @DESCRIPTION: +# Inverted filters for hardened compiler. This is trying to unpick +# the hardened compiler defaults. +_filter-hardened() { + local f + for f in "$@" ; do + case "${f}" in + # Ideally we should only concern ourselves with PIE flags, + # not -fPIC or -fpic, but too many places filter -fPIC without + # thinking about -fPIE. + -fPIC|-fpic|-fPIE|-fpie|-Wl,pie|-pie) + gcc-specs-pie || continue + if ! is-flagq -nopie && ! is-flagq -no-pie ; then + # Support older Gentoo form first (-nopie) before falling + # back to the official gcc-6+ form (-no-pie). + if test-flags -nopie >/dev/null ; then + append-flags -nopie + else + append-flags -no-pie + fi + fi + ;; + -fstack-protector) + gcc-specs-ssp || continue + is-flagq -fno-stack-protector || append-flags $(test-flags -fno-stack-protector);; + -fstack-protector-all) + gcc-specs-ssp-to-all || continue + is-flagq -fno-stack-protector-all || append-flags $(test-flags -fno-stack-protector-all);; + -fno-strict-overflow) + gcc-specs-nostrict || continue + is-flagq -fstrict-overflow || append-flags $(test-flags -fstrict-overflow);; + esac + done +} + +# @FUNCTION: _filter-var +# @INTERNAL +# @DESCRIPTION: +# Remove occurrences of strings from variable given in $1 +# Strings removed are matched as globs, so for example +# '-O*' would remove -O1, -O2 etc. +_filter-var() { + local f x var=$1 new=() + shift + + for f in ${!var} ; do + for x in "$@" ; do + # Note this should work with globs like -O* + [[ ${f} == ${x} ]] && continue 2 + done + new+=( "${f}" ) + done + export ${var}="${new[*]}" +} + +# @FUNCTION: filter-flags +# @USAGE: +# @DESCRIPTION: +# Remove particular from {C,CPP,CXX,CCAS,F,FC,LD}FLAGS. Accepts shell globs. +filter-flags() { + _filter-hardened "$@" + local v + for v in $(all-flag-vars) ; do + _filter-var ${v} "$@" + done + return 0 +} + +# @FUNCTION: filter-lfs-flags +# @DESCRIPTION: +# Remove flags that enable Large File Support. +filter-lfs-flags() { + [[ $# -ne 0 ]] && die "filter-lfs-flags takes no arguments" + # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html + # _LARGEFILE_SOURCE: enable support for new LFS funcs (ftello/etc...) + # _LARGEFILE64_SOURCE: enable support for 64bit variants (off64_t/fseeko64/etc...) + # _FILE_OFFSET_BITS: default to 64bit variants (off_t is defined as off64_t) + # _TIME_BITS: default to 64bit time_t (requires _FILE_OFFSET_BITS=64) + filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_TIME_BITS=64 +} + +# @FUNCTION: filter-ldflags +# @USAGE: +# @DESCRIPTION: +# Remove particular from LDFLAGS. Accepts shell globs. +filter-ldflags() { + _filter-var LDFLAGS "$@" + return 0 +} + +# @FUNCTION: append-cppflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current CPPFLAGS. +append-cppflags() { + [[ $# -eq 0 ]] && return 0 + export CPPFLAGS+=" $*" + return 0 +} + +# @FUNCTION: append-cflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current CFLAGS. If a flag might not be supported +# with different compilers (or versions), then use test-flags-CC like so: +# @CODE +# append-cflags $(test-flags-CC -funky-flag) +# @CODE +append-cflags() { + [[ $# -eq 0 ]] && return 0 + # Do not do automatic flag testing ourselves. #417047 + export CFLAGS+=" $*" + return 0 +} + +# @FUNCTION: append-cxxflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current CXXFLAGS. If a flag might not be supported +# with different compilers (or versions), then use test-flags-CXX like so: +# @CODE +# append-cxxflags $(test-flags-CXX -funky-flag) +# @CODE +append-cxxflags() { + [[ $# -eq 0 ]] && return 0 + # Do not do automatic flag testing ourselves. #417047 + export CXXFLAGS+=" $*" + return 0 +} + +# @FUNCTION: append-fflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current {F,FC}FLAGS. If a flag might not be supported +# with different compilers (or versions), then use test-flags-F77 like so: +# @CODE +# append-fflags $(test-flags-F77 -funky-flag) +# @CODE +append-fflags() { + [[ $# -eq 0 ]] && return 0 + # Do not do automatic flag testing ourselves. #417047 + export FFLAGS+=" $*" + export FCFLAGS+=" $*" + return 0 +} + +# @FUNCTION: append-lfs-flags +# @DESCRIPTION: +# Add flags that enable Large File Support. +append-lfs-flags() { + [[ $# -ne 0 ]] && die "append-lfs-flags takes no arguments" + # see comments in filter-lfs-flags func for meaning of these + append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE +} + +# @FUNCTION: append-ldflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current LDFLAGS. +append-ldflags() { + [[ $# -eq 0 ]] && return 0 + local flag + for flag in "$@"; do + [[ ${flag} == -l* ]] && \ + eqawarn "Appending a library link instruction (${flag}); libraries to link to should not be passed through LDFLAGS" + done + + export LDFLAGS="${LDFLAGS} $*" + return 0 +} + +# @FUNCTION: append-flags +# @USAGE: +# @DESCRIPTION: +# Add extra to your current {C,CXX,F,FC}FLAGS. +append-flags() { + [[ $# -eq 0 ]] && return 0 + case " $* " in + *' '-[DIU]*) eqawarn 'please use append-cppflags for preprocessor flags' ;; + *' '-L*|\ + *' '-Wl,*) eqawarn 'please use append-ldflags for linker flags' ;; + esac + append-cflags "$@" + append-cxxflags "$@" + append-fflags "$@" + return 0 +} + +# @FUNCTION: replace-flags +# @USAGE: +# @DESCRIPTION: +# Replace the flag with . Accepts shell globs for . +replace-flags() { + [[ $# != 2 ]] && die "Usage: replace-flags " + + local f var new + for var in $(all-flag-vars) ; do + # Looping over the flags instead of using a global + # substitution ensures that we're working with flag atoms. + # Otherwise globs like -O* have the potential to wipe out the + # list of flags. + new=() + for f in ${!var} ; do + # Note this should work with globs like -O* + [[ ${f} == ${1} ]] && f=${2} + new+=( "${f}" ) + done + export ${var}="${new[*]}" + done + + return 0 +} + +# @FUNCTION: replace-cpu-flags +# @USAGE: +# @DESCRIPTION: +# Replace cpu flags (like -march/-mcpu/-mtune) that select the cpu +# with flags that select the cpu. Accepts shell globs for . +replace-cpu-flags() { + local newcpu="$#" ; newcpu="${!newcpu}" + while [ $# -gt 1 ] ; do + # quote to make sure that no globbing is done (particularly on + # ${oldcpu}) prior to calling replace-flags + replace-flags "-march=${1}" "-march=${newcpu}" + replace-flags "-mcpu=${1}" "-mcpu=${newcpu}" + replace-flags "-mtune=${1}" "-mtune=${newcpu}" + shift + done + return 0 +} + +# @FUNCTION: _is_flagq +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if is in a given , else returns shell false. +_is_flagq() { + local x var="$1[*]" + for x in ${!var} ; do + [[ ${x} == $2 ]] && return 0 + done + return 1 +} + +# @FUNCTION: is-flagq +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is in {C,CXX,F,FC}FLAGS, else returns shell false. Accepts shell globs. +is-flagq() { + [[ -n $2 ]] && die "Usage: is-flag " + + local var + for var in $(all-flag-vars) ; do + _is_flagq ${var} "$1" && return 0 + done + return 1 +} + +# @FUNCTION: is-flag +# @USAGE: +# @DESCRIPTION: +# Echo's "true" if flag is set in {C,CXX,F,FC}FLAGS. Accepts shell globs. +is-flag() { + is-flagq "$@" && echo true +} + +# @FUNCTION: is-ldflagq +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is in LDFLAGS, else returns shell false. Accepts shell globs. +is-ldflagq() { + [[ -n $2 ]] && die "Usage: is-ldflag " + _is_flagq LDFLAGS $1 +} + +# @FUNCTION: is-ldflag +# @USAGE: +# @DESCRIPTION: +# Echo's "true" if flag is set in LDFLAGS. Accepts shell globs. +is-ldflag() { + is-ldflagq "$@" && echo true +} + +# @FUNCTION: filter-mfpmath +# @USAGE: +# @DESCRIPTION: +# Remove specified math types from the fpmath flag. For example, if the user +# has -mfpmath=sse,386, running `filter-mfpmath sse` will leave the user with +# -mfpmath=386. +filter-mfpmath() { + local orig_mfpmath new_math prune_math + + # save the original -mfpmath flag + orig_mfpmath=$(get-flag -mfpmath) + # get the value of the current -mfpmath flag + new_math=$(get-flag mfpmath) + # convert "both" to something we can filter + new_math=${new_math/both/387,sse} + new_math=" ${new_math//[,+]/ } " + # figure out which math values are to be removed + prune_math="" + for prune_math in "$@" ; do + new_math=${new_math/ ${prune_math} / } + done + new_math=$(echo ${new_math}) + new_math=${new_math// /,} + + if [[ -z ${new_math} ]] ; then + # if we're removing all user specified math values are + # slated for removal, then we just filter the flag + filter-flags ${orig_mfpmath} + else + # if we only want to filter some of the user specified + # math values, then we replace the current flag + replace-flags ${orig_mfpmath} -mfpmath=${new_math} + fi + return 0 +} + +# @FUNCTION: strip-flags +# @DESCRIPTION: +# Strip *FLAGS of everything except known good/safe flags. This runs over all +# flags returned by all_flag_vars(). +strip-flags() { + [[ $# -ne 0 ]] && die "strip-flags takes no arguments" + local x y var + + local ALLOWED_FLAGS + _setup-allowed-flags + + set -f # disable pathname expansion + + for var in $(all-flag-vars) ; do + local new=() + + for x in ${!var} ; do + local flag=${x%%=*} + for y in "${ALLOWED_FLAGS[@]}" ; do + if [[ -z ${flag%%${y}} ]] ; then + new+=( "${x}" ) + break + fi + done + done + + # In case we filtered out all optimization flags fallback to -O2 + if _is_flagq ${var} "-O*" && ! _is_flagq new "-O*" ; then + new+=( -O2 ) + fi + + if [[ ${!var} != "${new[*]}" ]] ; then + einfo "strip-flags: ${var}: changed '${!var}' to '${new[*]}'" + fi + export ${var}="${new[*]}" + done + + set +f # re-enable pathname expansion + + return 0 +} + +# @FUNCTION: test-flag-PROG +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if is supported by given , +# else returns shell false. +test-flag-PROG() { + [[ ${EAPI} == [567] ]] || + die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." + _test-flag-PROG "$@" +} + +# @FUNCTION: _test-flag-PROG +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if is supported by given , +# else returns shell false. +_test-flag-PROG() { + local comp=$1 + local lang=$2 + shift 2 + + if [[ -z ${comp} ]]; then + return 1 + fi + if [[ -z $1 ]]; then + return 1 + fi + + # verify selected compiler exists before using it + comp=($(tc-get${comp})) + # 'comp' can already contain compiler options. + # 'type' needs a binary name + if ! type -p ${comp[0]} >/dev/null; then + return 1 + fi + + # Set up test file. + local in_src in_ext cmdline_extra=() + case "${lang}" in + # compiler/assembler only + c) + in_ext='c' + in_src='int main(void) { return 0; }' + cmdline_extra+=(-xc -c) + ;; + c++) + in_ext='cc' + in_src='int main(void) { return 0; }' + cmdline_extra+=(-xc++ -c) + ;; + f77) + in_ext='f' + # fixed source form + in_src=' end' + cmdline_extra+=(-xf77 -c) + ;; + f95) + in_ext='f90' + in_src='end' + cmdline_extra+=(-xf95 -c) + ;; + + # C compiler/assembler/linker + c+ld) + in_ext='c' + in_src='int main(void) { return 0; }' + cmdline_extra+=(-xc) + ;; + esac + local test_in=${T}/test-flag.${in_ext} + local test_out=${T}/test-flag.exe + + printf "%s\n" "${in_src}" > "${test_in}" || die "Failed to create '${test_in}'" + + # Currently we rely on warning-free output of a compiler + # before the flag to see if a flag prduces any warnings. + # This has a few drawbacks: + # - if compiler already generates warnings we filter out + # every single flag: bug #712488 + # - if user actually wants to see warnings we just strip + # them regardless of warnings type. + # + # We can add more selective detection of no-op flags via + # '-Werror=ignored-optimization-argument' and similar error options + # similar to what we are doing with '-Qunused-arguments'. + local cmdline=( + "${comp[@]}" + # Clang will warn about unknown gcc flags but exit 0. + # Need -Werror to force it to exit non-zero. + -Werror + "$@" + # -x options need to go before first source file + "${cmdline_extra[@]}" + + "${test_in}" -o "${test_out}" + ) + + if ! "${cmdline[@]}" &>/dev/null; then + # -Werror makes clang bail out on unused arguments as well; + # try to add -Qunused-arguments to work-around that + # other compilers don't support it but then, it's failure like + # any other + cmdline+=( -Qunused-arguments ) + "${cmdline[@]}" &>/dev/null + fi +} + +# @FUNCTION: test-flag-CC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the C compiler, else returns shell false. +test-flag-CC() { _test-flag-PROG CC c "$@"; } + +# @FUNCTION: test-flag-CXX +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the C++ compiler, else returns shell false. +test-flag-CXX() { _test-flag-PROG CXX c++ "$@"; } + +# @FUNCTION: test-flag-F77 +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the Fortran 77 compiler, else returns shell false. +test-flag-F77() { _test-flag-PROG F77 f77 "$@"; } + +# @FUNCTION: test-flag-FC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the Fortran 90 compiler, else returns shell false. +test-flag-FC() { _test-flag-PROG FC f95 "$@"; } + +# @FUNCTION: test-flag-CCLD +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the C compiler and linker, else returns shell false. +test-flag-CCLD() { _test-flag-PROG CC c+ld "$@"; } + +# @FUNCTION: test-flags-PROG +# @USAGE: [more flags...] +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if are supported by given , +# else returns shell false. +test-flags-PROG() { + [[ ${EAPI} == [567] ]] || + die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." + _test-flags-PROG "$@" +} + +# @FUNCTION: _test-flags-PROG +# @USAGE: [more flags...] +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if are supported by given , +# else returns shell false. +_test-flags-PROG() { + local comp=$1 + local flags=() + local x + + shift + + [[ -z ${comp} ]] && return 1 + + while (( $# )); do + case "$1" in + # '-B /foo': bug # 687198 + --param|-B) + if test-flag-${comp} "$1" "$2"; then + flags+=( "$1" "$2" ) + fi + shift 2 + ;; + *) + if test-flag-${comp} "$1"; then + flags+=( "$1" ) + fi + shift 1 + ;; + esac + done + + echo "${flags[*]}" + + # Just bail if we dont have any flags + [[ ${#flags[@]} -gt 0 ]] +} + +# @FUNCTION: test-flags-CC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the C compiler, else returns shell false. +test-flags-CC() { _test-flags-PROG CC "$@"; } + +# @FUNCTION: test-flags-CXX +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the C++ compiler, else returns shell false. +test-flags-CXX() { _test-flags-PROG CXX "$@"; } + +# @FUNCTION: test-flags-F77 +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the Fortran 77 compiler, else returns shell false. +test-flags-F77() { _test-flags-PROG F77 "$@"; } + +# @FUNCTION: test-flags-FC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the Fortran 90 compiler, else returns shell false. +test-flags-FC() { _test-flags-PROG FC "$@"; } + +# @FUNCTION: test-flags-CCLD +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the C compiler and default linker, else returns shell false. +test-flags-CCLD() { _test-flags-PROG CCLD "$@"; } + +# @FUNCTION: test-flags +# @USAGE: +# @DESCRIPTION: +# Short-hand that should hopefully work for both C and C++ compiler, but +# its really only present due to the append-flags() abomination. +test-flags() { test-flags-CC "$@"; } + +# @FUNCTION: test_version_info +# @USAGE: +# @DESCRIPTION: +# Returns shell true if the current C compiler version matches , else returns shell false. +# Accepts shell globs. +test_version_info() { + if [[ $($(tc-getCC) --version 2>&1) == *$1* ]]; then + return 0 + else + return 1 + fi +} + +# @FUNCTION: strip-unsupported-flags +# @DESCRIPTION: +# Strip {C,CXX,F,FC}FLAGS of any flags not supported by the active toolchain. +strip-unsupported-flags() { + [[ $# -ne 0 ]] && die "strip-unsupported-flags takes no arguments" + export CFLAGS=$(test-flags-CC ${CFLAGS}) + export CXXFLAGS=$(test-flags-CXX ${CXXFLAGS}) + export FFLAGS=$(test-flags-F77 ${FFLAGS}) + export FCFLAGS=$(test-flags-FC ${FCFLAGS}) + export LDFLAGS=$(test-flags-CCLD ${LDFLAGS}) +} + +# @FUNCTION: get-flag +# @USAGE: +# @DESCRIPTION: +# Find and echo the value for a particular flag. Accepts shell globs. +get-flag() { + [[ $# -ne 1 ]] && die "usage: " + local f var findflag="$1" + + # this code looks a little flaky but seems to work for + # everything we want ... + # for example, if CFLAGS="-march=i686": + # `get-flag -march` == "-march=i686" + # `get-flag march` == "i686" + for var in $(all-flag-vars) ; do + for f in ${!var} ; do + if [ "${f/${findflag}}" != "${f}" ] ; then + printf "%s\n" "${f/-${findflag}=}" + return 0 + fi + done + done + return 1 +} + +# @FUNCTION: replace-sparc64-flags +# @DESCRIPTION: +# Sets mcpu to v8 and uses the original value as mtune if none specified. +replace-sparc64-flags() { + [[ $# -ne 0 ]] && die "replace-sparc64-flags takes no arguments" + local SPARC64_CPUS="ultrasparc3 ultrasparc v9" + + if [ "${CFLAGS/mtune}" != "${CFLAGS}" ]; then + for x in ${SPARC64_CPUS}; do + CFLAGS="${CFLAGS/-mcpu=${x}/-mcpu=v8}" + done + else + for x in ${SPARC64_CPUS}; do + CFLAGS="${CFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}" + done + fi + + if [ "${CXXFLAGS/mtune}" != "${CXXFLAGS}" ]; then + for x in ${SPARC64_CPUS}; do + CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8}" + done + else + for x in ${SPARC64_CPUS}; do + CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}" + done + fi + + export CFLAGS CXXFLAGS +} + +# @FUNCTION: append-libs +# @USAGE: +# @DESCRIPTION: +# Add extra to the current LIBS. All arguments should be prefixed with +# either -l or -L. For compatibility, if arguments are not prefixed as +# options, they are given a -l prefix automatically. +append-libs() { + [[ $# -eq 0 ]] && return 0 + local flag + for flag in "$@"; do + if [[ -z "${flag// }" ]]; then + eqawarn "Appending an empty argument to LIBS is invalid! Skipping." + continue + fi + case $flag in + -[lL]*) + export LIBS="${LIBS} ${flag}" + ;; + -*) + eqawarn "Appending non-library to LIBS (${flag}); Other linker flags should be passed via LDFLAGS" + export LIBS="${LIBS} ${flag}" + ;; + *) + export LIBS="${LIBS} -l${flag}" + esac + done + + return 0 +} + +# @FUNCTION: raw-ldflags +# @USAGE: [flags] +# @DESCRIPTION: +# Turn C style ldflags (-Wl,-foo) into straight ldflags - the results +# are suitable for passing directly to 'ld'; note LDFLAGS is usually passed +# to gcc where it needs the '-Wl,'. +# +# If no flags are specified, then default to ${LDFLAGS}. +raw-ldflags() { + local x input="$@" + [[ -z ${input} ]] && input=${LDFLAGS} + set -- + for x in ${input} ; do + case ${x} in + -Wl,*) + x=${x#-Wl,} + set -- "$@" ${x//,/ } + ;; + *) # Assume it's a compiler driver flag, so throw it away #441808 + ;; + esac + done + echo "$@" +} + +# @FUNCTION: no-as-needed +# @RETURN: Flag to disable asneeded behavior for use with append-ldflags. +no-as-needed() { + [[ $# -ne 0 ]] && die "no-as-needed takes no arguments" + case $($(tc-getLD) -v 2>&1 +# @AUTHOR: +# Michał Górny +# Matt Turner +# @SUPPORTED_EAPIS: 7 8 +# @PROVIDES: meson multilib-minimal +# @BLURB: meson wrapper for multilib builds +# @DESCRIPTION: +# The meson-multilib.eclass provides a glue between meson.eclass(5) +# and multilib-minimal.eclass(5), aiming to provide a convenient way +# to build packages using meson for multiple ABIs. +# +# Inheriting this eclass sets IUSE and exports default multilib_src_*() +# sub-phases that call meson phase functions for each ABI enabled. +# The multilib_src_*() functions can be defined in ebuild just like +# in multilib-minimal, yet they ought to call appropriate meson +# phase rather than 'default'. + +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +if [[ -z ${_MESON_MULTILIB_ECLASS} ]] ; then +_MESON_MULTILIB_ECLASS=1 + +inherit meson multilib-minimal + +EXPORT_FUNCTIONS src_configure src_compile src_test src_install + +# @FUNCTION: meson_native_use_bool +# @USAGE: [option name] +# @DESCRIPTION: +# Given a USE flag and a meson project option, output a string like: +# +# -Doption=true +# -Doption=false +# +# if building for the native ABI (multilib_is_native_abi is true). Otherwise, +# output -Doption=false. If the project option is unspecified, it defaults +# to the USE flag. +meson_native_use_bool() { + multilib_native_usex "${1}" "-D${2-${1}}=true" "-D${2-${1}}=false" +} + +# @FUNCTION: meson_native_use_feature +# @USAGE: [option name] +# @DESCRIPTION: +# Given a USE flag and a meson project option, output a string like: +# +# -Doption=enabled +# -Doption=disabled +# +# if building for the native ABI (multilib_is_native_abi is true). Otherwise, +# output -Doption=disabled. If the project option is unspecified, it defaults +# to the USE flag. +meson_native_use_feature() { + multilib_native_usex "${1}" "-D${2-${1}}=enabled" "-D${2-${1}}=disabled" +} + +# @FUNCTION: meson_native_enabled +# @USAGE: [tuple] +_tc-getPROG() { + local tuple=$1 + local v var vars=$2 + local prog=( $3 ) + + var=${vars%% *} + for v in ${vars} ; do + if [[ -n ${!v} ]] ; then + export ${var}="${!v}" + echo "${!v}" + return 0 + fi + done + + local search= + [[ -n $4 ]] && search=$(type -p $4-${prog[0]}) + [[ -z ${search} && -n ${!tuple} ]] && search=$(type -p ${!tuple}-${prog[0]}) + [[ -n ${search} ]] && prog[0]=${search##*/} + + export ${var}="${prog[*]}" + echo "${!var}" +} +tc-getBUILD_PROG() { + local vars="BUILD_$1 $1_FOR_BUILD HOST$1" + # respect host vars if not cross-compiling + # https://bugs.gentoo.org/630282 + tc-is-cross-compiler || vars+=" $1" + _tc-getPROG CBUILD "${vars}" "${@:2}" +} +tc-getPROG() { _tc-getPROG CHOST "$@"; } + +# @FUNCTION: tc-getAR +# @USAGE: [toolchain prefix] +# @RETURN: name of the archiver +tc-getAR() { tc-getPROG AR ar "$@"; } +# @FUNCTION: tc-getAS +# @USAGE: [toolchain prefix] +# @RETURN: name of the assembler +tc-getAS() { tc-getPROG AS as "$@"; } +# @FUNCTION: tc-getCC +# @USAGE: [toolchain prefix] +# @RETURN: name of the C compiler +tc-getCC() { tc-getPROG CC gcc "$@"; } +# @FUNCTION: tc-getCPP +# @USAGE: [toolchain prefix] +# @RETURN: name of the C preprocessor +tc-getCPP() { tc-getPROG CPP "${CC:-gcc} -E" "$@"; } +# @FUNCTION: tc-getCXX +# @USAGE: [toolchain prefix] +# @RETURN: name of the C++ compiler +tc-getCXX() { tc-getPROG CXX g++ "$@"; } +# @FUNCTION: tc-getLD +# @USAGE: [toolchain prefix] +# @RETURN: name of the linker +tc-getLD() { tc-getPROG LD ld "$@"; } +# @FUNCTION: tc-getSTRINGS +# @USAGE: [toolchain prefix] +# @RETURN: name of the strings program +tc-getSTRINGS() { tc-getPROG STRINGS strings "$@"; } +# @FUNCTION: tc-getSTRIP +# @USAGE: [toolchain prefix] +# @RETURN: name of the strip program +tc-getSTRIP() { tc-getPROG STRIP strip "$@"; } +# @FUNCTION: tc-getNM +# @USAGE: [toolchain prefix] +# @RETURN: name of the symbol/object thingy +tc-getNM() { tc-getPROG NM nm "$@"; } +# @FUNCTION: tc-getRANLIB +# @USAGE: [toolchain prefix] +# @RETURN: name of the archive indexer +tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; } +# @FUNCTION: tc-getREADELF +# @USAGE: [toolchain prefix] +# @RETURN: name of the ELF reader +tc-getREADELF() { tc-getPROG READELF readelf "$@"; } +# @FUNCTION: tc-getOBJCOPY +# @USAGE: [toolchain prefix] +# @RETURN: name of the object copier +tc-getOBJCOPY() { tc-getPROG OBJCOPY objcopy "$@"; } +# @FUNCTION: tc-getOBJDUMP +# @USAGE: [toolchain prefix] +# @RETURN: name of the object dumper +tc-getOBJDUMP() { tc-getPROG OBJDUMP objdump "$@"; } +# @FUNCTION: tc-getF77 +# @USAGE: [toolchain prefix] +# @RETURN: name of the Fortran 77 compiler +tc-getF77() { tc-getPROG F77 gfortran "$@"; } +# @FUNCTION: tc-getFC +# @USAGE: [toolchain prefix] +# @RETURN: name of the Fortran 90 compiler +tc-getFC() { tc-getPROG FC gfortran "$@"; } +# @FUNCTION: tc-getGCJ +# @USAGE: [toolchain prefix] +# @RETURN: name of the java compiler +tc-getGCJ() { tc-getPROG GCJ gcj "$@"; } +# @FUNCTION: tc-getGO +# @USAGE: [toolchain prefix] +# @RETURN: name of the Go compiler +tc-getGO() { tc-getPROG GO gccgo "$@"; } +# @FUNCTION: tc-getPKG_CONFIG +# @USAGE: [toolchain prefix] +# @RETURN: name of the pkg-config tool +tc-getPKG_CONFIG() { tc-getPROG PKG_CONFIG pkg-config "$@"; } +# @FUNCTION: tc-getRC +# @USAGE: [toolchain prefix] +# @RETURN: name of the Windows resource compiler +tc-getRC() { tc-getPROG RC windres "$@"; } +# @FUNCTION: tc-getDLLWRAP +# @USAGE: [toolchain prefix] +# @RETURN: name of the Windows dllwrap utility +tc-getDLLWRAP() { tc-getPROG DLLWRAP dllwrap "$@"; } + +# @FUNCTION: tc-getBUILD_AR +# @USAGE: [toolchain prefix] +# @RETURN: name of the archiver for building binaries to run on the build machine +tc-getBUILD_AR() { tc-getBUILD_PROG AR ar "$@"; } +# @FUNCTION: tc-getBUILD_AS +# @USAGE: [toolchain prefix] +# @RETURN: name of the assembler for building binaries to run on the build machine +tc-getBUILD_AS() { tc-getBUILD_PROG AS as "$@"; } +# @FUNCTION: tc-getBUILD_CC +# @USAGE: [toolchain prefix] +# @RETURN: name of the C compiler for building binaries to run on the build machine +tc-getBUILD_CC() { tc-getBUILD_PROG CC gcc "$@"; } +# @FUNCTION: tc-getBUILD_CPP +# @USAGE: [toolchain prefix] +# @RETURN: name of the C preprocessor for building binaries to run on the build machine +tc-getBUILD_CPP() { tc-getBUILD_PROG CPP "$(tc-getBUILD_CC) -E" "$@"; } +# @FUNCTION: tc-getBUILD_CXX +# @USAGE: [toolchain prefix] +# @RETURN: name of the C++ compiler for building binaries to run on the build machine +tc-getBUILD_CXX() { tc-getBUILD_PROG CXX g++ "$@"; } +# @FUNCTION: tc-getBUILD_LD +# @USAGE: [toolchain prefix] +# @RETURN: name of the linker for building binaries to run on the build machine +tc-getBUILD_LD() { tc-getBUILD_PROG LD ld "$@"; } +# @FUNCTION: tc-getBUILD_STRINGS +# @USAGE: [toolchain prefix] +# @RETURN: name of the strings program for building binaries to run on the build machine +tc-getBUILD_STRINGS() { tc-getBUILD_PROG STRINGS strings "$@"; } +# @FUNCTION: tc-getBUILD_STRIP +# @USAGE: [toolchain prefix] +# @RETURN: name of the strip program for building binaries to run on the build machine +tc-getBUILD_STRIP() { tc-getBUILD_PROG STRIP strip "$@"; } +# @FUNCTION: tc-getBUILD_NM +# @USAGE: [toolchain prefix] +# @RETURN: name of the symbol/object thingy for building binaries to run on the build machine +tc-getBUILD_NM() { tc-getBUILD_PROG NM nm "$@"; } +# @FUNCTION: tc-getBUILD_RANLIB +# @USAGE: [toolchain prefix] +# @RETURN: name of the archive indexer for building binaries to run on the build machine +tc-getBUILD_RANLIB() { tc-getBUILD_PROG RANLIB ranlib "$@"; } +# @FUNCTION: tc-getBUILD_READELF +# @USAGE: [toolchain prefix] +# @RETURN: name of the ELF reader for building binaries to run on the build machine +tc-getBUILD_READELF() { tc-getBUILD_PROG READELF readelf "$@"; } +# @FUNCTION: tc-getBUILD_OBJCOPY +# @USAGE: [toolchain prefix] +# @RETURN: name of the object copier for building binaries to run on the build machine +tc-getBUILD_OBJCOPY() { tc-getBUILD_PROG OBJCOPY objcopy "$@"; } +# @FUNCTION: tc-getBUILD_PKG_CONFIG +# @USAGE: [toolchain prefix] +# @RETURN: name of the pkg-config tool for building binaries to run on the build machine +tc-getBUILD_PKG_CONFIG() { tc-getBUILD_PROG PKG_CONFIG pkg-config "$@"; } + +# @FUNCTION: tc-getTARGET_CPP +# @USAGE: [toolchain prefix] +# @RETURN: name of the C preprocessor for the toolchain being built (or used) +tc-getTARGET_CPP() { + if [[ -n ${CTARGET} ]]; then + _tc-getPROG CTARGET TARGET_CPP "gcc -E" "$@" + else + tc-getCPP "$@" + fi +} + +# @FUNCTION: tc-export +# @USAGE: +# @DESCRIPTION: +# Quick way to export a bunch of compiler vars at once. +tc-export() { + local var + for var in "$@" ; do + [[ $(type -t "tc-get${var}") != "function" ]] && die "tc-export: invalid export variable '${var}'" + "tc-get${var}" > /dev/null + done +} + +# @FUNCTION: tc-is-cross-compiler +# @RETURN: Shell true if we are using a cross-compiler, shell false otherwise +tc-is-cross-compiler() { + [[ ${CBUILD:-${CHOST}} != ${CHOST} ]] +} + +# @FUNCTION: tc-cpp-is-true +# @USAGE: [cpp flags] +# @RETURN: Shell true if the condition is true, shell false otherwise. +# @DESCRIPTION: +# Evaluate the given condition using the C preprocessor for CTARGET, if +# defined, or CHOST. Additional arguments are passed through to the cpp +# command. A typical condition would be in the form defined(__FOO__). +tc-cpp-is-true() { + local CONDITION=${1} + shift + + $(tc-getTARGET_CPP) "${@}" -P - <<-EOF >/dev/null 2>&1 + #if ${CONDITION} + true + #else + #error false + #endif + EOF +} + +# @FUNCTION: tc-detect-is-softfloat +# @RETURN: Shell true if detection was possible, shell false otherwise +# @DESCRIPTION: +# Detect whether the CTARGET (or CHOST) toolchain is a softfloat based +# one by examining the toolchain's output, if possible. Outputs a value +# alike tc-is-softfloat if detection was possible. +tc-detect-is-softfloat() { + # If fetching CPP falls back to the default (gcc -E) then fail + # detection as this may not be the correct toolchain. + [[ $(tc-getTARGET_CPP) == "gcc -E" ]] && return 1 + + case ${CTARGET:-${CHOST}} in + # Avoid autodetection for bare-metal targets. bug #666896 + *-newlib|*-elf|*-eabi) + return 1 ;; + + # arm-unknown-linux-gnueabi is ambiguous. We used to treat it as + # hardfloat but we now treat it as softfloat like most everyone + # else. Check existing toolchains to respect existing systems. + arm*) + if tc-cpp-is-true "defined(__ARM_PCS_VFP)"; then + echo "no" + else + # Confusingly __SOFTFP__ is defined only when + # -mfloat-abi is soft, not softfp. + if tc-cpp-is-true "defined(__SOFTFP__)"; then + echo "yes" + else + echo "softfp" + fi + fi + + return 0 ;; + *) + return 1 ;; + esac +} + +# @FUNCTION: tc-tuple-is-softfloat +# @RETURN: See tc-is-softfloat for the possible values. +# @DESCRIPTION: +# Determine whether the CTARGET (or CHOST) toolchain is a softfloat +# based one solely from the tuple. +tc-tuple-is-softfloat() { + local CTARGET=${CTARGET:-${CHOST}} + case ${CTARGET//_/-} in + bfin*|h8300*) + echo "only" ;; + *-softfloat-*) + echo "yes" ;; + *-softfp-*) + echo "softfp" ;; + arm*-hardfloat-*|arm*eabihf) + echo "no" ;; + # bare-metal targets have their defaults. bug #666896 + *-newlib|*-elf|*-eabi) + echo "no" ;; + arm*) + echo "yes" ;; + *) + echo "no" ;; + esac +} + +# @FUNCTION: tc-is-softfloat +# @DESCRIPTION: +# See if this toolchain is a softfloat based one. +# @CODE +# The possible return values: +# - only: the target is always softfloat (never had fpu) +# - yes: the target should support softfloat +# - softfp: (arm specific) the target should use hardfloat insns, but softfloat calling convention +# - no: the target doesn't support softfloat +# @CODE +# This allows us to react differently where packages accept +# softfloat flags in the case where support is optional, but +# rejects softfloat flags where the target always lacks an fpu. +tc-is-softfloat() { + tc-detect-is-softfloat || tc-tuple-is-softfloat +} + +# @FUNCTION: tc-is-static-only +# @DESCRIPTION: +# Return shell true if the target does not support shared libs, shell false +# otherwise. +tc-is-static-only() { + local host=${CTARGET:-${CHOST}} + + # *MiNT doesn't have shared libraries, only platform so far + [[ ${host} == *-mint* ]] +} + +# @FUNCTION: tc-stack-grows-down +# @DESCRIPTION: +# Return shell true if the stack grows down. This is the default behavior +# for the vast majority of systems out there and usually projects shouldn't +# care about such internal details. +tc-stack-grows-down() { + # List the few that grow up. + case ${ARCH} in + hppa|metag) return 1 ;; + esac + + # Assume all others grow down. + return 0 +} + +# @FUNCTION: tc-export_build_env +# @USAGE: [compiler variables] +# @DESCRIPTION: +# Export common build related compiler settings. +tc-export_build_env() { + tc-export "$@" + if tc-is-cross-compiler; then + # Some build envs will initialize vars like: + # : ${BUILD_LDFLAGS:-${LDFLAGS}} + # So make sure all variables are non-empty. #526734 + : ${BUILD_CFLAGS:=-O1 -pipe} + : ${BUILD_CXXFLAGS:=-O1 -pipe} + : ${BUILD_CPPFLAGS:= } + : ${BUILD_LDFLAGS:= } + else + # https://bugs.gentoo.org/654424 + : ${BUILD_CFLAGS:=${CFLAGS}} + : ${BUILD_CXXFLAGS:=${CXXFLAGS}} + : ${BUILD_CPPFLAGS:=${CPPFLAGS}} + : ${BUILD_LDFLAGS:=${LDFLAGS}} + fi + export BUILD_{C,CXX,CPP,LD}FLAGS + + # Some packages use XXX_FOR_BUILD. + local v + for v in BUILD_{C,CXX,CPP,LD}FLAGS ; do + export ${v#BUILD_}_FOR_BUILD="${!v}" + done +} + +# @FUNCTION: tc-env_build +# @USAGE: [command args] +# @INTERNAL +# @DESCRIPTION: +# Setup the compile environment to the build tools and then execute the +# specified command. We use tc-getBUILD_XX here so that we work with +# all of the semi-[non-]standard env vars like $BUILD_CC which often +# the target build system does not check. +tc-env_build() { + tc-export_build_env + CFLAGS=${BUILD_CFLAGS} \ + CXXFLAGS=${BUILD_CXXFLAGS} \ + CPPFLAGS=${BUILD_CPPFLAGS} \ + LDFLAGS=${BUILD_LDFLAGS} \ + AR=$(tc-getBUILD_AR) \ + AS=$(tc-getBUILD_AS) \ + CC=$(tc-getBUILD_CC) \ + CPP=$(tc-getBUILD_CPP) \ + CXX=$(tc-getBUILD_CXX) \ + LD=$(tc-getBUILD_LD) \ + NM=$(tc-getBUILD_NM) \ + PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) \ + RANLIB=$(tc-getBUILD_RANLIB) \ + READELF=$(tc-getBUILD_READELF) \ + "$@" +} + +# @FUNCTION: econf_build +# @USAGE: [econf flags] +# @DESCRIPTION: +# Sometimes we need to locally build up some tools to run on CBUILD because +# the package has helper utils which are compiled+executed when compiling. +# This won't work when cross-compiling as the CHOST is set to a target which +# we cannot natively execute. +# +# For example, the python package will build up a local python binary using +# a portable build system (configure+make), but then use that binary to run +# local python scripts to build up other components of the overall python. +# We cannot rely on the python binary in $PATH as that often times will be +# a different version, or not even installed in the first place. Instead, +# we compile the code in a different directory to run on CBUILD, and then +# use that binary when compiling the main package to run on CHOST. +# +# For example, with newer EAPIs, you'd do something like: +# @CODE +# src_configure() { +# ECONF_SOURCE=${S} +# if tc-is-cross-compiler ; then +# mkdir "${WORKDIR}"/${CBUILD} +# pushd "${WORKDIR}"/${CBUILD} >/dev/null +# econf_build --disable-some-unused-stuff +# popd >/dev/null +# fi +# ... normal build paths ... +# } +# src_compile() { +# if tc-is-cross-compiler ; then +# pushd "${WORKDIR}"/${CBUILD} >/dev/null +# emake one-or-two-build-tools +# ln/mv build-tools to normal build paths in ${S}/ +# popd >/dev/null +# fi +# ... normal build paths ... +# } +# @CODE +econf_build() { + local CBUILD=${CBUILD:-${CHOST}} + tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@" +} + +# @FUNCTION: tc-ld-is-gold +# @USAGE: [toolchain prefix] +# @DESCRIPTION: +# Return true if the current linker is set to gold. +tc-ld-is-gold() { + local out + + # First check the linker directly. + out=$($(tc-getLD "$@") --version 2>&1) + if [[ ${out} == *"GNU gold"* ]] ; then + return 0 + fi + + # Then see if they're selecting gold via compiler flags. + # Note: We're assuming they're using LDFLAGS to hold the + # options and not CFLAGS/CXXFLAGS. + local base="${T}/test-tc-gold" + cat <<-EOF > "${base}.c" + int main() { return 0; } + EOF + out=$($(tc-getCC "$@") ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -Wl,--version "${base}.c" -o "${base}" 2>&1) + rm -f "${base}"* + if [[ ${out} == *"GNU gold"* ]] ; then + return 0 + fi + + # No gold here! + return 1 +} + +# @FUNCTION: tc-ld-is-lld +# @USAGE: [toolchain prefix] +# @DESCRIPTION: +# Return true if the current linker is set to lld. +tc-ld-is-lld() { + local out + + # First check the linker directly. + out=$($(tc-getLD "$@") --version 2>&1) + if [[ ${out} == *"LLD"* ]] ; then + return 0 + fi + + # Then see if they're selecting lld via compiler flags. + # Note: We're assuming they're using LDFLAGS to hold the + # options and not CFLAGS/CXXFLAGS. + local base="${T}/test-tc-lld" + cat <<-EOF > "${base}.c" + int main() { return 0; } + EOF + out=$($(tc-getCC "$@") ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -Wl,--version "${base}.c" -o "${base}" 2>&1) + rm -f "${base}"* + if [[ ${out} == *"LLD"* ]] ; then + return 0 + fi + + # No lld here! + return 1 +} + +# @FUNCTION: tc-ld-disable-gold +# @USAGE: [toolchain prefix] +# @DESCRIPTION: +# If the gold linker is currently selected, configure the compilation +# settings so that we use the older bfd linker instead. +tc-ld-disable-gold() { + tc-ld-is-gold "$@" && tc-ld-force-bfd "$@" +} + +# @FUNCTION: tc-ld-force-bfd +# @USAGE: [toolchain prefix] +# @DESCRIPTION: +# If the gold or lld linker is currently selected, configure the compilation +# settings so that we use the bfd linker instead. +tc-ld-force-bfd() { + if ! tc-ld-is-gold "$@" && ! tc-ld-is-lld "$@" ; then + # They aren't using gold or lld, so nothing to do! + return + fi + + ewarn "Forcing usage of the BFD linker" + + # Set up LD to point directly to bfd if it's available. + # We need to extract the first word in case there are flags appended + # to its value (like multilib). #545218 + local ld=$(tc-getLD "$@") + local bfd_ld="${ld%% *}.bfd" + local path_ld=$(which "${bfd_ld}" 2>/dev/null) + [[ -e ${path_ld} ]] && export LD=${bfd_ld} + + # Set up LDFLAGS to select bfd based on the gcc / clang version. + local fallback="true" + if tc-is-gcc; then + local major=$(gcc-major-version "$@") + local minor=$(gcc-minor-version "$@") + if [[ ${major} -gt 4 ]] || [[ ${major} -eq 4 && ${minor} -ge 8 ]]; then + # gcc-4.8+ supports -fuse-ld directly. + export LDFLAGS="${LDFLAGS} -fuse-ld=bfd" + fallback="false" + fi + elif tc-is-clang; then + local major=$(clang-major-version "$@") + local minor=$(clang-minor-version "$@") + if [[ ${major} -gt 3 ]] || [[ ${major} -eq 3 && ${minor} -ge 5 ]]; then + # clang-3.5+ supports -fuse-ld directly. + export LDFLAGS="${LDFLAGS} -fuse-ld=bfd" + fallback="false" + fi + fi + if [[ ${fallback} == "true" ]] ; then + # <=gcc-4.7 and <=clang-3.4 require some coercion. + # Only works if bfd exists. + if [[ -e ${path_ld} ]] ; then + local d="${T}/bfd-linker" + mkdir -p "${d}" + ln -sf "${path_ld}" "${d}"/ld + export LDFLAGS="${LDFLAGS} -B${d}" + else + die "unable to locate a BFD linker" + fi + fi +} + +# @FUNCTION: tc-has-openmp +# @USAGE: [toolchain prefix] +# @DESCRIPTION: +# See if the toolchain supports OpenMP. +tc-has-openmp() { + local base="${T}/test-tc-openmp" + cat <<-EOF > "${base}.c" + #include + int main() { + int nthreads, tid, ret = 0; + #pragma omp parallel private(nthreads, tid) + { + tid = omp_get_thread_num(); + nthreads = omp_get_num_threads(); ret += tid + nthreads; + } + return ret; + } + EOF + $(tc-getCC "$@") -fopenmp "${base}.c" -o "${base}" >&/dev/null + local ret=$? + rm -f "${base}"* + return ${ret} +} + +# @FUNCTION: tc-check-openmp +# @DESCRIPTION: +# Test for OpenMP support with the current compiler and error out with +# a clear error message, telling the user how to rectify the missing +# OpenMP support that has been requested by the ebuild. Using this function +# to test for OpenMP support should be preferred over tc-has-openmp and +# printing a custom message, as it presents a uniform interface to the user. +tc-check-openmp() { + if ! tc-has-openmp; then + eerror "Your current compiler does not support OpenMP!" + + if tc-is-gcc; then + eerror "Enable OpenMP support by building sys-devel/gcc with USE=\"openmp\"." + elif tc-is-clang; then + eerror "OpenMP support in sys-devel/clang is provided by sys-libs/libomp." + fi + + die "Active compiler does not have required support for OpenMP" + fi +} + +# @FUNCTION: tc-has-tls +# @USAGE: [-s|-c|-l] [toolchain prefix] +# @DESCRIPTION: +# See if the toolchain supports thread local storage (TLS). Use -s to test the +# compiler, -c to also test the assembler, and -l to also test the C library +# (the default). +tc-has-tls() { + local base="${T}/test-tc-tls" + cat <<-EOF > "${base}.c" + int foo(int *i) { + static __thread int j = 0; + return *i ? j : *i; + } + EOF + local flags + case $1 in + -s) flags="-S";; + -c) flags="-c";; + -l) ;; + -*) die "Usage: tc-has-tls [-c|-l] [toolchain prefix]";; + esac + : ${flags:=-fPIC -shared -Wl,-z,defs} + [[ $1 == -* ]] && shift + $(tc-getCC "$@") ${flags} "${base}.c" -o "${base}" >&/dev/null + local ret=$? + rm -f "${base}"* + return ${ret} +} + + +# Parse information from CBUILD/CHOST/CTARGET rather than +# use external variables from the profile. +tc-ninja_magic_to_arch() { +ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; } + + local type=$1 + local host=$2 + [[ -z ${host} ]] && host=${CTARGET:-${CHOST}} + + case ${host} in + aarch64*) echo arm64;; + alpha*) echo alpha;; + arm*) echo arm;; + avr*) ninj avr32 avr;; + bfin*) ninj blackfin bfin;; + c6x*) echo c6x;; + cris*) echo cris;; + frv*) echo frv;; + hexagon*) echo hexagon;; + hppa*) ninj parisc hppa;; + i?86*) + # Starting with linux-2.6.24, the 'x86_64' and 'i386' + # trees have been unified into 'x86'. + # FreeBSD still uses i386 + if [[ ${type} == "kern" && ${host} == *freebsd* ]] ; then + echo i386 + else + echo x86 + fi + ;; + ia64*) echo ia64;; + loongarch*) ninj loongarch loong;; + m68*) echo m68k;; + metag*) echo metag;; + microblaze*) echo microblaze;; + mips*) echo mips;; + nios2*) echo nios2;; + nios*) echo nios;; + or1k*|or32*) echo openrisc;; + powerpc*) + # Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees + # have been unified into simply 'powerpc', but until 2.6.16, + # ppc32 is still using ARCH="ppc" as default + if [[ ${type} == "kern" ]] ; then + echo powerpc + elif [[ ${host} == powerpc64* ]] ; then + echo ppc64 + else + echo ppc + fi + ;; + riscv*) echo riscv;; + s390*) echo s390;; + score*) echo score;; + sh64*) ninj sh64 sh;; + sh*) echo sh;; + sparc64*) ninj sparc64 sparc;; + sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \ + && ninj sparc64 sparc \ + || echo sparc + ;; + tile*) echo tile;; + vax*) echo vax;; + x86_64*freebsd*) echo amd64;; + x86_64*) + # Starting with linux-2.6.24, the 'x86_64' and 'i386' + # trees have been unified into 'x86'. + if [[ ${type} == "kern" ]] ; then + echo x86 + else + echo amd64 + fi + ;; + xtensa*) echo xtensa;; + + # since our usage of tc-arch is largely concerned with + # normalizing inputs for testing ${CTARGET}, let's filter + # other cross targets (mingw and such) into the unknown. + *) echo unknown;; + esac +} +# @FUNCTION: tc-arch-kernel +# @USAGE: [toolchain prefix] +# @RETURN: name of the kernel arch according to the compiler target +tc-arch-kernel() { + tc-ninja_magic_to_arch kern "$@" +} +# @FUNCTION: tc-arch +# @USAGE: [toolchain prefix] +# @RETURN: name of the portage arch according to the compiler target +tc-arch() { + tc-ninja_magic_to_arch portage "$@" +} + +tc-endian() { + local host=$1 + [[ -z ${host} ]] && host=${CTARGET:-${CHOST}} + host=${host%%-*} + + case ${host} in + aarch64*be) echo big;; + aarch64) echo little;; + alpha*) echo little;; + arm*b*) echo big;; + arm*) echo little;; + cris*) echo little;; + hppa*) echo big;; + i?86*) echo little;; + ia64*) echo little;; + loongarch*) echo little;; + m68*) echo big;; + mips*l*) echo little;; + mips*) echo big;; + powerpc*le) echo little;; + powerpc*) echo big;; + riscv*) echo little;; + s390*) echo big;; + sh*b*) echo big;; + sh*) echo little;; + sparc*) echo big;; + x86_64*) echo little;; + *) echo wtf;; + esac +} + +# @FUNCTION: tc-get-compiler-type +# @RETURN: keyword identifying the compiler: gcc, clang, pathcc, unknown +tc-get-compiler-type() { + local code=' +#if defined(__PATHSCALE__) + HAVE_PATHCC +#elif defined(__clang__) + HAVE_CLANG +#elif defined(__GNUC__) + HAVE_GCC +#endif +' + local res=$($(tc-getCPP "$@") -E -P - <<<"${code}") + + case ${res} in + *HAVE_PATHCC*) echo pathcc;; + *HAVE_CLANG*) echo clang;; + *HAVE_GCC*) echo gcc;; + *) echo unknown;; + esac +} + +# @FUNCTION: tc-is-gcc +# @RETURN: Shell true if the current compiler is GCC, false otherwise. +tc-is-gcc() { + [[ $(tc-get-compiler-type) == gcc ]] +} + +# @FUNCTION: tc-is-clang +# @RETURN: Shell true if the current compiler is clang, false otherwise. +tc-is-clang() { + [[ $(tc-get-compiler-type) == clang ]] +} + +# Internal func. The first argument is the version info to expand. +# Query the preprocessor to improve compatibility across different +# compilers rather than maintaining a --version flag matrix. #335943 +_gcc_fullversion() { + local ver="$1"; shift + set -- $($(tc-getCPP "$@") -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__") + eval echo "$ver" +} + +# @FUNCTION: gcc-fullversion +# @RETURN: compiler version (major.minor.micro: [3.4.6]) +gcc-fullversion() { + _gcc_fullversion '$1.$2.$3' "$@" +} +# @FUNCTION: gcc-version +# @RETURN: compiler version (major.minor: [3.4].6) +gcc-version() { + _gcc_fullversion '$1.$2' "$@" +} +# @FUNCTION: gcc-major-version +# @RETURN: major compiler version (major: [3].4.6) +gcc-major-version() { + _gcc_fullversion '$1' "$@" +} +# @FUNCTION: gcc-minor-version +# @RETURN: minor compiler version (minor: 3.[4].6) +gcc-minor-version() { + _gcc_fullversion '$2' "$@" +} +# @FUNCTION: gcc-micro-version +# @RETURN: micro compiler version (micro: 3.4.[6]) +gcc-micro-version() { + _gcc_fullversion '$3' "$@" +} + +# Internal func. Based on _gcc_fullversion() above. +_clang_fullversion() { + local ver="$1"; shift + set -- $($(tc-getCPP "$@") -E -P - <<<"__clang_major__ __clang_minor__ __clang_patchlevel__") + eval echo "$ver" +} + +# @FUNCTION: clang-fullversion +# @RETURN: compiler version (major.minor.micro: [3.4.6]) +clang-fullversion() { + _clang_fullversion '$1.$2.$3' "$@" +} +# @FUNCTION: clang-version +# @RETURN: compiler version (major.minor: [3.4].6) +clang-version() { + _clang_fullversion '$1.$2' "$@" +} +# @FUNCTION: clang-major-version +# @RETURN: major compiler version (major: [3].4.6) +clang-major-version() { + _clang_fullversion '$1' "$@" +} +# @FUNCTION: clang-minor-version +# @RETURN: minor compiler version (minor: 3.[4].6) +clang-minor-version() { + _clang_fullversion '$2' "$@" +} +# @FUNCTION: clang-micro-version +# @RETURN: micro compiler version (micro: 3.4.[6]) +clang-micro-version() { + _clang_fullversion '$3' "$@" +} + +# Returns the installation directory - internal toolchain +# function for use by _gcc-specs-exists (for flag-o-matic). +_gcc-install-dir() { + echo "$(LC_ALL=C $(tc-getCC) -print-search-dirs 2> /dev/null |\ + awk '$1=="install:" {print $2}')" +} +# Returns true if the indicated specs file exists - internal toolchain +# function for use by flag-o-matic. +_gcc-specs-exists() { + [[ -f $(_gcc-install-dir)/$1 ]] +} + +# Returns requested gcc specs directive unprocessed - for used by +# gcc-specs-directive() +# Note; later specs normally overwrite earlier ones; however if a later +# spec starts with '+' then it appends. +# gcc -dumpspecs is parsed first, followed by files listed by "gcc -v" +# as "Reading ", in order. Strictly speaking, if there's a +# $(gcc_install_dir)/specs, the built-in specs aren't read, however by +# the same token anything from 'gcc -dumpspecs' is overridden by +# the contents of $(gcc_install_dir)/specs so the result is the +# same either way. +_gcc-specs-directive_raw() { + local cc=$(tc-getCC) + local specfiles=$(LC_ALL=C ${cc} -v 2>&1 | awk '$1=="Reading" {print $NF}') + ${cc} -dumpspecs 2> /dev/null | cat - ${specfiles} | awk -v directive=$1 \ +'BEGIN { pspec=""; spec=""; outside=1 } +$1=="*"directive":" { pspec=spec; spec=""; outside=0; next } + outside || NF==0 || ( substr($1,1,1)=="*" && substr($1,length($1),1)==":" ) { outside=1; next } + spec=="" && substr($0,1,1)=="+" { spec=pspec " " substr($0,2); next } + { spec=spec $0 } +END { print spec }' + return 0 +} + +# Return the requested gcc specs directive, with all included +# specs expanded. +# Note, it does not check for inclusion loops, which cause it +# to never finish - but such loops are invalid for gcc and we're +# assuming gcc is operational. +gcc-specs-directive() { + local directive subdname subdirective + directive="$(_gcc-specs-directive_raw $1)" + while [[ ${directive} == *%\(*\)* ]]; do + subdname=${directive/*%\(} + subdname=${subdname/\)*} + subdirective="$(_gcc-specs-directive_raw ${subdname})" + directive="${directive//\%(${subdname})/${subdirective}}" + done + echo "${directive}" + return 0 +} + +# Returns true if gcc sets relro +gcc-specs-relro() { + local directive + directive=$(gcc-specs-directive link_command) + [[ "${directive/\{!norelro:}" != "${directive}" ]] +} +# Returns true if gcc sets now +gcc-specs-now() { + local directive + directive=$(gcc-specs-directive link_command) + [[ "${directive/\{!nonow:}" != "${directive}" ]] +} +# Returns true if gcc builds PIEs +gcc-specs-pie() { + local directive + directive=$(gcc-specs-directive cc1) + [[ "${directive/\{!nopie:}" != "${directive}" ]] +} +# Returns true if gcc builds with the stack protector +gcc-specs-ssp() { + local directive + directive=$(gcc-specs-directive cc1) + [[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]] +} +# Returns true if gcc upgrades fstack-protector to fstack-protector-all +gcc-specs-ssp-to-all() { + local directive + directive=$(gcc-specs-directive cc1) + [[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]] +} +# Returns true if gcc builds with fno-strict-overflow +gcc-specs-nostrict() { + local directive + directive=$(gcc-specs-directive cc1) + [[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]] +} +# Returns true if gcc builds with fstack-check +gcc-specs-stack-check() { + local directive + directive=$(gcc-specs-directive cc1) + [[ "${directive/\{!fno-stack-check:}" != "${directive}" ]] +} + + +# @FUNCTION: tc-enables-pie +# @RETURN: Truth if the current compiler generates position-independent code (PIC) which can be linked into executables +# @DESCRIPTION: +# Return truth if the current compiler generates position-independent code (PIC) +# which can be linked into executables. +tc-enables-pie() { + tc-cpp-is-true "defined(__PIE__)" ${CPPFLAGS} ${CFLAGS} +} + +# @FUNCTION: tc-enables-ssp +# @RETURN: Truth if the current compiler enables stack smashing protection (SSP) on at least minimal level +# @DESCRIPTION: +# Return truth if the current compiler enables stack smashing protection (SSP) +# on level corresponding to any of the following options: +# -fstack-protector +# -fstack-protector-strong +# -fstack-protector-all +tc-enables-ssp() { + tc-cpp-is-true "defined(__SSP__) || defined(__SSP_STRONG__) || defined(__SSP_ALL__)" ${CPPFLAGS} ${CFLAGS} +} + +# @FUNCTION: tc-enables-ssp-strong +# @RETURN: Truth if the current compiler enables stack smashing protection (SSP) on at least middle level +# @DESCRIPTION: +# Return truth if the current compiler enables stack smashing protection (SSP) +# on level corresponding to any of the following options: +# -fstack-protector-strong +# -fstack-protector-all +tc-enables-ssp-strong() { + tc-cpp-is-true "defined(__SSP_STRONG__) || defined(__SSP_ALL__)" ${CPPFLAGS} ${CFLAGS} +} + +# @FUNCTION: tc-enables-ssp-all +# @RETURN: Truth if the current compiler enables stack smashing protection (SSP) on maximal level +# @DESCRIPTION: +# Return truth if the current compiler enables stack smashing protection (SSP) +# on level corresponding to any of the following options: +# -fstack-protector-all +tc-enables-ssp-all() { + tc-cpp-is-true "defined(__SSP_ALL__)" ${CPPFLAGS} ${CFLAGS} +} + + +# @FUNCTION: gen_usr_ldscript +# @USAGE: [-a] +# @DESCRIPTION: +# This function is deprecated. Use the version from +# usr-ldscript.eclass instead. +gen_usr_ldscript() { + ewarn "${FUNCNAME}: Please migrate to usr-ldscript.eclass" + + local lib libdir=$(get_libdir) output_format="" auto=false suffix=$(get_libname) + [[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/ + + tc-is-static-only && return + + # We only care about stuffing / for the native ABI. #479448 + if [[ $(type -t multilib_is_native_abi) == "function" ]] ; then + multilib_is_native_abi || return 0 + fi + + # Eventually we'd like to get rid of this func completely #417451 + case ${CTARGET:-${CHOST}} in + *-darwin*) ;; + *-android*) return 0 ;; + *linux*|*-freebsd*|*-openbsd*|*-netbsd*) + use prefix && return 0 ;; + *) return 0 ;; + esac + + # Just make sure it exists + dodir /usr/${libdir} + + if [[ $1 == "-a" ]] ; then + auto=true + shift + dodir /${libdir} + fi + + # OUTPUT_FORMAT gives hints to the linker as to what binary format + # is referenced ... makes multilib saner + local flags=( ${CFLAGS} ${LDFLAGS} -Wl,--verbose ) + if $(tc-getLD) --version | grep -q 'GNU gold' ; then + # If they're using gold, manually invoke the old bfd. #487696 + local d="${T}/bfd-linker" + mkdir -p "${d}" + ln -sf $(which ${CHOST}-ld.bfd) "${d}"/ld + flags+=( -B"${d}" ) + fi + output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') + [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" + + for lib in "$@" ; do + local tlib + if ${auto} ; then + lib="lib${lib}${suffix}" + else + # Ensure /lib/${lib} exists to avoid dangling scripts/symlinks. + # This especially is for AIX where $(get_libname) can return ".a", + # so /lib/${lib} might be moved to /usr/lib/${lib} (by accident). + [[ -r ${ED}/${libdir}/${lib} ]] || continue + #TODO: better die here? + fi + + case ${CTARGET:-${CHOST}} in + *-darwin*) + if ${auto} ; then + tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) + else + tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib}) + fi + [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}" + tlib=${tlib##*/} + + if ${auto} ; then + mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die + # some install_names are funky: they encode a version + if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]] ; then + mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die + fi + rm -f "${ED}"/${libdir}/${lib} + fi + + # Mach-O files have an id, which is like a soname, it tells how + # another object linking against this lib should reference it. + # Since we moved the lib from usr/lib into lib this reference is + # wrong. Hence, we update it here. We don't configure with + # libdir=/lib because that messes up libtool files. + # Make sure we don't lose the specific version, so just modify the + # existing install_name + if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then + chmod u+w "${ED}${libdir}/${tlib}" # needed to write to it + local nowrite=yes + fi + install_name_tool \ + -id "${EPREFIX}"/${libdir}/${tlib} \ + "${ED}"/${libdir}/${tlib} || die "install_name_tool failed" + [[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}" + # Now as we don't use GNU binutils and our linker doesn't + # understand linker scripts, just create a symlink. + pushd "${ED}/usr/${libdir}" > /dev/null + ln -snf "../../${libdir}/${tlib}" "${lib}" + popd > /dev/null + ;; + *) + if ${auto} ; then + tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) + [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" + mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die + # some SONAMEs are funky: they encode a version before the .so + if [[ ${tlib} != ${lib}* ]] ; then + mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die + fi + rm -f "${ED}"/${libdir}/${lib} + else + tlib=${lib} + fi + cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT + /* GNU ld script + Since Gentoo has critical dynamic libraries in /lib, and the static versions + in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we + run into linking problems. This "fake" dynamic lib is a linker script that + redirects the linker to the real lib. And yes, this works in the cross- + compiling scenario as the sysroot-ed linker will prepend the real path. + + See bug https://bugs.gentoo.org/4411 for more info. + */ + ${output_format} + GROUP ( ${EPREFIX}/${libdir}/${tlib} ) + END_LDSCRIPT + ;; + esac + fperms a+x "/usr/${libdir}/${lib}" || die "could not change perms on ${lib}" + done +} + +fi diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass new file mode 100644 index 0000000..3693eb1 --- /dev/null +++ b/eclass/verify-sig.eclass @@ -0,0 +1,346 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: verify-sig.eclass +# @MAINTAINER: +# Michał Górny +# @SUPPORTED_EAPIS: 7 8 +# @BLURB: Eclass to verify upstream signatures on distfiles +# @DESCRIPTION: +# verify-sig eclass provides a streamlined approach to verifying +# upstream signatures on distfiles. Its primary purpose is to permit +# developers to easily verify signatures while bumping packages. +# The eclass removes the risk of developer forgetting to perform +# the verification, or performing it incorrectly, e.g. due to additional +# keys in the local keyring. It also permits users to verify +# the developer's work. +# +# To use the eclass, start by packaging the upstream's key +# as app-crypt/openpgp-keys-*. Then inherit the eclass, add detached +# signatures to SRC_URI and set VERIFY_SIG_OPENPGP_KEY_PATH. The eclass +# provides verify-sig USE flag to toggle the verification. +# +# If you need to use signify, you may want to copy distfiles into WORKDIR to +# work around "Too many levels of symbolic links" error. +# @EXAMPLE: +# Example use: +# +# @CODE +# inherit verify-sig +# +# SRC_URI="https://example.org/${P}.tar.gz +# verify-sig? ( https://example.org/${P}.tar.gz.sig )" +# BDEPEND=" +# verify-sig? ( app-crypt/openpgp-keys-example )" +# +# VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/example.asc +# @CODE + +case ${EAPI} in + 7|8) ;; + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; +esac + +EXPORT_FUNCTIONS src_unpack + +if [[ ! ${_VERIFY_SIG_ECLASS} ]]; then + +IUSE="verify-sig" + +# @ECLASS-VARIABLE: VERIFY_SIG_METHOD +# @PRE_INHERIT +# @DESCRIPTION: +# Signature verification method to use. The allowed value are: +# +# - openpgp -- verify PGP signatures using app-crypt/gnupg (the default) +# - signify -- verify signatures with Ed25519 public key using app-crypt/signify +: ${VERIFY_SIG_METHOD:=openpgp} + +case ${VERIFY_SIG_METHOD} in + openpgp) + BDEPEND=" + verify-sig? ( + app-crypt/gnupg + >=app-portage/gemato-16 + )" + ;; + signify) + BDEPEND="verify-sig? ( app-crypt/signify )" + ;; + *) + die "${ECLASS}: unknown method '${VERIFY_SIG_METHOD}'" + ;; +esac + +# @ECLASS-VARIABLE: VERIFY_SIG_OPENPGP_KEY_PATH +# @DEFAULT_UNSET +# @DESCRIPTION: +# Path to key bundle used to perform the verification. This is required +# when using default src_unpack. Alternatively, the key path can be +# passed directly to the verification functions. +# +# NB: this variable is also used for non-OpenPGP signatures. The name +# contains "OPENPGP" for historical reasons. + +# @ECLASS-VARIABLE: VERIFY_SIG_OPENPGP_KEYSERVER +# @DEFAULT_UNSET +# @DESCRIPTION: +# Keyserver used to refresh keys. If not specified, the keyserver +# preference from the key will be respected. If no preference +# is specified by the key, the GnuPG default will be used. +# +# Supported for OpenPGP only. + +# @ECLASS-VARIABLE: VERIFY_SIG_OPENPGP_KEY_REFRESH +# @USER_VARIABLE +# @DESCRIPTION: +# Attempt to refresh keys via WKD/keyserver. Set it to "yes" +# in make.conf to enable. Note that this requires working Internet +# connection. +# +# Supported for OpenPGP only. +: ${VERIFY_SIG_OPENPGP_KEY_REFRESH:=no} + +# @FUNCTION: verify-sig_verify_detached +# @USAGE: [] +# @DESCRIPTION: +# Read the detached signature from and verify against +# it. can either be passed directly, or it defaults +# to VERIFY_SIG_OPENPGP_KEY_PATH. The function dies if verification +# fails. +verify-sig_verify_detached() { + local file=${1} + local sig=${2} + local key=${3:-${VERIFY_SIG_OPENPGP_KEY_PATH}} + + [[ -n ${key} ]] || + die "${FUNCNAME}: no key passed and VERIFY_SIG_OPENPGP_KEY_PATH unset" + + local extra_args=() + [[ ${VERIFY_SIG_OPENPGP_KEY_REFRESH} == yes ]] || extra_args+=( -R ) + if [[ -n ${VERIFY_SIG_OPENPGP_KEYSERVER+1} ]]; then + [[ ${VERIFY_SIG_METHOD} == openpgp ]] || + die "${FUNCNAME}: VERIFY_SIG_OPENPGP_KEYSERVER is not supported" + + extra_args+=( + --keyserver "${VERIFY_SIG_OPENPGP_KEYSERVER}" + ) + fi + + # GPG upstream knows better than to follow the spec, so we can't + # override this directory. However, there is a clean fallback + # to GNUPGHOME. + addpredict /run/user + + local filename=${file##*/} + [[ ${file} == - ]] && filename='(stdin)' + einfo "Verifying ${filename} ..." + case ${VERIFY_SIG_METHOD} in + openpgp) + gemato gpg-wrap -K "${key}" "${extra_args[@]}" -- \ + gpg --verify "${sig}" "${file}" || + die "PGP signature verification failed" + ;; + signify) + signify -V -p "${key}" -m "${file}" -x "${sig}" || + die "Signify signature verification failed" + ;; + esac +} + +# @FUNCTION: verify-sig_verify_message +# @USAGE: [] +# @DESCRIPTION: +# Verify that the file ('-' for stdin) contains a valid, signed PGP +# message and write the message into ('-' for stdout). +# can either be passed directly, or it defaults +# to VERIFY_SIG_OPENPGP_KEY_PATH. The function dies if verification +# fails. Note that using output from is important as it +# prevents the injection of unsigned data. +verify-sig_verify_message() { + local file=${1} + local output_file=${2} + local key=${3:-${VERIFY_SIG_OPENPGP_KEY_PATH}} + + [[ -n ${key} ]] || + die "${FUNCNAME}: no key passed and VERIFY_SIG_OPENPGP_KEY_PATH unset" + + local extra_args=() + [[ ${VERIFY_SIG_OPENPGP_KEY_REFRESH} == yes ]] || extra_args+=( -R ) + if [[ -n ${VERIFY_SIG_OPENPGP_KEYSERVER+1} ]]; then + [[ ${VERIFY_SIG_METHOD} == openpgp ]] || + die "${FUNCNAME}: VERIFY_SIG_OPENPGP_KEYSERVER is not supported" + + extra_args+=( + --keyserver "${VERIFY_SIG_OPENPGP_KEYSERVER}" + ) + fi + + # GPG upstream knows better than to follow the spec, so we can't + # override this directory. However, there is a clean fallback + # to GNUPGHOME. + addpredict /run/user + + local filename=${file##*/} + [[ ${file} == - ]] && filename='(stdin)' + einfo "Verifying ${filename} ..." + case ${VERIFY_SIG_METHOD} in + openpgp) + gemato gpg-wrap -K "${key}" "${extra_args[@]}" -- \ + gpg --verify --output="${output_file}" "${file}" || + die "PGP signature verification failed" + ;; + signify) + signify -V -e -p "${key}" -m "${output_file}" -x "${file}" || + die "Signify signature verification failed" + ;; + esac +} + +# @FUNCTION: _gpg_verify_signed_checksums +# @INTERNAL +# @USAGE: [] +# @DESCRIPTION: +# GnuPG-specific function to verify a signed checksums list. +_gpg_verify_signed_checksums() { + local checksum_file=${1} + local algo=${2} + local files=() + read -r -d '' -a files <<<"${3}" + local key=${4:-${VERIFY_SIG_OPENPGP_KEY_PATH}} + local chksum_prog chksum_len + + case ${algo} in + sha256) + chksum_prog=sha256sum + chksum_len=64 + ;; + *) + die "${FUNCNAME}: unknown checksum algo ${algo}" + ;; + esac + + local checksum filename junk ret=0 count=0 + while read -r checksum filename junk; do + [[ ${#checksum} -eq ${chksum_len} ]] || continue + [[ -z ${checksum//[0-9a-f]} ]] || continue + has "${filename}" "${files[@]}" || continue + [[ -z ${junk} ]] || continue + + "${chksum_prog}" -c --strict - <<<"${checksum} ${filename}" + if [[ ${?} -eq 0 ]]; then + (( count++ )) + else + ret=1 + fi + done < <(verify-sig_verify_message "${checksum_file}" - "${key}") + + [[ ${ret} -eq 0 ]] || + die "${FUNCNAME}: at least one file did not verify successfully" + [[ ${count} -eq ${#files[@]} ]] || + die "${FUNCNAME}: checksums for some of the specified files were missing" +} + +# @FUNCTION: verify-sig_verify_signed_checksums +# @USAGE: [] +# @DESCRIPTION: +# Verify the checksums for all files listed in the space-separated list +# (akin to ${A}) using a signed . specifies +# the checksum algorithm (e.g. sha256). can either be passed +# directly, or it defaults to VERIFY_SIG_OPENPGP_KEY_PATH. +# +# The function dies if signature verification fails, the checksum file +# contains unsigned data, one of the files do not match checksums or +# are missing from the checksum file. +verify-sig_verify_signed_checksums() { + local checksum_file=${1} + local algo=${2} + local files=() + read -r -d '' -a files <<<"${3}" + local key=${4:-${VERIFY_SIG_OPENPGP_KEY_PATH}} + + [[ -n ${key} ]] || + die "${FUNCNAME}: no key passed and VERIFY_SIG_OPENPGP_KEY_PATH unset" + + case ${VERIFY_SIG_METHOD} in + openpgp) + _gpg_verify_signed_checksums \ + "${checksum_file}" "${algo}" "${files[@]}" "${key}" + ;; + signify) + signify -C -p "${key}" \ + -x "${checksum_file}" "${files[@]}" || + die "Signify signature verification failed" + ;; + esac +} + +# @FUNCTION: verify-sig_src_unpack +# @DESCRIPTION: +# Default src_unpack override that verifies signatures for all +# distfiles if 'verify-sig' flag is enabled. The function dies if any +# of the signatures fails to verify or if any distfiles are not signed. +# Please write src_unpack() yourself if you need to perform partial +# verification. +verify-sig_src_unpack() { + if use verify-sig; then + local f suffix found + local distfiles=() signatures=() nosigfound=() straysigs=() + + # find all distfiles and signatures, and combine them + for f in ${A}; do + found= + for suffix in .asc .sig; do + if [[ ${f} == *${suffix} ]]; then + signatures+=( "${f}" ) + found=sig + break + else + if has "${f}${suffix}" ${A}; then + distfiles+=( "${f}" ) + found=dist+sig + break + fi + fi + done + if [[ ! ${found} ]]; then + nosigfound+=( "${f}" ) + fi + done + + # check if all distfiles are signed + if [[ ${#nosigfound[@]} -gt 0 ]]; then + eerror "The following distfiles lack detached signatures:" + for f in "${nosigfound[@]}"; do + eerror " ${f}" + done + die "Unsigned distfiles found" + fi + + # check if there are no stray signatures + for f in "${signatures[@]}"; do + if ! has "${f%.*}" "${distfiles[@]}"; then + straysigs+=( "${f}" ) + fi + done + if [[ ${#straysigs[@]} -gt 0 ]]; then + eerror "The following signatures do not match any distfiles:" + for f in "${straysigs[@]}"; do + eerror " ${f}" + done + die "Unused signatures found" + fi + + # now perform the verification + for f in "${signatures[@]}"; do + verify-sig_verify_detached \ + "${DISTDIR}/${f%.*}" "${DISTDIR}/${f}" + done + fi + + # finally, unpack the distfiles + default_src_unpack +} + +_VERIFY_SIG_ECLASS=1 +fi diff --git a/media-libs/libplacebo/Manifest b/media-libs/libplacebo/Manifest new file mode 100644 index 0000000..bb1a83e --- /dev/null +++ b/media-libs/libplacebo/Manifest @@ -0,0 +1,3 @@ +DIST libplacebo-v3.120.3.tar.gz 523749 BLAKE2B 6192570dba8de6e0bb98ccf3f0e4f13c01a27c5f97873ff0e5e3212d9b7cdebd98cce3d5ee5364ca8a585ec2a16d0bafc5a863ed35f6f225d86a4410b92edfd3 SHA512 6a2d3c6c053edc3a912a46f9c16d226d83c6f8880714f0b20a8b9417889616e4c1d4d41b8935b898cc580dc3b480ce974bb3921162165f0774ea91be1dfff520 +EBUILD libplacebo-3.120.3.ebuild 2031 BLAKE2B e3baa1ed9a8ab3baa5e1577687030c289b9afe4c7cc244be59ca6e9c13848ae341838a1687fe5f357c668be5325ef4e48c6a801a58036183ef8c44619e510570 SHA512 9196702b9c256a7a1530d0e7a9bf9b64837fe7a37cc43efcd2625f06ae126549eecebfeba843174feea463fc8e1fb5f06855bffd1519cb74c63e621d3288e333 +MISC metadata.xml 600 BLAKE2B 64be4c9fc7d6f967c7439d374ab5a8cb499066d9a6216ee14161db98359e69d6cfe4a57eafc18ac3f7e414234d4987ef0cb812e01552810ea4c6f29e06e42498 SHA512 2b62cdec3e8ca9ddc669cd0dad10888ec394dba889f4547b81e8a48603ae3657828f4d62a6aa45d3f8bf53c360b0870c76b259e93f0242c0d332e978091bd5b4 diff --git a/media-libs/libplacebo/libplacebo-3.120.3.ebuild b/media-libs/libplacebo/libplacebo-3.120.3.ebuild new file mode 100644 index 0000000..61eab11 --- /dev/null +++ b/media-libs/libplacebo/libplacebo-3.120.3.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_REQ_USE="xml" +PYTHON_COMPAT=( python3_{7,8,9} ) + +if [[ "${PV}" == "9999" ]]; then + EGIT_REPO_URI="https://code.videolan.org/videolan/libplacebo.git" + inherit git-r3 +else + KEYWORDS="~amd64 ~ppc64 ~x86" + SRC_URI="https://code.videolan.org/videolan/libplacebo/-/archive/v${PV}/libplacebo-v${PV}.tar.gz" + S="${WORKDIR}/${PN}-v${PV}" +fi + +inherit meson-multilib python-any-r1 + +DESCRIPTION="Reusable library for GPU-accelerated image processing primitives" +HOMEPAGE="https://code.videolan.org/videolan/libplacebo" + +LICENSE="LGPL-2.1+" +SLOT="0/$(ver_cut 2)" # libplacebo.so version +IUSE="glslang lcms +opengl +shaderc test +vulkan" +REQUIRED_USE="vulkan? ( || ( glslang shaderc ) )" +RESTRICT="!test? ( test )" + +RDEPEND="glslang? ( dev-util/glslang[${MULTILIB_USEDEP}] ) + lcms? ( media-libs/lcms:2[${MULTILIB_USEDEP}] ) + opengl? ( media-libs/libepoxy[${MULTILIB_USEDEP}] ) + shaderc? ( >=media-libs/shaderc-2017.2[${MULTILIB_USEDEP}] ) + vulkan? ( + dev-util/vulkan-headers + media-libs/vulkan-loader[${MULTILIB_USEDEP}] + )" +DEPEND="${RDEPEND}" + +BDEPEND="virtual/pkgconfig + vulkan? ( + ${PYTHON_DEPS} + $(python_gen_any_dep 'dev-python/mako[${PYTHON_USEDEP}]') + )" + +python_check_deps() { + has_version -b "dev-python/mako[${PYTHON_USEDEP}]" +} + +pkg_setup() { + use vulkan && python-any-r1_pkg_setup +} + +multilib_src_configure() { + local emesonargs=( + $(meson_feature glslang) + $(meson_feature lcms) + $(meson_feature opengl) + $(meson_feature shaderc) + $(meson_feature vulkan) + $(meson_use test tests) + # hard-code path from dev-util/vulkan-headers + -Dvulkan-registry=/usr/share/vulkan/registry/vk.xml + -Ddemos=false + # ^ useless, and also semi-broken + # (well, actually, looks like it requires some new just-for-demos deps and even with versions restrictions (say, >=glfw-3.3)) + # feel free to patch if you need demos for some strange reason. + ) + meson_src_configure +} + +multilib_src_test() { + meson_src_test -t 10 +} diff --git a/media-libs/libplacebo/metadata.xml b/media-libs/libplacebo/metadata.xml new file mode 100644 index 0000000..9c79fff --- /dev/null +++ b/media-libs/libplacebo/metadata.xml @@ -0,0 +1,14 @@ + + + + + + Use dev-util/glslang to compile GLSL + Add support for color management via media-libs/lcms + Use media-libs/shaderc to compile GLSL + Add support for the vulkan graphics API + + + https://code.videolan.org/videolan/libplacebo/issues + + diff --git a/metadata/layout.conf b/metadata/layout.conf new file mode 100644 index 0000000..029406e --- /dev/null +++ b/metadata/layout.conf @@ -0,0 +1 @@ +masters = core-kit diff --git a/sys-devel/automake/Manifest b/sys-devel/automake/Manifest new file mode 100644 index 0000000..41a4f54 --- /dev/null +++ b/sys-devel/automake/Manifest @@ -0,0 +1,25 @@ +AUX automake-1.10-perl-5.16.patch 3555 BLAKE2B 8128b27ade89b12445b02532d9837ff469e6d0e1be3ebab6969d8d68c3a57a27e25ff89db82ed8abf3eff6d392bbd3b91a0b5b6b0827e7eec1279bc5345dc024 SHA512 050d66f3f1b4aed6482a234b32bbdbe231ddea0c9f4fb2ff97e963095ad69a487fd65986189fd659fbe8d8d011f3f866e92e506e653fd832d2adaf3263ed33fc +AUX automake-1.11-install-sh-avoid-low-risk-race-in-tmp.patch 3016 BLAKE2B 8dbc2ae72f8d687e785be6dde22429305cdbbb2b441a05ad268d5a7f019b087e090d7b93cb5ff033d004a8344fc9056172f1a16bd0bfa98501e1c55cf6933c54 SHA512 0f6c6ee15c895b64742113156f9864396daa6d7680897e4795909c78cb300df0d96c63091a39e901c2d62e76852fcbb49a5be747cb4b381c4346b81c0c570149 +AUX automake-1.13-dyn-ithreads.patch 2126 BLAKE2B 13fa89641077b7e9e7052441b84b756d7ddbd1ac3b87857028ccb34feb4528d774400fc411bf4fa54bbed697d8be6bf948d774d474f0638611c52f8d98696951 SHA512 7a3795cb8b14b347a296abd410f3a740401e796a06317e52fa1ef8b0866099f71965f7fb12fd85db2ccc7445f310a4dbff6870d8a63e72c49ed6f8ca9da97277 +AUX automake-1.13-hash-order-workaround.patch 529 BLAKE2B 92706c8c87aa1722de4ee4bbffd815720dfbc3d124776f7118ca57d682bbb9475174357412bb7e9f79c98adeb03651087cb095b52e682aa14447ab012945ca6a SHA512 2899c650664ead4c5fb4fdae79605b665cad52c3ecda0f8192e2ca37dbfdb42eb5937f9a24622e6463d4c003d70186b8a4c1404a47bd387de36d9f0db03e5593 +AUX automake-1.13-perl-escape-curly-bracket-r1.patch 1127 BLAKE2B 18664d2af473845f6ae91ab566651a53cbcf16df598adc3812f6d40f774c2c571c20dada4f23193b2b39ddc36c5fe9fea0449f32231540477fbf2260a7052c51 SHA512 25d94503572f70a5f9ab808057ca1ad7080cba89cf98c2b1664da2dc347f8ada1db6a97138a9b3ee12ffa54a37a34307a9fded4c069e1eb20e490556ad4f46d3 +AUX automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch 3015 BLAKE2B a0a7afb76c8cd8a5dce60bcb0a7a59a7957bcfe2b70f541889d5677005f4c9a295cf0459eaf4626314ce75031716028fe0a91db00f416e2aef8d17d8e31009d0 SHA512 34a061b72993290ac9fbf7957da89d0ed0ded70f304db0983ffff557887434dba01f5ca40cfd13dccfc648af7ade9b94d45895bac33dd560d550e3f1b24b6a55 +AUX automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch 3672 BLAKE2B e967579e81e3da85c9a5026a829be9dae93fd7d452c67bf94383787a7e7b46b62ba605112f3aaa5b4ee38d06727320ab8df017fc0b3a957e8fe0ba8e91883d52 SHA512 cfb9a11d82641b4f5b8e43d6a97fc20d012ce9ba6c4ab5fa3bae8c33da980867e3bad35229fbd5f2d811cfd849b275e83ecd0b80d25cff78695f700ebfc92cdc +AUX automake-1.16.2-fix-instmany-python.sh-test.patch 676 BLAKE2B b4368612ef22de981e56c633b6993db5bc7fc1c84f9be002018d4dd25c13bbc36ef7378940680b3c73a559100134e2356e7d626cdc24d91497e644e8e27268a1 SHA512 41d0d797cf25f2e080a57f57bee041cc02ea9e0a7f1ee8aa55af112f43e02c58b867d778b79d82b909d13c55ac0326718f1716947c9022e035e4631d7dbe85a0 +AUX automake-1.16.2-fix-py-compile-basedir.sh-test.patch 985 BLAKE2B 9a07629d107316ed765990ef2e1356a16dfb6231829315bab704dc7fdb4716dce9320eef4baaef3ab76db2908b9071c4cb35c6607be8b984896b2cfbcdb8b474 SHA512 22c1db04dcb71a6d1519c0d54e18c40f0ad5d4ada82edf606c8c0da6a3fb6dadcd7ec5289da2373b17c063211cb1ef6c85b5a6a7e355f906ca660bc402ce184b +AUX automake-1.16.2-py3-compile.patch 2412 BLAKE2B 20a3ce66047ad5106f0cafccce19fc8acd47ee0ba01882d1ff18c1a15592ef68b9c3debb61df78a31f238938a93ca4dc281b358b588727864673b09b11167131 SHA512 3bb9769d37b02e89373612752f127c582f948347a6f54e8b24dba262e14ca860e8fa507d96c0d51f0d64587371b9da17eb270dd5b7695091181731e35e5b9c2d +DIST automake-1.11.6.tar.xz 1092908 BLAKE2B 17254d81d6920c32aa877b6c892025de8e4060b8bcbe50fff841ada513dd462ddde8fc6838b4976098a812f8fda047e7186cb62cea8175df615dde75a9959144 SHA512 6e4cdf69f07734954f770fd4a7211a8c9dc69fe25a7746bd3c1e01d3139c94cab2900399e87371548833e99687e0d2b59c5e746ab2fdfbc7d47f2c1d439137ba +DIST automake-1.13.4.tar.xz 1449608 BLAKE2B 03dee42d65362a6f36e81c83d516c85faba1aac59bdc0d941077fde9be7742da0f57b48d678169e7a0e8b652c3ef46c314cdd3efb0fc489c389852fed1c39a02 SHA512 c9b145c1b822a4d83f2899f4280a76ccae932301b273f4c9718dc7f53161aa03dc1be2c1fb1a61083c54186e1908ae2c8284250aa1d8f6dea484767aca1344d3 +DIST automake-1.15.1.tar.xz 1509496 BLAKE2B e6ade31089f969140472004cd9854318470228c64e4f8e829d48c5379f62d2c5f8ef9509131c577653e81868d94544ecf6520f86b5d582ebb6ed65c832039f30 SHA512 02f661b2676f1d44334ce1c7188f9913a6874bf46ba487708ad8090ad57905f14aead80fefed815e21effacfbb925e23b944ea7dd32563dca39c1a4174eda688 +DIST automake-1.16.3.tar.xz 1590708 BLAKE2B ab6001a1b09e171ec83bac07155a77ab0fc29f5185116616aa3080b27e8bbf759472cd0dfb75630b26f7ad8d0741e668662d00b370ef79cf5ef6c62e945c94da SHA512 7265aeb7f82a8a205761d76e6ade7b7e97831c283349fd80f86e511f4b0b3e17f429d1506fca84c76079f63781e5dbf5ca81455d6bf6cda27d2e5c3d23b0d1aa +DIST automake-1.16.4.tar.xz 1599336 BLAKE2B a74bb444e7074e7dd7cf920a94a86756a5e6dec24a9eeb669ee629a1d3ab667efef0005d488fe6d9d8b33a680ada54f098ca334b63da4a739b0fec7c630a65aa SHA512 5a8883657e73b75bfa1ee59ab04af6bf4d43f390ab62fb7a9e8e2ac66159dfe4947b2ac7bc1028afffe6a09d88f388339500e03f6cdfa1226985be45ec033246 +DIST automake-1.16.5.tar.xz 1601740 BLAKE2B 87408abc57e1d4317a2b518fb3606d0f6d156522e7333016dd84747cd8922f27ef7fcc93220b11f794ce52bf8fd9a788d0166a4d1964d7c283905f269977ac7c SHA512 3084ae543aa3fb5a05104ffb2e66cfa9a53080f2343c44809707fd648516869511500dba50dae67ff10f92a1bf3b5a92b2a0fa01cda30adb69b9da03994d9d88 +EBUILD automake-1.11.6-r3.ebuild 2566 BLAKE2B c1e28e5349f89560b320f0fb61d63a18e13c3aac2a1962e6e8d31f2adf5f22136b9e949ff397c05c0781724aa40580f3217e7991fdbe8ac3c3d533f8e1262e7e SHA512 c4290cffa2dd4ce49949ba7e4db2a9ca7e07e22e6c26d814b1876583732ebd31954bbfed95e516125f12083a080209357872af2c7ccdafd4712fb30f922f9da7 +EBUILD automake-1.13.4-r2.ebuild 2643 BLAKE2B cfb0517a6dbee72711d8f25f4a86c8cfd73ba821f3ed58ca86035d380d5b03102f1a56037257515a21247f1e42d74637df2cd71496a74e5bc47c798c72d9699b SHA512 41dd36863935300680001619afe6fa931521bde40e07c1b226899a09a5ed7ed67603074bfeb2dbd1f51dc0d3a3c968e83e4e64c9ab732406a0983e87c95ad79d +EBUILD automake-1.15.1-r2.ebuild 3192 BLAKE2B edd43338af2e12fdc25c419bcf452e014a64f23aac91d57d727d61a4125dcc047406a954b8d3b5d02a6232b528b25dc2b4d210e9caf76814453f9793d1a7ca7c SHA512 6de009d30ad3126f93f1c3b705ef44181a385e042488aa206cdc5a9aa7e518da79e80d5853e8f4f73fb3b3c682882afc48bec625ea7a881c63ca7d675a605c2d +EBUILD automake-1.16.3-r1.ebuild 3518 BLAKE2B fa4a284c5f1564170e2d2ba0dc6f7e414d0a947b05c8b59e53a9622f93827add33d4551de53fff5fefd0e85b2fe7d9ddbe7e9032fee21b7ba6cf6a27cf217c02 SHA512 6c45e29f1304a2d219774359025c23c7a8bd20b99317c6a2c6275ab15eba935ac716da256411d002622574c4a48de9684f6fed2c4e4f6cb9e0bae1d27f8725c0 +EBUILD automake-1.16.4.ebuild 3518 BLAKE2B fa4a284c5f1564170e2d2ba0dc6f7e414d0a947b05c8b59e53a9622f93827add33d4551de53fff5fefd0e85b2fe7d9ddbe7e9032fee21b7ba6cf6a27cf217c02 SHA512 6c45e29f1304a2d219774359025c23c7a8bd20b99317c6a2c6275ab15eba935ac716da256411d002622574c4a48de9684f6fed2c4e4f6cb9e0bae1d27f8725c0 +EBUILD automake-1.16.5.ebuild 3526 BLAKE2B 2983d453d694de228a3206e1e2e95798768c7101af3b59287e16b0bbf2563c12deba911d9dae7a2bb0a62c2f23bb90e571a0788ebe41570d299afb860aed7691 SHA512 859c9074b0be85ffadf4c0791faee51ab4153c31a5ad99bbad0811856011f2218ea2b028f9d3ea5698fc41d7f0d36c08be5357784b75507d470f9fb205fa1091 +EBUILD automake-9999.ebuild 3438 BLAKE2B 120512bd6dafdd2c420159c87ebb547f3fc9fb2fc7614bd6334032a6402e76e3b4dc6a39f9e331ecc5b8eac354af5bf3661697973bbeaa42ee77215dc5f039e8 SHA512 a0c14464bc86c69ca843333db6cb8c154219c1493ec49dfe53cea86b2681962f51a65aea1e80490f81bf04b2d1983fa0322608f7d4d0839b4f883594a2c3eaa9 +MISC automake-1.11.6-r3.ebuild.1 2566 BLAKE2B c1e28e5349f89560b320f0fb61d63a18e13c3aac2a1962e6e8d31f2adf5f22136b9e949ff397c05c0781724aa40580f3217e7991fdbe8ac3c3d533f8e1262e7e SHA512 c4290cffa2dd4ce49949ba7e4db2a9ca7e07e22e6c26d814b1876583732ebd31954bbfed95e516125f12083a080209357872af2c7ccdafd4712fb30f922f9da7 +MISC metadata.xml 332 BLAKE2B d33ce6b379d5d8d44ae9104f3e5c5a0b5b25682072f7222bdd6dd92b97123b3cc011ed078178a8d2cb9e3e3d1da03dde67b3a844374819fdb67b879341a8a5fa SHA512 ad4477b610e680468526c77df5550b44f8d0558237aac887312a463d4da29216a63db372710398d0eb478550550507e81421d1deee272038b3658c38b84e5b06 diff --git a/sys-devel/automake/automake-1.11.6-r3.ebuild b/sys-devel/automake/automake-1.11.6-r3.ebuild new file mode 100644 index 0000000..8b96c4f --- /dev/null +++ b/sys-devel/automake/automake-1.11.6-r3.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" +SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" +IUSE="" +RESTRICT="test" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-10 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND} + sys-apps/help2man" +BDEPEND="app-arch/gzip" + +PATCHES=( + "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453 + "${FILESDIR}"/${PN}-1.11-install-sh-avoid-low-risk-race-in-tmp.patch + "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket-r1.patch +) + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + export HELP2MAN=true + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die + export TZ="UTC" #589138 +} + +src_compile() { + default + + local x + for x in aclocal automake; do + help2man "perl -Ilib ${x}" > doc/${x}-${SLOT}.1 + done +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir || die + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + slot_info_pages + + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/automake-1.11.6-r3.ebuild.1 b/sys-devel/automake/automake-1.11.6-r3.ebuild.1 new file mode 100644 index 0000000..8b96c4f --- /dev/null +++ b/sys-devel/automake/automake-1.11.6-r3.ebuild.1 @@ -0,0 +1,98 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" +SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" +IUSE="" +RESTRICT="test" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-10 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND} + sys-apps/help2man" +BDEPEND="app-arch/gzip" + +PATCHES=( + "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453 + "${FILESDIR}"/${PN}-1.11-install-sh-avoid-low-risk-race-in-tmp.patch + "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket-r1.patch +) + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + export HELP2MAN=true + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die + export TZ="UTC" #589138 +} + +src_compile() { + default + + local x + for x in aclocal automake; do + help2man "perl -Ilib ${x}" > doc/${x}-${SLOT}.1 + done +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir || die + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + slot_info_pages + + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/automake-1.13.4-r2.ebuild b/sys-devel/automake/automake-1.13.4-r2.ebuild new file mode 100644 index 0000000..2864771 --- /dev/null +++ b/sys-devel/automake/automake-1.13.4-r2.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" +SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="" +RESTRICT="test" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-10 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND} + sys-apps/help2man" +BDEPEND="app-arch/gzip" + +PATCHES=( + "${FILESDIR}"/${PN}-1.13-dyn-ithreads.patch + "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket-r1.patch + "${FILESDIR}"/${PN}-1.13-hash-order-workaround.patch + "${FILESDIR}"/${PN}-1.14-install-sh-avoid-low-risk-race-in-tmp.patch +) + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir || die + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + + slot_info_pages + rm "${ED}"/usr/share/aclocal/README || die + rmdir "${ED}"/usr/share/aclocal || die + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/automake-1.15.1-r2.ebuild b/sys-devel/automake/automake-1.15.1-r2.ebuild new file mode 100644 index 0000000..6162630 --- /dev/null +++ b/sys-devel/automake/automake-1.15.1-r2.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git" + + inherit git-r3 +else + KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + if [[ ${PV/_beta} == ${PV} ]]; then + MY_P=${P} + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz + https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + else + MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b" + MY_P="${PN}-${MY_PV}" + + # Alpha/beta releases are not distributed on the usual mirrors. + SRC_URI="https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + fi + S="${WORKDIR}/${MY_P}" +fi + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +IUSE="" +RESTRICT="test" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-10 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND} + sys-apps/help2man" +BDEPEND="app-arch/gzip" + +PATCHES=( "${FILESDIR}"/${PN}-1.15-install-sh-avoid-low-risk-race-in-tmp.patch ) + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + # Don't try wrapping the autotools this thing runs as it tends + # to be a bit esoteric, and the script does `set -e` itself. + ./bootstrap || die + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die + + # Bug 628912 + if ! has_version sys-apps/texinfo ; then + touch doc/{stamp-vti,version.texi,automake.info} || die + fi +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir || die + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + + slot_info_pages + rm "${ED}"/usr/share/aclocal/README || die + rmdir "${ED}"/usr/share/aclocal || die + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/automake-1.16.3-r1.ebuild b/sys-devel/automake/automake-1.16.3-r1.ebuild new file mode 100644 index 0000000..6908170 --- /dev/null +++ b/sys-devel/automake/automake-1.16.3-r1.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{8,9,10} ) + +inherit python-any-r1 + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git" + + inherit git-r3 +else + KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + if [[ ${PV/_beta} == ${PV} ]]; then + MY_P="${P}" + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz + https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + else + MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b" + MY_P="${PN}-${MY_PV}" + + # Alpha/beta releases are not distributed on the usual mirrors. + SRC_URI="https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + fi + S="${WORKDIR}/${MY_P}" +fi + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-11 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND}" +BDEPEND=" + app-arch/gzip + sys-apps/help2man + test? ( ${PYTHON_DEPS} ) +" + +PATCHES=( + "${FILESDIR}"/automake-1.16.2-py3-compile.patch + "${FILESDIR}"/automake-1.16.2-fix-instmany-python.sh-test.patch + "${FILESDIR}"/automake-1.16.2-fix-py-compile-basedir.sh-test.patch +) + +pkg_setup() { + # Avoid python-any-r1_pkg_setup + : +} + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + # Don't try wrapping the autotools this thing runs as it tends + # to be a bit esoteric, and the script does `set -e` itself. + ./bootstrap || die + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die + + # Bug 628912 + if ! has_version sys-apps/texinfo ; then + touch doc/{stamp-vti,version.texi,automake.info} || die + fi +} + +src_configure() { + use test && python_setup + default +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + + slot_info_pages + rm "${ED}"/usr/share/aclocal/README || die + rmdir "${ED}"/usr/share/aclocal || die + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/automake-1.16.4.ebuild b/sys-devel/automake/automake-1.16.4.ebuild new file mode 100644 index 0000000..6908170 --- /dev/null +++ b/sys-devel/automake/automake-1.16.4.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{8,9,10} ) + +inherit python-any-r1 + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git" + + inherit git-r3 +else + KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + if [[ ${PV/_beta} == ${PV} ]]; then + MY_P="${P}" + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz + https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + else + MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b" + MY_P="${PN}-${MY_PV}" + + # Alpha/beta releases are not distributed on the usual mirrors. + SRC_URI="https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + fi + S="${WORKDIR}/${MY_P}" +fi + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-11 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND}" +BDEPEND=" + app-arch/gzip + sys-apps/help2man + test? ( ${PYTHON_DEPS} ) +" + +PATCHES=( + "${FILESDIR}"/automake-1.16.2-py3-compile.patch + "${FILESDIR}"/automake-1.16.2-fix-instmany-python.sh-test.patch + "${FILESDIR}"/automake-1.16.2-fix-py-compile-basedir.sh-test.patch +) + +pkg_setup() { + # Avoid python-any-r1_pkg_setup + : +} + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + # Don't try wrapping the autotools this thing runs as it tends + # to be a bit esoteric, and the script does `set -e` itself. + ./bootstrap || die + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die + + # Bug 628912 + if ! has_version sys-apps/texinfo ; then + touch doc/{stamp-vti,version.texi,automake.info} || die + fi +} + +src_configure() { + use test && python_setup + default +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + + slot_info_pages + rm "${ED}"/usr/share/aclocal/README || die + rmdir "${ED}"/usr/share/aclocal || die + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/automake-1.16.5.ebuild b/sys-devel/automake/automake-1.16.5.ebuild new file mode 100644 index 0000000..a9dc19e --- /dev/null +++ b/sys-devel/automake/automake-1.16.5.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{8,9,10} ) + +inherit python-any-r1 + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git" + + inherit git-r3 +else + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + if [[ ${PV/_beta} == ${PV} ]]; then + MY_P="${P}" + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz + https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + else + MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b" + MY_P="${PN}-${MY_PV}" + + # Alpha/beta releases are not distributed on the usual mirrors. + SRC_URI="https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + fi + S="${WORKDIR}/${MY_P}" +fi + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-11 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND}" +BDEPEND=" + app-arch/gzip + sys-apps/help2man + test? ( ${PYTHON_DEPS} ) +" + +PATCHES=( + "${FILESDIR}"/automake-1.16.2-py3-compile.patch + "${FILESDIR}"/automake-1.16.2-fix-instmany-python.sh-test.patch + "${FILESDIR}"/automake-1.16.2-fix-py-compile-basedir.sh-test.patch +) + +pkg_setup() { + # Avoid python-any-r1_pkg_setup + : +} + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + # Don't try wrapping the autotools this thing runs as it tends + # to be a bit esoteric, and the script does `set -e` itself. + ./bootstrap || die + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die + + # Bug 628912 + if ! has_version sys-apps/texinfo ; then + touch doc/{stamp-vti,version.texi,automake.info} || die + fi +} + +src_configure() { + use test && python_setup + default +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + + slot_info_pages + rm "${ED}"/usr/share/aclocal/README || die + rmdir "${ED}"/usr/share/aclocal || die + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/automake-9999.ebuild b/sys-devel/automake/automake-9999.ebuild new file mode 100644 index 0000000..d5f4649 --- /dev/null +++ b/sys-devel/automake/automake-9999.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8,9,10} ) + +inherit python-any-r1 + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git" + inherit git-r3 +else + if [[ ${PV/_beta} == ${PV} ]]; then + MY_P="${P}" + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz + https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + else + MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b" + MY_P="${PN}-${MY_PV}" + + # Alpha/beta releases are not distributed on the usual mirrors. + SRC_URI="https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz" + fi + S="${WORKDIR}/${MY_P}" +fi + +DESCRIPTION="Used to generate Makefile.in from Makefile.am" +HOMEPAGE="https://www.gnu.org/software/automake/" + +LICENSE="GPL-2" +# Use Gentoo versioning for slotting. +SLOT="${PV:0:4}" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="dev-lang/perl + >=sys-devel/automake-wrapper-11 + >=sys-devel/autoconf-2.69:* + sys-devel/gnuconfig" +DEPEND="${RDEPEND}" +BDEPEND=" + app-arch/gzip + sys-apps/help2man + test? ( ${PYTHON_DEPS} ) +" + +PATCHES=( + "${FILESDIR}"/automake-1.16.2-py3-compile.patch +) +# All patches have been submitted upstream. + +pkg_setup() { + # Avoid python-any-r1_pkg_setup + : +} + +src_prepare() { + default + export WANT_AUTOCONF=2.5 + # Don't try wrapping the autotools this thing runs as it tends + # to be a bit esoteric, and the script does `set -e` itself. + ./bootstrap || die + sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die + + # Bug 628912 + if ! has_version sys-apps/texinfo ; then + touch doc/{stamp-vti,version.texi,automake.info} || die + fi +} + +src_configure() { + use test && python_setup + default +} + +# slot the info pages. do this w/out munging the source so we don't have +# to depend on texinfo to regen things. #464146 (among others) +slot_info_pages() { + pushd "${ED}"/usr/share/info >/dev/null || die + rm -f dir + + # Rewrite all the references to other pages. + # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4. + # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4. + local p pages=( *.info ) args=() + for p in "${pages[@]/%.info}" ; do + args+=( + -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|" + -e "s:(${p}):(${p}-${SLOT}):g" + ) + done + sed -i "${args[@]}" * || die + + # Rewrite all the file references, and rename them in the process. + local f d + for f in * ; do + d=${f/.info/-${SLOT}.info} + mv "${f}" "${d}" || die + sed -i -e "s:${f}:${d}:g" * || die + done + + popd >/dev/null || die +} + +src_install() { + default + + slot_info_pages + rm "${ED}"/usr/share/aclocal/README || die + rmdir "${ED}"/usr/share/aclocal || die + rm \ + "${ED}"/usr/bin/{aclocal,automake} \ + "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die + + # remove all config.guess and config.sub files replacing them + # w/a symlink to a specific gnuconfig version + local x + for x in guess sub ; do + dosym ../gnuconfig/config.${x} \ + /usr/share/${PN}-${SLOT}/config.${x} + done + + # Avoid QA message about pre-compressed file in docs + local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz" + if [[ -f "${tarfile}" ]] ; then + gunzip "${tarfile}" || die + fi +} diff --git a/sys-devel/automake/files/automake-1.10-perl-5.16.patch b/sys-devel/automake/files/automake-1.10-perl-5.16.patch new file mode 100644 index 0000000..19fe249 --- /dev/null +++ b/sys-devel/automake/files/automake-1.10-perl-5.16.patch @@ -0,0 +1,128 @@ +https://bugs.gentoo.org/424453 + +From 6bf58a59a1f3803e57e3f0378aa9344686707b75 Mon Sep 17 00:00:00 2001 +From: Stefano Lattarini +Date: Mon, 28 May 2012 13:32:03 +0200 +Subject: [PATCH] aclocal: declare function prototypes, do not use '&' in + function calls + +This change will also fix automake bug#11543 (from a report by Matt +Burgess). + +* aclocal.in: Declare prototypes for almost all functions early, before +any actual function definition (but omit the prototype for the dynamically +generated '&search' function). Add prototypes to any function definition. +Remove '&' from function invocations (i.e., simply use "func(ARGS..)" +instead of "&func(ARGS...)"). +* THANKS, NEWS: Update. + +Signed-off-by: Stefano Lattarini +--- + NEWS | 4 ++++ + THANKS | 1 + + aclocal.in | 42 ++++++++++++++++++++++++++++++++++-------- + 3 files changed, 39 insertions(+), 8 deletions(-) + +diff --git a/aclocal.in b/aclocal.in +index dfb851b..e8855d5 100644 +--- a/aclocal.in ++++ b/aclocal.in +@@ -152,8 +152,34 @@ my $erase_me; + + ################################################################ + ++# Prototypes for all subroutines. ++ ++sub unlink_tmp (;$); ++sub xmkdir_p ($); ++sub check_acinclude (); ++sub reset_maps (); ++sub install_file ($$); ++sub list_compare (\@\@); ++sub scan_m4_dirs ($@); ++sub scan_m4_files (); ++sub add_macro ($); ++sub scan_configure_dep ($); ++sub add_file ($); ++sub scan_file ($$$); ++sub strip_redundant_includes (%); ++sub trace_used_macros (); ++sub scan_configure (); ++sub write_aclocal ($@); ++sub usage ($); ++sub version (); ++sub handle_acdir_option ($$); ++sub parse_arguments (); ++sub parse_ACLOCAL_PATH (); ++ ++################################################################ ++ + # Erase temporary file ERASE_ME. Handle signals. +-sub unlink_tmp ++sub unlink_tmp (;$) + { + my ($sig) = @_; + +@@ -350,7 +376,7 @@ sub scan_m4_dirs ($@) + next if $file eq 'aclocal.m4'; + + my $fullfile = File::Spec->canonpath ("$m4dir/$file"); +- &scan_file ($type, $fullfile, 'aclocal'); ++ scan_file ($type, $fullfile, 'aclocal'); + } + closedir (DIR); + } +@@ -361,12 +387,12 @@ sub scan_m4_files () + { + # First, scan configure.ac. It may contain macro definitions, + # or may include other files that define macros. +- &scan_file (FT_USER, $configure_ac, 'aclocal'); ++ scan_file (FT_USER, $configure_ac, 'aclocal'); + + # Then, scan acinclude.m4 if it exists. + if (-f 'acinclude.m4') + { +- &scan_file (FT_USER, 'acinclude.m4', 'aclocal'); ++ scan_file (FT_USER, 'acinclude.m4', 'aclocal'); + } + + # Finally, scan all files in our search paths. +@@ -380,7 +406,7 @@ sub scan_m4_files () + my $search = "sub search {\nmy \$found = 0;\n"; + foreach my $key (reverse sort keys %map) + { +- $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key ++ $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { add_macro ("' . $key + . '"); $found = 1; }' . "\n"); + } + $search .= "return \$found;\n};\n"; +@@ -403,7 +429,7 @@ sub add_macro ($) + + verb "saw macro $macro"; + $macro_seen{$macro} = 1; +- &add_file ($map{$macro}); ++ add_file ($map{$macro}); + } + + # scan_configure_dep ($file) +@@ -465,7 +491,7 @@ sub scan_configure_dep ($) + } + + add_macro ($_) foreach (@rlist); +- &scan_configure_dep ($_) foreach @ilist; ++ scan_configure_dep ($_) foreach @ilist; + } + + # add_file ($FILE) +@@ -931,7 +957,7 @@ EOF + } + + # Print version and exit. +-sub version() ++sub version () + { + print < +Date: Sat, 15 Aug 2015 04:40:57 -0400 +Subject: install-sh: avoid (low risk) race in /tmp + +Ensure that nobody can cross privilege boundaries by pre-creating +symlink on '$tmpdir' path. + +Just testing 'mkdir -p' by creating '/tmp/ins$RANDOM-$$/d' is not +safe because '/tmp' directory is usually world-writeable and +'/tmp/ins$RANDOM-$$' content could be pretty easily guessed by +attacker (at least for shells where $RANDOM is not supported). +So, as the first step, create the '/tmp/ins$RANDOM-$$' without -p. +This step would fail early if somebody wanted catch us. + +Note that systems that implement (and have enabled) +fs.protected_symlinks kernel feature are not affected even without +this commit. + +References: +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760455 +https://bugzilla.redhat.com/show_bug.cgi?id=1140725 + +* lib/install-sh: Implement safer 'mkdir -p' test by running +'$mkdirprog $mkdir_mode "$tmpdir"' first. +(scriptversion): Bump. + +--- a/lib/install-sh ++++ b/lib/install-sh +@@ -345,34 +345,41 @@ do + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) ++ # $RANDOM is not portable (e.g. dash); use it when possible to ++ # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ +- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 ++ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + ++ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so ++ # create the $tmpdir first (and fail if unsuccessful) to make sure ++ # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && +- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 ++ $mkdirprog $mkdir_mode "$tmpdir" && ++ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. +- ls_ld_tmpdir=`ls -ld "$tmpdir"` ++ test_tmpdir="$tmpdir/a" ++ ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && +- $mkdirprog -m$different_mode -p -- "$tmpdir" && { +- ls_ld_tmpdir_1=`ls -ld "$tmpdir"` ++ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ++ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi +- rmdir "$tmpdir/d" "$tmpdir" ++ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. +- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null ++ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; diff --git a/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch b/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch new file mode 100644 index 0000000..f790e77 --- /dev/null +++ b/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/343439 + +From 182626687f2640609f8eb28ad1b04b078342f2c7 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Sat, 12 Jan 2013 00:19:40 -0500 +Subject: [PATCH] ithreads: use runtime (not configure time) detection of perl + threads + +I can't imagine the runtime checks being a big runtime penalty, so there +shouldn't be a need to do the checks at configure check and hardcode the +result in the generated automake. + +With the current system, it means if you change your perl config (build +perl w/threads, build automake, build perl w/out threads), or deploy a +compiled automake package on a different system (build had threads, but +deployed system does not), you get errors when trying to run automake. + +So take the logic from configure.ac and move it to the one place where +PERL_THREADS is used (lib/Automake/Config.in) and do the version/config +checking at runtime. + +* bootstrap.sh (PERL_THREADS): Delete assignment and use in sed. +* configure.ac (am_cv_prog_PERL_ithreads, PERL_THREADS): Delete all code +related to these two variables. +* lib/Automake/Config.in (perl_threads): Initialize to 0, and only set to +1 if the perl version is at least 5.007_002, and useithreads is in Config. + +Copyright-paperwork-exempt: yes +Signed-off-by: Mike Frysinger +Signed-off-by: Stefano Lattarini +--- + bootstrap.sh | 2 -- + configure.ac | 26 -------------------------- + lib/Automake/Config.in | 9 ++++++++- + 3 files changed, 8 insertions(+), 29 deletions(-) + +diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in +index fe6ef9d..885e74e 100644 +--- a/lib/Automake/Config.in ++++ b/lib/Automake/Config.in +@@ -33,7 +33,14 @@ our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@'; + our $VERSION = '@VERSION@'; + our $RELEASE_YEAR = '@RELEASE_YEAR@'; + our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@'; +-our $perl_threads = @PERL_THREADS@; ++ ++our $perl_threads = 0; ++# We need at least this version for CLONE support. ++if (eval { require 5.007_002; }) ++ { ++ use Config; ++ $perl_threads = $Config{useithreads}; ++ } + + 1; + +-- +1.8.0.2 + diff --git a/sys-devel/automake/files/automake-1.13-hash-order-workaround.patch b/sys-devel/automake/files/automake-1.13-hash-order-workaround.patch new file mode 100644 index 0000000..79b81e6 --- /dev/null +++ b/sys-devel/automake/files/automake-1.13-hash-order-workaround.patch @@ -0,0 +1,14 @@ +--- a/t/primary-prefix-invalid-couples.tap ++++ b/t/primary-prefix-invalid-couples.tap +@@ -186,8 +186,10 @@ grep -v 'dir.* not a legitimate directory' stderr && exit 1 + # Check that the same failures are present without the '--add-missing' + # option. + mv stderr stderr.old ++cat stderr.old | sort > a + AUTOMAKE_fails -d "automake error out on mismatched prefix/primary couples" ++cat stderr | sort > b + command_ok_ "... and with the same diagnostic of 'automake -a'" \ +- diff stderr.old stderr ++ diff a b + + : diff --git a/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch b/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch new file mode 100644 index 0000000..bf8819a --- /dev/null +++ b/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch @@ -0,0 +1,37 @@ +http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21001 + +From 34163794a58b5bd91c5d6bd9adf5437571c7a479 Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Tue, 7 Jul 2015 10:54:24 +0200 +Subject: [PATCH] bin/automake: escape '{' in regexp pattern + +Based on perlre(1) documentation: +.. in Perl v5.26, literal uses of a curly bracket will be required +to be escaped, say by preceding them with a backslash ("\{" ) or +enclosing them within square brackets ("[{]") .. + +References: +https://bugzilla.redhat.com/1239379 + +* bin/automake.in (substitute_ac_subst_variables): Escape the +occurrence of '{' character. +--- + bin/automake.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bin/automake.in b/bin/automake.in +index 0c29184..c294ced 100644 +--- a/automake.in ++++ b/automake.in +@@ -3898,7 +3898,7 @@ sub substitute_ac_subst_variables_worker + sub substitute_ac_subst_variables ($) + { + my ($text) = @_; +- $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge; ++ $text =~ s/\$\{([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge; + return $text; + } + +-- +2.1.0 + diff --git a/sys-devel/automake/files/automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch b/sys-devel/automake/files/automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch new file mode 100644 index 0000000..6793706 --- /dev/null +++ b/sys-devel/automake/files/automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch @@ -0,0 +1,77 @@ +From: Pavel Raiskup +Date: Sat, 15 Aug 2015 04:40:57 -0400 +Subject: install-sh: avoid (low risk) race in /tmp + +Ensure that nobody can cross privilege boundaries by pre-creating +symlink on '$tmpdir' path. + +Just testing 'mkdir -p' by creating '/tmp/ins$RANDOM-$$/d' is not +safe because '/tmp' directory is usually world-writeable and +'/tmp/ins$RANDOM-$$' content could be pretty easily guessed by +attacker (at least for shells where $RANDOM is not supported). +So, as the first step, create the '/tmp/ins$RANDOM-$$' without -p. +This step would fail early if somebody wanted catch us. + +Note that systems that implement (and have enabled) +fs.protected_symlinks kernel feature are not affected even without +this commit. + +References: +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760455 +https://bugzilla.redhat.com/show_bug.cgi?id=1140725 + +* lib/install-sh: Implement safer 'mkdir -p' test by running +'$mkdirprog $mkdir_mode "$tmpdir"' first. +(scriptversion): Bump. + +--- a/lib/install-sh ++++ b/lib/install-sh +@@ -345,34 +345,41 @@ do + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) ++ # $RANDOM is not portable (e.g. dash); use it when possible to ++ # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ +- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 ++ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + ++ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so ++ # create the $tmpdir first (and fail if unsuccessful) to make sure ++ # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && +- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 ++ $mkdirprog $mkdir_mode "$tmpdir" && ++ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. +- ls_ld_tmpdir=`ls -ld "$tmpdir"` ++ test_tmpdir="$tmpdir/a" ++ ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && +- $mkdirprog -m$different_mode -p -- "$tmpdir" && { +- ls_ld_tmpdir_1=`ls -ld "$tmpdir"` ++ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ++ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi +- rmdir "$tmpdir/d" "$tmpdir" ++ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. +- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null ++ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; diff --git a/sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch b/sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch new file mode 100644 index 0000000..1fabdd5 --- /dev/null +++ b/sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch @@ -0,0 +1,82 @@ +From: Pavel Raiskup +Date: Sat, 15 Aug 2015 04:40:57 -0400 +Subject: install-sh: avoid (low risk) race in /tmp + +Ensure that nobody can cross privilege boundaries by pre-creating +symlink on '$tmpdir' path. + +Just testing 'mkdir -p' by creating '/tmp/ins$RANDOM-$$/d' is not +safe because '/tmp' directory is usually world-writeable and +'/tmp/ins$RANDOM-$$' content could be pretty easily guessed by +attacker (at least for shells where $RANDOM is not supported). +So, as the first step, create the '/tmp/ins$RANDOM-$$' without -p. +This step would fail early if somebody wanted catch us. + +Note that systems that implement (and have enabled) +fs.protected_symlinks kernel feature are not affected even without +this commit. + +References: +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760455 +https://bugzilla.redhat.com/show_bug.cgi?id=1140725 + +* lib/install-sh: Implement safer 'mkdir -p' test by running +'$mkdirprog $mkdir_mode "$tmpdir"' first. +(scriptversion): Bump. +--- + lib/install-sh | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/lib/install-sh b/lib/install-sh +index 0b0fdcb..59990a1 100755 +--- a/lib/install-sh ++++ b/lib/install-sh +@@ -324,34 +324,41 @@ do + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) ++ # $RANDOM is not portable (e.g. dash); use it when possible to ++ # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ +- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 ++ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + ++ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so ++ # create the $tmpdir first (and fail if unsuccessful) to make sure ++ # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && +- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 ++ $mkdirprog $mkdir_mode "$tmpdir" && ++ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. +- ls_ld_tmpdir=`ls -ld "$tmpdir"` ++ test_tmpdir="$tmpdir/a" ++ ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && +- $mkdirprog -m$different_mode -p -- "$tmpdir" && { +- ls_ld_tmpdir_1=`ls -ld "$tmpdir"` ++ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ++ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi +- rmdir "$tmpdir/d" "$tmpdir" ++ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. +- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null ++ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; diff --git a/sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch b/sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch new file mode 100644 index 0000000..5cddb4c --- /dev/null +++ b/sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch @@ -0,0 +1,26 @@ +From 50daac4f15d207b6b69011b9cdde62b56c1c8b10 Mon Sep 17 00:00:00 2001 +From: Thomas Deutschmann +Date: Fri, 20 Nov 2020 02:17:31 +0100 +Subject: [PATCH 2/2] tests: fix instmany-python.sh: increase limit + +Still failing with 4500 on Gentoo. Passing with 7000... +--- + t/instmany-python.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/t/instmany-python.sh b/t/instmany-python.sh +index dce3594b5..1c482520d 100644 +--- a/t/instmany-python.sh ++++ b/t/instmany-python.sh +@@ -21,7 +21,7 @@ + required='python' + . test-init.sh + +-limit=4500 ++limit=7000 + subdir=long_subdir_name_with_many_characters + nfiles=81 + list=$(seq_ 1 $nfiles) +-- +2.29.2 + diff --git a/sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch b/sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch new file mode 100644 index 0000000..f49dd25 --- /dev/null +++ b/sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch @@ -0,0 +1,26 @@ +From e3db5b8038a902501a354b6921dcebcb4180f50a Mon Sep 17 00:00:00 2001 +From: Thomas Deutschmann +Date: Fri, 20 Nov 2020 02:13:56 +0100 +Subject: [PATCH 1/2] tests: fix py-compile-basedir.sh: add missing test call + +Fixes: b279a0d46 ("tests: in python tests, do not require .pyo files (for python3)") +--- + t/py-compile-basedir.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh +index 13a22ff1d..1a16ee2d7 100644 +--- a/t/py-compile-basedir.sh ++++ b/t/py-compile-basedir.sh +@@ -43,7 +43,7 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do + py_installed "$d2/sub/$f.pyc" + files=$(find "$d2" | grep '\.py[co]$') + # with new-enough Python3, there are six files. +- test $(echo "$files" | wc -l) -eq 4 || $(echo "$files" | wc -l) -eq 6 ++ test $(echo "$files" | wc -l) -eq 4 || test $(echo "$files" | wc -l) -eq 6 + case $d2 in + .|..) rm -f $files;; + *) rm -rf "$d2";; +-- +2.29.2 + diff --git a/sys-devel/automake/files/automake-1.16.2-py3-compile.patch b/sys-devel/automake/files/automake-1.16.2-py3-compile.patch new file mode 100644 index 0000000..7924f20 --- /dev/null +++ b/sys-devel/automake/files/automake-1.16.2-py3-compile.patch @@ -0,0 +1,73 @@ +From aa449bd4c836abf0320033c5077259fc760b622d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 3 Nov 2019 11:51:19 +0100 +Subject: [PATCH] py-compile: Support -OO for py3.5+, and -O&-OO for pypy3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Michał Górny +--- + lib/py-compile | 29 +++++++++++++++++++++++++---- + 1 file changed, 25 insertions(+), 4 deletions(-) + +diff --git a/lib/py-compile b/lib/py-compile +index e56d98d6e..5b9ae5d5d 100755 +--- a/lib/py-compile ++++ b/lib/py-compile +@@ -126,12 +126,10 @@ if test "$python_major" -le 2; then + import_lib=imp + import_test="hasattr(imp, 'get_tag')" + import_call=imp.cache_from_source +- import_arg2=', False' # needed in one call and not the other + else + import_lib=importlib + import_test="hasattr(sys.implementation, 'cache_tag')" + import_call=importlib.util.cache_from_source +- import_arg2= + fi + + $PYTHON -c " +@@ -159,7 +157,7 @@ $PYTHON -O -c " + import sys, os, py_compile, $import_lib + + # pypy does not use .pyo optimization +-if hasattr(sys, 'pypy_translation_info'): ++if hasattr(sys, 'pypy_translation_info') and sys.hexversion < 0x03050000: + sys.exit(0) + + files = '''$files''' +@@ -173,7 +171,30 @@ for file in files.split(): + sys.stdout.write(file) + sys.stdout.flush() + if $import_test: +- py_compile.compile(filepath, $import_call(filepath$import_arg2), path) ++ py_compile.compile(filepath, $import_call(filepath), path) ++ else: ++ py_compile.compile(filepath, filepath + 'o', path) ++sys.stdout.write('\n')" 2>/dev/null || : ++ ++$PYTHON -OO -c " ++import sys, os, py_compile, $import_lib ++ ++# python<3.5 does not have split files for -O and -OO ++if sys.hexversion < 0x03050000: ++ sys.exit(0) ++ ++files = '''$files''' ++sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') ++for file in files.split(): ++ $pathtrans ++ $filetrans ++ if not os.path.exists(filepath) or not (len(filepath) >= 3 ++ and filepath[-3:] == '.py'): ++ continue ++ sys.stdout.write(file) ++ sys.stdout.flush() ++ if $import_test: ++ py_compile.compile(filepath, $import_call(filepath), path) + else: + py_compile.compile(filepath, filepath + 'o', path) + sys.stdout.write('\n')" 2>/dev/null || : +-- +2.25.2 diff --git a/sys-devel/automake/metadata.xml b/sys-devel/automake/metadata.xml new file mode 100644 index 0000000..f671901 --- /dev/null +++ b/sys-devel/automake/metadata.xml @@ -0,0 +1,11 @@ + + + + + base-system@gentoo.org + Gentoo Base System + + + cpe:/a:gnu:automake + + diff --git a/virtual/libcrypt/Manifest b/virtual/libcrypt/Manifest new file mode 100644 index 0000000..61d1ba1 --- /dev/null +++ b/virtual/libcrypt/Manifest @@ -0,0 +1,3 @@ +EBUILD libcrypt-1-r1.ebuild 579 BLAKE2B 81f552f246b22253f40781b459aa36b2351edea935a9dba8126b8cd75aa65276873f0ba259bec75367a1cc764d8dcccaa644fb5e3bbab53c163a793728a47e8c SHA512 6164ec5fa7d4a59534efb58185ca478c0935e7935050cc38571af596de9d081983941b46d47f25cb2c14c14f34866ba239d17b26b82ad4c95a34ae701f7b982b +EBUILD libcrypt-2.ebuild 603 BLAKE2B 56018bde2d71c2aeb27a66b4c7023b410a85e8a578e8f53c1c1dbf3f905d596191cdb0202d7ce44bff47c7eeda7fd3f9b2d2b340afc94c48a8463f08b37ac3be SHA512 f0c36f75bc51ebbc29e43a87e694ac081a9c7563e00b4d712eaa2feafda490d18a3656fd55ac681b5d1c34cf7a4049e5d9da8fadcbb2ceba51f0766268e11ccc +MISC metadata.xml 286 BLAKE2B e2e007d7accebf84a8ce85442aab8f854639e308b3ddbfefa75c26e3b02b92a67526dcd177e619df1030a0f7ac52be3deb62be1c218bf34b01b76ca3cae4d0e7 SHA512 9d65bbb0c878ae150fcc102b1d81810bfc91025a375da3c6905bd56a2cefcc4f939540ca504547642e98d837b63ac4a6674328449547a883a93964a1487503c5 diff --git a/virtual/libcrypt/libcrypt-1-r1.ebuild b/virtual/libcrypt/libcrypt-1-r1.ebuild new file mode 100644 index 0000000..2c8f799 --- /dev/null +++ b/virtual/libcrypt/libcrypt-1-r1.ebuild @@ -0,0 +1,20 @@ +# Copyright 2020-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multilib-build + +DESCRIPTION="Virtual for libcrypt.so" + +SLOT="0/1" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="static-libs" + +RDEPEND=" + !prefix-guest? ( + elibc_glibc? ( sys-libs/glibc[crypt(+),static-libs(+)?] ) + elibc_musl? ( sys-libs/musl ) + ) + elibc_Cygwin? ( sys-libs/cygwin-crypt ) +" diff --git a/virtual/libcrypt/libcrypt-2.ebuild b/virtual/libcrypt/libcrypt-2.ebuild new file mode 100644 index 0000000..478041c --- /dev/null +++ b/virtual/libcrypt/libcrypt-2.ebuild @@ -0,0 +1,20 @@ +# Copyright 2020-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multilib-build + +DESCRIPTION="Virtual for libcrypt.so" + +SLOT="0/2" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="static-libs" + +RDEPEND=" + !prefix-guest? ( + elibc_glibc? ( sys-libs/libxcrypt[system(-),static-libs(-)?,${MULTILIB_USEDEP}] ) + elibc_musl? ( sys-libs/musl ) + ) + elibc_Cygwin? ( sys-libs/cygwin-crypt ) +" diff --git a/virtual/libcrypt/metadata.xml b/virtual/libcrypt/metadata.xml new file mode 100644 index 0000000..d65b2df --- /dev/null +++ b/virtual/libcrypt/metadata.xml @@ -0,0 +1,9 @@ + + + + + toolchain@gentoo.org + Gentoo Toolchain Project + + + diff --git a/x11-misc/barrier/Manifest b/x11-misc/barrier/Manifest new file mode 100644 index 0000000..7d55ed5 --- /dev/null +++ b/x11-misc/barrier/Manifest @@ -0,0 +1,4 @@ +AUX barrier-2.4.0-includes.patch 879 BLAKE2B 7d9652af91686fc43d76230d898556f4247314dfc72f817e4330c6e81e88f4cb6506b78522e9a1583a5bf7dd425fe88324ea8921ff3e63691e475dc4fefe5510 SHA512 ee1fd991b027bcb942b8785e2d34ec5a56d1e3efa7732e92120da77412a7f0caf8c7cd31a7d4e4d06fc2682a29cf329483693f9448fb66cc357bef47196012fc +DIST barrier-2.4.0.tar.gz 5572043 BLAKE2B e3eee306324a661a655b31e3179b7daf3fb199553a581059c67113f9597fb41d6af00fa3090d20c7d0b1d7420764454a512e91d8180ea663c3f99b89c663417f SHA512 dff8d95c358688952baee0bbbf56b818e40a6c0483d58f6cadd55558ab5d0cefc92a37b0751bfd70868686e1716c729871ae00a30ee9b0ba944f531dfb742449 +EBUILD barrier-2.4.0.ebuild 1553 BLAKE2B b80d2318e2805608b30f7dd011bddc3e5a8f557a55623a9e714db499c722de0a4e241d7d36d7159a7844a8d645ac645b005d7f3c2b6fff93ae24638a2e26f608 SHA512 efe3ac4d80da975c182a6cd75a64409c990c5cc4fa856d00db113c9bccf751b8204da992919d4a8e370a15048c8e0a3183f967da48e4ca7732a63c523c0567c1 +MISC metadata.xml 330 BLAKE2B 1fbe5756c4c15fbab194c7634c20e8736d2339a51d89853939397f12314122a3dec2e7842e58eac9e60b35d49f9dff147e8d022e125935598ce69e74b3fc8439 SHA512 102af001ad78e8da45205b0d2b44c9f9a0843a7a953a9868018821007d0c5e9d166dfe335f1fc9ecde71a200473edacff5643fab9d7c32ea16ceb8eaf9b857d4 diff --git a/x11-misc/barrier/barrier-2.4.0.ebuild b/x11-misc/barrier/barrier-2.4.0.ebuild new file mode 100644 index 0000000..aa93cfd --- /dev/null +++ b/x11-misc/barrier/barrier-2.4.0.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit desktop virtualx xdg cmake + +DESCRIPTION="Share a mouse and keyboard between computers (fork of Synergy)" +HOMEPAGE="https://github.com/debauchee/barrier" +SRC_URI="https://github.com/debauchee/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="gui test" +RESTRICT="!test? ( test )" + +RDEPEND=" + net-misc/curl + x11-libs/libICE + x11-libs/libSM + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXinerama + x11-libs/libXrandr + x11-libs/libXtst + gui? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 + net-dns/avahi[mdnsresponder-compat] + ) + dev-libs/openssl:0= +" +DEPEND=" + ${RDEPEND} + dev-cpp/gtest + dev-cpp/gulrak-filesystem + x11-base/xorg-proto +" + +PATCHES=( + "${FILESDIR}"/${P}-includes.patch +) + +DOCS=( + ChangeLog + README.md + doc/${PN}.conf.example{,-advanced,-basic} +) + +src_configure() { + local mycmakeargs=( + -DBARRIER_BUILD_GUI=$(usex gui) + -DBARRIER_BUILD_INSTALLER=OFF + -DBARRIER_BUILD_TESTS=$(usex test) + -DBARRIER_REVISION=00000000 + -DBARRIER_USE_EXTERNAL_GTEST=ON + -DBARRIER_VERSION_STAGE=gentoo + ) + + cmake_src_configure +} + +src_test() { + "${BUILD_DIR}"/bin/unittests || die + virtx "${BUILD_DIR}"/bin/integtests || die +} + +src_install() { + cmake_src_install + einstalldocs + doman doc/${PN}{c,s}.1 + + if use gui; then + doicon -s scalable res/${PN}.svg + doicon -s 256 res/${PN}.png + make_desktop_entry ${PN} Barrier ${PN} Utility + fi +} diff --git a/x11-misc/barrier/files/barrier-2.4.0-includes.patch b/x11-misc/barrier/files/barrier-2.4.0-includes.patch new file mode 100644 index 0000000..048a3b0 --- /dev/null +++ b/x11-misc/barrier/files/barrier-2.4.0-includes.patch @@ -0,0 +1,39 @@ +From aa0a2998e8894716644ea5fb29fc6f0165add956 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Tue, 2 Nov 2021 20:59:51 +0000 +Subject: [PATCH] Add missing cstddef includes for NULL + +--- + src/lib/base/Event.cpp | 2 ++ + src/lib/base/Event.h | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/src/lib/base/Event.cpp b/src/lib/base/Event.cpp +index cc548fc6..08c5e98f 100644 +--- a/src/lib/base/Event.cpp ++++ b/src/lib/base/Event.cpp +@@ -19,6 +19,8 @@ + #include "base/Event.h" + #include "base/EventQueue.h" + ++#include ++ + // + // Event + // +diff --git a/src/lib/base/Event.h b/src/lib/base/Event.h +index 38a2cf11..cb00dccb 100644 +--- a/src/lib/base/Event.h ++++ b/src/lib/base/Event.h +@@ -21,6 +21,8 @@ + #include "common/basic_types.h" + #include "common/stdmap.h" + ++#include ++ + class EventData { + public: + EventData() { } +-- +2.32.0 + diff --git a/x11-misc/barrier/metadata.xml b/x11-misc/barrier/metadata.xml new file mode 100644 index 0000000..70be39f --- /dev/null +++ b/x11-misc/barrier/metadata.xml @@ -0,0 +1,11 @@ + + + + + chewi@gentoo.org + James Le Cuirot + + + debauchee/barrier + + -- cgit v1.2.3