public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Patrice Clement" <monsieurp@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/micropython/
Date: Thu,  4 Jun 2020 15:36:49 +0000 (UTC)	[thread overview]
Message-ID: <1591284998.d9da7701771d663b3a9ed3417e9b320048c06846.monsieurp@gentoo> (raw)

commit:     d9da7701771d663b3a9ed3417e9b320048c06846
Author:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  4 15:34:08 2020 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Jun  4 15:36:38 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9da7701

dev-lang/micropython: honor CFLAGS/LDFLAGS.

Don't rely on emake as it discards internal flags and generates
compilation failures but patch Makefile directly. Also, this
enforcement, although correct, causes a few tests to fail. I haven't
looked at why in detail so tests are disabled for now until further
investigation.

Closes: https://bugs.gentoo.org/727092
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 dev-lang/micropython/micropython-1.11.ebuild | 31 ++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/dev-lang/micropython/micropython-1.11.ebuild b/dev-lang/micropython/micropython-1.11.ebuild
index e0c69a12c7a..94d80d97d92 100644
--- a/dev-lang/micropython/micropython-1.11.ebuild
+++ b/dev-lang/micropython/micropython-1.11.ebuild
@@ -21,28 +21,41 @@ DEPEND="
 
 PATCHES=( "${FILESDIR}/${P}-prevent-stripping.patch" )
 
-src_compile() {
+# A few tests fail after enforcing CFLAGS/LDFLAGS.
+# We need to work out why.
+RESTRICT="test"
+
+src_prepare() {
+	default
+
 	cd ports/unix || die
 
-	# 1) don't die on compiler warnings
+	# 1) don't die on compiler warning
 	# 2) remove /usr/local prefix references in favour of /usr
-	sed -i \
-		-e 's#-Werror##g;' \
+	# 3) enforce our CFLAGS
+	# 4) enforce our LDFLAGS
+	sed -e 's#-Werror##g;' \
 		-e 's#\/usr\/local#\/usr#g;' \
-		Makefile || die
+		-e "s#^CFLAGS = \(.*\)#CFLAGS = \1 ${CFLAGS}#g" \
+		-e "s#^LDFLAGS = \(.*\)#LDFLAGS = \1 ${LDFLAGS}#g" \
+		-i Makefile || die "can't patch Makefile"
+}
+
+src_compile() {
+	cd ports/unix || die
 
-	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" axtls
-	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+	emake CC="$(tc-getCC)" axtls
+	emake CC="$(tc-getCC)"
 }
 
 src_test() {
 	cd ports/unix || die
-	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" test
+	emake CC="$(tc-getCC)" test
 }
 
 src_install() {
 	pushd ports/unix > /dev/null || die
-	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" DESTDIR="${D}" install
+	emake CC="$(tc-getCC)" DESTDIR="${D}" install
 	popd > /dev/null || die
 
 	# remove .git files


             reply	other threads:[~2020-06-04 15:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 15:36 Patrice Clement [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-07-26  7:40 [gentoo-commits] repo/gentoo:master commit in: dev-lang/micropython/ Joonas Niilola
2022-11-18 15:06 Arthur Zamarin
2021-07-10 18:54 Sam James
2021-06-16 11:14 Michał Górny
2020-11-16 22:53 Sergei Trofimovich
2020-06-04  7:03 Patrice Clement
2020-06-03 20:54 Patrice Clement
2020-05-04  9:45 Michał Górny
2019-12-22 15:24 Patrice Clement
2019-11-27 23:29 Patrice Clement

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=1591284998.d9da7701771d663b3a9ed3417e9b320048c06846.monsieurp@gentoo \
    --to=monsieurp@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.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