public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alfred Persson Forsberg <cat@catcream.org>
To: gentoo-dev@lists.gentoo.org
Cc: sam@gentoo.org, llvm@gentoo.org, toolchain@gentoo.org,
	cross@gentoo.org, Alfred Persson Forsberg <cat@catcream.org>
Subject: [gentoo-dev] [PATCH 2/4] sys-libs/musl: Support LLVM/Clang crossdev
Date: Fri, 11 Aug 2023 05:48:21 +0200	[thread overview]
Message-ID: <20230811034823.34301-4-cat@catcream.org> (raw)
In-Reply-To: <20230811034823.34301-1-cat@catcream.org>

Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
---
 sys-libs/musl/musl-1.2.4.ebuild | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/sys-libs/musl/musl-1.2.4.ebuild b/sys-libs/musl/musl-1.2.4.ebuild
index a0653436a844..da55b8c05fe1 100644
--- a/sys-libs/musl/musl-1.2.4.ebuild
+++ b/sys-libs/musl/musl-1.2.4.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit flag-o-matic toolchain-funcs prefix
+inherit cross flag-o-matic toolchain-funcs prefix
 if [[ ${PV} == "9999" ]] ; then
 	EGIT_REPO_URI="git://git.musl-libc.org/musl"
 	inherit git-r3
@@ -25,14 +25,6 @@ SRC_URI+="
 	https://dev.gentoo.org/~blueness/musl-misc/iconv.c
 "
 
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
 DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
 HOMEPAGE="https://musl.libc.org"
 
@@ -49,17 +41,13 @@ QA_PRESTRIPPED="usr/lib/crtn.o"
 # built as part as crossdev. Also, elide the blockers when in cross-*,
 # as it doesn't make sense to block the normal CBUILD libxcrypt at all
 # there when we're installing into /usr/${CHOST} anyway.
-if [[ ${CATEGORY} == cross-* ]] ; then
+if is_crosspkg ; then
 	IUSE="${IUSE/crypt/+crypt}"
 else
 	RDEPEND="crypt? ( !sys-libs/libxcrypt[system] )"
 	PDEPEND="!crypt? ( sys-libs/libxcrypt[system] )"
 fi
 
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
 just_headers() {
 	use headers-only && is_crosscompile
 }
@@ -121,7 +109,7 @@ src_compile() {
 	just_headers && return 0
 
 	emake
-	if [[ ${CATEGORY} != cross-* ]] ; then
+	if ! is_crosspkg ; then
 		emake -C "${T}" getconf getent iconv \
 			CC="$(tc-getCC)" \
 			CFLAGS="${CFLAGS}" \
@@ -152,7 +140,7 @@ src_install() {
 		rm "${ED}/usr/$(get_libdir)/libcrypt.a" || die
 	fi
 
-	if [[ ${CATEGORY} != cross-* ]] ; then
+	if ! is_crosspkg ; then
 		# Fish out of config:
 		#   ARCH = ...
 		#   SUBARCH = ...
-- 
2.41.0



  parent reply	other threads:[~2023-08-11  3:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11  3:48 [gentoo-dev] [PATCH 3/4] kernel-2.eclass: Use cross.eclass for figuring out CTARGET Alfred Persson Forsberg
2023-08-11  3:48 ` [gentoo-dev] [PATCH 0/4] Introducing cross.eclass for Crossdev ebuilds Alfred Persson Forsberg
2023-08-11  3:48 ` [gentoo-dev] [PATCH 1/4] cross.eclass: new eclass Alfred Persson Forsberg
2023-08-11  3:48 ` Alfred Persson Forsberg [this message]
2023-08-11  3:48 ` [gentoo-dev] [PATCH 3/4] kernel-2.eclass: Use cross.eclass for figuring out CTARGET Alfred Persson Forsberg
2023-08-11  3:48 ` [gentoo-dev] [PATCH 4/4] sys-libs/compiler-rt: Support LLVM/Clang crossdev Alfred Persson Forsberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230811034823.34301-4-cat@catcream.org \
    --to=cat@catcream.org \
    --cc=cross@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=llvm@gentoo.org \
    --cc=sam@gentoo.org \
    --cc=toolchain@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox