void-packages/srcpkgs/gcc-multilib/template

109 lines
3.7 KiB
Plaintext

# Template build file for 'gcc-multilib'
pkgname=gcc-multilib
_majorver=4.6
_gmp_ver=5.0.3
_mpfr_ver=3.1.0
_mpc_ver=0.8.2
version=${_majorver}.2
wrksrc="gcc-${version}"
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"
short_desc="The GNU C Compiler suite (multilib libraries)"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum="
60b05463dfe18d40d68fb8a71b25b408a01f86cc6ceaf5e6b22238b6b0f450c2
dcafe9989c7f332b373e1f766af8e9cd790fc802fdec422a1910a6ef783480e3
74a7bbbad168dd1cc414f1c9210b8fc16ccfc8e422d34b3371a8978e31eab680
ae79f8d41d8a86456b68607e9ca398d00f8b7342d1d83bcf4428178ac45380c7"
long_desc="
The GNU C Compiler suite, with support for C, C++, ObjC and ObjC++.
This package installs the 32 bit libraries required to compile 32 bit
code on x86_64 systems."
subpackages="libgcc32 libssp32 libgomp32 libobjc32 libstdc++32 libmudflap32"
subpackages="${subpackages} libstdc++32-devel libmudflap32-devel"
subpackages="${subpackages} gcc-c++-multilib gcc-objc-multilib"
disable_parallel_build=yes
noverifyrdeps=yes
only_for_archs=x86_64
Add_dependency run gcc ">=${version}"
Add_dependency run libgcc32 ">=${version}"
Add_dependency run libgomp32 ">=${version}"
Add_dependency run zlib32
Add_dependency run glibc32-devel
Add_dependency build glibc32-devel
Add_dependency build zlib32-devel
do_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
mkdir -p ${build_wrksrc}/gmp
{ mv ${XBPS_BUILDDIR}/gmp-${_gmp_ver} gmp; \
mv ${XBPS_BUILDDIR}/mpfr-${_mpfr_ver} mpfr; \
mv ${XBPS_BUILDDIR}/mpc-${_mpc_ver} mpc; }
cp -a gmp/*.h ${build_wrksrc}/gmp
./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 --with-system-zlib \
--enable-languages=c,c++,objc,obj-c++ --disable-nls \
--enable-multilib
}
do_build() {
make ${makejobs}
}
do_install() {
local triplet="x86_64-unknown-linux-gnu"
local libmddir="usr/lib/gcc/${triplet}/${_majorver}"
local dirn _dir_
vmkdir usr/lib
cd ${DESTDIR}/usr && ln -sf lib lib64 && cd ${wrksrc}/${build_wrksrc}
# Create major version to version symlink.
make DESTDIR=${DESTDIR} install
mv ${DESTDIR}/usr/lib/gcc/${triplet}/${version} \
${DESTDIR}/${libmddir}
# We are only interested in 32bit stuff, remove anything else.
rm -rf ${DESTDIR}/usr/{lib64,libexec,bin,share}
rm -f ${DESTDIR}/usr/lib/*.{spec,a,so*}
rm -f ${DESTDIR}/usr/lib32/{libiberty*,*.py}
rm -rf ${DESTDIR}/${libmddir}/{include,include-fixed,install-tools,plugin}
rm -f ${DESTDIR}/${libmddir}/*.{a,o}
rm -f ${DESTDIR}/${libmddir}/{c,lto}*
rm -f ${DESTDIR}/usr/lib32/libquadmath*
# Move around some stuff for multilib.
mv ${DESTDIR}/usr/lib32/lib{std,sup}c++.a ${DESTDIR}/${libmddir}/32
mv ${DESTDIR}/usr/lib32/lib{gomp,objc*}.a ${DESTDIR}/${libmddir}/32
mv ${DESTDIR}/usr/lib32/libssp*.a ${DESTDIR}/${libmddir}/32
# Keep libstdc++ 32bit headers, remove anything else.
rm -rf ${wrksrc}/xbps_32bits_libstdc++
mv ${DESTDIR}/usr/include/c++/${version}/${triplet}/32 \
${wrksrc}/xbps_32bits_libstdc++
rm -rf ${DESTDIR}/usr/include/c++/${version}/*
vmkdir usr/include/c++/${_majorver}/${triplet}
mv xbps_32bits_libstdc++ \
${DESTDIR}/usr/include/c++/${_majorver}/${triplet}/32
# Install specs file overriding native gcc with no multilib support.
vinstall host-${triplet}/gcc/specs 644 ${libmddir}
}