void-packages/srcpkgs/msp430-toolchain/template

70 lines
2.1 KiB
Bash

# Template file for 'msp430-toolchain'
pkgname=msp430-toolchain
version=3.02.03.00
revision=1
short_desc="Toolchain for the TI MSP430 microprocessor"
maintainer="allan <mail@may.mooo.com>"
homepage="http://www.ti.com/tool/msp430-gcc-opensource"
license="GPL-2"
distfiles="http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/msp430-gcc-source.tar.bz2
http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/msp430-gcc-support-files.zip"
checksum="67179535e68951bfb82f8bb1bf099a716e921f11b1ad773c87a08b6054ed31b0
303b743fae597c8861c6bd85bb52d9b4ad51d6537bbc3f010b2e09c6a624651e"
nocross=yes
nostrip=yes
create_wrksrc=yes
hostmakedepends="unzip expect flex"
makedepends="tk-devel ncurses-devel"
_prefix=/usr/msp430
_target=msp430-none-elf
do_configure() {
unset CC LD AR AS RANLIB CPP CFLAGS CPPFLAGS LDFLAGS
mkdir obj-msp
cd obj-msp
../sources/tools/configure \
--prefix=$_prefix \
--enable-languages=c \
--program-prefix="msp430-" \
--disable-nls \
--enable-gold \
--target=$_target
}
do_build() {
unset CC LD AR AS RANLIB CPP CFLAGS CPPFLAGS LDFLAGS
cd obj-msp
sed -i 's:^prefix =.*:prefix = '${DESTDIR}'/@prefix@:' \
../sources/tools/libgloss/Makefile.in
sed -i 's:^LIBEXPAT .*:LIBEXPAT = @LIBEXPAT@ @BDYNAMIC@:' \
../sources/tools/gdb/Makefile.in
make ${makejobs} DESTDIR=${DESTDIR} all
}
do_install() {
cd obj-msp
sed -i '190,194s:$(tooldir):'${DESTDIR}'/$(tooldir):' \
msp430-none-elf/libgloss/msp430/Makefile
sed -i '190,194s:$(tooldir):'${DESTDIR}'/$(tooldir):' \
msp430-none-elf/430/libgloss/msp430/Makefile
sed -i '190,194s:$(tooldir):'${DESTDIR}'/$(tooldir):' \
msp430-none-elf/large/libgloss/msp430/Makefile
make DESTDIR=${DESTDIR} prefix=${_prefix} install
# copy msp430-gcc-support-files.zip
cp ${wrksrc}/msp430-gcc-support-files/*.h \
${DESTDIR}/${_prefix}/${_target}/include/
cp ${wrksrc}/msp430-gcc-support-files/*.ld \
${DESTDIR}/${_prefix}/${_target}/lib/430/
mkdir -p ${DESTDIR}/usr/bin
cd ${DESTDIR}/${_prefix}/bin
for i in *
do ln -s ${_prefix}/bin/$i ${DESTDIR}/usr/bin/$i
done
}