Sync with portage [Fri Apr 22 13:23:35 MSK 2022].

akrasnyh 2254
root 2 years ago
parent 87c106fd44
commit 688815c97b

Binary file not shown.

Binary file not shown.

@ -1,5 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<maintainer type="person" proxied="yes">
<email>guyu2876@gmail.com</email>
<name>Yu Gu</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
</pkgmetadata>

Binary file not shown.

@ -1,5 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<maintainer type="person" proxied="yes">
<email>guyu2876@gmail.com</email>
<name>Yu Gu</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
</pkgmetadata>

Binary file not shown.

@ -1,2 +1,3 @@
DIST at-spi2-core-2.42.0.tar.xz 198016 BLAKE2B 9b14d7d0f5845c7510f7b256a05f5e30c3d3d893a9ae63eee81b3d378dfa9f6ebaa9853f60b23734929692efc4b8c652d4bd7bd035bd989fe0006975bdbea427 SHA512 befcab94b3aa99471723238d9666fc6667041b058a2bac3b012cfa15a91950996431296f33c921764e0ec4ffd0cc41ebe00be461a8460d6f4d2bafff19a38e10
DIST at-spi2-core-2.44.0.tar.xz 209692 BLAKE2B 149251ba4061f5dbfac1e27775491bb6d7cee279cb7bd58c05f97cdec8a4e0208e5a129651a07c9febea681cc3fe36a7d7fa57c43c2b558249cdd321466729dd SHA512 6d74a56d7ad6c643985e98aebbbf0cdaad69c03b8030f8968bd9cce9357805cd846d71d35d2cc4a193770cd6d4a83cbfb98ef082e17719f3dee7b839c48bda44
DIST at-spi2-core-2.44.1.tar.xz 209780 BLAKE2B e76f0b0c478564181db774633dfc9613bdfa6c74c5c52878d877723e37605b7b7169fee45a9025b331e84bf5af8132eed50b388db9ac1aee0fec7776a633628a SHA512 8d85df75f886c4a19d829d14e5a9412b607b9cbe2d1b7ecb95b4082602f0624e90747fe955f96d378c3a52bc0e732074b97008bb34e6acc2722c7056b2c0504e

@ -0,0 +1,55 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit gnome.org meson-multilib systemd virtualx xdg
DESCRIPTION="D-Bus accessibility specifications and registration daemon"
HOMEPAGE="https://wiki.gnome.org/Accessibility https://gitlab.gnome.org/GNOME/at-spi2-core"
LICENSE="LGPL-2.1+"
SLOT="2"
IUSE="X gtk-doc +introspection"
REQUIRED_USE="gtk-doc? ( X )"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
RDEPEND="
>=sys-apps/dbus-1.5[${MULTILIB_USEDEP}]
>=dev-libs/glib-2.62:2[${MULTILIB_USEDEP}]
introspection? ( >=dev-libs/gobject-introspection-1.54.0:= )
X? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXtst[${MULTILIB_USEDEP}]
x11-libs/libXi[${MULTILIB_USEDEP}]
)
"
DEPEND="${RDEPEND}"
BDEPEND="
dev-util/glib-utils
gtk-doc? (
>=dev-util/gtk-doc-1.25
app-text/docbook-xml-dtd:4.3
)
>=sys-devel/gettext-0.19.8
virtual/pkgconfig
"
PATCHES=(
# disable teamspaces test since that requires Novell.ICEDesktop.Daemon
"${FILESDIR}/${PN}-2.0.2-disable-teamspaces-test.patch"
)
multilib_src_configure() {
local emesonargs=(
-Dsystemd_user_dir="$(systemd_get_userunitdir)"
$(meson_native_use_bool gtk-doc docs)
-Dintrospection=$(multilib_native_usex introspection)
-Dx11=$(usex X)
)
meson_src_configure
}
multilib_src_test() {
virtx dbus-run-session meson test -C "${BUILD_DIR}"
}

@ -1,2 +1,3 @@
DIST kontrast-21.08.3.tar.xz 125632 BLAKE2B 8734de15fcfd542d037cde92e6a80060e9c6628cd69d3cfee1f1f4c9b8938647d83924381966600ac9978acfa14723e0920c98f3ce2e666ddfdb624b8cc5f010 SHA512 193d372cdcecb3b90a352fb2deb24528d004c44e50c834e02a63c562eb97bd1f528fd81254bfc3ab7152edcc9894129eae7c6e1826a9ae42bc5ab22bf9a660c9
DIST kontrast-21.12.3.tar.xz 125760 BLAKE2B b72d78961d22fc0eb51c0a64f9a7381ef9e87709d9fc24a08c3b08c60ad8102eadbc97943e72b1153f950654f442f97190d1e34c3beb24f4f8ea070f923dba55 SHA512 36d084f0801d393a0d7bdd771d23163a192e6d0e50f6499b9080e3928f5f3982dcee81c3e3453f8de2ece721c508479928fdff4a971cfef945acadd917e19581
DIST kontrast-22.04.0.tar.xz 125872 BLAKE2B a04569299df54635687d0e30b7453d4fa7dfe9699cbac4da82749d0e0e37e2f6006b1d7e0de88813c1103b59dd10141d6c034fd51bebe0846120790d4aa0cfa2 SHA512 cf8103b28b0e2658c251af2e9adcc7099a55655d4f59a6d410bfbf12fe20830f6be80ab28bd80534e0a20d7ad6b8f83740bb022b1c1602f9c24a0cd94198cbfd

@ -0,0 +1,33 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
KDE_GEAR="true"
KFMIN=5.92.0
QTMIN=5.15.2
inherit ecm kde.org
DESCRIPTION="Tool to check contrast for colors to verify they are correctly accessible"
HOMEPAGE="https://apps.kde.org/kontrast/"
LICENSE="GPL-3+"
SLOT="5"
KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
IUSE=""
DEPEND="
>=dev-qt/qtdbus-${QTMIN}:5
>=dev-qt/qtdeclarative-${QTMIN}:5
>=dev-qt/qtgui-${QTMIN}:5
>=dev-qt/qtquickcontrols2-${QTMIN}:5
>=dev-qt/qtsql-${QTMIN}:5
>=dev-qt/qtsvg-${QTMIN}:5
>=dev-qt/qtwidgets-${QTMIN}:5
>=kde-frameworks/kcoreaddons-${KFMIN}:5
>=kde-frameworks/ki18n-${KFMIN}:5
>=kde-frameworks/kirigami-${KFMIN}:5
"
RDEPEND="${DEPEND}
kde-plasma/xdg-desktop-portal-kde
"

Binary file not shown.

@ -1,3 +1,4 @@
DIST awscli-1.22.100.tar.gz 2196386 BLAKE2B 36f5b4df2111251fa78f2b83def150fd266b558006e9627b5a5b5e86318eedc160a5d2c5b906535c967ca1dbef8637619b5c0f8b7b8c88ef5f192c38e974c54b SHA512 6d8ecc2cd55e27e0eb7c23bd4633e0c3b6151b1a3df8db2557eb3010d9413a8561a736cd77b9d4745c9fb45269bd85800f17d9b6ba8abb2f25521b677e111329
DIST awscli-1.22.77.tar.gz 2179996 BLAKE2B fec49002841fa634bd2b7ae72f534bda875d69169179bbeb85eac18f2d9e9102121b6c0d73d8c7132ac0a6b8e5a8a39cea258d90c15f90b29b44d12ed509cfd1 SHA512 0fa89b6a2dd9dfc7e7be713c10b7470ad8fe8877a7fa9712510254cfbef36771f9e2541adfef9366e13e2273a373c2b88730572f7f1ad79c19f67e57c17e6631
DIST awscli-1.22.82.tar.gz 2182473 BLAKE2B 0d73e62f7c394c1ac77f6b011e2303d9b48b8fd6d874360aef6b2fc4378feb8f9fa04b88e9c1ee8cf0cb5fb7d1884d4a08eee64093c151de274c1aa50777ebf3 SHA512 195061199fa3ed24b5be2a22a5d0ee2891bfb616239aaf54e5aa8715b3374e68edad613ea6e6b71a165e501b5a009856993259de3ac57f14ff3cd2a39453ec38
DIST awscli-1.22.87.tar.gz 2185493 BLAKE2B 5d274e0c9483b22e664ad6de8710c04cc99f854b7c1efdac6dd4164deab47dc55d35520b34b276f8b4de1ee8b1ed10205b1806a31fc776d17b289a5e29277016 SHA512 c117fb8f89680836206f678637fb480ffd06db2225533bff75686eb8c1bd6e450297adb11863247441eeed67744b13930c0f62afce1dd12527d06d4e2eb58a4b

@ -0,0 +1,66 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{8..10} )
inherit bash-completion-r1 distutils-r1 multiprocessing
DESCRIPTION="Universal Command Line Environment for AWS"
HOMEPAGE="https://pypi.org/project/awscli/"
#SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
SRC_URI="https://github.com/aws/aws-cli/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/aws-cli-${PV}"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
# awscli 1.22.55 → botocore 1.24.0
# so botocore is x.(y+2).(z-55)
BOTOCORE_PV="$(ver_cut 1).$(( $(ver_cut 2) + 2)).$(( $(ver_cut 3-) - 55))"
RDEPEND="
>=dev-python/botocore-${BOTOCORE_PV}[${PYTHON_USEDEP}]
dev-python/colorama[${PYTHON_USEDEP}]
dev-python/docutils[${PYTHON_USEDEP}]
dev-python/rsa[${PYTHON_USEDEP}]
>=dev-python/s3transfer-0.4.0[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
"
BDEPEND="
test? (
dev-python/pytest-xdist[${PYTHON_USEDEP}]
)
"
distutils_enable_tests pytest
src_prepare() {
# do not rely on bundled deps in botocore (sic!)
find -name '*.py' -exec sed -i \
-e 's:from botocore[.]vendored import:import:' \
-e 's:from botocore[.]vendored[.]:from :' \
{} + || die
# strip overzealous upper bounds on requirements
sed -i -e 's:,<[0-9.]*::' -e 's:==:>=:' setup.py || die
distutils-r1_src_prepare
}
python_test() {
# integration tests require AWS credentials and Internet access
epytest tests/{functional,unit} \
-n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")"
}
python_install_all() {
newbashcomp bin/aws_bash_completer aws
insinto /usr/share/zsh/site-functions
newins bin/aws_zsh_completer.sh _aws
distutils-r1_python_install_all
rm "${ED}"/usr/bin/{aws.cmd,aws_bash_completer,aws_zsh_completer.sh} || die
}

@ -0,0 +1,37 @@
https://bugs.gentoo.org/839909
https://github.com/tstack/lnav/pull/961
From b8a31ae9b4bcd5690a2b3d2fbd6373caffbc4a57 Mon Sep 17 00:00:00 2001
From: Peter Schiffer <3899107+pschiffe@users.noreply.github.com>
Date: Mon, 21 Feb 2022 21:09:30 +0100
Subject: [PATCH] Add `#include <iterator>` to `string_util.cc`
Lnav fails to build on the next Fedora version due to the following error:
```
make[3]: Entering directory '/builddir/build/BUILD/lnav-0.10.1/src/base'
g++ -std=c++14 -DHAVE_CONFIG_H -I. -I../../src -Wall -I../../src/ -I../../src/third-party -I../../src/fmtlib -I../../src/third-party/doctest-root -I/usr/local/include -D_ISOC99_SOURCE -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c -o string_util.o string_util.cc
make[3]: Leaving directory '/builddir/build/BUILD/lnav-0.10.1/src/base'
string_util.cc: In function 'std::string repeat(const std::string&, size_t)':
string_util.cc:199:22: error: 'ostream_iterator' is not a member of 'std'
199 | std::fill_n(std::ostream_iterator<std::string>(os), num, input);
| ^~~~~~~~~~~~~~~~
string_util.cc:38:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; did you forget to '#include <iterator>'?
37 | #include "string_util.hh"
+++ |+#include <iterator>
38 |
```
Reason is probably the updated GNU toolchain, more info:
https://fedoraproject.org/wiki/Changes/GNUToolchainF36
This patch fixes the issue.
--- a/src/base/string_util.cc
+++ b/src/base/string_util.cc
@@ -29,6 +29,7 @@
#include "config.h"
+#include <iterator>
#include <regex>
#include <sstream>

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -31,6 +31,7 @@ DOCS=( AUTHORS NEWS README )
PATCHES=(
"${FILESDIR}"/${PN}-0.10.0-disable-tests.patch
"${FILESDIR}"/${PN}-0.10.1-gcc12.patch
)
src_prepare() {

Binary file not shown.

@ -1,2 +1,4 @@
DIST lkrg-0.9.2.tar.gz 125976 BLAKE2B c3da2d4599c9dd5b7d6fbec426fd93d802715f6c8566471f82c8f1c7d31621ebb4a2cc4c285d076aad6a6ee6b1bb790debbb365cfc6220192df049ac1d3c67a9 SHA512 5fec807618817bcb516e1a6779def6979badbdac6fe9b38fcce8425a0c7ebe3fb55c05d3080d8cac2d67cac6e8b7d2d77b3a1be450227299e2a02a311e223331
DIST lkrg-0.9.2.tar.gz.sign 801 BLAKE2B 0cd8b18c8a0fbcca61ffa868b406d048461ddf9189fb08f15faa45e01b8731906a6b14105dfcf92bb5124373860f6695594063ee8d138c94c70adf471bc15e0a SHA512 18b547ca84a7fd2957484857e17983408e92fd005d58b77b399c5156ecb09fc5e9e6c910337654a2655883d103098c1769b1993017eec753bd21e63d6491ad04
DIST lkrg-0.9.3.tar.gz 127986 BLAKE2B 5d059247c9a8a5abe4795d22b3806544dbb4c332947012ec33ceace27747663375acf68a4e859fae293eead5f7d9540b4261d3fef149d1e5c6ee8714a2df28d6 SHA512 9b441b93ff28b733afc513643a5d843c1707ac5a05adb359a3142b9ca7cba6a4790ebca4f9e6ca88a6ddf61f2b06aa242e02f288e9295e74999ed534794fb45d
DIST lkrg-0.9.3.tar.gz.sign 801 BLAKE2B c054522f281d09a008821f92c7b43b5384241100c68ef0b0ea7171b8c492772a5d668b425089e1aac990bf6a675215dd5861f3f2598995e31a8db82a8b2ec7e9 SHA512 87c2bfe8d342b85f3c6c8226be5b698527a507369603a03eefead89ea8635b5ba95f3cbbe1d84cd77ac42bb8a773a7133917e0c87132b4851ff4017f77bc683a

@ -0,0 +1,38 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-mod linux-info verify-sig
DESCRIPTION="Linux Kernel Runtime Guard"
HOMEPAGE="https://lkrg.org"
SRC_URI="https://lkrg.org/download/${P}.tar.gz
verify-sig? ( https://lkrg.org/download/${P}.tar.gz.sign )"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-openwall )"
MODULE_NAMES="p_lkrg(misc:${S}:${S})"
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/openwall.asc"
pkg_setup() {
CONFIG_CHECK="HAVE_KRETPROBES KALLSYMS_ALL KPROBES JUMP_LABEL"
CONFIG_CHECK+=" MODULE_UNLOAD !PREEMPT_RT ~STACKTRACE"
linux-mod_pkg_setup
# compile against selected (not running) target
BUILD_PARAMS="P_KVER=${KV_FULL} P_KERNEL=${KERNEL_DIR}"
BUILD_TARGETS="all"
}
src_unpack() {
if use verify-sig; then
verify-sig_verify_detached ${DISTDIR}/${P}.tar.gz{,.sign}
fi
default
}

Binary file not shown.

@ -1,2 +1,3 @@
DIST stenc-1.0.7.tar.gz 107096 BLAKE2B 678be2fea4eb3db5cf84a70243fd61dcb574627bacb59b2f9af682e2e0851d41187565b4706313c98bb5b297f865b1424bc47c52f15efa2a2e8b2c7413b09009 SHA512 84cb0114c969e1a5122a8621d2c136663ee2a2d9aae1d455631c1d4555e947f4841004b74a1f63b800be713cfae637c19ea34adf40f0bc81f1c56a555a27ba31
DIST stenc-1.0.8.tar.gz 29297 BLAKE2B 269310fb7a9063eb3b367dfec534096201003e6178a31aeb73aa7a73ed0473d4a606634ac9cf7377d17240dee074345efa49fc907d9487f573a75ec44c3454f6 SHA512 4fd882861d248cf59cde1782833bd3e4f7e01e8b6c00424c55f26454a620510b22de0d42f2d7f6c4e67c2b277776a174fe687756a75f410026fda55554f9dc87
DIST stenc-1.1.0.tar.gz 31822 BLAKE2B f132c74ac84f38b312a8fa74f0a0fbfd253748bbc0516e5f5a860dbeb4ad4683ad965858c73f2fba58075074e9fae6c6fadf66c9da2bd85bf88de877439f66ad SHA512 d73eb349ad06979803caaa89af1068ef3732830b99557b7ca62d5cb357d7a105d1c884fea3c227b18e906a80f17581c08fe276f92ad698cd0dfca4919fe73fa9

@ -0,0 +1,31 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools
if [[ ${PV} == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/scsitape/stenc.git"
S="${WORKDIR}/${P}/src"
else
SRC_URI="https://github.com/scsitape/stenc/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
DESCRIPTION="SCSI Tape Encryption Manager enables AES support for LTO drives"
HOMEPAGE="https://github.com/scsitape/stenc/"
LICENSE="GPL-2"
SLOT="0"
IUSE=""
DEPEND=""
RDEPEND="${DEPEND}"
src_prepare() {
default
eautoreconf
}

Binary file not shown.

@ -1,2 +1,3 @@
DIST dolphin-plugins-21.08.3.tar.xz 254604 BLAKE2B 9a7a9c7a1cf82d458c1fd0bbce6b47c233b8a7a20bd1d1696bc75d6b04c8e4a9d6464025d8ad39b3bb96b8dd428fb880a5d318f7c0d13ef3bc8bf24a42c24169 SHA512 2fb7fbd6490d768f3eb7d756429d858337b8088a7c87836ed4a54fc3f863f50c4973bbe2ae149d53d2769d7ce3c31fbd737bc4afc74fd14260a158da83992076
DIST dolphin-plugins-21.12.3.tar.xz 254696 BLAKE2B e669a8acbf8b5559a602dd3ae646e2384b89a672bb0ed42d2f094b75a1eaefd6994644daaa70d17f9baba8ea491cef632090050b93e0f5e0b50f203a6166338e SHA512 3dad72b6e0283a8c825aded82e9d15bc5e03303bbfc6dd8f1e6af2cb3892ec9b04a3c97f01246e20abe6d86e5a91fa1c4f8fff48ed24186a3780009a78298d23
DIST dolphin-plugins-22.04.0.tar.xz 256164 BLAKE2B 8980f3d7687b456edc81d69027c66f1e7801fa5876ef605a021caecae02b7b30596b1b9bdd8c0de2b5c6c98393eafb75bedc6f0d411d144fa430619778ff7f97 SHA512 3c7dcc1404cbfbb0a4805eb1116dae53b03fa1b49ee483b09009f32035d0939fc8bedd65866765e94d5294185f42bda4b6aaba6486c52ea2a524e5678e6b4c28

@ -0,0 +1,65 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
ECM_HANDBOOK="false"
KDE_GEAR="true"
KDE_ORG_CATEGORY="sdk"
KDE_ORG_NAME="dolphin-plugins"
MY_PLUGIN_NAME="mountiso"
KFMIN=5.92.0
PVCUT=$(ver_cut 1-3)
QTMIN=5.15.2
inherit ecm kde.org
DESCRIPTION="Dolphin plugin for ISO loopback device mounting"
HOMEPAGE="https://apps.kde.org/dolphin_plugins/"
LICENSE="GPL-2" # TODO: CHECK
SLOT="5"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
IUSE=""
DEPEND="
>=dev-qt/qtdbus-${QTMIN}:5
>=dev-qt/qtgui-${QTMIN}:5
>=dev-qt/qtwidgets-${QTMIN}:5
>=kde-apps/dolphin-${PVCUT}:5
>=kde-frameworks/kcompletion-${KFMIN}:5
>=kde-frameworks/kconfig-${KFMIN}:5
>=kde-frameworks/kcoreaddons-${KFMIN}:5
>=kde-frameworks/ki18n-${KFMIN}:5
>=kde-frameworks/kio-${KFMIN}:5
>=kde-frameworks/ktextwidgets-${KFMIN}:5
>=kde-frameworks/solid-${KFMIN}:5
"
RDEPEND="${DEPEND}"
src_prepare() {
ecm_src_prepare
# kxmlgui, qtnetwork only required by dropbox
ecm_punt_qt_module Network
ecm_punt_kf_module XmlGui
# delete non-${PN} translations
if [[ ${KDE_BUILD_TYPE} = release ]]; then
find po -type f -name "*po" -and -not -name "*${MY_PLUGIN_NAME}plugin" -delete || die
fi
}
src_configure() {
local mycmakeargs=(
-DBUILD_${MY_PLUGIN_NAME}=ON
-DBUILD_bazaar=OFF
-DBUILD_dropbox=OFF
-DBUILD_git=OFF
-DBUILD_hg=OFF
-DBUILD_svn=OFF
)
ecm_src_configure
}
src_install() {
ecm_src_install
rm "${D}"/usr/share/metainfo/org.kde.dolphin-plugins.metainfo.xml || die
}

Binary file not shown.

@ -2,3 +2,5 @@ DIST gnupg-2.2.34.tar.bz2 7252882 BLAKE2B f42fd8c4019a051c9f087ae1806ce61c831e0a
DIST gnupg-2.2.34.tar.bz2.sig 119 BLAKE2B 38d384f215f02bb45ab7c77bb7ad434d9038d8ed19610210ebf84e43e1548c2e938f1f45a1047a9c161c3a88308b83c21fb2bc254a77e68fcf00c7f0cf72e5f9 SHA512 220436aa2387376d4af41ee84dbac9a9e4fda2904024d81da9af6f8c704700c5c6f9da98cfa7e4a9f188ad2739189b905473cfd88747978300829ec382771745
DIST gnupg-2.3.4.tar.bz2 7589561 BLAKE2B 6e04a90a5ffac7d4701202e35071a48530ba86d8c64cab3ed1617df23358f4d564ddf6cdbc6c861890725344a19619e0f6791ccabd97b18b28dc4e6e01f7837b SHA512 a3cf1c759512ec561c6f01cec72d533fc099dccf8c03b3a3e4a930862ae4c6815ecb856edd41884a65f058b65553cb69519e53e134d652353a7a76144bd99758
DIST gnupg-2.3.4.tar.bz2.sig 238 BLAKE2B e384c1528d015b4470eabfeffbe59db82cfc6522d739d6017f72f60a55959ded9cf031fec7b9b286f8020cdd429b2d07780205633d6fb459521ba96374fb3b3f SHA512 be43535068b1ad33458ad320e3ec37fad49341ebfb0846a2b21d2b87fd55696567df91abcea0b83e70ad1322832635279a4d0bf1f736ae6dd70e255c951bf0b3
DIST gnupg-2.3.5.tar.bz2 7601772 BLAKE2B b1044d8a62636be1fe870fe73213ffdefefc4b4f99b4cb1abcbc85679fda8ec855c1ac11296e2a37c7aef9bf0eec401bd3aafe68154a22df780512deb5ed77f8 SHA512 dcaf6a72179cbc21263f27c994100fbd45687daaa63e3a9a9668e26c25f331516e8c7b656cdce6c646e5fe29f0ad2e20b72ac364f242524fb3ead4e96e89520d
DIST gnupg-2.3.5.tar.bz2.sig 119 BLAKE2B 5377908e2ad968db06e870d17116827c9a332bd159aba2ff737131805b9f81d7ff44352ffb9af0006ec2d48934fcfc7af54965d948a8a043fe3a59b3600f8745 SHA512 f12e799274833a657317e997e85958cc450d57bb6a3a39a613d41de50953ab1363e0a38a4f4948f81f7da08dd00ccb2e141d6b2eb7f131ed2905d3c1666f7da2

@ -0,0 +1,161 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/gnupg.asc
inherit flag-o-matic systemd toolchain-funcs verify-sig
MY_P="${P/_/-}"
DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
HOMEPAGE="https://gnupg.org/"
SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
SRC_URI+=" verify-sig? ( mirror://gnupg/gnupg/${P}.tar.bz2.sig )"
S="${WORKDIR}/${MY_P}"
LICENSE="GPL-3"
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="bzip2 doc ldap nls readline selinux +smartcard ssl test +tofu tpm tools usb user-socket wks-server"
RESTRICT="!test? ( test )"
REQUIRED_USE="test? ( tofu )"
# Existence of executables is checked during configuration.
# Note: On each bump, update dep bounds on each version from configure.ac!
DEPEND=">=dev-libs/libassuan-2.5.0
>=dev-libs/libgcrypt-1.9.1:=
>=dev-libs/libgpg-error-1.41
>=dev-libs/libksba-1.3.4
>=dev-libs/npth-1.2
>=net-misc/curl-7.10
bzip2? ( app-arch/bzip2 )
ldap? ( net-nds/openldap:= )
readline? ( sys-libs/readline:0= )
smartcard? ( usb? ( virtual/libusb:1 ) )
tofu? ( >=dev-db/sqlite-3.27 )
tpm? ( >=app-crypt/tpm2-tss-2.4.0 )
ssl? ( >=net-libs/gnutls-3.0:0= )
sys-libs/zlib
"
RDEPEND="${DEPEND}
app-crypt/pinentry
nls? ( virtual/libintl )
selinux? ( sec-policy/selinux-gpg )
wks-server? ( virtual/mta )"
BDEPEND="virtual/pkgconfig
doc? ( sys-apps/texinfo )
nls? ( sys-devel/gettext )
verify-sig? ( sec-keys/openpgp-keys-gnupg )"
DOCS=(
ChangeLog NEWS README THANKS TODO VERSION
doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER
)
PATCHES=(
"${FILESDIR}/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch"
)
src_prepare() {
default
# Inject SSH_AUTH_SOCK into user's sessions after enabling gpg-agent-ssh.socket in systemctl --user mode,
# idea borrowed from libdbus, see
# https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/bus/systemd-user/dbus.socket.in#L6
#
# This cannot be upstreamed, as it requires determining the exact prefix of 'systemctl',
# which in turn requires discovery in Autoconf, something that upstream deeply resents.
sed -e "/DirectoryMode=/a ExecStartPost=-${EPREFIX}/bin/systemctl --user set-environment SSH_AUTH_SOCK=%t/gnupg/S.gpg-agent.ssh" \
-i doc/examples/systemd-user/gpg-agent-ssh.socket || die
}
src_configure() {
local myconf=(
$(use_enable bzip2)
$(use_enable nls)
$(use_enable smartcard scdaemon)
$(use_enable ssl gnutls)
$(use_enable tofu)
$(use_enable tofu keyboxd)
$(use_enable tofu sqlite)
$(usex tpm '--with-tss=intel' '--disable-tpm2d')
$(use smartcard && use_enable usb ccid-driver || echo '--disable-ccid-driver')
$(use_enable wks-server wks-tools)
$(use_with ldap)
$(use_with readline)
--with-mailprog=/usr/libexec/sendmail
--disable-ntbtls
--enable-all-tests
--enable-gpgsm
--enable-large-secmem
CC_FOR_BUILD="$(tc-getBUILD_CC)"
GPG_ERROR_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpg-error-config"
KSBA_CONFIG="${ESYSROOT}/usr/bin/ksba-config"
LIBASSUAN_CONFIG="${ESYSROOT}/usr/bin/libassuan-config"
LIBGCRYPT_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-libgcrypt-config"
NPTH_CONFIG="${ESYSROOT}/usr/bin/npth-config"
$("${S}/configure" --help | grep -o -- '--without-.*-prefix')
)
if use prefix && use usb; then
# bug #649598
append-cppflags -I"${EPREFIX}/usr/include/libusb-1.0"
fi
#bug 663142
if use user-socket; then
myconf+=( --enable-run-gnupg-user-socket )
fi
# glib fails and picks up clang's internal stdint.h causing weird errors
[[ ${CC} == *clang ]] && \
export gl_cv_absolute_stdint_h=/usr/include/stdint.h
# Hardcode mailprog to /usr/libexec/sendmail even if it does not exist.
# As of GnuPG 2.3, the mailprog substitution is used for the binary called
# by wks-client & wks-server; and if it's autodetected but not not exist at
# build time, then then 'gpg-wks-client --send' functionality will not
# work. This has an unwanted side-effect in stage3 builds: there was a
# [R]DEPEND on virtual/mta, which also brought in virtual/logger, bloating
# the build where the install guide previously make the user chose the
# logger & mta early in the install.
econf "${myconf[@]}"
}
src_compile() {
default
use doc && emake -C doc html
}
src_test() {
#Bug: 638574
use tofu && export TESTFLAGS=--parallel
default
}
src_install() {
default
use tools &&
dobin \
tools/{convert-from-106,gpg-check-pattern} \
tools/{gpgconf,gpgsplit,lspgpot,mail-signed-keys} \
tools/make-dns-cert
dosym gpg /usr/bin/gpg2
dosym gpgv /usr/bin/gpgv2
echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die
echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die
dodir /etc/env.d
echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg || die
use doc && dodoc doc/gnupg.html/* doc/*.png
systemd_douserunit doc/examples/systemd-user/*.{service,socket}
}

Binary file not shown.

@ -32,6 +32,10 @@ PATCHES=( "${FILESDIR}"/${PN}-require-diminish.patch )
ELISP_TEXINFO="${PN}.texi"
SITEFILE="50${PN}-gentoo.el"
src_test() {
emake BATCH="${EMACS} ${EMACSFLAGS} -L . -l diminish" test
}
src_install() {
rm bind-{chord,key}.el{,c} ${PN}-tests.el || die

@ -1 +1 @@
DIST 86Box-3.3.tar.gz 4017011 BLAKE2B f7d666e8a35cf500309bc02392f170d489c598c957d84a51f63cee870c7d12933c46964b555cf754587b926cfee3f6e99f07518e6c073996933e675b54dcd57e SHA512 c590b138d4cb19519847f13d8d68d6d8a54ee2372cb00e998dbb9b15d6c18beaa2e842625631fa716c1dba49149f1a93e8f6521a02d05d97b91ca311b8d91859
DIST 86Box-3.4.tar.gz 4218439 BLAKE2B ea5dbc31ca3b801f45c9923d0723fcf7f71dfda2a3835b54ee9c700650f28dbb8ed8644b0344c7cfea244fd755847842466bf203482b5eabde85f72b60b15fd8 SHA512 a60034e027bd188343c8eaefe6c56699bf5f7b8016cb1443b081655377bddbd84159cd63362d268a73fc6a5f92ec38544d2fb82aacdb40e8d0eec83bba00cff0

Binary file not shown.

@ -1,4 +1,2 @@
DIST VBoxGuestAdditions_6.1.24.iso 61081600 BLAKE2B 66427a961c83f2de1a0b8671066154133795e8e4f50ac82e927e82e05594c520b155f29f7f19373e5846c36a1e3f6e5d2f5d17db1cebc1996c4d1737d5b45862 SHA512 8753558fcf467805bff801be43281597ef6738f90f8f7a62f6acbba2753e57f44bc72cb66411f0a0f413135026ddf683b0330b49ccad77676ec67b7bf3faf06e
DIST VBoxGuestAdditions_6.1.28.iso 62226432 BLAKE2B 0f2d4076476945466cd5d3c5e3064c0f23e511596933d29cd7bab275ee1a21ac5fb81a4723c342f79946000e97681a5e9875cba006bdee6ec684169abd5e04d9 SHA512 2801c78909bdd38b623e958ce61154da7aa2ababf6e7723baf50e958afd1a8d4b0930800fe5549f728a7ac7979d8fa1597c969bf28743d7266b16ccc1b5960bb
DIST VBoxGuestAdditions_6.1.30.iso 62238720 BLAKE2B 1459548ad7d4c7ed79a44793d11fc4071a8b043dc0cb9b113775688c254cdfa8f658dcf33fa666c5d4c000357f8a1f8ef0f43268af8f84bd6833e16381e276d1 SHA512 0729275f46b486872f665b264c6ad83a0d42bb2a35ff5e96d9a8449bc9042328219f7533e6ef6ded0351e1fa73024755b32560af13606e808910262c3b133726
DIST VBoxGuestAdditions_6.1.32.iso 62388224 BLAKE2B e8e4addf5d3a61ff193fcccf185353aa4325ed3747f1bc9afb376276cd38857cc2a087e8c6872cef083ea4eeda20a0c29bac62263c378b6c608e5fb6424623a0 SHA512 268526eec6d07e69e3ab583a11211331c103db87162be045e0068ebd6beeda491e215ea6de6ca2aed10e4312dd9b2904ab315f05bad7041ba6787bfa61aeb6e9
DIST VBoxGuestAdditions_6.1.34.iso 61538304 BLAKE2B 7709ef735fafc7dcb78dba8ce77a5afbffbe23e9b83c46cd930519150a60eea7c9399075fde58c6f7be07adb82752352f5db7d9f59b3eb5fccc6c55cbdba36ee SHA512 a3b5977fe773bdc5d67bf9fbb529fb8f77e01a95af51a6681a1716ec300eb574e669bf9d57d0d1663c33440cce92b499efffbf5e468830d82e0c072ddc2d9d31

@ -1,34 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN=VBoxGuestAdditions
MY_PV="${PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
MY_P=${MY_PN}_${MY_PV}
DESCRIPTION="CD image containing guest additions for VirtualBox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.iso"
LICENSE="GPL-2+ LGPL-2.1+ MIT SGI-B-2.0 CDDL"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE=""
RESTRICT="mirror"
RDEPEND="!app-emulation/virtualbox-bin
!=app-emulation/virtualbox-9999"
S="${WORKDIR}"
src_unpack() {
return 0
}
src_install() {
insinto /usr/share/${PN/-additions}
newins "${DISTDIR}"/${MY_P}.iso ${MY_PN}.iso
}

@ -1,34 +0,0 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN=VBoxGuestAdditions
MY_PV="${PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
MY_P=${MY_PN}_${MY_PV}
DESCRIPTION="CD image containing guest additions for VirtualBox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.iso"
LICENSE="GPL-2+ LGPL-2.1+ MIT SGI-B-2.0 CDDL"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE=""
RESTRICT="mirror"
RDEPEND="!app-emulation/virtualbox-bin
!=app-emulation/virtualbox-9999"
S="${WORKDIR}"
src_unpack() {
return 0
}
src_install() {
insinto /usr/share/${PN/-additions}
newins "${DISTDIR}"/${MY_P}.iso ${MY_PN}.iso
}

@ -1,4 +1,4 @@
# Copyright 2021 Gentoo Authors
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8

@ -1,4 +1,2 @@
DIST Oracle_VM_VirtualBox_Extension_Pack-6.1.24.tar.gz 11135003 BLAKE2B 53bb6dc35eb8ab1a58492ca3b67b63885ffa1ad3ed3a51a9e7e8c522845b082c420fb39a31a379ee56b45c9b02452acc5be4d72c5a5d9bddaa428bf7c9a3a086 SHA512 e2af2213e99c8c35a3090f5e36d05b1ef27c920cd31a2bf97b0368a89f27a5e2d0e0e0dced5e4e7bacda50fe4b57738924f13a933f5307ff2c8c4015ecc030ae
DIST Oracle_VM_VirtualBox_Extension_Pack-6.1.28.tar.gz 11136237 BLAKE2B 66f09d39a60277358b08f073e3d5836bdb4acddfacc0c5321b19f876d4c5407ed1039b65e22e188690cb6c034aacca2be8d60a52acb8467a6c6319f46c15bb61 SHA512 7e352889469ad678e93d042a5a240820753918cd191c9e164678b84947fba5ae0616fda7f8e6385b2ba525e51948e4860ca91cdd62a2eb503f79acadcb367f2e
DIST Oracle_VM_VirtualBox_Extension_Pack-6.1.30.tar.gz 11136343 BLAKE2B c3db50c02da2a9a6ba766bf24103f0f45f073ea65954352fe3a3f01c25974374f6c7f7851e933ce4e5a082ec3944f1c521d74f51e10db5708454bd8817d8f23d SHA512 c525743b2304fe39c66f56147d85a92d4fc884cae007c8b801519e0b5bcbf08c7656ba66befbac63b03ba4d20034899ae4438c263de0bae7a3fd36af1608ea75
DIST Oracle_VM_VirtualBox_Extension_Pack-6.1.32.tar.gz 11137804 BLAKE2B 376274d56ce61a9da785be0a3de63566bc39e9c7a2915a33ff7792173f7625c21d345da757e9963d9b1833124c3430523bc89ba0a0ed27b66a6d87a07d6d6602 SHA512 e7297a9fccd6c74a7986496da71bd6a0970bc53c49845b9bc44714ab04e90e9a4c427f1491f6ec287cdba87a93733de7849f5e78ab7f3ee1a127e8ac4ea20861
DIST Oracle_VM_VirtualBox_Extension_Pack-6.1.34.tar.gz 11137259 BLAKE2B 81709b2f3e67cafd9cffd80de2d07cfa5a64054b590455f7393ab701984b469b2677ecae8ba82aa812c17688a9212ef2ee97be6584bdefb1eb1a53643ba92d17 SHA512 ec41e31bff4bcb79d46957c8ee41e561c9e3a8932152633a16953add38f142e8ac4029bbbd67d72bdb64784819db2f52c4d66a9a7e8009435231c98d88676cc4

@ -1,41 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MAIN_PV="$(ver_cut 1-3)"
if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
MY_PV="${MAIN_PV}_$(ver_cut 5-6)"
DEP_PV="${MY_PV}"
MY_PV="${MY_PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
else
MY_PV="${MAIN_PV}"
DEP_PV="${MAIN_PV}"
fi
#VBOX_BUILD_ID="$(ver_cut 4)"
MY_PN="Oracle_VM_VirtualBox_Extension_Pack"
MY_P="${MY_PN}-${MY_PV}" #-${VBOX_BUILD_ID}"
DESCRIPTION="PUEL extensions for VirtualBox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.vbox-extpack -> ${MY_P}.tar.gz"
LICENSE="PUEL"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE=""
RESTRICT="bindist mirror strip"
RDEPEND="=app-emulation/virtualbox-${DEP_PV}*"
S="${WORKDIR}"
QA_PREBUILT="/usr/lib*/virtualbox/ExtensionPacks/${MY_PN}/.*"
src_install() {
insinto /usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}
doins -r linux.${ARCH}
doins ExtPack* PXE-Intel.rom
}

@ -1,41 +0,0 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MAIN_PV="$(ver_cut 1-3)"
if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
MY_PV="${MAIN_PV}_$(ver_cut 5-6)"
DEP_PV="${MY_PV}"
MY_PV="${MY_PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
else
MY_PV="${MAIN_PV}"
DEP_PV="${MAIN_PV}"
fi
#VBOX_BUILD_ID="$(ver_cut 4)"
MY_PN="Oracle_VM_VirtualBox_Extension_Pack"
MY_P="${MY_PN}-${MY_PV}" #-${VBOX_BUILD_ID}"
DESCRIPTION="PUEL extensions for VirtualBox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.vbox-extpack -> ${MY_P}.tar.gz"
LICENSE="PUEL"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE=""
RESTRICT="bindist mirror strip"
RDEPEND="=app-emulation/virtualbox-${DEP_PV}*"
S="${WORKDIR}"
QA_PREBUILT="/usr/lib*/virtualbox/ExtensionPacks/${MY_PN}/.*"
src_install() {
insinto /usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}
doins -r linux.${ARCH}
doins ExtPack* PXE-Intel.rom
}

@ -1,4 +1,4 @@
# Copyright 2021 Gentoo Authors
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8

@ -1,5 +1,3 @@
DIST VirtualBox-6.1.24.tar.bz2 165754851 BLAKE2B 65bbc130281a745a00eee2a055dd59893e2f4b701cbdb31f4c45e2b7389f85f59d8a78ce1e03c83734a49b76fa61f56ea083a588874fa4023b723694f75ee8fb SHA512 cf2c5f58d2f160f8a22d94b7e30bcdaabd907661e05a72341bee93f5092b96c0c84d2291005f433040235227e3d6595ce0e66759c44c24eaedc6c9614646b3d6
DIST VirtualBox-6.1.28.tar.bz2 165774255 BLAKE2B fe66ab411ef8fd78ca7b5deb151b2bfc11f3625d54629e6768da9040297cea999c53873c94437f2a57b245e71db0e28bd2ad94ed557f8a1c1c674f477301e192 SHA512 d0eb49a82ec6ddb7ce7da362faf86254d324e73522001c44ab0f26a09ead3d9a800ce0d4ad3698853d4f9a4e9803ceb21f3bf50388a1855edcb2a42ce51f3a96
DIST VirtualBox-6.1.30.tar.bz2 165769447 BLAKE2B e15a8370c7cd83b547012639c3361da1b2ee40e8b094f11c22fadb95c9ddaae4791ee7cab16cb2eb23c6da4fc383f89f629335d577fa834fa1a979e19b9701bb SHA512 fab5b8327d9ad4186e584e90d1aca461d95731d0935509301e8adfe28d0737fb3ded5ac1d97e4cd1edc12c79bebb75cc675289762f9e918106f34bf6e8d363d4
DIST VirtualBox-6.1.32.tar.bz2 165758238 BLAKE2B 24873d7cc8bd306ea3552fe75379fbe7be767c85406042344eb047ed31184c3357aea07dda5e15c275f5036ae63106ef1d2e6524b143bc645a6b5ba0016f1391 SHA512 8bf7af6b8b4d3ba90f0e91589cf26400648436eb9da6d31c1a760460bfe5eb7311ac3220b4c9a98ac50e559641d3d5f559134be65288821038255de1c2c7ce1e
DIST VirtualBox-6.1.34.tar.bz2 165761216 BLAKE2B d3c8f7d3d6f408e4c4275c2b2815e92819c871359501ec4fa7212bf7cdc852613e2e4703d8650371097a5bc805efa04ea75bb03ab83d24a869a677555f6e22d5 SHA512 46d63a9fd9df76af654af59fab5cf555858bc2c4b5dc34e2378d85ae784e6380b6def4aab06909a9b5e114a7297269f90cfb2c3d8d6529b423d703afbad18c64
DIST virtualbox-6.1.12-patches-01.tar.xz 2528 BLAKE2B a5d7cde0daea41bee2e40e46569c725769927a31865d99d13b8b13c4903e59b4097f85da15dc592b9c7e8baf8ff805397af827620f107ba09a468b4d1198ecab SHA512 f71d10a9fbce99c3f631ef30bcfa9d0e017e702ac509541b039e08ccbcd024beb93fde09c43d90af5d9d28f6842a7947f20e7950d3897da3e6d57859657e1123

@ -1,221 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-mod systemd toolchain-funcs
MY_PN="VirtualBox"
MY_PV="${PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
MY_P="${MY_PN}-${MY_PV}"
[[ "${PV}" == *a ]] && DIR_PV="$(ver_cut 1-3)"
DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${DIR_PV:-${MY_PV}}/${MY_P}.tar.bz2
https://dev.gentoo.org/~polynomial-c/virtualbox/patchsets/virtualbox-6.1.12-patches-01.tar.xz"
LICENSE="GPL-2"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64 x86"
IUSE="X"
# automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
RDEPEND="
acct-group/vboxguest
acct-group/vboxsf
acct-user/vboxguest
X? ( x11-apps/xrandr
x11-apps/xrefresh
x11-libs/libXmu
x11-libs/libX11
x11-libs/libXt
x11-libs/libXext
x11-libs/libXau
x11-libs/libXdmcp
x11-libs/libSM
x11-libs/libICE )
sys-apps/dbus
"
DEPEND="
${RDEPEND}
>=dev-util/kbuild-0.1.9998.3127
>=dev-lang/yasm-0.6.2
sys-devel/bin86
sys-libs/pam
sys-power/iasl
x11-base/xorg-proto
"
PDEPEND="
X? ( x11-drivers/xf86-video-vboxvideo )
"
BUILD_TARGETS="all"
BUILD_TARGET_ARCH="${ARCH}"
S="${WORKDIR}/${MY_PN}-${DIR_PV:-${PV}}"
VBOX_MOD_SRC_DIR="${S}/out/linux.${ARCH}/release/bin/additions/src"
pkg_setup() {
export DISTCC_DISABLE=1 #674256
MODULE_NAMES="vboxguest(misc:${VBOX_MOD_SRC_DIR}/vboxguest:${VBOX_MOD_SRC_DIR}/vboxguest)
vboxsf(misc:${VBOX_MOD_SRC_DIR}/vboxsf:${VBOX_MOD_SRC_DIR}/vboxsf)"
use X && MODULE_NAMES+=" vboxvideo(misc:${VBOX_MOD_SRC_DIR}/vboxvideo::${VBOX_MOD_SRC_DIR}/vboxvideo)"
linux-mod_pkg_setup
BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build KERNOUT=${KV_OUT_DIR} KBUILD_EXTRA_SYMBOLS=${S}/Module.symvers"
}
src_prepare() {
# Remove shipped binaries (kBuild,yasm), see bug #232775
rm -r kBuild/bin tools || die
# Provide kernel sources
pushd src/VBox/Additions &>/dev/null || die
ebegin "Extracting guest kernel module sources"
kmk GuestDrivers-src vboxguest-src vboxsf-src vboxvideo-src &>/dev/null || die
eend
popd &>/dev/null || die
# PaX fixes (see bug #298988)
pushd "${VBOX_MOD_SRC_DIR}" &>/dev/null || die
eapply "${FILESDIR}"/vboxguest-6.0.6-log-use-c99.patch
popd &>/dev/null || die
# Disable things unused or splitted into separate ebuilds
cp "${FILESDIR}/${PN}-5-localconfig" LocalConfig.kmk || die
use X || echo "VBOX_WITH_X11_ADDITIONS :=" >> LocalConfig.kmk
# Remove pointless GCC version check
sed -e '/^check_gcc$/d' -i configure || die
eapply "${WORKDIR}/patches"
eapply_user
}
src_configure() {
# build the user-space tools, warnings are harmless
local cmd=(
./configure
--nofatal
--disable-xpcom
--disable-sdl-ttf
--disable-pulse
--disable-alsa
--with-gcc="$(tc-getCC)"
--with-g++="$(tc-getCXX)"
--target-arch=${ARCH}
--with-linux="${KV_OUT_DIR}"
--build-headless
)
echo "${cmd[@]}"
"${cmd[@]}" || die "configure failed"
source ./env.sh
export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
}
src_compile() {
MAKE="kmk" emake \
VBOX_BUILD_PUBLISHER=_Gentoo \
TOOL_GXX3_CC="$(tc-getCC)" TOOL_GXX3_CXX="$(tc-getCXX)" \
TOOL_GXX3_LD="$(tc-getCXX)" VBOX_GCC_OPT="${CXXFLAGS}" \
TOOL_YASM_AS=yasm \
VBOX_ONLY_ADDITIONS=1 \
KBUILD_VERBOSE=2
# Now creating the kernel modules. We must do this _after_
# we compiled the user-space tools as we need two of the
# automatically generated header files. (>=3.2.0)
linux-mod_src_compile
}
src_install() {
linux-mod_src_install
cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
insinto /sbin
newins mount.vboxsf mount.vboxsf
fperms 4755 /sbin/mount.vboxsf
newinitd "${FILESDIR}"/${PN}-8.initd-r1 ${PN}
insinto /usr/sbin/
newins VBoxService vboxguest-service
fperms 0755 /usr/sbin/vboxguest-service
insinto /usr/bin
doins VBoxControl
fperms 0755 /usr/bin/VBoxControl
# VBoxClient user service and xrandr wrapper
if use X ; then
doins VBoxClient
fperms 0755 /usr/bin/VBoxClient
pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null \
|| die
newins 98vboxadd-xclient VBoxClient-all
fperms 0755 /usr/bin/VBoxClient-all
popd &>/dev/null || die
fi
# udev rule for vboxdrv
local udev_rules_dir="/lib/udev/rules.d"
dodir ${udev_rules_dir}
echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
>> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
|| die
echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
>> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
|| die
# VBoxClient autostart file
insinto /etc/xdg/autostart
doins "${FILESDIR}"/vboxclient.desktop
# sample xorg.conf
dodoc "${FILESDIR}"/xorg.conf.vbox
docompress -x "${ED}"/usr/share/doc/${PF}/xorg.conf.vbox
systemd_dounit "${FILESDIR}/${PN}.service"
}
pkg_postinst() {
linux-mod_pkg_postinst
if ! use X ; then
elog "use flag X is off, enable it to install the"
elog "X Window System video driver."
fi
elog ""
elog "Please add users to the \"vboxguest\" group so they can"
elog "benefit from seamless mode, auto-resize and clipboard."
elog ""
elog "The vboxsf group has been added to make automount services work."
elog "These services are part of the shared folders support."
elog ""
elog "Please add:"
elog "/etc/init.d/${PN}"
elog "to the default runlevel in order to start"
elog "needed services."
elog "To use the VirtualBox X driver, use the following"
elog "file as your /etc/X11/xorg.conf:"
elog " /usr/share/doc/${PF}/xorg.conf.vbox"
elog ""
elog "Also make sure you use the Mesa library for OpenGL:"
elog " eselect opengl set xorg-x11"
elog ""
elog "An autostart .desktop file has been installed to start"
elog "VBoxClient in desktop sessions."
elog ""
elog "You can mount shared folders with:"
elog " mount -t vboxsf <shared_folder_name> <mount_point>"
elog ""
elog "Warning:"
elog "this ebuild is only needed if you are running gentoo"
elog "inside a VirtualBox Virtual Machine, you don't need"
elog "it to run VirtualBox itself."
elog ""
}

@ -1,221 +0,0 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit linux-mod systemd toolchain-funcs
MY_PN="VirtualBox"
MY_PV="${PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
MY_P="${MY_PN}-${MY_PV}"
[[ "${PV}" == *a ]] && DIR_PV="$(ver_cut 1-3)"
DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${DIR_PV:-${MY_PV}}/${MY_P}.tar.bz2
https://dev.gentoo.org/~polynomial-c/virtualbox/patchsets/virtualbox-6.1.12-patches-01.tar.xz"
LICENSE="GPL-2"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64 x86"
IUSE="X"
# automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
RDEPEND="
acct-group/vboxguest
acct-group/vboxsf
acct-user/vboxguest
X? ( x11-apps/xrandr
x11-apps/xrefresh
x11-libs/libXmu
x11-libs/libX11
x11-libs/libXt
x11-libs/libXext
x11-libs/libXau
x11-libs/libXdmcp
x11-libs/libSM
x11-libs/libICE )
sys-apps/dbus
"
DEPEND="
${RDEPEND}
>=dev-util/kbuild-0.1.9998.3127
>=dev-lang/yasm-0.6.2
sys-devel/bin86
sys-libs/pam
sys-power/iasl
x11-base/xorg-proto
"
PDEPEND="
X? ( x11-drivers/xf86-video-vboxvideo )
"
BUILD_TARGETS="all"
BUILD_TARGET_ARCH="${ARCH}"
S="${WORKDIR}/${MY_PN}-${DIR_PV:-${PV}}"
VBOX_MOD_SRC_DIR="${S}/out/linux.${ARCH}/release/bin/additions/src"
pkg_setup() {
export DISTCC_DISABLE=1 #674256
MODULE_NAMES="vboxguest(misc:${VBOX_MOD_SRC_DIR}/vboxguest:${VBOX_MOD_SRC_DIR}/vboxguest)
vboxsf(misc:${VBOX_MOD_SRC_DIR}/vboxsf:${VBOX_MOD_SRC_DIR}/vboxsf)"
use X && MODULE_NAMES+=" vboxvideo(misc:${VBOX_MOD_SRC_DIR}/vboxvideo::${VBOX_MOD_SRC_DIR}/vboxvideo)"
linux-mod_pkg_setup
BUILD_PARAMS="KERN_DIR=/lib/modules/${KV_FULL}/build KERNOUT=${KV_OUT_DIR} KBUILD_EXTRA_SYMBOLS=${S}/Module.symvers"
}
src_prepare() {
# Remove shipped binaries (kBuild,yasm), see bug #232775
rm -r kBuild/bin tools || die
# Provide kernel sources
pushd src/VBox/Additions &>/dev/null || die
ebegin "Extracting guest kernel module sources"
kmk GuestDrivers-src vboxguest-src vboxsf-src vboxvideo-src &>/dev/null || die
eend
popd &>/dev/null || die
# PaX fixes (see bug #298988)
pushd "${VBOX_MOD_SRC_DIR}" &>/dev/null || die
eapply "${FILESDIR}"/vboxguest-6.0.6-log-use-c99.patch
popd &>/dev/null || die
# Disable things unused or splitted into separate ebuilds
cp "${FILESDIR}/${PN}-5-localconfig" LocalConfig.kmk || die
use X || echo "VBOX_WITH_X11_ADDITIONS :=" >> LocalConfig.kmk
# Remove pointless GCC version check
sed -e '/^check_gcc$/d' -i configure || die
eapply "${WORKDIR}/patches"
eapply_user
}
src_configure() {
# build the user-space tools, warnings are harmless
local cmd=(
./configure
--nofatal
--disable-xpcom
--disable-sdl-ttf
--disable-pulse
--disable-alsa
--with-gcc="$(tc-getCC)"
--with-g++="$(tc-getCXX)"
--target-arch=${ARCH}
--with-linux="${KV_OUT_DIR}"
--build-headless
)
echo "${cmd[@]}"
"${cmd[@]}" || die "configure failed"
source ./env.sh
export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
}
src_compile() {
MAKE="kmk" emake \
VBOX_BUILD_PUBLISHER=_Gentoo \
TOOL_GXX3_CC="$(tc-getCC)" TOOL_GXX3_CXX="$(tc-getCXX)" \
TOOL_GXX3_LD="$(tc-getCXX)" VBOX_GCC_OPT="${CXXFLAGS}" \
TOOL_YASM_AS=yasm \
VBOX_ONLY_ADDITIONS=1 \
KBUILD_VERBOSE=2
# Now creating the kernel modules. We must do this _after_
# we compiled the user-space tools as we need two of the
# automatically generated header files. (>=3.2.0)
linux-mod_src_compile
}
src_install() {
linux-mod_src_install
cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
insinto /sbin
newins mount.vboxsf mount.vboxsf
fperms 4755 /sbin/mount.vboxsf
newinitd "${FILESDIR}"/${PN}-8.initd-r1 ${PN}
insinto /usr/sbin/
newins VBoxService vboxguest-service
fperms 0755 /usr/sbin/vboxguest-service
insinto /usr/bin
doins VBoxControl
fperms 0755 /usr/bin/VBoxControl
# VBoxClient user service and xrandr wrapper
if use X ; then
doins VBoxClient
fperms 0755 /usr/bin/VBoxClient
pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null \
|| die
newins 98vboxadd-xclient VBoxClient-all
fperms 0755 /usr/bin/VBoxClient-all
popd &>/dev/null || die
fi
# udev rule for vboxdrv
local udev_rules_dir="/lib/udev/rules.d"
dodir ${udev_rules_dir}
echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
>> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
|| die
echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
>> "${ED}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
|| die
# VBoxClient autostart file
insinto /etc/xdg/autostart
doins "${FILESDIR}"/vboxclient.desktop
# sample xorg.conf
dodoc "${FILESDIR}"/xorg.conf.vbox
docompress -x "${ED}"/usr/share/doc/${PF}/xorg.conf.vbox
systemd_dounit "${FILESDIR}/${PN}.service"
}
pkg_postinst() {
linux-mod_pkg_postinst
if ! use X ; then
elog "use flag X is off, enable it to install the"
elog "X Window System video driver."
fi
elog ""
elog "Please add users to the \"vboxguest\" group so they can"
elog "benefit from seamless mode, auto-resize and clipboard."
elog ""
elog "The vboxsf group has been added to make automount services work."
elog "These services are part of the shared folders support."
elog ""
elog "Please add:"
elog "/etc/init.d/${PN}"
elog "to the default runlevel in order to start"
elog "needed services."
elog "To use the VirtualBox X driver, use the following"
elog "file as your /etc/X11/xorg.conf:"
elog " /usr/share/doc/${PF}/xorg.conf.vbox"
elog ""
elog "Also make sure you use the Mesa library for OpenGL:"
elog " eselect opengl set xorg-x11"
elog ""
elog "An autostart .desktop file has been installed to start"
elog "VBoxClient in desktop sessions."
elog ""
elog "You can mount shared folders with:"
elog " mount -t vboxsf <shared_folder_name> <mount_point>"
elog ""
elog "Warning:"
elog "this ebuild is only needed if you are running gentoo"
elog "inside a VirtualBox Virtual Machine, you don't need"
elog "it to run VirtualBox itself."
elog ""
}

@ -1,7 +1,7 @@
# Copyright 2021 Gentoo Authors
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit linux-mod systemd toolchain-funcs

@ -1,4 +1,2 @@
DIST vbox-kernel-module-src-6.1.24.tar.xz 674584 BLAKE2B 3a20f615426a7b788bc4bce00e416fa3822cbec3f00691651acd53b7c7bda8b43d3669195cececa83f1fc50a792e417adcd709d859497da143c4d93a2b414912 SHA512 220d57ab33a41464cd9e506d38390e60b9e67ca8262b1a13732f3d40820e038365c129eb7144f1932b8c2d3fdcea828de3070dd927788015301bf4aa59c1cc48
DIST vbox-kernel-module-src-6.1.28.tar.xz 674924 BLAKE2B 4a262a1609df493df8ba5b78d2daa225aed41fe51d54648633393dcb24ec648ae95f2fcb003f9a7ceb1a2a2ea99bc113d54db6621523ddfc3819e729c46f42c8 SHA512 b0fc1a1a821c93aa7dadd3a064d87938d31cf6ce37ab55d960fba104df4f28ab48797dc254e246af7bf1d5df913a9f329035941555fc9f165f02abea4448f684
DIST vbox-kernel-module-src-6.1.30.tar.xz 675180 BLAKE2B 7df02a4b94dd30d211538cffe7e08aa590f78fea79add4105ecaa2e6d0ac2b495d950bab4950f301100b189a58dd29d1fd42c97c12e4458a5953cb5a2ed7c44e SHA512 19f080bea53bc11eeb67bb894fdce3ee6cfc0e9bcd0e697baad86b4f49ac331b0dfcca9b043def8ef8a9d40d3b867f09e14ffafb4eef47418184cbfd0e9acc03
DIST vbox-kernel-module-src-6.1.32.tar.xz 675300 BLAKE2B fc843779ae9348203f2528009880e2d2dde65102c8be1837eb3a362e2703f9ecf54f7a10939318cbecbb41b4790a8b7d56c98ad82a4e83592b4c5491af0772b5 SHA512 e1c00be4fe2a0447c30ae0d380fc7a78fec1c3f52fb0cf0d20ccefcd174bf11097a91aa862ef8753be012e546a31555f5be9c1136cbaefc2240708b3adde7e5b
DIST vbox-kernel-module-src-6.1.34.tar.xz 675236 BLAKE2B 45385b4e60f7f5da8ebd2bb20ebc706ec8ac48e698dc62740ead31bd77e059bfb2980a83f8781832fe8e5faaade88db97c73f25096724ae4f29aba6daf04f7a0 SHA512 313dda056cb5e4020bfc9bafca2d05ab628aa740d174b9457f860ce0cd8eccaf557798cbb5fc1efeb36dc0f1f0320034ee86e48da03b33779eda1093b50d6c64

@ -1,55 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# XXX: the tarball here is just the kernel modules split out of the binary
# package that comes from virtualbox-bin
EAPI=7
inherit linux-mod toolchain-funcs
MY_P="vbox-kernel-module-src-${PV}"
DESCRIPTION="Kernel Modules for Virtualbox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
LICENSE="GPL-2"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE="pax-kernel"
RDEPEND="!=app-emulation/virtualbox-9999"
S="${WORKDIR}"
BUILD_TARGETS="all"
MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S})"
MODULESD_VBOXDRV_ENABLED="yes"
MODULESD_VBOXNETADP_ENABLED="no"
MODULESD_VBOXNETFLT_ENABLED="no"
pkg_setup() {
linux-mod_pkg_setup
BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KERN_DIR=${KV_DIR} KERN_VER=${KV_FULL} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
}
src_prepare() {
if use pax-kernel && kernel_is -ge 3 0 0 ; then
eapply -p0 "${FILESDIR}"/${PN}-5.2.8-pax-const.patch
fi
default
}
src_install() {
linux-mod_src_install
insinto /usr/lib/modules-load.d/
newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
}
pkg_postinst() {
# Remove vboxpci.ko from current running kernel
find /lib/modules/${KV_FULL}/misc -type f -name "vboxpci.ko" -delete
linux-mod_pkg_postinst
}

@ -1,55 +0,0 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# XXX: the tarball here is just the kernel modules split out of the binary
# package that comes from virtualbox-bin
EAPI=7
inherit linux-mod toolchain-funcs
MY_P="vbox-kernel-module-src-${PV}"
DESCRIPTION="Kernel Modules for Virtualbox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
LICENSE="GPL-2"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE="pax-kernel"
RDEPEND="!=app-emulation/virtualbox-9999"
S="${WORKDIR}"
BUILD_TARGETS="all"
MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S})"
MODULESD_VBOXDRV_ENABLED="yes"
MODULESD_VBOXNETADP_ENABLED="no"
MODULESD_VBOXNETFLT_ENABLED="no"
pkg_setup() {
linux-mod_pkg_setup
BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KERN_DIR=${KV_DIR} KERN_VER=${KV_FULL} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
}
src_prepare() {
if use pax-kernel && kernel_is -ge 3 0 0 ; then
eapply -p0 "${FILESDIR}"/${PN}-5.2.8-pax-const.patch
fi
default
}
src_install() {
linux-mod_src_install
insinto /usr/lib/modules-load.d/
newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
}
pkg_postinst() {
# Remove vboxpci.ko from current running kernel
find /lib/modules/${KV_FULL}/misc -type f -name "vboxpci.ko" -delete
linux-mod_pkg_postinst
}

@ -1,55 +0,0 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# XXX: the tarball here is just the kernel modules split out of the binary
# package that comes from VirtualBox-*.run
EAPI=7
inherit linux-mod toolchain-funcs
MY_P="vbox-kernel-module-src-${PV}"
DESCRIPTION="Kernel Modules for Virtualbox"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
LICENSE="GPL-2"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="~amd64"
IUSE="pax-kernel"
RDEPEND="!=app-emulation/virtualbox-9999"
S="${WORKDIR}"
BUILD_TARGETS="all"
MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S})"
MODULESD_VBOXDRV_ENABLED="yes"
MODULESD_VBOXNETADP_ENABLED="no"
MODULESD_VBOXNETFLT_ENABLED="no"
pkg_setup() {
linux-mod_pkg_setup
BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KERN_DIR=${KV_DIR} KERN_VER=${KV_FULL} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
}
src_prepare() {
if use pax-kernel && kernel_is -ge 3 0 0 ; then
eapply -p0 "${FILESDIR}"/${PN}-5.2.8-pax-const.patch
fi
default
}
src_install() {
linux-mod_src_install
insinto /usr/lib/modules-load.d/
newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
}
pkg_postinst() {
# Remove vboxpci.ko from current running kernel
find /lib/modules/${KV_FULL}/misc -type f -name "vboxpci.ko" -delete
linux-mod_pkg_postinst
}

@ -1,10 +1,10 @@
# Copyright 2021 Gentoo Authors
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# XXX: the tarball here is just the kernel modules split out of the binary
# package that comes from VirtualBox-*.run
EAPI=7
EAPI=8
inherit linux-mod toolchain-funcs

@ -1,5 +1,3 @@
DIST VirtualBox-6.1.24.tar.bz2 165754851 BLAKE2B 65bbc130281a745a00eee2a055dd59893e2f4b701cbdb31f4c45e2b7389f85f59d8a78ce1e03c83734a49b76fa61f56ea083a588874fa4023b723694f75ee8fb SHA512 cf2c5f58d2f160f8a22d94b7e30bcdaabd907661e05a72341bee93f5092b96c0c84d2291005f433040235227e3d6595ce0e66759c44c24eaedc6c9614646b3d6
DIST VirtualBox-6.1.28.tar.bz2 165774255 BLAKE2B fe66ab411ef8fd78ca7b5deb151b2bfc11f3625d54629e6768da9040297cea999c53873c94437f2a57b245e71db0e28bd2ad94ed557f8a1c1c674f477301e192 SHA512 d0eb49a82ec6ddb7ce7da362faf86254d324e73522001c44ab0f26a09ead3d9a800ce0d4ad3698853d4f9a4e9803ceb21f3bf50388a1855edcb2a42ce51f3a96
DIST VirtualBox-6.1.30.tar.bz2 165769447 BLAKE2B e15a8370c7cd83b547012639c3361da1b2ee40e8b094f11c22fadb95c9ddaae4791ee7cab16cb2eb23c6da4fc383f89f629335d577fa834fa1a979e19b9701bb SHA512 fab5b8327d9ad4186e584e90d1aca461d95731d0935509301e8adfe28d0737fb3ded5ac1d97e4cd1edc12c79bebb75cc675289762f9e918106f34bf6e8d363d4
DIST VirtualBox-6.1.32.tar.bz2 165758238 BLAKE2B 24873d7cc8bd306ea3552fe75379fbe7be767c85406042344eb047ed31184c3357aea07dda5e15c275f5036ae63106ef1d2e6524b143bc645a6b5ba0016f1391 SHA512 8bf7af6b8b4d3ba90f0e91589cf26400648436eb9da6d31c1a760460bfe5eb7311ac3220b4c9a98ac50e559641d3d5f559134be65288821038255de1c2c7ce1e
DIST VirtualBox-6.1.34.tar.bz2 165761216 BLAKE2B d3c8f7d3d6f408e4c4275c2b2815e92819c871359501ec4fa7212bf7cdc852613e2e4703d8650371097a5bc805efa04ea75bb03ab83d24a869a677555f6e22d5 SHA512 46d63a9fd9df76af654af59fab5cf555858bc2c4b5dc34e2378d85ae784e6380b6def4aab06909a9b5e114a7297269f90cfb2c3d8d6529b423d703afbad18c64
DIST virtualbox-6.1.12-patches-01.tar.xz 2528 BLAKE2B a5d7cde0daea41bee2e40e46569c725769927a31865d99d13b8b13c4903e59b4097f85da15dc592b9c7e8baf8ff805397af827620f107ba09a468b4d1198ecab SHA512 f71d10a9fbce99c3f631ef30bcfa9d0e017e702ac509541b039e08ccbcd024beb93fde09c43d90af5d9d28f6842a7947f20e7950d3897da3e6d57859657e1123

@ -0,0 +1,20 @@
https://www.virtualbox.org/ticket/20904
--- VirtualBox-6.1.34/Config.kmk
+++ VirtualBox-6.1.34/Config.kmk
@@ -4502,11 +4502,14 @@
TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL)
TEMPLATE_VBoxR0_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) \
$(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions \
- $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
+ $(VBOX_GCC_fno-stack-protector) -fno-common -ffreestanding $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) \
$(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions \
$(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \
-fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
+ if $(VBOX_GCC_VERSION_CC) >= 40500 # 4.1.2 complains, 4.5.2 is okay, didn't check which version inbetween made it okay with g++.
+TEMPLATE_VBoxR0_CXXFLAGS += -ffreestanding
+ endif
TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables -ffreestanding
TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables
TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -ffreestanding

@ -1,511 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{7..9} )
inherit desktop flag-o-matic java-pkg-opt-2 linux-info pax-utils python-single-r1 tmpfiles toolchain-funcs udev xdg
MY_PN="VirtualBox"
MY_PV="${PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
MY_P=${MY_PN}-${MY_PV}
[[ "${PV}" == *a ]] && DIR_PV="$(ver_cut 1-3)"
DESCRIPTION="Family of powerful x86 virtualization products for enterprise and home use"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${DIR_PV:-${MY_PV}}/${MY_P}.tar.bz2
https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-6.1.12-patches-01.tar.xz"
LICENSE="GPL-2 dtrace? ( CDDL )"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE="alsa debug doc dtrace headless java lvm +opus pam pax-kernel pch pulseaudio +opengl python +qt5 +sdk +udev vboxwebsrv vnc"
CDEPEND="
${PYTHON_DEPS}
!app-emulation/virtualbox-bin
acct-group/vboxusers
~app-emulation/virtualbox-modules-${DIR_PV:-${PV}}
dev-libs/libIDL
>=dev-libs/libxslt-1.1.19
net-misc/curl
dev-libs/libxml2
media-libs/libpng:0=
media-libs/libvpx:0=
sys-libs/zlib:=
!headless? (
media-libs/libsdl:0[X,video]
x11-libs/libX11
x11-libs/libxcb:=
x11-libs/libXcursor
x11-libs/libXext
x11-libs/libXmu
x11-libs/libXt
opengl? (
media-libs/libglvnd[X]
virtual/glu
)
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtprintsupport:5
dev-qt/qtwidgets:5
dev-qt/qtx11extras:5
opengl? ( dev-qt/qtopengl:5 )
x11-libs/libXinerama
)
)
dev-libs/openssl:0=
virtual/libcrypt:=
lvm? ( sys-fs/lvm2 )
opus? ( media-libs/opus )
udev? ( >=virtual/udev-171 )
vnc? ( >=net-libs/libvncserver-0.9.9 )
"
DEPEND="
${CDEPEND}
alsa? ( >=media-libs/alsa-lib-1.0.13 )
!headless? (
x11-libs/libXinerama
opengl? ( virtual/opengl )
)
pam? ( sys-libs/pam )
pax-kernel? ( sys-apps/elfix )
pulseaudio? ( media-sound/pulseaudio )
qt5? ( dev-qt/linguist-tools:5 )
vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
"
BDEPEND="
${PYTHON_DEPS}
>=dev-util/kbuild-0.1.9998.3127
>=dev-lang/yasm-0.6.2
sys-devel/bin86
sys-libs/libcap
sys-power/iasl
virtual/pkgconfig
doc? (
app-text/docbook-sgml-dtd:4.4
dev-texlive/texlive-basic
dev-texlive/texlive-latex
dev-texlive/texlive-latexrecommended
dev-texlive/texlive-latexextra
dev-texlive/texlive-fontsrecommended
dev-texlive/texlive-fontsextra
)
java? ( >=virtual/jdk-1.8 )
"
RDEPEND="
${CDEPEND}
java? ( >=virtual/jre-1.6 )
"
QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
usr/lib/virtualbox/VBoxSDL.so
usr/lib/virtualbox/VBoxSharedFolders.so
usr/lib/virtualbox/VBoxDD2.so
usr/lib/virtualbox/VBoxOGLrenderspu.so
usr/lib/virtualbox/VBoxPython.so
usr/lib/virtualbox/VBoxDD.so
usr/lib/virtualbox/VBoxDDU.so
usr/lib/virtualbox/VBoxREM64.so
usr/lib/virtualbox/VBoxSharedClipboard.so
usr/lib/virtualbox/VBoxHeadless.so
usr/lib/virtualbox/VBoxRT.so
usr/lib/virtualbox/VBoxREM.so
usr/lib/virtualbox/VBoxSettings.so
usr/lib/virtualbox/VBoxKeyboard.so
usr/lib/virtualbox/VBoxSharedCrOpenGL.so
usr/lib/virtualbox/VBoxVMM.so
usr/lib/virtualbox/VirtualBox.so
usr/lib/virtualbox/VBoxOGLhosterrorspu.so
usr/lib/virtualbox/components/VBoxC.so
usr/lib/virtualbox/components/VBoxSVCM.so
usr/lib/virtualbox/components/VBoxDDU.so
usr/lib/virtualbox/components/VBoxRT.so
usr/lib/virtualbox/components/VBoxREM.so
usr/lib/virtualbox/components/VBoxVMM.so
usr/lib/virtualbox/VBoxREM32.so
usr/lib/virtualbox/VBoxPython2_7.so
usr/lib/virtualbox/VBoxXPCOMC.so
usr/lib/virtualbox/VBoxOGLhostcrutil.so
usr/lib/virtualbox/VBoxNetDHCP.so
usr/lib/virtualbox/VBoxNetNAT.so"
S="${WORKDIR}/${MY_PN}-${DIR_PV:-${MY_PV}}"
REQUIRED_USE="
java? ( sdk )
python? ( sdk )
vboxwebsrv? ( java )
${PYTHON_REQUIRED_USE}
"
pkg_pretend() {
if ! use headless && ! use qt5 ; then
einfo "No USE=\"qt5\" selected, this build will not include any Qt frontend."
elif use headless && use qt5 ; then
einfo "You selected USE=\"headless qt5\", defaulting to"
einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
fi
if ! use opengl ; then
einfo "No USE=\"opengl\" selected, this build will lack"
einfo "the OpenGL feature."
fi
if ! use python ; then
einfo "You have disabled the \"python\" USE flag. This will only"
einfo "disable the python bindings being installed."
fi
}
pkg_setup() {
java-pkg-opt-2_pkg_setup
python-single-r1_pkg_setup
tc-ld-disable-gold #bug 488176
tc-export CC CXX LD AR RANLIB
export HOST_CC="$(tc-getBUILD_CC)"
}
src_prepare() {
# Remove shipped binaries (kBuild,yasm), see bug #232775
rm -r kBuild/bin tools || die
# Replace pointless GCC version check with something less stupid.
# This is needed for the qt5 version check.
sed -e 's@^check_gcc$@cc_maj="$(${CC} -dumpversion | cut -d. -f1)" ; cc_min="$(${CC} -dumpversion | cut -d. -f2)"@' \
-i configure || die
# Disable things unused or split into separate ebuilds
sed -e "s@MY_LIBDIR@$(get_libdir)@" \
"${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
if ! use pch ; then
# bug #753323
echo -e "VBOX_WITHOUT_PRECOMPILED_HEADERS=1\r\n" >> LocalConfig.kmk || die
fi
# Respect LDFLAGS
sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
-i Config.kmk src/libs/xpcom18a4/Config.kmk || die
# Do not use hard-coded ld (related to bug #488176)
sed -e '/QUIET)ld /s@ld @$(LD) @' \
-i src/VBox/Devices/PC/ipxe/Makefile.kmk || die
# Use PAM only when pam USE flag is enbaled (bug #376531)
if ! use pam ; then
einfo "Disabling PAM removes the possibility to use the VRDP features."
sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
src/VBox/HostServices/Makefile.kmk || die
fi
# add correct java path
if use java ; then
sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
-i "${S}"/Config.kmk || die
java-pkg-opt-2_src_prepare
fi
# Only add nopie patch when we're on hardened
if gcc-specs-pie ; then
eapply "${FILESDIR}/050_virtualbox-5.2.8-nopie.patch"
fi
# Only add paxmark patch when we're on pax-kernel
if use pax-kernel ; then
eapply "${FILESDIR}"/virtualbox-5.2.8-paxmark-bldprogs.patch
fi
eapply "${WORKDIR}/patches"
default
}
doecho() {
echo "$@"
"$@" || die
}
src_configure() {
local myconf=(
--with-gcc="$(tc-getCC)"
--with-g++="$(tc-getCXX)"
--disable-dbus
--disable-kmods
$(usex alsa '' --disable-alsa)
$(usex debug --build-debug '')
$(usex doc '' --disable-docs)
$(usex java '' --disable-java)
$(usex lvm '' --disable-devmapper)
$(usex opus '' --disable-libopus)
$(usex pulseaudio '' --disable-pulse)
$(usex python '' --disable-python)
$(usex vboxwebsrv --enable-webservice '')
$(usex vnc --enable-vnc '')
)
if ! use headless ; then
myconf+=(
$(usex opengl '' --disable-opengl)
$(usex qt5 '' --disable-qt)
)
else
myconf+=(
--build-headless
--disable-opengl
)
fi
if use amd64 && ! has_multilib_profile ; then
myconf+=( --disable-vmmraw )
fi
# not an autoconf script
doecho ./configure "${myconf[@]}"
}
src_compile() {
source ./env.sh || die
# Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
MAKEJOBS=$(grep -Eo '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS}) #'
MAKELOAD=$(grep -Eo '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS}) #'
MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
MAKE="kmk" emake \
VBOX_BUILD_PUBLISHER=_Gentoo \
TOOL_GXX3_CC="$(tc-getCC)" TOOL_GXX3_CXX="$(tc-getCXX)" \
TOOL_GXX3_LD="$(tc-getCXX)" VBOX_GCC_OPT="${CXXFLAGS}" \
TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
VBOX_WITH_VBOXIMGMOUNT=1 \
all
}
src_install() {
cd "${S}"/out/linux.${ARCH}/$(usex debug debug release)/bin || die
local vbox_inst_path="/usr/$(get_libdir)/${PN}" each size ico icofile
vbox_inst() {
local binary="${1}"
local perms="${2:-0750}"
local path="${3:-${vbox_inst_path}}"
[[ -n "${binary}" ]] || die "vbox_inst: No binary given!"
[[ ${perms} =~ ^[[:digit:]]+{4}$ ]] || die "vbox_inst: perms must consist of four digits."
insinto ${path}
doins ${binary}
fowners root:vboxusers ${path}/${binary}
fperms ${perms} ${path}/${binary}
}
# Create configuration files
insinto /etc/vbox
newins "${FILESDIR}/${PN}-4-config" vbox.cfg
# Set the correct libdir
sed \
-e "s@MY_LIBDIR@$(get_libdir)@" \
-i "${ED}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
# Install the wrapper script
exeinto ${vbox_inst_path}
newexe "${FILESDIR}/${PN}-ose-6-wrapper" "VBox"
fowners root:vboxusers ${vbox_inst_path}/VBox
fperms 0750 ${vbox_inst_path}/VBox
# Install binaries and libraries
insinto ${vbox_inst_path}
doins -r components
for each in VBox{Autostart,BalloonCtrl,BugReport,CpuReport,ExtPackHelperApp,Manage,SVC,Tunctl,VMMPreload,XPCOMIPCD} vboximg-mount *so *r0 iPxeBaseBin ; do
vbox_inst ${each}
done
# These binaries need to be suid root.
for each in VBox{Headless,Net{AdpCtl,DHCP,NAT}} ; do
vbox_inst ${each} 4750
done
# Install EFI Firmware files (bug #320757)
for each in VBoxEFI{32,64}.fd ; do
vbox_inst ${each} 0644
done
# VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
# VBoxXPCOMIPCD (bug #524202)
for each in VBox{Headless,Manage,SVC,XPCOMIPCD} ; do
pax-mark -m "${ED}"${vbox_inst_path}/${each}
done
# Symlink binaries to the shipped wrapper
for each in vbox{autostart,balloonctrl,bugreport,headless,manage} VBox{Autostart,BalloonCtrl,BugReport,Headless,Manage,VRDP} ; do
dosym ${vbox_inst_path}/VBox /usr/bin/${each}
done
dosym ${vbox_inst_path}/VBoxTunctl /usr/bin/VBoxTunctl
dosym ${vbox_inst_path}/vboximg-mount /usr/bin/vboximg-mount
if use pam ; then
# VRDPAuth only works with this (bug #351949)
dosym VBoxAuth.so ${vbox_inst_path}/VRDPAuth.so
fi
# set an env-variable for 3rd party tools
echo -n "VBOX_APP_HOME=${vbox_inst_path}" > "${T}/90virtualbox"
doenvd "${T}/90virtualbox"
if ! use headless ; then
vbox_inst rdesktop-vrdp
vbox_inst VBoxSDL 4750
pax-mark -m "${ED}"${vbox_inst_path}/VBoxSDL
for each in vboxsdl VBoxSDL ; do
dosym ${vbox_inst_path}/VBox /usr/bin/${each}
done
if use qt5 ; then
vbox_inst VirtualBox
vbox_inst VirtualBoxVM 4750
for each in VirtualBox{,VM} ; do
pax-mark -m "${ED}"${vbox_inst_path}/${each}
done
if use opengl ; then
vbox_inst VBoxTestOGL
pax-mark -m "${ED}"${vbox_inst_path}/VBoxTestOGL
fi
for each in virtualbox{,vm} VirtualBox{,VM} ; do
dosym ${vbox_inst_path}/VBox /usr/bin/${each}
done
insinto /usr/share/${PN}
doins -r nls
doins -r UnattendedTemplates
domenu ${PN}.desktop
fi
pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
for size in 16 32 48 64 128 ; do
newicon -s ${size} ${PN}-${size}px.png ${PN}.png
done
newicon ${PN}-48px.png ${PN}.png
doicon -s scalable ${PN}.svg
popd &>/dev/null || die
pushd "${S}"/src/VBox/Artwork/other &>/dev/null || die
for size in 16 24 32 48 64 72 96 128 256 512 ; do
for ico in hdd ova ovf vbox{,-extpack} vdi vdh vmdk ; do
icofile="${PN}-${ico}-${size}px.png"
if [[ -f "${icofile}" ]] ; then
newicon -s ${size} ${icofile} ${PN}-${ico}.png
fi
done
done
popd &>/dev/null || die
fi
if use lvm ; then
vbox_inst VBoxVolInfo 4750
dosym ${vbox_inst_path}/VBoxVolInfo /usr/bin/VBoxVolInfo
fi
if use sdk ; then
insinto ${vbox_inst_path}
doins -r sdk
if use java ; then
java-pkg_regjar "${ED}/${vbox_inst_path}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
java-pkg_regso "${ED}/${vbox_inst_path}/libvboxjxpcom.so"
fi
fi
if use udev ; then
local udevdir="$(get_udevdir)"
insinto ${udevdir}
doins VBoxCreateUSBNode.sh
fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
insinto ${udevdir}/rules.d
sed "s@%UDEVDIR%@${udevdir}@" "${FILESDIR}"/10-virtualbox.rules \
> "${T}"/10-virtualbox.rules || die
doins "${T}"/10-virtualbox.rules
fi
if use vboxwebsrv ; then
vbox_inst vboxwebsrv
dosym ${vbox_inst_path}/VBox /usr/bin/vboxwebsrv
newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
fi
# Remove dead symlinks (bug #715338)
find "${ED}"/usr/$(get_libdir)/${PN} -xtype l -delete || die
# Fix version string in extensions or else they don't get accepted
# by the virtualbox host process (see bug #438930)
find ExtensionPacks -type f -name "ExtPack.xml" -print0 \
| xargs --no-run-if-empty --null sed -i '/Version/s@_Gentoo@@' \
|| die
local extensions_dir="${vbox_inst_path}/ExtensionPacks"
if use vnc ; then
insinto ${extensions_dir}
doins -r ExtensionPacks/VNC
fi
if use dtrace ; then
insinto ${extensions_dir}
doins -r ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack
fi
if use doc ; then
dodoc UserManual.pdf
fi
newtmpfiles "${FILESDIR}"/${PN}-vboxusb_tmpfilesd ${PN}-vboxusb.conf
}
pkg_postinst() {
xdg_pkg_postinst
if use udev ; then
udevadm control --reload-rules \
&& udevadm trigger --subsystem-match=usb
fi
tmpfiles_process virtualbox-vboxusb.conf
if ! use headless && use qt5 ; then
elog "To launch VirtualBox just type: \"virtualbox\"."
fi
elog "You must be in the vboxusers group to use VirtualBox."
elog ""
elog "The latest user manual is available for download at:"
elog "http://download.virtualbox.org/virtualbox/${DIR_PV:-${PV}}/UserManual.pdf"
elog ""
elog "For advanced networking setups you should emerge:"
elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
elog ""
elog "Starting with version 4.0.0, ${PN} has USB-1 support."
elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
elog " app-emulation/virtualbox-extpack-oracle"
elog "package."
elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and"
elog "the \"extension\" USE flag. For installation of the guest additions ISO"
elog "image, please emerge"
elog " app-emulation/virtualbox-additions"
elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge"
elog " app-emulation/virtualbox-extpack-oracle"
if ! use udev ; then
elog ""
elog "WARNING!"
elog "Without USE=udev, USB devices will likely not work in ${PN}."
elif [[ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ]] ; then
elog ""
elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
elog "or else USB in ${PN} won't work."
fi
}

@ -1,513 +0,0 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8..10} )
inherit desktop flag-o-matic java-pkg-opt-2 linux-info pax-utils python-single-r1 tmpfiles toolchain-funcs udev xdg
MY_PN="VirtualBox"
MY_PV="${PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
MY_P=${MY_PN}-${MY_PV}
[[ "${PV}" == *a ]] && DIR_PV="$(ver_cut 1-3)"
DESCRIPTION="Family of powerful x86 virtualization products for enterprise and home use"
HOMEPAGE="https://www.virtualbox.org/"
SRC_URI="https://download.virtualbox.org/virtualbox/${DIR_PV:-${MY_PV}}/${MY_P}.tar.bz2
https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-6.1.12-patches-01.tar.xz"
LICENSE="GPL-2 dtrace? ( CDDL )"
SLOT="0/$(ver_cut 1-2)"
[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
KEYWORDS="amd64"
IUSE="alsa debug doc dtrace headless java lvm +opus pam pax-kernel pch pulseaudio +opengl python +qt5 +sdk +udev vboxwebsrv vnc"
COMMON_DEPEND="
${PYTHON_DEPS}
!app-emulation/virtualbox-bin
acct-group/vboxusers
~app-emulation/virtualbox-modules-${DIR_PV:-${PV}}
dev-libs/libIDL
>=dev-libs/libxslt-1.1.19
net-misc/curl
dev-libs/libxml2
media-libs/libpng:0=
media-libs/libvpx:0=
sys-libs/zlib:=
!headless? (
media-libs/libsdl:0[X,video]
x11-libs/libX11
x11-libs/libxcb:=
x11-libs/libXcursor
x11-libs/libXext
x11-libs/libXmu
x11-libs/libXt
opengl? (
media-libs/libglvnd[X]
virtual/glu
)
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtprintsupport:5
dev-qt/qtwidgets:5
dev-qt/qtx11extras:5
opengl? ( dev-qt/qtopengl:5 )
x11-libs/libXinerama
)
)
dev-libs/openssl:0=
virtual/libcrypt:=
lvm? ( sys-fs/lvm2 )
opus? ( media-libs/opus )
udev? ( >=virtual/udev-171 )
vnc? ( >=net-libs/libvncserver-0.9.9 )
"
DEPEND="
${COMMON_DEPEND}
alsa? ( >=media-libs/alsa-lib-1.0.13 )
!headless? (
x11-libs/libXinerama
opengl? ( virtual/opengl )
)
pam? ( sys-libs/pam )
pax-kernel? ( sys-apps/elfix )
pulseaudio? ( media-sound/pulseaudio )
qt5? ( dev-qt/linguist-tools:5 )
vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
"
BDEPEND="
${PYTHON_DEPS}
>=dev-util/kbuild-0.1.9998.3127
>=dev-lang/yasm-0.6.2
sys-devel/bin86
sys-libs/libcap
sys-power/iasl
virtual/pkgconfig
doc? (
app-text/docbook-sgml-dtd:4.4
dev-texlive/texlive-basic
dev-texlive/texlive-latex
dev-texlive/texlive-latexrecommended
dev-texlive/texlive-latexextra
dev-texlive/texlive-fontsrecommended
dev-texlive/texlive-fontsextra
)
java? ( >=virtual/jdk-1.8 )
"
RDEPEND="
${COMMON_DEPEND}
java? ( >=virtual/jre-1.6 )
"
QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
usr/lib/virtualbox/VBoxSDL.so
usr/lib/virtualbox/VBoxSharedFolders.so
usr/lib/virtualbox/VBoxDD2.so
usr/lib/virtualbox/VBoxOGLrenderspu.so
usr/lib/virtualbox/VBoxPython.so
usr/lib/virtualbox/VBoxDD.so
usr/lib/virtualbox/VBoxDDU.so
usr/lib/virtualbox/VBoxREM64.so
usr/lib/virtualbox/VBoxSharedClipboard.so
usr/lib/virtualbox/VBoxHeadless.so
usr/lib/virtualbox/VBoxRT.so
usr/lib/virtualbox/VBoxREM.so
usr/lib/virtualbox/VBoxSettings.so
usr/lib/virtualbox/VBoxKeyboard.so
usr/lib/virtualbox/VBoxSharedCrOpenGL.so
usr/lib/virtualbox/VBoxVMM.so
usr/lib/virtualbox/VirtualBox.so
usr/lib/virtualbox/VBoxOGLhosterrorspu.so
usr/lib/virtualbox/components/VBoxC.so
usr/lib/virtualbox/components/VBoxSVCM.so
usr/lib/virtualbox/components/VBoxDDU.so
usr/lib/virtualbox/components/VBoxRT.so
usr/lib/virtualbox/components/VBoxREM.so
usr/lib/virtualbox/components/VBoxVMM.so
usr/lib/virtualbox/VBoxREM32.so
usr/lib/virtualbox/VBoxPython2_7.so
usr/lib/virtualbox/VBoxXPCOMC.so
usr/lib/virtualbox/VBoxOGLhostcrutil.so
usr/lib/virtualbox/VBoxNetDHCP.so
usr/lib/virtualbox/VBoxNetNAT.so"
S="${WORKDIR}/${MY_PN}-${DIR_PV:-${MY_PV}}"
REQUIRED_USE="
java? ( sdk )
python? ( sdk )
vboxwebsrv? ( java )
${PYTHON_REQUIRED_USE}
"
pkg_pretend() {
if ! use headless && ! use qt5 ; then
einfo "No USE=\"qt5\" selected, this build will not include any Qt frontend."
elif use headless && use qt5 ; then
einfo "You selected USE=\"headless qt5\", defaulting to"
einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
fi
if ! use opengl ; then
einfo "No USE=\"opengl\" selected, this build will lack"
einfo "the OpenGL feature."
fi
if ! use python ; then
einfo "You have disabled the \"python\" USE flag. This will only"
einfo "disable the python bindings being installed."
fi
}
pkg_setup() {
java-pkg-opt-2_pkg_setup
python-single-r1_pkg_setup
tc-ld-disable-gold #bug 488176
tc-export CC CXX LD AR RANLIB
export HOST_CC="$(tc-getBUILD_CC)"
}
src_prepare() {
# Remove shipped binaries (kBuild,yasm), see bug #232775
rm -r kBuild/bin tools || die
# Replace pointless GCC version check with something less stupid.
# This is needed for the qt5 version check.
sed -e 's@^check_gcc$@cc_maj="$(${CC} -dumpversion | cut -d. -f1)" ; cc_min="$(${CC} -dumpversion | cut -d. -f2)"@' \
-i configure || die
# Disable things unused or split into separate ebuilds
sed -e "s@MY_LIBDIR@$(get_libdir)@" \
"${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
if ! use pch ; then
# bug #753323
echo -e "VBOX_WITHOUT_PRECOMPILED_HEADERS=1\r\n" >> LocalConfig.kmk || die
fi
# Respect LDFLAGS
sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
-i Config.kmk src/libs/xpcom18a4/Config.kmk || die
# Do not use hard-coded ld (related to bug #488176)
sed -e '/QUIET)ld /s@ld @$(LD) @' \
-i src/VBox/Devices/PC/ipxe/Makefile.kmk || die
# Use PAM only when pam USE flag is enbaled (bug #376531)
if ! use pam ; then
einfo "Disabling PAM removes the possibility to use the VRDP features."
sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
src/VBox/HostServices/Makefile.kmk || die
fi
# add correct java path
if use java ; then
sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
-i "${S}"/Config.kmk || die
java-pkg-opt-2_src_prepare
fi
# Only add nopie patch when we're on hardened
if gcc-specs-pie ; then
eapply "${FILESDIR}/050_virtualbox-5.2.8-nopie.patch"
fi
# Only add paxmark patch when we're on pax-kernel
if use pax-kernel ; then
eapply "${FILESDIR}"/virtualbox-5.2.8-paxmark-bldprogs.patch
fi
eapply "${FILESDIR}/${PN}-6.1.26-configure-include-qt5-path.patch" #805365
eapply "${WORKDIR}/patches"
default
}
doecho() {
echo "$@"
"$@" || die
}
src_configure() {
local myconf=(
--with-gcc="$(tc-getCC)"
--with-g++="$(tc-getCXX)"
--disable-dbus
--disable-kmods
$(usex alsa '' --disable-alsa)
$(usex debug --build-debug '')
$(usex doc '' --disable-docs)
$(usex java '' --disable-java)
$(usex lvm '' --disable-devmapper)
$(usex opus '' --disable-libopus)
$(usex pulseaudio '' --disable-pulse)
$(usex python '' --disable-python)
$(usex vboxwebsrv --enable-webservice '')
$(usex vnc --enable-vnc '')
)
if ! use headless ; then
myconf+=(
$(usex opengl '' --disable-opengl)
$(usex qt5 '' --disable-qt)
)
else
myconf+=(
--build-headless
--disable-opengl
)
fi
if use amd64 && ! has_multilib_profile ; then
myconf+=( --disable-vmmraw )
fi
# not an autoconf script
doecho ./configure "${myconf[@]}"
}
src_compile() {
source ./env.sh || die
# Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
MAKEJOBS=$(grep -Eo '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS}) #'
MAKELOAD=$(grep -Eo '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS}) #'
MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
MAKE="kmk" emake \
VBOX_BUILD_PUBLISHER=_Gentoo \
TOOL_GXX3_CC="$(tc-getCC)" TOOL_GXX3_CXX="$(tc-getCXX)" \
TOOL_GXX3_LD="$(tc-getCXX)" VBOX_GCC_OPT="${CXXFLAGS}" \
TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
VBOX_WITH_VBOXIMGMOUNT=1 \
all
}
src_install() {
cd "${S}"/out/linux.${ARCH}/$(usex debug debug release)/bin || die
local vbox_inst_path="/usr/$(get_libdir)/${PN}" each size ico icofile
vbox_inst() {
local binary="${1}"
local perms="${2:-0750}"
local path="${3:-${vbox_inst_path}}"
[[ -n "${binary}" ]] || die "vbox_inst: No binary given!"
[[ ${perms} =~ ^[[:digit:]]+{4}$ ]] || die "vbox_inst: perms must consist of four digits."
insinto ${path}
doins ${binary}
fowners root:vboxusers ${path}/${binary}
fperms ${perms} ${path}/${binary}
}
# Create configuration files
insinto /etc/vbox
newins "${FILESDIR}/${PN}-4-config" vbox.cfg
# Set the correct libdir
sed \
-e "s@MY_LIBDIR@$(get_libdir)@" \
-i "${ED}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
# Install the wrapper script
exeinto ${vbox_inst_path}
newexe "${FILESDIR}/${PN}-ose-6-wrapper" "VBox"
fowners root:vboxusers ${vbox_inst_path}/VBox
fperms 0750 ${vbox_inst_path}/VBox
# Install binaries and libraries
insinto ${vbox_inst_path}
doins -r components
for each in VBox{Autostart,BalloonCtrl,BugReport,CpuReport,ExtPackHelperApp,Manage,SVC,Tunctl,VMMPreload,XPCOMIPCD} vboximg-mount *so *r0 iPxeBaseBin ; do
vbox_inst ${each}
done
# These binaries need to be suid root.
for each in VBox{Headless,Net{AdpCtl,DHCP,NAT}} ; do
vbox_inst ${each} 4750
done
# Install EFI Firmware files (bug #320757)
for each in VBoxEFI{32,64}.fd ; do
vbox_inst ${each} 0644
done
# VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
# VBoxXPCOMIPCD (bug #524202)
for each in VBox{Headless,Manage,SVC,XPCOMIPCD} ; do
pax-mark -m "${ED}"${vbox_inst_path}/${each}
done
# Symlink binaries to the shipped wrapper
for each in vbox{autostart,balloonctrl,bugreport,headless,manage} VBox{Autostart,BalloonCtrl,BugReport,Headless,Manage,VRDP} ; do
dosym ${vbox_inst_path}/VBox /usr/bin/${each}
done
dosym ${vbox_inst_path}/VBoxTunctl /usr/bin/VBoxTunctl
dosym ${vbox_inst_path}/vboximg-mount /usr/bin/vboximg-mount
if use pam ; then
# VRDPAuth only works with this (bug #351949)
dosym VBoxAuth.so ${vbox_inst_path}/VRDPAuth.so
fi
# set an env-variable for 3rd party tools
echo -n "VBOX_APP_HOME=${vbox_inst_path}" > "${T}/90virtualbox"
doenvd "${T}/90virtualbox"
if ! use headless ; then
vbox_inst rdesktop-vrdp
vbox_inst VBoxSDL 4750
pax-mark -m "${ED}"${vbox_inst_path}/VBoxSDL
for each in vboxsdl VBoxSDL ; do
dosym ${vbox_inst_path}/VBox /usr/bin/${each}
done
if use qt5 ; then
vbox_inst VirtualBox
vbox_inst VirtualBoxVM 4750
for each in VirtualBox{,VM} ; do
pax-mark -m "${ED}"${vbox_inst_path}/${each}
done
if use opengl ; then
vbox_inst VBoxTestOGL
pax-mark -m "${ED}"${vbox_inst_path}/VBoxTestOGL
fi
for each in virtualbox{,vm} VirtualBox{,VM} ; do
dosym ${vbox_inst_path}/VBox /usr/bin/${each}
done
insinto /usr/share/${PN}
doins -r nls
doins -r UnattendedTemplates
domenu ${PN}.desktop
fi
pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
for size in 16 32 48 64 128 ; do
newicon -s ${size} ${PN}-${size}px.png ${PN}.png
done
newicon ${PN}-48px.png ${PN}.png
doicon -s scalable ${PN}.svg
popd &>/dev/null || die
pushd "${S}"/src/VBox/Artwork/other &>/dev/null || die
for size in 16 24 32 48 64 72 96 128 256 512 ; do
for ico in hdd ova ovf vbox{,-extpack} vdi vdh vmdk ; do
icofile="${PN}-${ico}-${size}px.png"
if [[ -f "${icofile}" ]] ; then
newicon -s ${size} ${icofile} ${PN}-${ico}.png
fi
done
done
popd &>/dev/null || die
fi
if use lvm ; then
vbox_inst VBoxVolInfo 4750
dosym ${vbox_inst_path}/VBoxVolInfo /usr/bin/VBoxVolInfo
fi
if use sdk ; then
insinto ${vbox_inst_path}
doins -r sdk
if use java ; then
java-pkg_regjar "${ED}/${vbox_inst_path}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
java-pkg_regso "${ED}/${vbox_inst_path}/libvboxjxpcom.so"
fi
fi
if use udev ; then
local udevdir="$(get_udevdir)"
insinto ${udevdir}
doins VBoxCreateUSBNode.sh
fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
insinto ${udevdir}/rules.d
sed "s@%UDEVDIR%@${udevdir}@" "${FILESDIR}"/10-virtualbox.rules \
> "${T}"/10-virtualbox.rules || die
doins "${T}"/10-virtualbox.rules
fi
if use vboxwebsrv ; then
vbox_inst vboxwebsrv
dosym ${vbox_inst_path}/VBox /usr/bin/vboxwebsrv
newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
fi
# Remove dead symlinks (bug #715338)
find "${ED}"/usr/$(get_libdir)/${PN} -xtype l -delete || die
# Fix version string in extensions or else they don't get accepted
# by the virtualbox host process (see bug #438930)
find ExtensionPacks -type f -name "ExtPack.xml" -print0 \
| xargs --no-run-if-empty --null sed -i '/Version/s@_Gentoo@@' \
|| die
local extensions_dir="${vbox_inst_path}/ExtensionPacks"
if use vnc ; then
insinto ${extensions_dir}
doins -r ExtensionPacks/VNC
fi
if use dtrace ; then
insinto ${extensions_dir}
doins -r ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack
fi
if use doc ; then
dodoc UserManual.pdf
fi
newtmpfiles "${FILESDIR}"/${PN}-vboxusb_tmpfilesd ${PN}-vboxusb.conf
}
pkg_postinst() {
xdg_pkg_postinst
if use udev ; then
udevadm control --reload-rules \
&& udevadm trigger --subsystem-match=usb
fi
tmpfiles_process virtualbox-vboxusb.conf
if ! use headless && use qt5 ; then
elog "To launch VirtualBox just type: \"virtualbox\"."
fi
elog "You must be in the vboxusers group to use VirtualBox."
elog ""
elog "The latest user manual is available for download at:"
elog "http://download.virtualbox.org/virtualbox/${DIR_PV:-${PV}}/UserManual.pdf"
elog ""
elog "For advanced networking setups you should emerge:"
elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
elog ""
elog "Starting with version 4.0.0, ${PN} has USB-1 support."
elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
elog " app-emulation/virtualbox-extpack-oracle"
elog "package."
elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and"
elog "the \"extension\" USE flag. For installation of the guest additions ISO"
elog "image, please emerge"
elog " app-emulation/virtualbox-additions"
elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge"
elog " app-emulation/virtualbox-extpack-oracle"
if ! use udev ; then
elog ""
elog "WARNING!"
elog "Without USE=udev, USB devices will likely not work in ${PN}."
elif [[ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ]] ; then
elog ""
elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
elog "or else USB in ${PN} won't work."
fi
}

@ -1,7 +1,7 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit desktop flag-o-matic java-pkg-opt-2 linux-info pax-utils python-single-r1 tmpfiles toolchain-funcs udev xdg
@ -101,37 +101,24 @@ RDEPEND="
java? ( >=virtual/jre-1.6 )
"
QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
usr/lib/virtualbox/VBoxSDL.so
usr/lib/virtualbox/VBoxSharedFolders.so
usr/lib/virtualbox/VBoxDD2.so
usr/lib/virtualbox/VBoxOGLrenderspu.so
usr/lib/virtualbox/VBoxPython.so
usr/lib/virtualbox/VBoxDD.so
usr/lib/virtualbox/VBoxDDU.so
usr/lib/virtualbox/VBoxREM64.so
usr/lib/virtualbox/VBoxSharedClipboard.so
usr/lib/virtualbox/VBoxHeadless.so
usr/lib/virtualbox/VBoxRT.so
usr/lib/virtualbox/VBoxREM.so
usr/lib/virtualbox/VBoxSettings.so
usr/lib/virtualbox/VBoxKeyboard.so
usr/lib/virtualbox/VBoxSharedCrOpenGL.so
usr/lib/virtualbox/VBoxVMM.so
usr/lib/virtualbox/VirtualBox.so
usr/lib/virtualbox/VBoxOGLhosterrorspu.so
usr/lib/virtualbox/components/VBoxC.so
usr/lib/virtualbox/components/VBoxSVCM.so
usr/lib/virtualbox/components/VBoxDDU.so
usr/lib/virtualbox/components/VBoxRT.so
usr/lib/virtualbox/components/VBoxREM.so
usr/lib/virtualbox/components/VBoxVMM.so
usr/lib/virtualbox/VBoxREM32.so
usr/lib/virtualbox/VBoxPython2_7.so
usr/lib/virtualbox/VBoxXPCOMC.so
usr/lib/virtualbox/VBoxOGLhostcrutil.so
usr/lib/virtualbox/VBoxNetDHCP.so
usr/lib/virtualbox/VBoxNetNAT.so"
QA_TEXTRELS="
usr/lib64/virtualbox/VMMR0.r0
"
QA_EXECSTACK="
usr/lib64/virtualbox/iPxeBaseBin
usr/lib64/virtualbox/VMMR0.r0
usr/lib64/virtualbox/VBoxDDR0.r0
"
QA_WX_LOAD="
usr/lib64/virtualbox/iPxeBaseBin
"
QA_PRESTRIPPED="
/usr/lib64/virtualbox/VMMR0.r0
/usr/lib64/virtualbox/VBoxDDR0.r0
"
S="${WORKDIR}/${MY_PN}-${DIR_PV:-${MY_PV}}"
@ -142,6 +129,10 @@ REQUIRED_USE="
${PYTHON_REQUIRED_USE}
"
PATCHES=(
"${FILESDIR}/${P}-vboxr0.patch"
)
pkg_pretend() {
if ! use headless && ! use qt5 ; then
einfo "No USE=\"qt5\" selected, this build will not include any Qt frontend."
@ -426,14 +417,18 @@ src_install() {
if use udev ; then
local udevdir="$(get_udevdir)"
local udev_file="VBoxCreateUSBNode.sh"
local rules_file="10-virtualbox.rules"
insinto ${udevdir}
doins VBoxCreateUSBNode.sh
fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
doins ${udev_file}
fowners root:vboxusers ${udevdir}/${udev_file}
fperms 0750 ${udevdir}/${udev_file}
insinto ${udevdir}/rules.d
sed "s@%UDEVDIR%@${udevdir}@" "${FILESDIR}"/10-virtualbox.rules \
> "${T}"/10-virtualbox.rules || die
doins "${T}"/10-virtualbox.rules
sed "s@%UDEVDIR%@${udevdir}@" "${FILESDIR}"/${rules_file} \
> "${T}"/${rules_file} || die
doins "${T}"/${rules_file}
fi
if use vboxwebsrv ; then
@ -506,9 +501,5 @@ pkg_postinst() {
elog ""
elog "WARNING!"
elog "Without USE=udev, USB devices will likely not work in ${PN}."
elif [[ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ]] ; then
elog ""
elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
elog "or else USB in ${PN} won't work."
fi
}

@ -415,6 +415,10 @@ src_prepare() {
sed -e 's/$(ABI_DUMPER) /echo /g' \
-i tools/libs/libs.mk || die
# Remove -Werror
find . -type f \( -name Makefile -o -name "*.mk" \) \
-exec sed -i "s/-Werror //g" {} + || die
default
}

@ -114,38 +114,51 @@ src_prepare() {
default
}
xen_make() {
# Setting clang to either 'y' or 'n' tells Xen's build system
# whether or not clang is used.
local clang=n
if tc-is-clang; then
clang=y
fi
# Send raw LDFLAGS so that --as-needed works
emake \
V=1 \
LDFLAGS="$(raw-ldflags)" \
HOSTCC="$(tc-getBUILD_CC)" \
HOSTCXX="$(tc-getBUILD_CXX)" \
clang="${clang}" \
"$@"
}
src_configure() {
cd xen || die
touch gentoo-config || die
if use arm; then
echo "CONFIG_EARLY_PRINTK=sun7i" > gentoo-config || die
echo "CONFIG_EARLY_PRINTK=sun7i" >> gentoo-config || die
fi
if use debug; then
echo "CONFIG_DEBUG=y" > gentoo-config || die
cat <<-EOF >> gentoo-config || die
CONFIG_DEBUG=y
CONFIG_CRASH_DEBUG=y
EOF
fi
if use flask; then
echo "CONFIG_XSM=y" > gentoo-config || die
echo "CONFIG_XSM=y" >> gentoo-config || die
fi
emake KCONFIG_ALLCONFIG=gentoo-config alldefconfig
# remove flags
unset CFLAGS
unset LDFLAGS
unset ASFLAGS
tc-ld-disable-gold # Bug 700374
xen_make KCONFIG_ALLCONFIG=gentoo-config alldefconfig
}
src_compile() {
# Send raw LDFLAGS so that --as-needed works
emake \
V=1 \
CC="$(tc-getCC)" \
LDFLAGS="$(raw-ldflags)" \
LD="$(tc-getLD)" \
-C xen
xen_make -C xen
}
src_install() {
@ -154,12 +167,7 @@ src_install() {
mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
fi
emake \
LDFLAGS="$(raw-ldflags)" \
LD="$(tc-getLD)" \
DESTDIR="${D}" \
-C xen \
install
xen_make DESTDIR="${D}" -C xen install
# make install likes to throw in some extra EFI bits if it built
use efi || rm -rf "${D}/usr/$(get_libdir)/efi"

Binary file not shown.

@ -1,4 +1,4 @@
# Copyright 2019-2021 Gentoo Authors
# Copyright 2019-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -11,7 +11,7 @@ SRC_URI="https://github.com/mgorny/pram/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 ~arm64 ppc64 x86 ~x64-macos"
KEYWORDS="amd64 ~arm64 ppc64 ~riscv x86 ~x64-macos"
IUSE="test"
RESTRICT="!test? ( test )"

Binary file not shown.

@ -1,3 +1,3 @@
DIST pico-8_0.2.4b_amd64.zip 10451591 BLAKE2B 7ed19ba04aac5626c4c6990cf6b33e2fa3724c49918bc49b1a5e561f681827d867be32cd6aadb5ad5f8715266e1fb887f0d7003744bcb9ae46e11e6eef070ef3 SHA512 f618749f1ae558503eeda7c7fba515fb106258e78feb9088751b952fac603e14b54b913f92a2a7898f0d2c039e208e5c8b6354a1c8587cc9471997fe2a1d10d7
DIST pico-8_0.2.4b_i386.zip 9756611 BLAKE2B 9074915f4a27abe3bb68b1327c778a2ce74ce91feda27cc07df2198b202bf2b3750c73fbf38db15b12adaef598ae7038b06419ffae99bad91a015c01e27e7ee2 SHA512 2364700713d3d3cdff5e651ce8f42761b40163da1a77c0c47671fa3ffdceaaf2d81c3ef79d7d8125c100224c2d1219d946f4e46b2ce8a7efece7239398f86de0
DIST pico-8_0.2.4b_raspi.zip 13972213 BLAKE2B 70ce42c58e2551fa79c2fe3a55622b3ab6bf4657202821117d075f330fea372a4d280b0b982d17cef199013194eaf6f29c9b40f048bf9ab44540697b52c66306 SHA512 7fbe5288dedea97f181e662cffc5c6059e9fc9aa2dd652677df170cbafb9487898b82a1ff7b84547942ba592edae02b8f649c94e0cb95850b6494d1f5d841006
DIST pico-8_0.2.4c_amd64.zip 10503440 BLAKE2B 0bb2997c56ed80385a2d69e24416c969ed33c122a0c751a41eeea8569817e393e9a7b6290caf2a560665121b18c6d00a948e946ef5b20570fe49d34f34697049 SHA512 451d72988c4c0af01ad6298ee02e0f18584076e2df2b00b72de63ea517129cf4bc613b1be67c533fb328bf9d3aa66f3c4ca86d03c5561438d3555688a05ef508
DIST pico-8_0.2.4c_i386.zip 9806731 BLAKE2B 60b1fe0adb00d524bc67cbf42ff56ebf656c8d4c8ac6440aa924723862a988d86346ea978741a56b221352f16bc88b551149d9fe85e6924901d81f1bb1e8094a SHA512 2d96494054e786ab2638e06da5e861ab8a4bfae6608811da481aa05d720807e620cb2059633f4c4194e3c2cd6a5a22c4ba2b9257e4d1712c1842e0dff5b1c203
DIST pico-8_0.2.4c_raspi.zip 14027914 BLAKE2B c32be57ce016cd13f7a6fcfacc185665af5d741ceb3886eb8bd66620ff48d084994f708ba7b6e9c51d8e58461cc839667c1bf912209bd4b9613d26ccc98f28bc SHA512 f7c3185dd58ea00a761ddf632ade3fc8c19bc6251bd1c4ba02e6e07cb02fc0fa22e394a398377fde01d77a655350f8cdcdac3390218a9e0e9d78baf4fb2fa313

@ -1,53 +1,25 @@
DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381998256a1a002d316b38288349884d5960de35c49352d03129ed0bae599e641ec2225898158ebce50a7a2fd74d2c SHA512 a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c
DIST Python-2.7.18.tar.xz.asc 833 BLAKE2B 1d98770e46171971fb99994508d238c01d2755281d2f94353314014d9e83e0ec5f0b3e3950ea1fdf5fce9ba6b8f55312355845c2a3fc4291c27ee56fe6215448 SHA512 c2a5f5a52f47dec52460ad3275758d4e5de6e7075c3def4353c988d74d563a39b42cae2d5eb24e2a23a6247cef69100f91620b11a49c2359fbf99b203c9cbda8
DIST Python-3.10.0.tar.xz 18726176 BLAKE2B 77143edf733cadf7e52327a58782f0617b1dd0d132cf58e0f26d37a454bb97f82e7931118a6a71f22779d9b6ec4efca974c43c19a6338b4b24a9fd616b60cc89 SHA512 82b2729afc7d72a80882f199970667dce7d971a2e5ecfe6cf84f7b68612ab2caf6ed6d7a8cb81f24ea85cb0816464bb2e8b2e6884eda62fa40742edc674193bd
DIST Python-3.10.0.tar.xz.asc 833 BLAKE2B 295df19932ea076bb1a50acb38782055ff34fb235df0380fa361727eedb3ca68aeca2a31419de5b05ce128c2e21ad04605c226e7a61d508a17607f615e46e570 SHA512 67236e02bc49da1423717cb54216b745f613ba2fc4b372a4aa15a36ab15fe69d9b9087070382957d480df7576d13056caedcd979fb56531799a1190b822f673d
DIST Python-3.10.1.tar.xz 18775460 BLAKE2B d2dbf875ef5f9cee6dfd66e2d2489b884813c6a4eb3ef4da25713361efebb9ab271dc7050de25d4b07808bd3fd510700975c733ca8f283caa7426d16f273a93d SHA512 1c559e33f1252e51bafb941c380de16f142c0735858363c84cb8dbed6767843de3af126889c2826ffb94bd4777d7cdfc31040301c8c74de56af52b80b1aa9e76
DIST Python-3.10.1.tar.xz.asc 833 BLAKE2B a5678c522b486a246993616ee36ddb3f74a093fb5729d8d2da3cfc4de5c3e1fcf3f4f55504b7bbf929050204d22a89ff3c7750b599034a3d5c941666f54fcad4 SHA512 645d5f40e6e80a590923a48763f20dea7da3f3eea5825bb79e08618d81d1b8eee0ddee2b57503321a584280536e0671e4913e5ad450568fbbb44509c01d3907d
DIST Python-3.10.2.tar.xz 18780936 BLAKE2B ce202f7b45858b88ffdefe8217422fa9dccccc58000c6f3d40c9791d28ab58f67fa033b5102cacaf0ccec5524510becec9870c9bf5238b78203a0a354e8f526c SHA512 215a7159face84788fe547c1e2689b8d0ae510275157cf01636bef2902d0ff465f844eb0328c9f39fd1cd03a1d1736d4cf258992f2788e492a801a372032c08b
DIST Python-3.10.2.tar.xz.asc 833 BLAKE2B ff3b1f8c1c62e75a00ac70bbe3a2e87406f0f44fba8bfa1ea5c0d8b8175a8720af62c57664bf50fa5f7ec7caeeb2669c17917e457daf43755f1583e92eb410ba SHA512 086aeaa999d3005cc1f9057d90230c7a9e65d80f436febf16b0e8ba6f49645870ef21170ca1af50c8e2f51e6f46338cfad73a2d91320ad4a3315a2ae87eb70b4
DIST Python-3.10.3.tar.xz 19343528 BLAKE2B 5234f14d3dbc1b7c43da65fbc242218c1f94601d13ca84419cd9b29eab22ab411b7cd043ebaabc2b2aa1856e5e91c3ecc42eaaf333f92b8e133844e09d515bdf SHA512 5020407798ebaae6002b8de29475c1064a32f1527a0e4ec6fe7fcf076b4ea3ef0ab4b4a7864a6081cc8dd01dd545123198b11cc8dd1259c670394b7d81f35a86
DIST Python-3.10.3.tar.xz.asc 833 BLAKE2B 03117464582146b78748ba129a10b7481607dd9dc7cdd38ced9f20e96c8c01722852941b6b7b58f34fd42b3709fc8bd31b7ba97d89235ce61d8f0ac89106d69b SHA512 ddbe55225fcdd5d36f6be4bb802ea8fb9c5e8cf1b573b76501cc0999bcbfb2355f5bf7bbe10bf7cb209e54f37ed0789b4b936920b208b2afc18597bab33f2f51
DIST Python-3.10.4.tar.xz 19342692 BLAKE2B c430ad9bed71729fda29433af0614b6c0110a85e23f4cb5cff3a9b501febe99b20094367a5428f256fb3aeef97f34d439ef677fc8ae4d596d52da7976b65ebb5 SHA512 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113
DIST Python-3.10.4.tar.xz.asc 833 BLAKE2B 289f2e96bfc2b60c4ae94b1591779d604f203890c4f5db2ee16e305bf03c6ddb9c8d6da4471a06b5943e12888f37ca572ea30876e9a80382a26814f66b41b7bf SHA512 699e37bf09067083af159e3734b38c952bdc75432c8abfb7a7b8cce7ca975038da37490abeb5c13befd2dacb84a5341ad30de5d0a63d35af5c512215744f4d6d
DIST Python-3.11.0a6.tar.xz 18754036 BLAKE2B af19b9f548891fa9c89899f83ea05579a0fd30d030575dfbc33f28d26ec7c97081d978462760bbf3a160ff2ff4b04127983c7b6a62062587e630eca7bafe6981 SHA512 867f7aabe10977ccf31bcfd6968fd8bb880cf5c3671bb70364a9b37296dae7ab017624446c64c12f7753b59c1ebda9e494bed5f946c5586b54fd86b0289d04ea
DIST Python-3.11.0a6.tar.xz.asc 833 BLAKE2B 30b26fcc60d77f189c8b6c7e87306f752de88366700a899f9a6a90e2a74c5a5259592a350eb812a338fd823994c066d0354285ba54a9e9421f400c9cf1c41b33 SHA512 c29bef3fa59ef304f420a18657fe3448211e4f742cc119937335aaad36b9898d965d84fc6ea8a2f9f27865e237cc929b9843663292c44dd7b3ae329aa3fab1e9
DIST Python-3.11.0a7.tar.xz 19362368 BLAKE2B e11ba447731b5e7a15f9c11e44ebf2555e67cdebd9c52b0d232fdcbf1c061a4ed9e528bf493d68a868b438c65b54b30f426da41009408df286bc1583ab0124cd SHA512 f193ff9dedece16a428db129f4aac9ee2ad5f73a7f7eda2063ed58bfe230a4bfef067fe6c03e2b26d01be1d3205cee8778489ea6543b74a9d2a1f415739a63ba
DIST Python-3.11.0a7.tar.xz.asc 833 BLAKE2B 33788f8855fd65fd27473a503c2e711fde6bbd52d0c812cdccd495daed2b3d3b1f93590d1b9aa87840326caf264a796875b626c06bd58060f070fe7c802dd10f SHA512 eae66913e3a5efe70a0c3639537e5b19cd66175a61f6e8b46b194411e27df2ea3f6a8154ed05c5905f511815f011e80c5b06b3a836ea8749cb9825f85223ecc2
DIST Python-3.7.12.tar.xz 17401916 BLAKE2B f01b5cc54cd0ffe2e8756767c624dda8d2fbf24e90f22a16b5a406dad995ef218613db10f0b3fb2da0ece50ccb02c8a8e007ceb0842ce9e93ee9df7348ef1528 SHA512 e1a5942908c1d1469c0ab129fb4287d4ba6eb2a030e88fd71c043fe187a1bc86c00878dab29147199617a361a0c60d9e720fe3bc58bc7bc4cc8ec4bb50c7ea2a
DIST Python-3.7.12.tar.xz.asc 833 BLAKE2B 587fcf019f4b07b811834d7279b9861eb709731a431be9cbe8f5b868ac72b6d9a4de8b24e3fefd6b339813299514a0ac12b5f627acd04c185ff8dea22a044723 SHA512 a47003dd5c784eca4e3c34dc8705d1171043e060f3a97e4dd63ce4aec2bceac56d7e808924d63b2a38f9a020bf799cf29e5055fb444b9b2c3f03976d47122355
DIST Python-3.7.13.tar.xz 18027980 BLAKE2B e5ea14e3b080e7a126a4faeaad9287a7b5cb6be138a0423b4dbfd1c3b07e452ed99aeb818380ab02e9967673b0855a4a81cec1fa5b9b919f8a4e45da70e9df3a SHA512 e95366b68c1bc1dc1cfb2d956f1f49c5d0f620b4780d03002b3c321d2788108eb4e51d224cfa6bcecf7d780e9024ab0ef88b422d6d25e983dbc56b2a89b7dce9
DIST Python-3.7.13.tar.xz.asc 833 BLAKE2B 1e09a904c07951ae10fc039935c3974dbe2d0a51fed40c6830f321e42f7ddab32a17afe1b35319982160e0fed47b1ff7663d0f18d0b4ae8e81a34298394462a9 SHA512 35c35bd386841fde4f7d614de84cdc05d8ba1377b224bbcd4d6de18a1c87969b23e1583ca9f4e673e0340350c7f59c80986f8ccf41ef573b6585320c90fde19b
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-3.8.13.tar.xz 19023016 BLAKE2B d3cb8624496e56d93d34f2aa5082746869a99210197529bc19e6a9d265f4ce246e0e83a3528a7602a28aac8855bf84e6bf6495b85e9202fcf04ef90600cb5e43 SHA512 5c732b5d21b189b99a0e9ccd3ae59466bed60a930d5d3f437a262d38f0797b776cecbf12a1852eaebcfb638a6f2e28e471cc2ebf94237cc728144be21842cb81
DIST Python-3.8.13.tar.xz.asc 833 BLAKE2B 918894777e1a783f2a7c7958a808610631cb7a6039df84675158e8d2fd66782f29921d44ab9b4625c4ca3821852e0d0e0005163b086c7d0c3d617e3a76cb7033 SHA512 6683c4ae6cf20a97a29165f96b9f5dd09d618892583650d803aa677240695968dfe344294fc33db68fd4669c82021afcc29a1f6afe49915be51fae281eeeedbe
DIST Python-3.9.10.tar.xz 19154136 BLAKE2B 4acd2dc26506592c776f9ed9fac22e5a8741ab700ec11aca93566425ab2a957392e6284f0818198e20088463c047502a07d3f5dadc8ed8689c316f823fb2d444 SHA512 09cb942f84bf362df88999ffa6faf89b4ad12302e67cda4a11547828ebe410c7c93a3dc96cd66fd9c5c7d9a1abe5b8e259e7ec47c10273b42d212270aca5ecba
DIST Python-3.9.10.tar.xz.asc 833 BLAKE2B ab6a514bc4ac5032f5209344d234491063bc3dc1ef9c3e4b66951deaff042e25bc830a301cff2a1b674ef4025526001f6e73c37b65d9d102da247660a419e2f7 SHA512 d9fed5b39100b81835085d712453516d309b0dddc1524d578cb63c95cd1e2392882702111dd3cb0ebf58c98b94ec04838c89c57f4a7a649c585f7ba5eef70e5e
DIST Python-3.9.11.tar.xz 19724780 BLAKE2B 25b017e36b22235790633eb1a88f52092225252f39963fc365c1ea863f5b5d98a796bceb01e5e34c02d9690f2a664959766b214b8c13350d6e22839218d0c097 SHA512 804e6e6b31922378f07f290023f6efc870c6fd3010204c499c2b375880f6e6ec0f72ce96a8fff81956f6fa3bea2123df2138ef0fda23a3d5d3cf757174a930c3
DIST Python-3.9.11.tar.xz.asc 833 BLAKE2B c60c291f3dad39c842d16717239006f3ee703eaa586d95ea02ba4486d20a1e82065bbaf7af6f7cf6a04799229359791a72834096b6ce5f5d2b583ba5962d441b SHA512 a84bbfa68ec1c0e45bbd64af4481be7d68885021287731c69346a3cb25c9bf607be84dd72af2d3a6fbeabbde64975f37c4bb4f61274e72b92b4277fa48543e52
DIST Python-3.9.12.tar.xz 19740524 BLAKE2B 05f2469aa53ca36221ef4976b17bfde3e5b86afd5a8114e5a7fd899f975a8e55022555ef718d5352ab68de1b7b23865a0bf713768c9c2b30d591438c9a396d25 SHA512 081981901e14149748fd35228db0b3b1d96fef227ae7404f07b8bad0fda4b02649bf31c348c94aefdaf3327565d78f9489437c2c02f647b15d41376a27a23e97
DIST Python-3.9.12.tar.xz.asc 833 BLAKE2B 33436d0404a643215a8fd2b967ffd216201da24f374941bf65b888159ccfabcbe79b751eca2dd489b06605604338c8bbaab74aa10abbe4bcffaa54236301228e SHA512 dddaa27f8a29034f458edb6739398a5455c87fe37b6349e161865a9deedca118ffe9cb82663cc75bbe60b3b556399c0c6855f5262aac1fe90d36a3694fca65b2
DIST Python-3.9.9.tar.xz 19144372 BLAKE2B 3a144ca5e4b11b2fd09d05a4a40ddf3f622c077338602c519b21ea827c96e0f14ab97563c0a9d306ae4a5c3f44753573a07474dc084fb364d24b2128bb378ddd SHA512 0ab29fb9a7ecb808bd08d84d28908d5a934e0f021853da0f7a9c94670eb30c8dbbc233d461afdb3995b0de59275ef7e1de43e82d7f848802cbd6e6e50b7b25a6
DIST Python-3.9.9.tar.xz.asc 833 BLAKE2B 41d05ee1ec256f0cab4e9d3540877783745f0f30e3f1177d01096b352341a90893c5c9523926bed8176bd304cbb1fd6619be3b4e375103874eac5e5ebc113135 SHA512 84fb739c60216ab9a7a487a0ec4039a7e85c7684ef1f71d8b3bc415ff2ae284f79474103ae05385502bc2510401f8cfb33d84dccf5d0ea9a0dd62528519d935f
DIST python-gentoo-patches-2.7.18_p14.tar.xz 34292 BLAKE2B 654cefb34e3ff61b2a212b83ec1344ebace160aa3971a4a61212b637b83083864e1bdad2b78b166ba0b2302d145f3051b71b3e6b581b064f7f09353acdb4e4b1 SHA512 d6551a045ade16ef523a29451cc07499c29aca92548e46c21bcd6b3a3549f5a0f1f7e420ac326e7ac2e0158fb5490429a9d28994cbfd6c8b5b652788612bac26
DIST python-gentoo-patches-2.7.18_p15.tar.xz 34956 BLAKE2B d173f276dd9c0ce31004dcc55a0d18e9ce25a47683c2df3c4dd62e967dfbbb35be59a2f08cf20f30a19475a8a2344dd95b17400eafa88b5fdbe9270a12ccbf32 SHA512 d9386808265f978808e5c0ffd384cefe54fb0e05aeccfd394167d5227d9cd66e25c8e93c54914762b2cfc3c2dd851b26a7a84d62634c6aa8a0798aacbb7ac25f
DIST python-gentoo-patches-3.10.0_p1.tar.xz 10068 BLAKE2B 1c9817b449831559f0a0b722c02a5f55d94b3dfde98e5882c1403fe24a4addf7074ab39c09b91cff6fd7ace2e4b6e8ed899d9a0b9ffd6612ce315c4c192bd309 SHA512 39aa41dbf17b6dc5255491c75031a3dae6962b44125e426dbfdce365a6533c5dae9856b1fff8016a189124b7cff72d2665ce99da344c2f9dff005ba685e8c2c4
DIST python-gentoo-patches-3.10.1.tar.xz 8580 BLAKE2B 58d165c6c21a6736787d77d5bbeb770adff7f3729a47f62d0b7c4f0982c15c6a50b326be33638f3fca5574936cbce35d26e9ce0868faa3b5a3412b30586b066a SHA512 f86adf4e5195b1eb13cedbf24c1956964ce56745f0524a62b1e7c6baf74c6f1802e05cf4c08519b147579945c0526ff0a0ffc01cfb4372c0ec4f403b25e81012
DIST python-gentoo-patches-3.10.2.tar.xz 8584 BLAKE2B 4328b21d7b8b0e39d0d6761c3a52cb5369aff7dfa890a1496fe5c01720bd9d8ef38d915188ad6079158104f8acf5847e220d58c092a9682615aa366dce9f20d2 SHA512 063c53022525cea988a9a27643bf0b2b5e674259de487826ee3b3cbca50c369857908d53cee9be59adf09db7ac0dcaed65639c40204ff4519b812b215de588a6
DIST python-gentoo-patches-3.10.2_p1.tar.xz 9860 BLAKE2B 6343b9fa1af2763501fc67674f0ebcec9bffa340edd741c97f54b290e91056141230264221b8746447da553ced7081156d83517330b7bb3ac027d9f72fa0d62a SHA512 7c8666bf47cda7647d330fff6070b9d0410dc21dc7114ff232bdbb5e5f993c02b9fc373919bae73391a2d28a8bbe096efc071f8273f2338758876a5f50b28d30
DIST python-gentoo-patches-3.10.3.tar.xz 8584 BLAKE2B 4287b33e696a1c350fef2ef34843353a2f4ad20feed2e9d7e05d727ec4f18105f57c21e7ab73941e14cc2ace27e8ac7f5e96ce2893b626c8e75cac52760f0935 SHA512 515025b13063eaee71738b8e1f071cd9930cf516e90c1c652adc6f8bee356598d152cb3337a6633500cda4228a5ddc2819f1db0cdb2524a479a0bca69ca557cb
DIST python-gentoo-patches-3.10.4.tar.xz 8592 BLAKE2B 67fba3e1fedb17430e5cd93da995b4acaf714db512031b5a2f775a25f793f007941561663cfa413d645ccddc2e22d65d250a40fa166cafda8805488d877ff57d SHA512 3ed2b8ff8f1eb8febe7dcd4b5d13d6d54468be1d525f8f1118977d3bbc78f690a597b09383939d023b03380a306e4bff1693382e29ff562312d803305b1709b2
DIST python-gentoo-patches-3.11.0a6.tar.xz 3676 BLAKE2B 6fa21569fc8249f76d0eb8d4c3347e87aca70a77e2fc4887de7c51ac9866734bb29cc6b82a17f55ada74ccd03f9918ee89ef273b8a7fbbe86c5987eb8b1754fd SHA512 c61d6accef58722efe6c7f4266bda48a74417a68e27ba75b27fe7eb406aeec7a0e0f7c0f5a2bff9879f807a2ef11608aeaff796e62d907441596455c756d14a7
DIST python-gentoo-patches-3.11.0a7.tar.xz 3332 BLAKE2B 3c658cd486d96fe103146cfa77deaaf828919ad1d8cb4b73bc48e7c9f856c58634aa99fffe16fcd4bc071f70651313ee0e46f60cef8b129c2f096c0db7873303 SHA512 1787f75997e34544f4756a647a69ba3d188574430a1a317bef25cf8e7aaab8a78f0d6c94fd9c603f45262bf55eb6c9d9557e167e53aef7ac6f9ed88a93d39434
DIST python-gentoo-patches-3.7.12_p1.tar.xz 19112 BLAKE2B e9964244af3db544dd6e96d85ca4bc24d7131b48eda85df5bafa3fb36474a024cecbbf4b27324e1f35f76ae6a1aed31dd7896e831b79b574b45a4371afcc7e5b SHA512 9ec996c2904f99bd6651ed1b700eabd91f2b82b1e9e0f3d9572243886a9c7139bf8ac2af04169485d3ca6339e1a87044cba203f6f0aee9609d2a1d53c812548d
DIST python-gentoo-patches-3.7.12_p2.tar.xz 19604 BLAKE2B bd3b88d7ad5b73219d83fb1cd35190186a0c3e451a2d0764cfbfcffbb7323a1f01376d94e5fa01a48b9fae35bd5c9e3b61052020a8190816fcbb26bde0f4df94 SHA512 3c906ccabfcedf51c115706349389b7d5a3a0325713b27ceca638fb0f13558fad6cd1f9a3e2ad83c0d82586b30399124aefffc959ae66616a7cf8b30dba8b599
DIST python-gentoo-patches-3.7.13.tar.xz 18344 BLAKE2B 038db3d4e08f7af41811af0073b9c970171a26ffdf8ca116646f285101cc2299372f264e89183f136b3a56c4f756f39518ef6083c3c13baf409034706212fd22 SHA512 7f0d95e0a558aa4171589b887121e09c74679fc99089274e38c35188cd77e7fd6c53231d052455d752fab0c7dcef86a0efc4b8875a9e2a6c295907c271c6e822
DIST python-gentoo-patches-3.8.12_p1.tar.xz 16632 BLAKE2B cce7a41d020af1ffc55a01ef67b20bcb16c68adbccc1e44ef166d1707e817ed6c3bae70f84c56553f27bca449015e273014c0be73bc2f9b4e25844ddce385486 SHA512 4621727c2e9cc1c5519e021210e16a97e7167ea831445dfdd07f5b0ed642b5919834244111708a971ce098b10b439797e1c76827eccab803f801052c671f1ae6
DIST python-gentoo-patches-3.8.12_p2.tar.xz 17224 BLAKE2B 1287a7fe2e55a5a24872cc9849d2339fbc453ed9a02a276afef9aecb451f97104cbc926d10dc99fdf423dbe49987b7a56c548120e204088b59e5ca710c146a66 SHA512 c2ebea7a74fe2d2d9af5b3902a0cd8542247f2e3a310b1e91be3ed7f5bd1d51a77f013f7c3047aef8c2762b740cb9daeb30fd4680dc3bbe1b61dc095ebb1a6ac
DIST python-gentoo-patches-3.8.13.tar.xz 16004 BLAKE2B 5c0c6c9263570a467391e60c324d1dbc1e50ffda9cad1e204df124441b593146f18e5f1529eb7d385b35c5f4b9e597807971b6b66f7f8eef156ad87c9ad32743 SHA512 4ceb831e2d62bd73909b53a3b553b2cd73d08bcf2a1c92b47eaeb1221d40daabcaed14977265bcb265df00b6bf363dbebbd61a62dca4bf6ef40c6b911e980597
DIST python-gentoo-patches-3.9.10.tar.xz 12844 BLAKE2B f342fbdd1a580787e2d699ded9dc5307f5b610303c6869aa8d0fa4d9e60acd997dc12ae96c6de07cdf9ce0a8bfb6e13291d611d4a6a193844049882b5d01d1e5 SHA512 50111552ff82019672d82e5a328e6e9d8ec2a61a957b63a7a49c5de1f1b77be296272f4273c78154667d5a88d82646360d9a411bb8cf451408837413b06d4b23
DIST python-gentoo-patches-3.9.10_p1.tar.xz 14080 BLAKE2B 7cc21ffc439b82661e151ce7f85e217ce7cbe674296e7f7fc7f9b9215486d2845e8314130d1d378e24a0c2c9a6340055b1e4345426b136c113b7e833c564e903 SHA512 1be7ccf4dbb29d4b19985000baf98e54d77f493069f44381b5a3629b1e5b275755ef5a4736a7490d0bec037ab4be88ca1856d615bca9c759b0995b066dd2dbed
DIST python-gentoo-patches-3.9.11.tar.xz 12844 BLAKE2B de7ffa39e96127949d2b894fe15c8c1345180842791743af14a3728a7c950e877ab7c74f3e72da5518b16ecb2f3ff13e6132740bb067fe43a8359c673befbaf5 SHA512 0507792188587e66d63a70dde17c6aea1c9aab9e40ace3aeb585adbd2c62acf828782312ba7523f7a4ea49ab1125a30c7b091d10fe02874b018f2733fb8e141d
DIST python-gentoo-patches-3.9.12.tar.xz 12848 BLAKE2B 5dd66fa94b136a463d2c4be3a5b7dfad770c3905467a1d81af02a35b2783ce7d614881c915ee8f8e764c1656963d6886d9c60c6e524f512e1bc496e42d01307b SHA512 07de63e47a8e547724099062239df8fcfd254f19d38be28131e6bbb094ffbab8483861fb6a5905e60d7fa7a1a5dc06785951fa31984ecad89516b0b742c47f91
DIST python-gentoo-patches-3.9.9.tar.xz 13200 BLAKE2B 672e3b79094cbc791988639a5dde4c9e5622e91bef4310d26838716c65763ca69a12c6afef2f19487f4389974af009896e452c19783b0a491072d13f893af7e9 SHA512 3cd4ddd070ab48d9978e1136d237fc24030fd3ce6704371ce99815702a45d839ee26c7e9552b004661827759edd30222434e4166f9ee16f873ad4783c83f723f

@ -22,7 +22,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="berkdb bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl tk wininst +xml"
# Do not add a dependency on dev-lang/python to this ebuild.

@ -1,371 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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 lto +ncurses pgo +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_10(-)]
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:= )
!!<sys-apps/sandbox-2.21"
# bluetooth requires headers from bluez
DEPEND="${RDEPEND}
bluetooth? ( net-wireless/bluez )
test? ( app-arch/xz-utils[extra-filters(+)] )"
# autoconf-archive needed to eautoreconf
BDEPEND="
sys-devel/autoconf-archive
virtual/awk
virtual/pkgconfig
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
--without-static-libpython
--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
$(use_with lto)
$(use_enable pgo optimizations)
)
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.10/site-packages
fi
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=
addpredict /usr/lib/python3.10/site-packages
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
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
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
}

@ -1,380 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 libedit lto +ncurses pgo +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_10(-)]
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? (
!libedit? ( >=sys-libs/readline-4.1:= )
libedit? ( dev-libs/libedit:= )
)
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:= )
!!<sys-apps/sandbox-2.21"
# bluetooth requires headers from bluez
DEPEND="${RDEPEND}
bluetooth? ( net-wireless/bluez )
test? ( app-arch/xz-utils[extra-filters(+)] )"
# autoconf-archive needed to eautoreconf
BDEPEND="
sys-devel/autoconf-archive
virtual/awk
virtual/pkgconfig
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
--without-static-libpython
--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
$(use_with lto)
$(use_enable pgo optimizations)
$(use_with readline readline "$(usex libedit editline readline)")
)
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.10/site-packages
fi
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=
addpredict /usr/lib/python3.10/site-packages
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
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
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
}

@ -1,386 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 libedit lto +ncurses pgo +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_10(-)]
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? (
!libedit? ( >=sys-libs/readline-4.1:= )
libedit? ( dev-libs/libedit:= )
)
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:= )
!!<sys-apps/sandbox-2.21"
# bluetooth requires headers from bluez
DEPEND="${RDEPEND}
bluetooth? ( net-wireless/bluez )
test? ( app-arch/xz-utils[extra-filters(+)] )"
# autoconf-archive needed to eautoreconf
BDEPEND="
sys-devel/autoconf-archive
virtual/awk
virtual/pkgconfig
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
--without-static-libpython
--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
$(use_with lto)
$(use_enable pgo optimizations)
$(use_with readline readline "$(usex libedit editline readline)")
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.10/site-packages
fi
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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=
# workaround https://bugs.gentoo.org/775416
addwrite /usr/lib/python3.10/site-packages
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
# 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
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
}

@ -1,381 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 libedit lto +ncurses pgo +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_10(-)]
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? (
!libedit? ( >=sys-libs/readline-4.1:= )
libedit? ( dev-libs/libedit:= )
)
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:= )
!!<sys-apps/sandbox-2.21"
# bluetooth requires headers from bluez
DEPEND="${RDEPEND}
bluetooth? ( net-wireless/bluez )
test? ( app-arch/xz-utils[extra-filters(+)] )"
# autoconf-archive needed to eautoreconf
BDEPEND="
sys-devel/autoconf-archive
virtual/awk
virtual/pkgconfig
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
--without-static-libpython
--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
$(use_with lto)
$(use_enable pgo optimizations)
$(use_with readline readline "$(usex libedit editline readline)")
)
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.10/site-packages
fi
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=
# workaround https://bugs.gentoo.org/775416
addwrite /usr/lib/python3.10/site-packages
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
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
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
}

@ -1,392 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 libedit lto +ncurses pgo +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_10(-)]
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? (
!libedit? ( >=sys-libs/readline-4.1:= )
libedit? ( dev-libs/libedit:= )
)
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:= )
!!<sys-apps/sandbox-2.21"
# bluetooth requires headers from bluez
DEPEND="${RDEPEND}
bluetooth? ( net-wireless/bluez )
test? ( app-arch/xz-utils[extra-filters(+)] )"
# autoconf-archive needed to eautoreconf
BDEPEND="
sys-devel/autoconf-archive
virtual/awk
virtual/pkgconfig
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
--without-static-libpython
--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
$(use_with lto)
$(use_enable pgo optimizations)
$(use_with readline readline "$(usex libedit editline readline)")
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.10/site-packages
fi
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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"
if use sparc ; then
# bug #788022
skipped_tests+=" multiprocessing_fork"
skipped_tests+=" multiprocessing_forkserver"
fi
for test in ${skipped_tests}; do
mv "${S}"/Lib/test/test_${test}.py "${T}"
done
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
# workaround https://bugs.gentoo.org/775416
addwrite /usr/lib/python3.10/site-packages
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
# 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
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
}

@ -24,7 +24,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"

@ -1,403 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
python-utils-r1 toolchain-funcs verify-sig
MY_PV=${PV/_alpha/a}
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/~mgorny/dist/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 libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst"
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-libs/expat-2.1:=
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? (
!libedit? ( >=sys-libs/readline-4.1:= )
libedit? ( dev-libs/libedit:= )
)
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
)
!!<sys-apps/sandbox-2.21"
# bluetooth requires headers from bluez
DEPEND="${RDEPEND}
bluetooth? ( net-wireless/bluez )
test? ( app-arch/xz-utils[extra-filters(+)] )"
# autoconf-archive needed to eautoreconf
BDEPEND="
sys-devel/autoconf-archive
virtual/awk
virtual/pkgconfig
verify-sig? ( sec-keys/openpgp-keys-python )
!sys-devel/gcc[libffi(-)]"
RDEPEND+=" !build? ( app-misc/mime-types )"
[[ ${PV} != *_alpha* ]] &&
RDEPEND+=" dev-lang/python-exec[python_targets_python${PYVER/./_}(-)]"
VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
# 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
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
--without-static-libpython
--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
--with-platlibdir=lib
$(use_with lto)
$(use_enable pgo optimizations)
$(use_with readline readline "$(usex libedit editline readline)")
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
# force-disable modules we don't want built
local disable_modules=(
NIS
)
use gdbm || disable_modules+=( _GDBM _DBM )
use sqlite || disable_modules+=( _SQLITE3 )
use ssl || disable_modules+=( _HASHLIB _SSL )
use ncurses || disable_modules+=( _CURSES _CURSES_PANEL )
use readline || disable_modules+=( READLINE )
use tk || disable_modules+=( _TKINTER )
local mod
for mod in "${disable_modules[@]}"; do
echo "MODULE_${mod}=disabled"
done >> Makefile || die
}
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
export PYTHONSTRICTEXTENSIONBUILD=1
# Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't
# end up writing bytecode & violating sandbox.
# bug #831897
local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.11/site-packages
fi
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
emake CPPFLAGS= CFLAGS= LDFLAGS=
# Restore saved value from above.
local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE}
# 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"
if use sparc ; then
# bug #788022
skipped_tests+=" multiprocessing_fork"
skipped_tests+=" multiprocessing_forkserver"
fi
for test in ${skipped_tests}; do
mv "${S}"/Lib/test/test_${test}.py "${T}"
done
# Expects to find skipped tests and fails
mv "${S}"/Lib/test/test_tools/test_freeze.py "${T}" || die
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
# workaround https://bugs.gentoo.org/775416
addwrite /usr/lib/python3.11/site-packages
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
mv "${T}"/test_freeze.py "${S}"/Lib/test/test_tools/test_freeze.py || die
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
# 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 || die
use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || 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
}

@ -1,335 +0,0 @@
# 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_P="Python-${PV%_p*}"
PYVER=$(ver_cut 1-2)
PATCHSET="python-gentoo-patches-${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}/${PYVER}m"
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-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
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 "/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
# 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
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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
# 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, pyvenv
ln -s "../../../bin/2to3-${PYVER}" \
"${scriptdir}/2to3" || die
ln -s "../../../bin/pydoc${PYVER}" \
"${scriptdir}/pydoc" || die
ln -s "../../../bin/pyvenv-${PYVER}" \
"${scriptdir}/pyvenv" || die
# idle
if use tk; then
ln -s "../../../bin/idle${PYVER}" \
"${scriptdir}/idle" || die
fi
}

@ -1,330 +0,0 @@
# Copyright 1999-2021 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_P="Python-${PV%_p*}"
PYVER=$(ver_cut 1-2)
PATCHSET="python-gentoo-patches-${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}/${PYVER}m"
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-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
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 "/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
# 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
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, pyvenv
ln -s "../../../bin/2to3-${PYVER}" \
"${scriptdir}/2to3" || die
ln -s "../../../bin/pydoc${PYVER}" \
"${scriptdir}/pydoc" || die
ln -s "../../../bin/pyvenv-${PYVER}" \
"${scriptdir}/pyvenv" || die
# idle
if use tk; then
ln -s "../../../bin/idle${PYVER}" \
"${scriptdir}/idle" || die
fi
}

@ -1,341 +0,0 @@
# 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_P="Python-${PV%_p*}"
PYVER=$(ver_cut 1-2)
PATCHSET="python-gentoo-patches-${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/~mgorny/dist/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}/${PYVER}m"
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-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
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 "/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
# 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
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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"
if use sparc ; then
# bug #788022
skipped_tests+=" multiprocessing_fork"
skipped_tests+=" multiprocessing_forkserver"
fi
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
# 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, pyvenv
ln -s "../../../bin/2to3-${PYVER}" \
"${scriptdir}/2to3" || die
ln -s "../../../bin/pydoc${PYVER}" \
"${scriptdir}/pydoc" || die
ln -s "../../../bin/pyvenv-${PYVER}" \
"${scriptdir}/pyvenv" || die
# idle
if use tk; then
ln -s "../../../bin/idle${PYVER}" \
"${scriptdir}/idle" || die
fi
}

@ -23,7 +23,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}/${PYVER}m"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
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 )"

@ -1,340 +0,0 @@
# 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
}

@ -1,345 +0,0 @@
# 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
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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
# 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
}

@ -1,351 +0,0 @@
# 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/~mgorny/dist/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
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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"
if use sparc ; then
# bug #788022
skipped_tests+=" multiprocessing_fork"
skipped_tests+=" multiprocessing_forkserver"
fi
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
# 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
}

@ -24,7 +24,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86"
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 )"

@ -1,380 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 lto +ncurses pgo +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_9(-)]
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
$(use_with lto)
$(use_enable pgo optimizations)
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.9/site-packages
fi
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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
# 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
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
}

@ -1,375 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 lto +ncurses pgo +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_9(-)]
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
$(use_with lto)
$(use_enable pgo optimizations)
)
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.9/site-packages
fi
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
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
}

@ -1,386 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 lto +ncurses pgo +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_9(-)]
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
$(use_with lto)
$(use_enable pgo optimizations)
)
# disable implicit optimization/debugging flags
local -x OPT=
# pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get
# propagated to sysconfig for built extensions
local -x CFLAGS_NODIST=${CFLAGS}
local -x LDFLAGS_NODIST=${LDFLAGS}
local -x CFLAGS= LDFLAGS=
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.9/site-packages
fi
# also need to clear the flags explicitly here or they end up
# in _sysconfigdata*
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"
if use sparc ; then
# bug #788022
skipped_tests+=" multiprocessing_fork"
skipped_tests+=" multiprocessing_forkserver"
fi
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
# 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
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
}

@ -23,7 +23,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha ~amd64 ~arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc ~x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"

@ -1,375 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
WANT_LIBTOOL="none"
inherit autotools check-reqs 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/~mgorny/dist/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 lto +ncurses pgo +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_9(-)]
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
# large file tests involve a 2.5G file being copied (duplicated)
CHECKREQS_DISK_BUILD=5500M
pkg_pretend() {
use test && check-reqs_pkg_pretend
}
pkg_setup() {
use test && check-reqs_pkg_setup
}
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
if use pgo; then
local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
# All of these seem to occasionally hang for PGO inconsistently
# They'll even hang here but be fine in src_test sometimes.
# bug #828535 (and related: bug #788022)
PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
if has_version "app-arch/rpm" ; then
# Avoid sandbox failure (attempts to write to /var/lib/rpm)
PROFILE_TASK+=" -x test_distutils"
fi
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
$(use_with lto)
$(use_enable pgo optimizations)
)
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
if use pgo ; then
# bug 660358
local -x COLUMNS=80
local -x PYTHONDONTWRITEBYTECODE=
addpredict /usr/lib/python3.9/site-packages
fi
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
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
}

Binary file not shown.

@ -13,7 +13,7 @@ DESCRIPTION="Imath basic math package"
HOMEPAGE="https://imath.readthedocs.io"
SRC_URI="https://github.com/AcademySoftwareFoundation/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
# re-keywording needed for (according to ilmbase keywords): ~x64-macos ~x86-solaris
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD"

@ -1,2 +1,3 @@
DIST kopeninghours-21.08.3.tar.xz 65904 BLAKE2B 88169a5881a49fbb6728d706585d2e2d4c88d2eb66360917c1d0cef0cb7239de378d69afc1970f038e9c52756fe6097d5e423577a29e77c071e0b5ad54b7c6c2 SHA512 9fe8181b4c4e9427a6eba133a51b119e86378933ebf5bdbfe5a78c711837ccdbaa8baa04cb10e234febe7596c7e7e515dda8e09f8568bd785b0a3e061f6d8bcf
DIST kopeninghours-21.12.3.tar.xz 68916 BLAKE2B d80275c195231ca52e0042149d685224c9ffadd6d341ddce1af6f46df451442e924f282119c91ab004dcabb64b112de559bbbcddc2a91daee5cf9a76b84fb4bb SHA512 42bdbe8172ff5ff89469786f3d544db4a07bc0d1de9a54b8525dc8789d0f4328159ee815c07595463f190073433de567fb2d3496d261daa46aac70354b3da6ae
DIST kopeninghours-22.04.0.tar.xz 69016 BLAKE2B 6e432bb2981b4eb62970fef37390ff871ee51a09e964434f2c43bf89de8ab2568b4843369fa99166fc731937989a155c9f391c2cc32c023f4be56ff886fabc60 SHA512 21bbd64000dec12015a5a2904f414876602a1b7096d6c64f4b327ed4d38d5a38d5058138a422c6fe41f7e205508b753b9d0502b1379d0e8816f1d4929d3fe45c

@ -0,0 +1,65 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
ECM_QTHELP="true"
ECM_TEST="true"
KDE_GEAR="true"
PVCUT=$(ver_cut 1-3)
KFMIN=5.92.0
QTMIN=5.15.2
PYTHON_COMPAT=( python3_{8..10} )
inherit ecm kde.org python-single-r1
DESCRIPTION="Library for parsing and evaluating OSM opening hours expressions"
HOMEPAGE="https://api.kde.org/kopeninghours/html/index.html
https://invent.kde.org/libraries/kopeninghours"
LICENSE="LGPL-2+"
SLOT="5"
KEYWORDS="~amd64"
IUSE="python"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DEPEND="
>=dev-libs/kpublictransport-${PVCUT}:5
>=dev-qt/qtdeclarative-${QTMIN}:5
>=kde-frameworks/kholidays-${KFMIN}:5
>=kde-frameworks/ki18n-${KFMIN}:5
sys-libs/zlib
python? (
$(python_gen_cond_dep '
>=dev-libs/boost-1.70:=[python,${PYTHON_USEDEP}]
')
)
"
RDEPEND="${DEPEND}
${PYTHON_DEPS}
>=dev-qt/qtquickcontrols2-${QTMIN}:5
"
BDEPEND="
sys-devel/bison
sys-devel/flex
"
PATCHES=( "${FILESDIR}"/${PN}-21.03.90-boostpython.patch )
pkg_setup() {
ecm_pkg_setup
python_setup
}
src_configure() {
local mycmakeargs=(
-DBOOSTPYTHON_VERSION_MAJOR_MINOR=${EPYTHON}
$(cmake_use_find_package python Boost)
)
ecm_src_configure
}
src_install() {
ecm_src_install
python_optimize
}

@ -1,2 +1,3 @@
DIST kosmindoormap-21.08.3.tar.xz 342772 BLAKE2B e30c0645105627b304162187ac9c84e8ebef0bbf5db17b28c1239428ec982eed526a7f29f7e543d1c1fb660d90d641358c1d0e8b1c6d6c40c5b11e471b25be52 SHA512 3a2337b433c25c16f2e69ab1a42e9324e8e176eaf85094a08d95a542af479e65637544a8486d481a3fe811e5c90aee1bcf803d92f3225db7c53c75840247e642
DIST kosmindoormap-21.12.3.tar.xz 351272 BLAKE2B 8fde9196e18062770c63eb2b636bf3bfea65d8575f4d67106c28fcf3349c6d9bfa3bd1d48a8978b3ec2e2d027f89be3338b88cdfd4b59b7609cc9bba2aeab689 SHA512 f2f5bc04dbb9943114d9807787d98ad4a4963be556c5f2ec332c59bc60533abbf6d39b982f79264ff3d764cb4b8e60501d711039e0fc475500abbd800fc13b86
DIST kosmindoormap-22.04.0.tar.xz 351100 BLAKE2B bfc1401ff87fe10c0bee0b395dbb1386ed424521d72622450038851b768e429323966a8417a0605a456ca19bee58ba1a555e94e54e7bf40abbf9eb863ba3bab1 SHA512 477c1674ebf11a664e7286723a616c6146cfa54827c1eee8aa68e907bd3be068dd8fc90829895fdecff6827bdd3e930728100393071e5dcd6107d0317d318e58

@ -0,0 +1,48 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
ECM_TEST="true"
KDE_GEAR="true"
PVCUT=$(ver_cut 1-3)
KFMIN=5.92.0
QTMIN=5.15.2
inherit ecm kde.org
DESCRIPTION="Data Model and Extraction System for Travel Reservation information"
HOMEPAGE="https://invent.kde.org/libraries/kosmindoormap"
LICENSE="LGPL-2+"
SLOT="5"
KEYWORDS="~amd64"
IUSE="+openinghours"
COMMON_DEPEND="
>=dev-libs/kpublictransport-${PVCUT}:5
dev-libs/protobuf:=
>=dev-qt/qtdeclarative-${QTMIN}:5
>=dev-qt/qtgui-${QTMIN}:5
>=dev-qt/qtnetwork-${QTMIN}:5
>=kde-frameworks/ki18n-${KFMIN}:5
sys-libs/zlib
openinghours? ( >=dev-libs/kopeninghours-${PVCUT}:5 )
"
DEPEND="${COMMON_DEPEND}
test? ( >=dev-qt/qtwidgets-${QTMIN}:5 )
"
RDEPEND="${COMMON_DEPEND}
>=dev-qt/qtquickcontrols2-${QTMIN}:5
"
BDEPEND="
sys-devel/bison
sys-devel/flex
"
src_configure() {
local mycmakeargs=(
-DCMAKE_DISABLE_FIND_PACKAGE_OsmTools=ON # we have no use for it
$(cmake_use_find_package openinghours KOpeningHours)
)
ecm_src_configure
}

@ -1,2 +1,3 @@
DIST kpublictransport-21.08.3.tar.xz 411364 BLAKE2B 46d4681e98037d84d5813c62f13d76831922f9b2a3c04a51885292d702fa569f276dbd00056ee79cfecfebc4597d1ddde3c497b2d72e585ec5c14006253944e5 SHA512 bcd422855de8f224f7a30f09cd95345bd8637d3fb7a32ba0a7efe5c4bd350aed02cd6d8f186b4bfb467d50ce4ae927f360ccb5d188dadfbfa4e498ca4665df72
DIST kpublictransport-21.12.3.tar.xz 480780 BLAKE2B 949c394497fcd76af7e4cc3d83e1db74cbef221f9f468a4ac247e82000503468e204eaa45ee61b4f5d05d84c1f4878484db342ff760d101a6a0a7b0960937baf SHA512 495fc7e92bab00fa0953fa81d2cb73e37055f8ccee899c8d9f8783e85f83e7f6a4c04a1e48ed607d565926bdc9fcadc539a2738b7c898a07aa6934f5e15038eb
DIST kpublictransport-22.04.0.tar.xz 484884 BLAKE2B 6712d73ff46a1b16c5a66df644367fba45c82e0b767ff1f110bd18cf50725742a682dc11f453288a8f677868d4f0da313c9f73d1f26980aaca39a1fa2e3999cc SHA512 61c3125d050bfd4717a44ca087acaea110690c44fd6e9ef2b165286d2c88124ddf99f45aeddb33969d087e257e8593ed4b545b164caa99d32f1c98faacc4815b

@ -0,0 +1,38 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
ECM_QTHELP="true"
ECM_TEST="true"
KDE_GEAR="true"
KFMIN=5.92.0
QTMIN=5.15.2
inherit ecm kde.org
DESCRIPTION="Library for accessing public transport timetables and other information"
HOMEPAGE="https://invent.kde.org/libraries/kpublictransport
https://www.volkerkrause.eu/2019/03/02/kpublictransport-introduction.html"
LICENSE="LGPL-2+"
SLOT="5"
KEYWORDS="~amd64"
IUSE=""
RDEPEND="
dev-libs/protobuf:=
>=dev-qt/qtdeclarative-${QTMIN}:5
>=dev-qt/qtgui-${QTMIN}:5
>=dev-qt/qtnetwork-${QTMIN}:5[ssl]
sys-libs/zlib
"
DEPEND="${RDEPEND}
test? ( >=dev-qt/qtwidgets-${QTMIN}:5 )
"
src_configure() {
local mycmakeargs=(
-DCMAKE_DISABLE_FIND_PACKAGE_OsmTools=ON # we have no use for it
)
ecm_src_configure
}

@ -1 +1,2 @@
DIST libaio-0.3.112.tar.gz 46977 BLAKE2B 088f3b195a65bdc97ae2318e47af17c65259ed3208dca7bfef93c81a800602085e5b2078dbd436c740be316d0ebd923a1b3b7c0808257e2e7c7fb0f7ae1e0dba SHA512 5f984529c9f747a6c82f1e4457fc0832bb1fc299ae6e700f2ac5a8ea7b9bfc6ea1e75809728cc115a020cff6685ed1f4e38c6aeacc1ea98dfccce04dd19dafaa
DIST libaio-0.3.113.tar.gz 49980 BLAKE2B 2379c88670310b36942563d10f29dfcba0f49391952ffe7fe18b0c917f33ef610405fe13297d1dbb34b7ad1d3066d4a32587a7fb20babba2f264cfc2ab289e57 SHA512 65c30a102433bf8386581b03fc706d84bd341be249fbdee11a032b237a7b239e8c27413504fef15e2797b1acd67f752526637005889590ecb380e2e120ab0b71

@ -0,0 +1,12 @@
We need to place LDFLAGS earlier to ensure e.g. as-needed works correctly.
--- a/src/Makefile
+++ b/src/Makefile
@@ -56,7 +56,7 @@ libaio.a: $(libaio_objs)
$(libname): $(libaio_sobjs) libaio.map
$(CC) $(CFLAGS) -c struct_offsets.c
- $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
+ $(CC) $(SO_CFLAGS) $(LINK_FLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs)
install: $(all_targets)
install -D -m 644 libaio.h $(includedir)/libaio.h

@ -0,0 +1,90 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit multilib-minimal toolchain-funcs flag-o-matic usr-ldscript
DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
HOMEPAGE="https://pagure.io/libaio"
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://pagure.io/libaio.git"
else
SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.gz"
# Has test failure on abi_x86_32 which needs investigating
# https://marc.info/?l=linux-aio&m=164996470108464&w=2
#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
fi
LICENSE="LGPL-2"
SLOT="0"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-0.3.112-cppflags.patch
"${FILESDIR}"/${PN}-0.3.113-respect-LDFLAGS.patch
)
src_prepare() {
default
local sed_args=(
-e "/^prefix=/s:/usr:${EPREFIX}/usr:"
-e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
-e 's:-Werror ::'
)
if ! use static-libs; then
sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
# Tests require the static library to be built.
use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
fi
sed -i "${sed_args[@]}" src/Makefile harness/Makefile Makefile || die
multilib_copy_sources
}
multilib_src_configure() {
if use arm ; then
# When building for thumb, we can't allow frame pointers.
# http://crbug.com/464517
if $(tc-getCPP) ${CFLAGS} ${CPPFLAGS} - <<<$'#ifndef __thumb__\n#error\n#endif' >&/dev/null ; then
append-flags -fomit-frame-pointer
fi
fi
}
_emake() {
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
ABI_LIBDIR="$(get_libdir)" \
CFLAGS_WERROR= \
emake "$@"
}
multilib_src_compile() {
_emake
}
multilib_src_test() {
mkdir -p testdir || die
# 'make check' breaks with sandbox, 'make partcheck' works
_emake partcheck prefix="${S}/src" libdir="${S}/src"
}
multilib_src_install() {
_emake install DESTDIR="${D}"
}
multilib_src_install_all() {
doman man/*
dodoc ChangeLog TODO
# move to / for multipath-tools, bug #325355
gen_usr_ldscript -a aio
# This lib is a bare minimal shim on top of kernel syscalls.
export QA_DT_NEEDED=$(find "${ED}" -type f -name 'libaio.so.*' -printf '/%P\n')
}

@ -1,13 +1,13 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
EAPI=7
inherit multilib-minimal toolchain-funcs flag-o-matic usr-ldscript
DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
HOMEPAGE="https://pagure.io/libaio"
if [[ "${PV}" == 9999 ]] ; then
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://pagure.io/libaio.git"
else
@ -21,8 +21,7 @@ RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-0.3.112-cppflags.patch
"${FILESDIR}"/${PN}-0.3.111-optional-werror.patch
"${FILESDIR}"/${PN}-0.3.112-respect-LDFLAGS.patch
"${FILESDIR}"/${PN}-0.3.113-respect-LDFLAGS.patch
)
src_prepare() {
@ -31,13 +30,14 @@ src_prepare() {
local sed_args=(
-e "/^prefix=/s:/usr:${EPREFIX}/usr:"
-e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
-e 's:-Werror ::'
)
if ! use static-libs; then
sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
# Tests require the static library to be built.
use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
fi
sed -i "${sed_args[@]}" src/Makefile Makefile || die
sed -i "${sed_args[@]}" src/Makefile harness/Makefile Makefile || die
multilib_copy_sources
}
@ -67,6 +67,7 @@ multilib_src_compile() {
multilib_src_test() {
mkdir -p testdir || die
# 'make check' breaks with sandbox, 'make partcheck' works
_emake partcheck prefix="${S}/src" libdir="${S}/src"
}
@ -79,7 +80,7 @@ multilib_src_install_all() {
doman man/*
dodoc ChangeLog TODO
# move crap to / for multipath-tools #325355
# move to / for multipath-tools, bug #325355
gen_usr_ldscript -a aio
# This lib is a bare minimal shim on top of kernel syscalls.

@ -0,0 +1,29 @@
https://github.com/Pulse-Eight/libcec/pull/599
From 452b2049b2ee3e73968c603e5524b2d349ac0c3e Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Sat, 9 Apr 2022 17:59:11 +0000
Subject: [PATCH] cecloader.h: fix null return
returning NULL is invalid for a return type of bool when NULL is defined
as `nullptr` instead of 0L
--- a/include/cecloader.h
+++ b/include/cecloader.h
@@ -172,7 +172,7 @@ bool LibCecBootloader(const char *strLib = NULL)
if (!g_libCEC)
{
std::cout << dlerror() << std::endl;
- return NULL;
+ return false;
}
}
@@ -181,7 +181,7 @@ bool LibCecBootloader(const char *strLib = NULL)
if (!LibCecBootloader)
{
std::cout << "cannot find CECStartBootloader" << std::endl;
- return NULL;
+ return false;
}
bool bReturn = LibCecBootloader();

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -36,6 +36,7 @@ S="${WORKDIR}/${PN}-${MY_P}"
PATCHES=(
"${FILESDIR}/${PN}-4.0.7-no-override-udev.patch"
"${FILESDIR}/${PN}-6.0.2-musl-nullptr.patch"
)
pkg_pretend() {

@ -1,4 +1,2 @@
DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f
DIST llvmorg-14.0.0.tar.gz 158057350 BLAKE2B 7052684c620a5eaf52beeee4591adf58cfec9e64a5ee0b24f3d5849fd4df5b006e2906a839cb806ac69c33fab6013c58589b1d74e4fb8558758edcb7d5065064 SHA512 eb5acf96b5e2c59bd07579f7ebe73018b0dd6e2f2d9a5a3c7986320e88febd837d1084b9e5313a2264310342193044629d228337cc76dd2b8527dc0a8bdda999
DIST llvmorg-14.0.1.tar.gz 158074615 BLAKE2B bf80366461580058494eb101646efcd1a8b55a66818a710c2eb8c649bf88c02fe4552cecf4c1c8637a64e7cee8d644bca31aafc804765ed18f2b5e2975dd6c92 SHA512 0a15aa9cfc978a7b03a1659a2affad65ede66d280f5c12bf0beaaf194cd7bdd57ff438b5f40e64c1e1b88f368de99be349e9d30b544d2bbe4a50f0ebed3307f2

@ -1,67 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8..10} )
inherit cmake llvm llvm.org python-any-r1
DESCRIPTION="OpenCL C library"
HOMEPAGE="https://libclc.llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( MIT BSD )"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE_VIDEO_CARDS="video_cards_nvidia video_cards_r600 video_cards_radeonsi"
IUSE="${IUSE_VIDEO_CARDS}"
REQUIRED_USE="|| ( ${IUSE_VIDEO_CARDS} )"
LLVM_MAX_SLOT=13
BDEPEND="
|| (
sys-devel/clang:13
sys-devel/clang:12
sys-devel/clang:11
sys-devel/clang:10
)
${PYTHON_DEPS}"
LLVM_COMPONENTS=( libclc )
llvm.org_set_globals
llvm_check_deps() {
has_version -b "sys-devel/clang:${LLVM_SLOT}"
}
pkg_setup() {
# we do not need llvm_pkg_setup
python-any-r1_pkg_setup
}
src_configure() {
local libclc_targets=()
use video_cards_nvidia && libclc_targets+=(
"nvptx--"
"nvptx64--"
"nvptx--nvidiacl"
"nvptx64--nvidiacl"
)
use video_cards_r600 && libclc_targets+=(
"r600--"
)
use video_cards_radeonsi && libclc_targets+=(
"amdgcn--"
"amdgcn-mesa-mesa3d"
"amdgcn--amdhsa"
)
# TODO: spirv
[[ ${#libclc_targets[@]} ]] || die "libclc target missing!"
libclc_targets=${libclc_targets[*]}
local mycmakeargs=(
-DLIBCLC_TARGETS_TO_BUILD="${libclc_targets// /;}"
-DLLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
)
cmake_src_configure
}

@ -11,7 +11,7 @@ HOMEPAGE="https://libclc.llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions || ( MIT BSD )"
SLOT="0"
KEYWORDS="amd64 ~x86"
KEYWORDS="amd64 x86"
IUSE_VIDEO_CARDS="video_cards_nvidia video_cards_r600 video_cards_radeonsi"
IUSE="${IUSE_VIDEO_CARDS}"
REQUIRED_USE="|| ( ${IUSE_VIDEO_CARDS} )"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save