void-packages/srcpkgs/chroot-gcc/template

109 lines
3.5 KiB
Text
Raw Normal View History

2012-02-28 13:41:08 +00:00
# Template build file for 'chroot-gcc'
pkgname=chroot-gcc
2012-03-30 11:10:20 +00:00
_majorver=4.7
2012-02-28 13:41:08 +00:00
_gmp_ver=5.0.3
2012-07-09 16:11:56 +00:00
_mpfr_ver=3.1.1
2012-02-28 13:41:08 +00:00
_mpc_ver=0.8.2
2012-06-15 06:01:38 +00:00
version=${_majorver}.1
2012-07-10 16:38:28 +00:00
revision=3
2012-02-28 13:41:08 +00:00
wrksrc="gcc-${version}"
homepage="http://gcc.gnu.org"
short_desc="The GNU C Compiler suite -- for xbps-src use"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-3"
2012-02-28 13:41:08 +00:00
distfiles="
http://ftp.gnu.org/pub/gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2
http://ftp.gnu.org/pub/gnu/gmp/gmp-${_gmp_ver}.tar.bz2
http://www.mpfr.org/mpfr-current/mpfr-${_mpfr_ver}.tar.bz2
http://www.multiprecision.org/mpc/download/mpc-${_mpc_ver}.tar.gz"
checksum="
2012-06-15 06:01:38 +00:00
16093f6fa01732adf378d97fe338f113c933bdf56da22bf87c76beff13da406f
2012-02-28 13:41:08 +00:00
dcafe9989c7f332b373e1f766af8e9cd790fc802fdec422a1910a6ef783480e3
2012-07-09 16:11:56 +00:00
7b66c3f13dc8385f08264c805853f3e1a8eedab8071d582f3e661971c9acd5fd
2012-02-28 13:41:08 +00:00
ae79f8d41d8a86456b68607e9ca398d00f8b7342d1d83bcf4428178ac45380c7"
long_desc="
The GNU C Compiler suite, with support for C and C++.
This package is only meant to be used by xbps-src, don't install it manually."
noverifyrdeps=yes
provides="libgcc-$version libstdc++-$version libstdc++-devel-$version gcc-$version gcc-c++-$version"
2012-02-28 13:41:08 +00:00
conflicts="libgcc>=0 libstdc++>=0 libstdc++-devel>=0 gcc>=0 gcc-c++>=0"
makedepends="chroot-binutils>=2.22.52.0.4"
2012-02-28 13:41:08 +00:00
if [ -n "$IN_CHROOT" ]; then
makedepends="${makedepends} perl flex"
fi
2012-02-28 13:41:08 +00:00
pre_configure() {
# As specified in the LFS book, disable installing libiberty.
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
# Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
{ mv ${XBPS_BUILDDIR}/gmp-${_gmp_ver} ${wrksrc}/gmp; \
mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_ver} ${wrksrc}/mpfr; \
mv ${XBPS_BUILDDIR}/mpc-${_mpc_ver} ${wrksrc}/mpc; }
}
do_configure() {
CONFIG_SHELL=/bin/bash ./configure \
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib \
--enable-clocale=gnu --enable-shared --disable-bootstrap \
--enable-threads=posix --enable-__cxa_atexit \
--disable-gold --disable-lto --enable-linker-build-id \
--enable-gnu-unique-object --enable-checking=release \
--enable-languages=c,c++ --disable-nls --disable-multilib \
--with-mpfr-include=${wrksrc}/mpfr/src \
--with-mpfr-lib=${wrksrc}/mpfr/src/.libs \
--without-cloog --without-ppl --disable-libstdcxx-pch \
--disable-libquadmath --disable-libquadmath-support \
2012-03-30 11:10:20 +00:00
--disable-libgomp --disable-libssp --disable-libitm
2012-02-28 13:41:08 +00:00
}
do_build() {
make ${makejobs}
}
do_install() {
local _triplet=
if [ "${XBPS_MACHINE}" = "x86_64" ]; then
_triplet="${XBPS_MACHINE}-unknown-linux-gnu"
else
_triplet="${XBPS_MACHINE}-pc-linux-gnu"
fi
if [ "$XBPS_MACHINE" = "x86_64" ]; then
vmkdir usr/lib
cd ${DESTDIR}/usr && ln -sf lib lib64 && cd ${wrksrc}
fi
make DESTDIR=${DESTDIR} install
# Make version a symlink of major version to make all versions
# from the same series work automagically.
mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}
2012-07-09 16:11:56 +00:00
cd ${DESTDIR}/usr/lib/gcc/${_triplet} && ln -sf ${_majorver} ${version}
2012-02-28 13:41:08 +00:00
# Ditto for c++ headers.
mv ${DESTDIR}/usr/include/c++/${version} \
${DESTDIR}/usr/include/c++/${_majorver}
2012-07-09 16:11:56 +00:00
cd ${DESTDIR}/usr/include/c++ && ln -sf ${_majorver} ${version}
2012-02-28 13:41:08 +00:00
# cc symlink.
2012-07-09 16:11:56 +00:00
cd ${DESTDIR}/usr/bin && ln -sf gcc cc
# rpcgen wants /lib/cpp, make a symlink
2012-07-10 16:38:28 +00:00
cd ${DESTDIR}/usr/lib && ln -sf ../bin/cpp .
2012-07-09 16:11:56 +00:00
2012-02-28 13:41:08 +00:00
rm -f ${DESTDIR}/usr/lib64
# Remove unused stuff.
rm -f ${DESTDIR}/usr/lib/libffi*
rm -f ${DESTDIR}/usr/lib/libmudflap*
rm -rf ${DESTDIR}/usr/share
# Remove all python scripts in libdir.
rm -f ${DESTDIR}/usr/lib/*.py
}