45 lines
989 B
Bash
45 lines
989 B
Bash
# Copyright 2018 Martin Sekera <sekerama@gmail.com>
|
|
# 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
|
|
}
|