summaryrefslogtreecommitdiff
path: root/dev-lang/micropython/micropython-1.23.0.ebuild
diff options
context:
space:
mode:
authorDaniella Kicsak <nosqrt@outlook.com>2024-06-20 22:42:16 +1000
committerJoonas Niilola <juippis@gentoo.org>2024-07-26 10:40:31 +0300
commitb932ffe8e0c938200d104c096112986cf0f49683 (patch)
tree9b7a1e525aab405342c230744cdffa96fb74591e /dev-lang/micropython/micropython-1.23.0.ebuild
parent84c4b307d7073adfeb1de635e0d6e09819befe92 (diff)
downloadgentoo-b932ffe8e0c938200d104c096112986cf0f49683.tar.gz
gentoo-b932ffe8e0c938200d104c096112986cf0f49683.tar.bz2
gentoo-b932ffe8e0c938200d104c096112986cf0f49683.zip
dev-lang/micropython: add 1.23.0
Signed-off-by: Daniella Kicsak <nosqrt@outlook.com> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-lang/micropython/micropython-1.23.0.ebuild')
-rw-r--r--dev-lang/micropython/micropython-1.23.0.ebuild73
1 files changed, 73 insertions, 0 deletions
diff --git a/dev-lang/micropython/micropython-1.23.0.ebuild b/dev-lang/micropython/micropython-1.23.0.ebuild
new file mode 100644
index 000000000000..740c69961ef7
--- /dev/null
+++ b/dev-lang/micropython/micropython-1.23.0.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Python implementation for microcontrollers"
+HOMEPAGE="https://github.com/micropython/micropython"
+SRC_URI="https://micropython.org/resources/source/${P}.tar.xz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ dev-libs/libffi:=
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-gcc13-build-fix.patch"
+)
+
+src_prepare() {
+ default
+ cd ports/unix || die
+
+ # 1) don't die on compiler warning
+ # 2) remove /usr/local prefix references in favour of /usr
+ # 3) enforce our CFLAGS
+ # 4) enforce our LDFLAGS
+ sed -e 's#-Werror##g;' \
+ -e 's#\/usr\/local#\/usr#g;' \
+ -e "s#^CFLAGS = \(.*\)#CFLAGS = \1 ${CFLAGS}#g" \
+ -e "s#^LDFLAGS = \(.*\)#LDFLAGS = \1 ${LDFLAGS}#g" \
+ -i Makefile || die "can't patch Makefile"
+}
+
+src_compile() {
+ # Build the cross-compiler first. Build fails without this.
+ einfo ""
+ einfo "Building the mpy-crosscompiler."
+ einfo ""
+ cd "${S}/mpy-cross" || die
+ emake CC="$(tc-getCC)"
+
+ # Finally, build the unix port.
+ einfo ""
+ einfo "Building the micropython unix port."
+ einfo ""
+ cd "${S}/ports/unix" || die
+ emake CC="$(tc-getCC)"
+}
+
+src_test() {
+ cd ports/unix || die
+ emake CC="$(tc-getCC)" test
+}
+
+src_install() {
+ pushd ports/unix > /dev/null || die
+ emake CC="$(tc-getCC)" DESTDIR="${D}" install
+ popd > /dev/null || die
+
+ # remove .git files
+ find tools -type f -name '.git*' -exec rm {} \; || die
+
+ dodoc -r tools
+ einstalldocs
+}