summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/distcc')
-rw-r--r--sys-devel/distcc/Manifest1
-rw-r--r--sys-devel/distcc/distcc-3.4-r1.ebuild (renamed from sys-devel/distcc/distcc-3.4.ebuild)17
-rw-r--r--sys-devel/distcc/distcc-3.4-r2.ebuild (renamed from sys-devel/distcc/distcc-3.3.3-r3.ebuild)30
-rw-r--r--sys-devel/distcc/distcc-3.4-r3.ebuild186
-rw-r--r--sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch112
-rw-r--r--sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch28
-rw-r--r--sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch28
-rw-r--r--sys-devel/distcc/files/distcc-3.3.3-py38.patch53
-rw-r--r--sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch65
-rw-r--r--sys-devel/distcc/files/distcc-3.4-pump-tests.patch153
-rw-r--r--sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch79
-rw-r--r--sys-devel/distcc/metadata.xml7
12 files changed, 509 insertions, 250 deletions
diff --git a/sys-devel/distcc/Manifest b/sys-devel/distcc/Manifest
index f78dee9dc148..19f4116d75c4 100644
--- a/sys-devel/distcc/Manifest
+++ b/sys-devel/distcc/Manifest
@@ -1,2 +1 @@
-DIST distcc-3.3.3.tar.gz 1195666 BLAKE2B b393fdb20eb555dec794bf55c1287dd804a576e0a5db9f2fa84c3924a40185a193231aea807353918430297c9c83c7592aaaafd521cf73c92a72bf30b8a69caa SHA512 d5e7fc67f49ee640cef753038b5c0ebcbbac61c6ac29f20ee4736b045a89979ced765717c46383a4fadc50a4fe34e94e58e307509144414a9ca19eb4cc68a135
DIST distcc-3.4.tar.gz 1239519 BLAKE2B 8dc9baa6b1f65f2bb3621e4e643d7d15d55e2338de4d6a7f20a572d9ec280925b4421a294f40c9fcfba8d4193a6bd1871eb8caf13dd2c2a8a81834671f6bc8bc SHA512 de09329fdfa25e08a9b9529190ddaa9ceccb34c8655692edb86f367a8db4a71b750c6e928cb8e5a670f51fbbc02fd1c8524f72e01b3ebaacc1106dc676d18eef
diff --git a/sys-devel/distcc/distcc-3.4.ebuild b/sys-devel/distcc/distcc-3.4-r1.ebuild
index cb49de0fd3c1..482c5d36a63e 100644
--- a/sys-devel/distcc/distcc-3.4.ebuild
+++ b/sys-devel/distcc/distcc-3.4-r1.ebuild
@@ -1,12 +1,11 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{10..11} )
-inherit autotools flag-o-matic prefix python-single-r1 systemd \
- toolchain-funcs xdg-utils
+inherit autotools flag-o-matic prefix python-single-r1 systemd
DESCRIPTION="Distribute compilation of C code across several machines on a network"
HOMEPAGE="https://github.com/distcc/distcc"
@@ -14,7 +13,7 @@ SRC_URI="https://github.com/distcc/distcc/releases/download/v${PV}/${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
-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="gssapi gtk hardened ipv6 selinux xinetd zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
@@ -27,7 +26,7 @@ RDEPEND="${PYTHON_DEPS}
DEPEND="${RDEPEND}
sys-libs/binutils-libs"
BDEPEND="
- sys-devel/autoconf-archive
+ dev-build/autoconf-archive
virtual/pkgconfig"
RDEPEND+="
acct-user/distcc
@@ -40,6 +39,7 @@ src_prepare() {
eapply "${FILESDIR}/${PN}-3.0-xinetd.patch"
# SOCKSv5 support needed for Portage, bug #537616
eapply "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
+ eapply "${FILESDIR}/${PN}-3.4-pump-tests.patch"
eapply_user
# Bugs #120001, #167844 and probably more. See patch for description.
@@ -64,6 +64,9 @@ src_prepare() {
}
src_configure() {
+ # https://github.com/distcc/distcc/issues/454
+ append-cppflags -DPY_SSIZE_T_CLEAN
+
local myconf=(
--disable-Werror
--libdir="${EPREFIX}"/usr/lib
diff --git a/sys-devel/distcc/distcc-3.3.3-r3.ebuild b/sys-devel/distcc/distcc-3.4-r2.ebuild
index c535bb1a9fe3..8aeae8cfb6ff 100644
--- a/sys-devel/distcc/distcc-3.3.3-r3.ebuild
+++ b/sys-devel/distcc/distcc-3.4-r2.ebuild
@@ -1,12 +1,11 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{10..11} )
-inherit autotools flag-o-matic prefix python-single-r1 systemd \
- toolchain-funcs xdg-utils
+inherit autotools flag-o-matic prefix python-single-r1 systemd
DESCRIPTION="Distribute compilation of C code across several machines on a network"
HOMEPAGE="https://github.com/distcc/distcc"
@@ -14,20 +13,20 @@ SRC_URI="https://github.com/distcc/distcc/releases/download/v${PV}/${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="gssapi gtk hardened ipv6 selinux xinetd zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="${PYTHON_DEPS}
dev-libs/popt
gssapi? ( net-libs/libgssglue )
- gtk? ( x11-libs/gtk+:2 )
+ gtk? ( x11-libs/gtk+:3 )
zeroconf? ( >=net-dns/avahi-0.6[dbus] )
"
DEPEND="${RDEPEND}
sys-libs/binutils-libs"
BDEPEND="
- sys-devel/autoconf-archive
+ dev-build/autoconf-archive
virtual/pkgconfig"
RDEPEND+="
acct-user/distcc
@@ -38,16 +37,10 @@ RDEPEND+="
src_prepare() {
eapply "${FILESDIR}/${PN}-3.0-xinetd.patch"
- # bug #255188
- eapply "${FILESDIR}/${PN}-3.3.2-freedesktop.patch"
# SOCKSv5 support needed for Portage, bug #537616
eapply "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
- # backport py3.8 fixes
- eapply "${FILESDIR}/${P}-py38.patch"
- # gcc-10 fix, #707502
- eapply "${FILESDIR}/${P}-gcc-10-fix.patch"
- # unbreak CHOST prefix, https://bugs.gentoo.org/773652
- eapply "${FILESDIR}/${P}-no-rewrite-chost.patch"
+ eapply "${FILESDIR}/${PN}-3.4-pump-tests.patch"
+ eapply "${FILESDIR}/${P}-fix-dcc_gcc_rewrite_fqn-corruption.patch"
eapply_user
# Bugs #120001, #167844 and probably more. See patch for description.
@@ -72,9 +65,12 @@ src_prepare() {
}
src_configure() {
+ # https://github.com/distcc/distcc/issues/454
+ append-cppflags -DPY_SSIZE_T_CLEAN
+
local myconf=(
--disable-Werror
- --libdir=/usr/lib
+ --libdir="${EPREFIX}"/usr/lib
$(use_enable ipv6 rfc2553)
$(use_with gtk)
--without-gnome
diff --git a/sys-devel/distcc/distcc-3.4-r3.ebuild b/sys-devel/distcc/distcc-3.4-r3.ebuild
new file mode 100644
index 000000000000..aacc1981dc3e
--- /dev/null
+++ b/sys-devel/distcc/distcc-3.4-r3.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit autotools flag-o-matic prefix python-single-r1 systemd
+
+DESCRIPTION="Distribute compilation of C code across several machines on a network"
+HOMEPAGE="https://github.com/distcc/distcc"
+SRC_URI="https://github.com/distcc/distcc/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="gssapi gtk hardened ipv6 selinux xinetd zeroconf"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-libs/popt
+ gssapi? ( net-libs/libgssglue )
+ gtk? ( x11-libs/gtk+:3 )
+ zeroconf? ( >=net-dns/avahi-0.6[dbus] )
+"
+DEPEND="${RDEPEND}
+ sys-libs/binutils-libs"
+BDEPEND="
+ dev-build/autoconf-archive
+ virtual/pkgconfig"
+RDEPEND+="
+ acct-user/distcc
+ dev-util/shadowman
+ >=sys-devel/gcc-config-1.4.1
+ selinux? ( sec-policy/selinux-distcc )
+ xinetd? ( sys-apps/xinetd )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.0-xinetd.patch"
+ # SOCKSv5 support needed for Portage, bug #537616
+ "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
+ "${FILESDIR}/${PN}-3.4-pump-tests.patch"
+ "${FILESDIR}/${P}-fix-dcc_gcc_rewrite_fqn-corruption.patch"
+ "${FILESDIR}/${P}-rewrite-chost.patch"
+)
+
+src_prepare() {
+ default
+
+ # Bugs #120001, #167844 and probably more. See patch for description.
+ use hardened && eapply "${FILESDIR}/distcc-hardened.patch"
+
+ sed -i \
+ -e "/PATH/s:\$distcc_location:${EPREFIX}/usr/lib/distcc/bin:" \
+ -e "s:@PYTHON@:${EPYTHON}:" \
+ pump.in || die "sed failed"
+
+ sed \
+ -e "s:@EPREFIX@:${EPREFIX:-/}:" \
+ -e "s:@libdir@:/usr/lib:" \
+ "${FILESDIR}/distcc-config" > "${T}/distcc-config" || die
+
+ # TODO: gdb tests fail due to gdb failing to find .c file
+ sed -i -e '/Gdb.*Case,/d' test/testdistcc.py || die
+
+ hprefixify update-distcc-symlinks.py src/{serve,daemon}.c
+ python_fix_shebang update-distcc-symlinks.py "${T}/distcc-config"
+ eautoreconf
+}
+
+src_configure() {
+ # https://github.com/distcc/distcc/issues/454
+ append-cppflags -DPY_SSIZE_T_CLEAN
+
+ local myconf=(
+ --disable-Werror
+ --libdir="${EPREFIX}"/usr/lib
+ $(use_enable ipv6 rfc2553)
+ $(use_with gtk)
+ --without-gnome
+ $(use_with gssapi auth)
+ $(use_with zeroconf avahi)
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ # sandbox breaks some tests, and hangs some too
+ # retest once #590084 is fixed
+ local -x SANDBOX_ON=0
+ emake -j1 check
+}
+
+src_install() {
+ # override GZIP_BIN to stop it from compressing manpages
+ emake -j1 DESTDIR="${D}" GZIP_BIN=false install
+ python_optimize
+
+ newinitd "${FILESDIR}/distccd.initd" distccd
+ systemd_newunit "${FILESDIR}/distccd.service-1" distccd.service
+ systemd_install_serviced "${FILESDIR}/distccd.service.conf"
+
+ cp "${FILESDIR}/distccd.confd" "${T}/distccd" || die
+ if use zeroconf; then
+ cat >> "${T}/distccd" <<-EOF || die
+
+ # Enable zeroconf support in distccd
+ DISTCCD_OPTS="\${DISTCCD_OPTS} --zeroconf"
+ EOF
+
+ sed -i '/ExecStart/ s|$| --zeroconf|' "${D}$(systemd_get_systemunitdir)"/distccd.service || die
+ fi
+ doconfd "${T}/distccd"
+
+ newenvd - 02distcc <<-EOF || die
+ # This file is managed by distcc-config; use it to change these settings.
+ # DISTCC_LOG and DISTCC_DIR should not be set.
+ DISTCC_VERBOSE="${DISTCC_VERBOSE:-0}"
+ DISTCC_FALLBACK="${DISTCC_FALLBACK:-1}"
+ DISTCC_SAVE_TEMPS="${DISTCC_SAVE_TEMPS:-0}"
+ DISTCC_TCP_CORK="${DISTCC_TCP_CORK}"
+ DISTCC_SSH="${DISTCC_SSH}"
+ UNCACHED_ERR_FD="${UNCACHED_ERR_FD}"
+ DISTCC_ENABLE_DISCREPANCY_EMAIL="${DISTCC_ENABLE_DISCREPANCY_EMAIL}"
+ DCC_EMAILLOG_WHOM_TO_BLAME="${DCC_EMAILLOG_WHOM_TO_BLAME}"
+ EOF
+
+ keepdir /usr/lib/distcc
+
+ dobin "${T}/distcc-config"
+
+ if use gtk; then
+ einfo "Renaming /usr/bin/distccmon-gnome to /usr/bin/distccmon-gui"
+ einfo "This is to have a little sensability in naming schemes between distccmon programs"
+ mv "${ED}/usr/bin/distccmon-gnome" "${ED}/usr/bin/distccmon-gui" || die
+ dosym distccmon-gui /usr/bin/distccmon-gnome
+ fi
+
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ newins "doc/example/xinetd" distcc
+ fi
+
+ insinto /usr/share/shadowman/tools
+ newins - distcc <<<"${EPREFIX}/usr/lib/distcc/bin"
+ newins - distccd <<<"${EPREFIX}/usr/lib/distcc"
+
+ rm -r "${ED}/etc/default" || die
+ rm "${ED}/etc/distcc/clients.allow" || die
+ rm "${ED}/etc/distcc/commands.allow.sh" || die
+}
+
+pkg_postinst() {
+ # remove the old paths when switching from libXX to lib
+ if [[ $(get_libdir) != lib && ${SYMLINK_LIB} != yes && \
+ -d ${EROOT}/usr/$(get_libdir)/distcc ]]; then
+ rm -r -f "${EROOT}/usr/$(get_libdir)/distcc" || die
+ fi
+
+ if [[ -z ${ROOT} ]]; then
+ eselect compiler-shadow update distcc
+ eselect compiler-shadow update distccd
+ fi
+
+ elog
+ elog "Tips on using distcc with Gentoo can be found at"
+ elog "https://wiki.gentoo.org/wiki/Distcc"
+ elog
+ elog "distcc-pump is known to cause breakage with multiple packages."
+ elog "Do NOT enable it globally."
+ elog
+ elog "To use the distccmon programs with Gentoo you should use this command:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-text 5"
+
+ if use gtk; then
+ elog "Or:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-gnome"
+ fi
+}
+
+pkg_prerm() {
+ if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]]; then
+ eselect compiler-shadow remove distcc
+ fi
+}
diff --git a/sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch b/sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch
deleted file mode 100644
index 7b735ebec7f9..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From d852c808d6f470031f40edec9ebe980afc69b9b9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sat, 8 Dec 2018 12:50:07 +0100
-Subject: [PATCH] Fix desktop spec compliance of distccmon-gnome install
-
----
- Makefile.in | 18 ++++++++++--------
- gnome/distccmon-gnome.desktop | 7 +++----
- ...mon-gnome-icon.png => distccmon-gnome.png} | Bin
- src/mon-gnome.c | 2 +-
- 4 files changed, 14 insertions(+), 13 deletions(-)
- rename gnome/{distccmon-gnome-icon.png => distccmon-gnome.png} (100%)
-
-diff --git a/Makefile.in b/Makefile.in
-index 6e1e467..1106559 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -52,13 +52,14 @@ mandir = @mandir@
- includedir = @includedir@
- oldincludedir = /usr/include
- docdir = @docdir@
--pkgdatadir = $(datadir)/@PACKAGE_NAME@
-+icondir = $(datarootdir)/pixmaps
-+desktopdir = $(datarootdir)/applications
-
- include_server_builddir = $(builddir)/_include_server
-
- # These must be done from here, not from autoconf, because they can
- # contain variable expansions written in Make syntax. Ew.
--DIR_DEFS = -DLIBDIR="\"${libdir}\"" -DSYSCONFDIR="\"${sysconfdir}\"" -DPKGDATADIR="\"${pkgdatadir}\""
-+DIR_DEFS = -DLIBDIR="\"${libdir}\"" -DSYSCONFDIR="\"${sysconfdir}\"" -DICONDIR="\"${icondir}\""
-
- # arguments to pkgconfig
- GNOME_PACKAGES = @GNOME_PACKAGES@
-@@ -387,7 +388,7 @@ man_HTML = man/distcc_1.html man/distccd_1.html man/distccmon_text_1.html \
- man/lsdistcc_1.html man/pump_1.html man/include_server_1.html
- MEN = $(man1_MEN)
-
--gnome_data = gnome/distccmon-gnome-icon.png \
-+gnome_data = gnome/distccmon-gnome.png \
- gnome/distccmon-gnome.desktop
-
- popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
-@@ -1033,7 +1034,8 @@ showpaths:
- @echo " programs $(DESTDIR)$(bindir)"
- @echo " sbin programs $(DESTDIR)$(sbindir)"
- @echo " system configuration $(DESTDIR)$(sysconfdir)"
-- @echo " shared data files $(DESTDIR)$(pkgdatadir)"
-+ @echo " icon file $(DESTDIR)$(icondir)"
-+ @echo " application file $(DESTDIR)$(desktopdir)"
-
-
- # install-sh can't handle multiple arguments, but we don't need any
-@@ -1129,10 +1131,10 @@ install-example: $(example_DOCS)
- done
-
- install-gnome-data: $(gnome_data)
-- $(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)"
-- for p in $(gnome_data); do \
-- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
-- done
-+ $(mkinstalldirs) "$(DESTDIR)$(icondir)"
-+ $(mkinstalldirs) "$(DESTDIR)$(desktopdir)"
-+ $(INSTALL_DATA) gnome/distccmon-gnome.png "$(DESTDIR)$(icondir)"
-+ $(INSTALL_DATA) gnome/distccmon-gnome.desktop "$(DESTDIR)$(desktopdir)"
-
- install-conf: $(conf_files) $(default_files)
- $(mkinstalldirs) "$(DESTDIR)$(sysconfdir)/distcc"
-diff --git a/gnome/distccmon-gnome.desktop b/gnome/distccmon-gnome.desktop
-index bd1fa26..7205f5e 100644
---- a/gnome/distccmon-gnome.desktop
-+++ b/gnome/distccmon-gnome.desktop
-@@ -1,6 +1,5 @@
- [Desktop Entry]
--Version=0.9.4
--Encoding=UTF-8
-+Version=1.0
- Exec=distccmon-gnome
- Name=distcc monitor
- Name[sv]=distcc övervakare
-@@ -8,9 +7,9 @@ GenericName=Distributed Compile Monitor
- GenericName[sv]=Distribuerad kompilerings-övervakare
- Comment=Graphical view of distributed compile tasks
- Comment[sv]=Grafisk vy av distribuerade kompileringsuppgifter
--Icon=distccmon-gnome-icon.png
-+Icon=distccmon-gnome
- TryExec=distccmon-gnome
- Terminal=false
- Type=Application
--Categories=GNOME;Application;Development;
-+Categories=GNOME;GTK;Development;
- StartupNotify=true
-diff --git a/gnome/distccmon-gnome-icon.png b/gnome/distccmon-gnome.png
-similarity index 100%
-rename from gnome/distccmon-gnome-icon.png
-rename to gnome/distccmon-gnome.png
-diff --git a/src/mon-gnome.c b/src/mon-gnome.c
-index 24681d0..bfc286d 100644
---- a/src/mon-gnome.c
-+++ b/src/mon-gnome.c
-@@ -599,7 +599,7 @@ static GtkWidget * dcc_gnome_make_mainwin (void)
-
- #if GTK_CHECK_VERSION(2,2,0)
- gtk_window_set_icon_from_file (GTK_WINDOW (mainwin),
-- PKGDATADIR "/distccmon-gnome-icon.png",
-+ ICONDIR "/distccmon-gnome.png",
- NULL);
- #endif
-
---
-2.20.0.rc2
-
diff --git a/sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch b/sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch
deleted file mode 100644
index 2c0bce6c82b6..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 377969cc762569f4a5ec409a1e7ad6a7be3e51b3 Mon Sep 17 00:00:00 2001
-From: Romain Geissler <romain.geissler@amadeus.com>
-Date: Mon, 27 Jan 2020 09:28:43 +0000
-Subject: [PATCH] Fix build with gcc 10 which defaults to -fno-common (cf
- https://gcc.gnu.org/gcc-10/porting_to.html)
-
-This fixes the following link error I see when I use the latest gcc 10
-git branch:
-/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/serve.o:(.bss+0x0): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
-/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/stats.o:(.data+0x20): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
-collect2: error: ld returned 1 exit status
----
- src/stats.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/stats.h b/src/stats.h
-index 9bde285..74d4690 100644
---- a/src/stats.h
-+++ b/src/stats.h
-@@ -33,7 +33,7 @@ enum stats_e { STATS_TCP_ACCEPT, STATS_REJ_BAD_REQ, STATS_REJ_OVERLOAD,
- STATS_COMPILE_OK, STATS_COMPILE_ERROR, STATS_COMPILE_TIMEOUT,
- STATS_CLI_DISCONN, STATS_OTHER, STATS_ENUM_MAX };
-
--const char *stats_text[20];
-+extern const char *stats_text[20];
-
- int dcc_stats_init(void);
- void dcc_stats_init_kid(void);
diff --git a/sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch b/sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch
deleted file mode 100644
index dafaa90759b4..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From c2471d4cf3e2ef2556c150d52860b4e8f04e4994 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
-Date: Mon, 1 Mar 2021 22:13:36 +0200
-Subject: [PATCH] distcc: fix i686 cross compile
-
-[mgorny: disable toolchain prefix rewriting code that workarounds some
- Debian invention and breaks everything else]
-
----
- src/compile.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/compile.c b/src/compile.c
-index 25df355..e5d655b 100644
---- a/src/compile.c
-+++ b/src/compile.c
-@@ -572,7 +572,7 @@ static int dcc_gcc_rewrite_fqn(char **argv)
- if (!newcmd)
- return -ENOMEM;
-
-- if ((t = strstr(target_with_vendor, "-pc-"))) {
-+ if (0 && (t = strstr(target_with_vendor, "-pc-"))) {
- memcpy(newcmd, target_with_vendor, t - target_with_vendor);
- strcat(newcmd, t + strlen("-pc"));
- } else
---
-2.26.2
-
diff --git a/sys-devel/distcc/files/distcc-3.3.3-py38.patch b/sys-devel/distcc/files/distcc-3.3.3-py38.patch
deleted file mode 100644
index 1ba5fee7d87e..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.3-py38.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From c52a023b8a17e4346c66a8fddee69b40b327eae7 Mon Sep 17 00:00:00 2001
-From: MartB <mart.b@outlook.de>
-Date: Thu, 28 Nov 2019 21:00:59 +0100
-Subject: [PATCH] Replace time.clock() with time.perf_counter()
-
-.clock() got removed in python 3.8 and was marked as deprecated since 3.3
-(https://github.com/python/cpython/pull/13270)
----
- include_server/parse_file.py | 4 ++--
- include_server/statistics.py | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/include_server/parse_file.py b/include_server/parse_file.py
-index d1dcc74..f5d78b7 100755
---- a/include_server/parse_file.py
-+++ b/include_server/parse_file.py
-@@ -272,7 +272,7 @@ def Parse(self, filepath, symbol_table):
-
- assert isinstance(filepath, str)
- self.filepath = filepath
-- parse_file_start_time = time.clock()
-+ parse_file_start_time = time.perf_counter()
- statistics.parse_file_counter += 1
-
- includepath_map_index = self.includepath_map.Index
-@@ -338,6 +338,6 @@ def Parse(self, filepath, symbol_table):
- expr_includes, next_includes)
-
-
-- statistics.parse_file_total_time += time.clock() - parse_file_start_time
-+ statistics.parse_file_total_time += time.perf_counter() - parse_file_start_time
-
- return (quote_includes, angle_includes, expr_includes, next_includes)
-diff --git a/include_server/statistics.py b/include_server/statistics.py
-index 9677af3..7bc9cb8 100755
---- a/include_server/statistics.py
-+++ b/include_server/statistics.py
-@@ -62,13 +62,13 @@ def StartTiming():
- global start_time, translation_unit_counter
- """Mark the start of a request to find an include closure."""
- translation_unit_counter += 1
-- start_time = time.clock()
-+ start_time = time.perf_counter()
-
-
- def EndTiming():
- """Mark the end of an include closure calculation."""
- global translation_unit_time, min_time, max_time, total_time
-- translation_unit_time = time.clock() - start_time
-+ translation_unit_time = time.perf_counter() - start_time
- min_time = min(translation_unit_time, min_time)
- max_time = max(translation_unit_time, max_time)
- total_time += translation_unit_time
diff --git a/sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch b/sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch
new file mode 100644
index 000000000000..14c08db329d1
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch
@@ -0,0 +1,65 @@
+https://bugs.gentoo.org/904720
+https://github.com/distcc/distcc/commit/879b71d6e95673e58d33f6c3c341a893ee307161
+
+From 879b71d6e95673e58d33f6c3c341a893ee307161 Mon Sep 17 00:00:00 2001
+From: Alexey Sheplyakov <asheplyakov@yandex.ru>
+Date: Sat, 10 Jul 2021 22:18:14 +0400
+Subject: [PATCH] dcc_gcc_rewrite_fqn: avoid heap corruption
+
+On ALT Linux I've run into the following bug:
+
+distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c
+free(): invalid next size (fast)
+Aborted (core dumped)
+
+Apparently dcc_gcc_rewrite writes beyond the allocated memory:
+
+valgrind --leak-check=full -v ./distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c
+
+==11382== ERROR SUMMARY: 53 errors from 5 contexts (suppressed: 0 from 0)
+==11382==
+==11382== 1 errors in context 1 of 5:
+==11382== Invalid write of size 1
+==11382== at 0x4C349D8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+==11382== Address 0x544e828 is 1 bytes after a block of size 23 alloc'd
+==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+==11382==
+==11382==
+==11382== 1 errors in context 2 of 5:
+==11382== Invalid write of size 1
+==11382== at 0x4C349C8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+==11382== Address 0x544e827 is 0 bytes after a block of size 23 alloc'd
+==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+
+and ALT Linux' hardened glibc does not quite like that.
+Correctly compute the `newcmd_len` to avoid the problem.
+
+ALTBUG: #40425
+--- a/src/compile.c
++++ b/src/compile.c
+@@ -584,7 +584,7 @@ static int dcc_gcc_rewrite_fqn(char **argv)
+ return -ENOENT;
+
+
+- newcmd_len = strlen(target_with_vendor) + 1 + strlen(argv[0] + 1);
++ newcmd_len = strlen(target_with_vendor) + 1 + strlen(argv[0]) + 1;
+ newcmd = malloc(newcmd_len);
+ if (!newcmd)
+ return -ENOMEM;
+
diff --git a/sys-devel/distcc/files/distcc-3.4-pump-tests.patch b/sys-devel/distcc/files/distcc-3.4-pump-tests.patch
new file mode 100644
index 000000000000..db392b7f3632
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.4-pump-tests.patch
@@ -0,0 +1,153 @@
+https://github.com/distcc/distcc/pull/460
+
+From 45d9c4a1ef66451ed45a6afdec7098ed02082390 Mon Sep 17 00:00:00 2001
+From: Rosen Matev <rosen.matev@cern.ch>
+Date: Fri, 29 Apr 2022 15:42:28 +0200
+Subject: [PATCH] Fix tests in pump mode
+
+`make check` is also running tests for the pump mode
+(`pump-maintainer-check` target) but they were all falling back to
+the usual preprocessor mode as the include server was not started.
+
+This is solved by prepending `pump` to the distcc invocations and
+also some trivially failing tests are fixed or disabled when they
+make no sense in pump mode.
+---
+ Makefile.in | 2 +-
+ pump.in | 13 +++++++++++--
+ test/testdistcc.py | 28 ++++++++++++++++++++++++----
+ 3 files changed, 36 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index f240ca6f..79e28380 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -583,7 +583,7 @@ distccmon-gnome@EXEEXT@: $(mon_obj) $(gnome_obj)
+ # the distcc version, the source location, the CPP flags (for location of the
+ # includes), and the build location.
+ include-server:
+- if test -z "$(PYTHON)"; then \
++ @if test -z "$(PYTHON)"; then \
+ echo "Not building $@: No suitable python found"; \
+ else \
+ mkdir -p "$(include_server_builddir)" && \
+diff --git a/pump.in b/pump.in
+index 8e46f458..08a32c0e 100755
+--- a/pump.in
++++ b/pump.in
+@@ -218,7 +218,9 @@ PrintIncludeServerStatusMessage() {
+ }
+
+ Announce() {
+- echo "__________Using distcc-pump from $DISTCC_LOCATION"
++ if [ "$verbose" = 1 ]; then
++ echo "__________Using distcc-pump from $DISTCC_LOCATION"
++ fi
+ }
+
+ # Starts up the include server. Sets $socket, $socket_dir, and
+@@ -359,7 +361,9 @@ ShutDown() {
+ # Always -- at exit -- shut down include_server and remove $socket_dir
+ if [ -n "$include_server_pid" ] && \
+ ps -p "$include_server_pid" > /dev/null; then
+- echo '__________Shutting down distcc-pump include server'
++ if [ "$verbose" = 1 ]; then
++ echo '__________Shutting down distcc-pump include server'
++ fi
+ kill $include_server_pid
+ # Wait until it's really dead. We need to do this because the
+ # include server may produce output after receiving SIGTERM.
+@@ -508,6 +512,11 @@ Main() {
+
+ Initialize
+
++ # Do not write on stdout if we're testing pump mode
++ if [ "0$DISTCC_TESTING_INCLUDE_SERVER" -ne "0" ]; then
++ verbose=0
++ fi
++
+ case "$*" in
+ --startup)
+ # Don't put ordinary progress messages on stdout,
+diff --git a/test/testdistcc.py b/test/testdistcc.py
+index dfdf2f13..6377d0b6 100755
+--- a/test/testdistcc.py
++++ b/test/testdistcc.py
+@@ -258,7 +258,11 @@ def valgrind(self):
+ return _valgrind_command;
+
+ def distcc(self):
+- return self.valgrind() + "distcc "
++ if "cpp" not in _server_options:
++ return self.valgrind() + "distcc "
++ else:
++ return "DISTCC_TESTING_INCLUDE_SERVER=1 " + self.valgrind() + "pump distcc "
++
+
+ def distccd(self):
+ return self.valgrind() + "distccd "
+@@ -422,6 +426,11 @@ class BogusOption_Case(SimpleDistCC_Case):
+ Now that we support implicit compilers, this is passed to gcc,
+ which returns a non-zero status."""
+ def runtest(self):
++ # Disable the test in pump mode since the pump wrapper fails
++ # before we can run distcc.
++ if "cpp" in _server_options:
++ raise comfychair.NotRunError('pump wrapper expects DISTCC_HOSTS')
++
+ error_rc, _, _ = self.runcmd_unchecked(self._cc + " --bogus-option")
+ assert error_rc != 0
+ self.runcmd(self.distcc() + self._cc + " --bogus-option", error_rc)
+@@ -432,7 +441,7 @@ def runtest(self):
+ class CompilerOptionsPassed_Case(SimpleDistCC_Case):
+ """Test that options following the compiler name are passed to the compiler."""
+ def runtest(self):
+- out, err = self.runcmd("DISTCC_HOSTS=localhost "
++ out, err = self.runcmd("DISTCC_HOSTS=localhost%s " % _server_options
+ + self.distcc()
+ + self._cc + " --help")
+ if re.search('distcc', out):
+@@ -1422,7 +1431,8 @@ def source(self):
+
+ def setupEnv(self):
+ Compilation_Case.setupEnv(self)
+- os.environ['DISTCC_HOSTS'] = '127.0.0.1:%d,lzo' % self.server_port
++ os.environ['DISTCC_HOSTS'] = (
++ '127.0.0.1:%d,lzo' % self.server_port + _server_options)
+
+ class DashONoSpace_Case(CompileHello_Case):
+ def compileCmd(self):
+@@ -1525,6 +1535,11 @@ def source(self):
+ """
+
+ def runtest(self):
++ # Disable the test in pump mode since the pump wrapper fails
++ # before we can run distcc.
++ if "cpp" in _server_options:
++ raise comfychair.NotRunError('pump wrapper expects DISTCC_HOSTS')
++
+ # -P means not to emit linemarkers
+ self.runcmd(self.distcc()
+ + self._cc + " -E testtmp.c -o testtmp.out")
+@@ -1828,7 +1843,7 @@ class NoServer_Case(CompileHello_Case):
+ """Invalid server name"""
+ def setup(self):
+ self.stripEnvironment()
+- os.environ['DISTCC_HOSTS'] = 'no.such.host.here'
++ os.environ['DISTCC_HOSTS'] = 'no.such.host.here' + _server_options
+ self.distcc_log = 'distcc.log'
+ os.environ['DISTCC_LOG'] = self.distcc_log
+ self.createSource()
+@@ -1874,6 +1889,11 @@ class NoHosts_Case(CompileHello_Case):
+ We expect compilation to succeed, but with a warning that it was
+ run locally."""
+ def runtest(self):
++ # Disable the test in pump mode since the pump wrapper fails
++ # before we can run distcc.
++ if "cpp" in _server_options:
++ raise comfychair.NotRunError('pump wrapper expects DISTCC_HOSTS')
++
+ # WithDaemon_Case sets this to point to the local host, but we
+ # don't want that. Note that you cannot delete environment
+ # keys in Python1.5, so we need to just set them to the empty
+
diff --git a/sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch b/sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch
new file mode 100644
index 000000000000..05db9691bbbe
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch
@@ -0,0 +1,79 @@
+https://bugs.gentoo.org/773652
+https://github.com/distcc/distcc/issues/440
+https://github.com/distcc/distcc/commit/850db9eec0d5dd7f47ade8ffca91b679081f6d85
+
+From 850db9eec0d5dd7f47ade8ffca91b679081f6d85 Mon Sep 17 00:00:00 2001
+From: Alexey Sheplyakov <asheplyakov@altlinux.org>
+Date: Sun, 11 Jul 2021 18:57:00 +0400
+Subject: [PATCH] Improved cross-rewriting on non-x86 systems
+
+Unfortunately autoconf and GCC don't agree on the system name:
+
+- On arm (aarch64): `GNU_HOST` is `aarch64-unknown-linux-gnu`,
+ and GCC triple is `aarch64-linux-gnu` instead.
+- On rpm-based x86_64 distros: `GNU_HOST` is `x86_64-pc-linux-gnu`,
+ and GCC triple is `x86_64-redhat-linux`
+
+Therefore ask the compiler (when running distcc configure script)
+how to correctly identify it.
+
+Closes: #440
+ALTBUG: 40425
+--- a/configure.ac
++++ b/configure.ac
+@@ -547,6 +547,22 @@ AC_SUBST(CPPFLAGS)
+ AC_SUBST(POPT_INCLUDES)
+ AC_SUBST(BUILD_POPT)
+ AC_SUBST(GNOME_BIN)
++
++
++# Sometimes canonical triples as used by configure differ from GCC ones
++# x86: configure: x86_64-pc-linux-gnu, GCC: x86_64-linux-gnu
++# ALT Linux: configure: ${arch}-alt-linux-gnu, GCC: ${arch}-alt-linux
++# Therefore ask the compiler for its triple
++if test "x${GCC}" = xyes ; then
++ native_compiler_triple=`$CC -dumpmachine`
++fi
++if test "x$native_compiler_triple" = "x"; then
++ native_compiler_triple="$host"
++fi
++AC_MSG_NOTICE([Native compiler triple: $native_compiler_triple])
++
++AC_DEFINE_UNQUOTED(NATIVE_COMPILER_TRIPLE, ["$native_compiler_triple"], [Native compiler triple])
++
+ AC_DEFINE_UNQUOTED(GNU_HOST, ["$host"], [Your gnu-style host triple])
+ # The '.stamp-conf' files force creation of the containing directories in the
+ # build tree.
+--- a/src/compile.c
++++ b/src/compile.c
+@@ -549,7 +549,7 @@ static void dcc_rewrite_generic_compiler(char **argv)
+ static void dcc_add_clang_target(char **argv)
+ {
+ /* defined by autoheader */
+- const char *target = GNU_HOST;
++ const char *target = NATIVE_COMPILER_TRIPLE;
+
+ if (strcmp(argv[0], "clang") == 0 || strncmp(argv[0], "clang-", strlen("clang-")) == 0 ||
+ strcmp(argv[0], "clang++") == 0 || strncmp(argv[0], "clang++-", strlen("clang++-")) == 0)
+@@ -577,7 +577,7 @@ static void dcc_add_clang_target(char **argv)
+ static int dcc_gcc_rewrite_fqn(char **argv)
+ {
+ /* defined by autoheader */
+- const char *target_with_vendor = GNU_HOST;
++ const char *target_with_vendor = NATIVE_COMPILER_TRIPLE;
+ char *newcmd, *t, *path;
+ int pathlen = 0;
+ int newcmd_len = 0;
+@@ -595,11 +595,7 @@ static int dcc_gcc_rewrite_fqn(char **argv)
+ return -ENOMEM;
+ memset(newcmd, 0, newcmd_len);
+
+- if ((t = strstr(target_with_vendor, "-pc-"))) {
+- memcpy(newcmd, target_with_vendor, t - target_with_vendor);
+- strcat(newcmd, t + strlen("-pc"));
+- } else
+- strcpy(newcmd, target_with_vendor);
++ strcpy(newcmd, target_with_vendor);
+
+
+ strcat(newcmd, "-");
diff --git a/sys-devel/distcc/metadata.xml b/sys-devel/distcc/metadata.xml
index 949da1a6e8db..8e23cf8fbb58 100644
--- a/sys-devel/distcc/metadata.xml
+++ b/sys-devel/distcc/metadata.xml
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="person">
- <email>mgorny@gentoo.org</email>
- <name>Michał Górny</name>
- </maintainer>
<maintainer type="project">
<email>cluster@gentoo.org</email>
<name>Gentoo Cluster Project</name>
@@ -12,4 +8,7 @@
<use>
<flag name="gssapi">Enable support for <pkg>net-libs/libgssglue</pkg></flag>
</use>
+ <upstream>
+ <remote-id type="github">distcc/distcc</remote-id>
+ </upstream>
</pkgmetadata>