1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils autotools toolchain-funcs
9 MY_P=kBuild-${PV/_/-}-src
10 DESCRIPTION="A makefile framework for writing simple makefiles for complex tasks"
11 HOMEPAGE="http://svn.netlabs.org/kbuild/wiki"
12 #SRC_URI="ftp://ftp.netlabs.org/pub/${PN}/${MY_P}.tar.gz"
13 SRC_URI="https://dev.gentoo.org/~polynomial-c/${MY_P}.tar.xz"
20 DEPEND="sys-devel/flex
25 S=${WORKDIR}/${MY_P/-src}
28 rm -rf "${S}/kBuild/bin"
31 "${FILESDIR}/0001-unknown-configure-opt.patch" \
32 "${FILESDIR}/0002-glibc-2.10.patch" \
33 "${FILESDIR}/0003-gentoo-docdir.patch" \
34 "${FILESDIR}/0004-have-unistd.h.patch" \
35 "${FILESDIR}/0005-kash-link-pthread.patch" \
36 "${FILESDIR}/0006-another-pthread.patch" \
37 "${FILESDIR}/0007-gcc-4.7.patch" \
38 "${FILESDIR}/0008-allperms.patch" \
39 "${FILESDIR}/0009-getloadavg.patch" \
40 "${FILESDIR}/0010-glob.patch" \
41 "${FILESDIR}/0011-kobjcache.patch" \
42 "${FILESDIR}/0012-lchmod.patch" \
43 "${FILESDIR}/0013-obstack.patch" \
44 "${FILESDIR}/0014-strlcpy.patch" \
45 "${FILESDIR}/0015-sys-types.h.patch" \
46 "${FILESDIR}/0016-sys_siglist.patch" \
47 "${FILESDIR}/0017-uclibc.patch" \
48 "${FILESDIR}/0018-strlcpy-exists-on-musl.patch"
50 cd "${S}/src/kmk" || die
52 cd "${S}/src/sed" || die
53 # AM_CONFIG_HEADER is obsolete since automake-1.13 (bug #467104)
54 sed 's@AM_CONFIG_HEADER@AC_CONFIG_HEADERS@' -i configure.ac || die
57 sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
58 -i "${S}"/Config.kmk || die #332225
59 tc-export CC RANLIB #AR does not work here
63 kBuild/env.sh --full make -f bootstrap.gmk AUTORECONF=true AR="$(tc-getAR)" \
64 || die "bootstrap failed"
68 kBuild/env.sh kmk NIX_INSTALL_DIR=/usr PATH_INS="${D}" install \
69 || die "install failed"