void-packages/srcpkgs/avr-gcc/template
Colin Booth 489036a767 avr-gcc: fix license
Closes: #29753 [via git-merge-pr]
2021-04-04 20:21:18 -03:00

81 lines
1.9 KiB
Bash

# Template file for 'avr-gcc'
pkgname=avr-gcc
version=9.3.0
revision=2
wrksrc="gcc-$version"
short_desc="GNU C Compiler for AVR"
maintainer="allan <mail@may.mooo.com>"
license="GFDL-1.3-or-later, GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later, GCC-exception-3.1"
homepage="http://gcc.gnu.org"
distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
checksum=71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1
hostmakedepends="flex avr-binutils tar"
if [ "$CROSS_BUILD" ]; then
# Need a direct cross-compiler for libgcc.
hostmakedepends+=" avr-gcc"
fi
makedepends="zlib-devel libmpc-devel isl15-devel"
depends="avr-binutils"
nostrip=yes
do_configure() {
[ -d obj-avr ] && rm -rf obj-avr
mkdir obj-avr
cd obj-avr
unset CFLAGS CXXFLAGS LDFLAGS
CFLAGS="-O2 -pipe" \
CONFIG_SHELL=/bin/bash \
LDFLAGS= \
../configure \
--prefix=/usr \
--disable-install-libiberty \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-libunwind-exceptions \
--disable-linker-build-id \
--disable-nls \
--disable-werror \
--enable-checking=release \
--enable-clocale=gnu \
--enable-gnu-indirect-function \
--enable-gnu-unique-object \
--enable-gold \
--enable-languages=c,c++ \
--enable-ld=default \
--enable-lto \
--enable-plugin \
--enable-shared \
--build=$XBPS_TRIPLET \
--host=$XBPS_CROSS_TRIPLET \
--target=avr \
--with-isl \
--with-gnu-as \
--with-gnu-ld \
--with-as=/usr/bin/avr-as \
--with-ld=/usr/bin/avr-ld \
--with-plugin-ld=ld.gold \
--with-default-libstdcxx-abi=gcc4-compatible \
--with-system-zlib
}
do_build() {
cd obj-avr
make ${makejobs}
}
do_install() {
cd obj-avr
make DESTDIR="$DESTDIR" install
}
post_install() {
rm -rf "$DESTDIR"/usr/share/man/man7
rm -rf "$DESTDIR"/usr/share/info
rm -rf "$DESTDIR"/usr/lib/libcc1.*
rm -rf "$DESTDIR"/usr/lib64
ln -s avr-gcc "$DESTDIR"/usr/bin/avr-cc
find "$DESTDIR"/usr/lib -type f -name "*.a" \
-exec avr-strip --strip-debug {} \;
}