From 990b2e61d93de587d0618094ca42ec56a6cd5ae4 Mon Sep 17 00:00:00 2001 From: Martin Sekera Date: Sun, 16 Dec 2018 23:56:51 +0100 Subject: [PATCH] add sys-kernel/dtc --- metadata/categories.conf | 1 + packages/sys-kernel/dtc/dtc-1.4.6.exheres-0 | 45 +++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 packages/sys-kernel/dtc/dtc-1.4.6.exheres-0 diff --git a/metadata/categories.conf b/metadata/categories.conf index fadbb22..d29f802 100644 --- a/metadata/categories.conf +++ b/metadata/categories.conf @@ -15,3 +15,4 @@ x11-apps app-security media-gfx sys-kernel +cross-avr diff --git a/packages/sys-kernel/dtc/dtc-1.4.6.exheres-0 b/packages/sys-kernel/dtc/dtc-1.4.6.exheres-0 new file mode 100644 index 0000000..c4a4ab6 --- /dev/null +++ b/packages/sys-kernel/dtc/dtc-1.4.6.exheres-0 @@ -0,0 +1,45 @@ +# Copyright 2018 Martin Sekera +# Distributed under the terms of the GNU General Public License v2 + +DOWNLOADS="mirror://kernel/software/utils/${PN}/${PNV}.tar.gz" +HOMEPAGE="https://devicetree.org/ https://git.kernel.org/cgit/utils/dtc/dtc.git/" +SUMMARY="Open Firmware device tree compiler" + +LICENCES="GPL-2" +SLOT="0" +PLATFORMS="~amd64 ~armv7 ~armv8 ~x86" +MYOPTIONS="" + +DEPENDENCIES=" + build: + sys-devel/bison + sys-devel/flex +" + +# this is a very broken Makefile +# it fails to build the Python library if we set our own CFLAGS +# it also installs to crazy places + +src_prepare() { + default + + edo sed -i \ + -e '/^CFLAGS =/s:=:+=:' \ + -e '/^CPPFLAGS =/s:=:+=:' \ + -e 's:-g -Os::' \ + -e "/^PREFIX =/s:=.*:= ${EPREFIX}/usr/$(exhost --target):" \ + -e "/^LIBDIR =/s:=.*:= \$(PREFIX)/$(exhost --target)/lib:" \ + Makefile +} + +src_compile() { + emake -j8 NO_PYTHON=1 +} + +src_test() { + emake NO_PYTHON=1 tests +} + +src_install() { + emake NO_PYTHON=1 DESTDIR="${IMAGE}" install +}