2010-01-06 16:57:53 +01:00
|
|
|
# Copyright 1999-2010 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# $Header: $
|
|
|
|
|
2010-01-06 19:04:20 +01:00
|
|
|
EAPI="2"
|
|
|
|
|
2010-11-10 07:15:18 +01:00
|
|
|
inherit eutils toolchain-funcs
|
2010-01-06 16:57:53 +01:00
|
|
|
|
|
|
|
DESCRIPTION="It's a complete cross development package for 65(C)02 systems."
|
|
|
|
HOMEPAGE="http://www.cc65.org"
|
|
|
|
#SRC_URI="ftp://ftp.musoftware.de/pub/uz/cc65/snapshot/cc65-snapshot-sources-${PV}.tar.bz2"
|
|
|
|
SRC_URI="ftp://ftp.musoftware.de/pub/uz/${PN}/${PN}-sources-${PV}.tar.bz2"
|
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
2010-11-08 08:01:19 +01:00
|
|
|
KEYWORDS="~amd64 ~x86"
|
2010-01-06 16:57:53 +01:00
|
|
|
IUSE="doc"
|
|
|
|
|
2010-01-06 19:04:20 +01:00
|
|
|
DEPEND="doc? ( app-text/linuxdoc-tools )"
|
|
|
|
RDEPEND=""
|
2010-01-06 16:57:53 +01:00
|
|
|
|
2010-11-08 08:01:19 +01:00
|
|
|
#S="${WORKDIR}"/${PN}-snapshot-${PV}
|
2010-01-06 16:57:53 +01:00
|
|
|
|
2010-01-06 19:04:20 +01:00
|
|
|
src_prepare() {
|
2010-11-07 07:03:56 +01:00
|
|
|
# uncomment to install sim65
|
|
|
|
#sed -i -e "s:od65:od65 sim65:g" src/make/gcc.mak
|
2010-01-06 19:04:20 +01:00
|
|
|
|
|
|
|
# correct paths for install (also in documentation)
|
2010-01-06 16:57:53 +01:00
|
|
|
sed -i -e "s:)/lib:)/$(get_libdir):g" make/gcc.mak
|
2010-11-10 07:05:53 +01:00
|
|
|
sed -e "s:/usr/lib/cc65:/usr/$(get_libdir)/cc65:g" \
|
|
|
|
-i src/ca65/make/gcc.mak -i doc/ca65.sgml \
|
|
|
|
-i src/cc65/make/gcc.mak -i doc/cc65.sgml \
|
|
|
|
-i src/ld65/make/gcc.mak -i doc/ld65.sgml
|
2010-01-06 19:04:20 +01:00
|
|
|
|
2010-11-07 07:03:56 +01:00
|
|
|
# solve conflict by renameing make.info to cc65make.info
|
2010-11-08 08:01:19 +01:00
|
|
|
sed -i -e "s:make.html:cc65make.html:g" doc/index.sgml
|
2010-01-06 16:57:53 +01:00
|
|
|
sed -i -e "s:make.sgml:cc65make.sgml:g" doc/Makefile
|
|
|
|
mv doc/make.sgml doc/cc65make.sgml
|
2010-01-06 19:04:20 +01:00
|
|
|
|
2010-11-07 07:03:56 +01:00
|
|
|
epatch "${FILESDIR}"/cc65-2.13.2-asneeded-1.patch
|
2010-01-06 16:57:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
2010-11-07 07:03:56 +01:00
|
|
|
# the build needs to be split otherwise we can't specify CC
|
2010-01-06 19:04:20 +01:00
|
|
|
# these makefiles are not parallel build aware
|
2010-11-07 07:03:56 +01:00
|
|
|
emake -j1 -C src -f make/gcc.mak CC="$(tc-getCC)" AR="$(tc-getAR)" CFLAGS="-g -O2 -Wall -W -std=c89 ${CFLAGS}" LDFLAGS="${LDFLAGS}" || die "src build fail"
|
2010-01-06 16:57:53 +01:00
|
|
|
emake -j1 -C libsrc || die "libsrc build fail"
|
2010-11-08 07:12:02 +01:00
|
|
|
use doc && emake -j1 -C doc html info
|
2010-01-06 16:57:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2010-11-07 07:03:56 +01:00
|
|
|
# can't trust the install target (sandbox violation) so do it by hand
|
2010-01-06 16:57:53 +01:00
|
|
|
dobin src/*65/*65 src/ca65html/ca65html src/grc/grc || die "dobin fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/emd
|
|
|
|
doins libsrc/*.emd || die "install memory map fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/joy
|
|
|
|
doins libsrc/*.joy || die "install joystick driver fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/mou
|
|
|
|
doins libsrc/*.mou || die "install mouse driver fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/ser
|
|
|
|
doins libsrc/*.ser || die "install UART driver fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/tgi
|
|
|
|
doins libsrc/*.tgi || die "install graphic driver fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/asminc
|
|
|
|
doins asminc/*.inc || die "install asm include fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/include
|
|
|
|
doins -r include/* || die "install include fail"
|
|
|
|
insinto /usr/$(get_libdir)/cc65/lib
|
|
|
|
doins libsrc/*.lib || die "install lib definations fail"
|
|
|
|
doins libsrc/*.o || die "install lib fail"
|
2010-11-08 08:01:19 +01:00
|
|
|
insinto /usr/$(get_libdir)/cc65/cfg
|
|
|
|
doins src/ld65/cfg/*.cfg || die "cfg install fail"
|
2010-01-06 16:57:53 +01:00
|
|
|
use doc && dohtml doc/*.htm*
|
2010-11-08 08:01:19 +01:00
|
|
|
use doc && insinto /usr/share/doc/${PF}/html
|
|
|
|
use doc && doins doc/*.txt
|
2010-01-06 16:57:53 +01:00
|
|
|
doman packages/debian/*.1 || die "man install fail"
|
2010-01-06 19:04:20 +01:00
|
|
|
use doc && doinfo doc/*.info
|
2010-11-10 07:15:18 +01:00
|
|
|
dodoc src/ca65/macpack/*.mac doc/readme.1st doc/BUGS doc/CREDITS || die "macro & doc install fail"
|
2010-01-06 16:57:53 +01:00
|
|
|
}
|