updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / gcc-msp430 / PKGBUILD
blob2676a7a41ede5a0789055893ca6130217b96fa58
1 # Contributor: Rick W. Chen <stuffcorpse at archlinux dot us>
3 pkgname=gcc-msp430
4 pkgver=4.5.3
5 pkgrel=8
6 pkgdesc="GNU toolchain for the TI MSP430 processor"
7 arch=('i686' 'x86_64')
8 url="http://mspgcc4.sourceforge.net/"
9 license=('GPL')
10 makedepends=('binutils-msp430')
11 depends=('elfutils' 'libmpc')
12 options=(!strip !emptydirs !libtool)
14 _mspgcc_ver=20110716
15 _gnu_mirror="http://ftpmirror.gnu.org"
16 _sf_base="http://sourceforge.net/projects/mspgcc/files"
17 _patches_base="${_sf_base}/Patches/LTS/${_mspgcc_ver}"
19 _patches=("msp430-gcc-${pkgver}-20110706-sf3370978.patch"
20           "msp430-gcc-${pkgver}-20110706-sf3390964.patch"
21           "msp430-gcc-${pkgver}-20110706-sf3394176.patch"
22           "msp430-gcc-${pkgver}-20110706-sf3396639.patch"
23           "msp430-gcc-${pkgver}-20110706-sf3409864.patch"
24           "msp430-gcc-${pkgver}-20110706-sf3417263.patch"
25           "msp430-gcc-${pkgver}-20110706-sf3431602.patch"
26           "msp430-gcc-${pkgver}-20110706-sf3433730.patch")
28 source=("http://sourceforge.net/projects/mspgcc/files/mspgcc/mspgcc-${_mspgcc_ver}.tar.bz2"
29         "${_gnu_mirror}/gcc/gcc-${pkgver}/gcc-${pkgver}.tar.bz2"
30         "${_patches[0]}::${_patches_base}/${_patches[0]}/download"
31         "${_patches[1]}::${_patches_base}/${_patches[1]}/download"
32         "${_patches[2]}::${_patches_base}/${_patches[2]}/download"
33         "${_patches[3]}::${_patches_base}/${_patches[3]}/download"
34         "${_patches[4]}::${_patches_base}/${_patches[4]}/download"
35         "${_patches[5]}::${_patches_base}/${_patches[5]}/download"
36         "${_patches[6]}::${_patches_base}/${_patches[6]}/download"
37         "${_patches[7]}::${_patches_base}/${_patches[7]}/download")
38 sha1sums=('db625da1295fa7b64fe687420d908e532e72439c'
39           '73c45dfda5eef6b124be53e56828b5925198cc1b'
40           '7d1b0adb04bf2c1bf9c3b2dad07ff4f1eaf47aee'
41           'b158623b7f10a23e2e6f144b2822e1733bd27b76'
42           'ed5eccad295d7bb8e883e13c0c8ff90fb156d642'
43           'ce812f349084a887f27e99b5a3277545da52f5ad'
44           'd2402a262ba5455324fdab9107bcbd297994fa55'
45           '032e6dfd1665aa70ac3cde75233367cb2a68f7f9'
46           'd6e8e4c3b1ab64e4068408a36a6d74e868a148de'
47           '84a69a42e168c97e99d6b120db4a48fe4fabaaf3')
49 _builddir="${srcdir}/build"
51 build() {
52   _patch_name="msp430-gcc-${pkgver}-20110706.patch"
53   (cd "${srcdir}/gcc-${pkgver}" &&
54     patch -p1 < "${srcdir}/mspgcc-${_mspgcc_ver}/${_patch_name}" &&
55     for patch in ${_patches[@]} ; do
56       msg "Applying ${patch}"
57       patch -p1 < "${srcdir}/${patch}"
58     done)
60   rm -frv ${_builddir}
61   mkdir -p ${_builddir} && cd ${_builddir}
62   "${srcdir}/gcc-${pkgver}/configure" \
63                CFLAGS_FOR_TARGET="-Os" \
64                --prefix=/usr \
65                --infodir=/usr/share/info \
66                --mandir=/usr/share/man \
67                --disable-libssp \
68                --disable-nls \
69                --target=msp430 \
70                --enable-languages=c,c++ \
71                --with-gnu-as \
72                --with-gnu-ld \
73                --with-as=/usr/bin/msp430-as \
74                --with-ld=/usr/bin/msp430-ld \
75                --with-pkgversion="mspgcc_${_mspgcc_ver}"
76   make
79 package() {
80   cd ${_builddir}
81   make DESTDIR=${pkgdir} install
83   rm -f  ${pkgdir}/usr/lib/libiberty.a
84   rm -rf ${pkgdir}/usr/share/man/man7
85   rm -rf ${pkgdir}/usr/share/info
87   msg "Stripping debugging symbols from binaries"
88   local binary
89   find ${pkgdir} -type f 2>/dev/null | while read binary ; do
90     case "$(file -biz "$binary")" in
91       *compressed-encoding*)      # Skip compressed binarys
92         ;;
93       *application/x-executable*) # Binaries
94         /usr/bin/strip "$binary" >/dev/null 2>&1 ;;
95     esac
96   done
99 # vim:set sts=2 ts=2 sw=2 et: