From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1446778-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 6A8AD158020
	for <garchives@archives.gentoo.org>; Thu, 13 Oct 2022 19:58:23 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9F8BEE0917;
	Thu, 13 Oct 2022 19:58:22 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 88FADE090E
	for <gentoo-commits@lists.gentoo.org>; Thu, 13 Oct 2022 19:58:22 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id CC121340FCC
	for <gentoo-commits@lists.gentoo.org>; Thu, 13 Oct 2022 19:58:21 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B3D661E
	for <gentoo-commits@lists.gentoo.org>; Thu, 13 Oct 2022 19:58:19 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1665691074.11b2dd23d0346810812e8b07ba1f8e5f06ae470d.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
X-VCS-Repository: repo/gentoo
X-VCS-Files: eclass/kernel-build.eclass
X-VCS-Directories: eclass/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 11b2dd23d0346810812e8b07ba1f8e5f06ae470d
X-VCS-Branch: master
Date: Thu, 13 Oct 2022 19:58:19 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 7f28a994-20e5-4cc7-a69f-c927eebf246e
X-Archives-Hash: 4e5d11c57e6d48a375a482dd06cdde2e

commit:     11b2dd23d0346810812e8b07ba1f8e5f06ae470d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 11 19:54:56 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 19:57:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11b2dd23

kernel-build.eclass: compress xz/zstd in parallel

Note that this will only take effect if compressing
modules with xz or zstd (COMPRESS_MODULE_XZ is set or
COMPRESS_MODULE_ZSTD is set respectively)

... or if compiling the kernel with xz or zstd (COMPRESS_KERNEL_XZ
or COMPRESS_KERNEL_ZSTD is set respectiely).

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/kernel-build.eclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 98a385bf72c0..936258e9e8af 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -29,7 +29,7 @@ esac
 
 PYTHON_COMPAT=( python3_{8..11} )
 
-inherit python-any-r1 savedconfig toolchain-funcs kernel-install
+inherit multiprocessing python-any-r1 savedconfig toolchain-funcs kernel-install
 
 BDEPEND="
 	${PYTHON_DEPS}
@@ -90,6 +90,14 @@ kernel-build_src_configure() {
 		ARCH=$(tc-arch-kernel)
 	)
 
+	if type -P xz ; then
+		export XZ_OPT="-T$(makeopts_jobs)"
+	fi
+
+	if type -P zstd ; then
+		export ZSTD_NBTHREADS="$(makeopts_jobs)"
+	fi
+
 	restore_config .config
 	[[ -f .config ]] || die "Ebuild error: please copy default config into .config"