diff options
author | Patrice Clement <monsieurp@gentoo.org> | 2020-06-04 17:34:08 +0200 |
---|---|---|
committer | Patrice Clement <monsieurp@gentoo.org> | 2020-06-04 17:36:38 +0200 |
commit | d9da7701771d663b3a9ed3417e9b320048c06846 (patch) | |
tree | 02563fb1bcf3597662868303a7d856066104b9e6 /dev-lang/micropython | |
parent | app-misc/sl: honor LDFLAGS. (diff) | |
download | gentoo-d9da7701771d663b3a9ed3417e9b320048c06846.tar.gz gentoo-d9da7701771d663b3a9ed3417e9b320048c06846.tar.bz2 gentoo-d9da7701771d663b3a9ed3417e9b320048c06846.zip |
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@gentoo.org>
Diffstat (limited to 'dev-lang/micropython')
-rw-r--r-- | dev-lang/micropython/micropython-1.11.ebuild | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/dev-lang/micropython/micropython-1.11.ebuild b/dev-lang/micropython/micropython-1.11.ebuild index e0c69a12c7ab..94d80d97d921 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 |