gcc: install all stuff into /usr/lib, rework for easy upgrades, etc.

This commit is contained in:
Juan RP 2011-07-10 17:55:00 +02:00
parent 139673c71d
commit f6a62fac86
9 changed files with 104 additions and 99 deletions

View file

@ -5,6 +5,8 @@ long_desc="${long_desc}
This package contains GCC C++ support."
revision=1
Add_dependency run glibc
Add_dependency run zlib
Add_dependency run cloog-ppl
@ -18,25 +20,15 @@ Add_dependency run libstdc++-devel ">=$version"
do_install()
{
local triplet=
# create version -> major symlink
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
if [ "${xbps_machine}" = "x86_64" ]; then
triplet="${xbps_machine}-unknown-linux-gnu"
else
triplet="${xbps_machine}-pc-linux-gnu"
fi
mkdir -p ${DESTDIR}/usr/lib
mkdir -p ${DESTDIR}/usr/bin
mkdir -p ${DESTDIR}/usr/share/man/man1
mkdir -p ${DESTDIR}/usr/libexec/gcc/${triplet}/${version}
for f in g++ c++ ${triplet}-g++ ${triplet}-c++; do
mv ${SRCPKGDESTDIR}/usr/bin/${f} ${DESTDIR}/usr/bin
for f in g++ c++ ${_triplet}-g++ ${_triplet}-c++; do
vmove usr/bin/${f} usr/bin
done
mv ${SRCPKGDESTDIR}/usr/libexec/gcc/${triplet}/${version}/cc1plus \
${DESTDIR}/usr/libexec/gcc/${triplet}/${version}
mv ${SRCPKGDESTDIR}/usr/share/man/man1/g++.1 \
${DESTDIR}/usr/share/man/man1
vmove usr/lib/gcc/${_triplet}/${_majorver}/cc1plus \
usr/lib/gcc/${_triplet}/${_majorver}
vmove usr/share/man/man1/g++.1 usr/share/man/man1
}

View file

@ -5,6 +5,8 @@ long_desc="${long_desc}
This package contains the GCC Fortran frontend."
revision=1
Add_dependency run libgcc ">=$version"
Add_dependency run glibc
Add_dependency run libgfortran ">=$version"
@ -18,19 +20,17 @@ Add_dependency run gcc ">=$version"
do_install()
{
local triplet=
# create version -> major symlink
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
if [ "${xbps_machine}" = "x86_64" ]; then
triplet="${xbps_machine}-unknown-linux-gnu"
else
triplet="${xbps_machine}-pc-linux-gnu"
fi
for f in gfortran ${triplet}-gfortran; do
for f in gfortran ${_triplet}-gfortran; do
vmove usr/bin/${f} usr/bin
done
vmove usr/libexec/gcc/${triplet}/${version}/f951 \
usr/libexec/gcc/${triplet}/${version}
vmove usr/lib/gcc/${_triplet}/${_majorver}/f951 \
usr/lib/gcc/${_triplet}/${_majorver}
vmove usr/share/info/gfortran.info usr/share/info
touch ${DESTDIR}/usr/share/info/dir
vmove usr/share/man/man1/gfortran.1 usr/share/man/man1

View file

@ -5,6 +5,8 @@ long_desc="${long_desc}
This package contains the GCC Go frontend."
revision=1
Add_dependency run libgcc ">=$version"
Add_dependency run glibc
Add_dependency run libstdc++ ">=$version"
@ -19,19 +21,17 @@ Add_dependency run libgo-devel ">=$version"
do_install()
{
local triplet=
# create version -> major symlink
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
if [ "${xbps_machine}" = "x86_64" ]; then
triplet="${xbps_machine}-unknown-linux-gnu"
else
triplet="${xbps_machine}-pc-linux-gnu"
fi
for f in gccgo ${triplet}-gccgo; do
for f in gccgo ${_triplet}-gccgo; do
vmove usr/bin/${f} usr/bin
done
vmove usr/libexec/gcc/${triplet}/${version}/go1 \
usr/libexec/gcc/${triplet}/${version}
vmove usr/lib/gcc/${_triplet}/${_majorver}/go1 \
usr/lib/gcc/${_triplet}/${_majorver}
vmove usr/share/info/gccgo.info usr/share/info
touch ${DESTDIR}/usr/share/info/dir
vmove usr/share/man/man1/gccgo.1 usr/share/man

View file

@ -5,6 +5,8 @@ long_desc="${long_desc}
This package contains GCC Objective-C++ support."
revision=1
Add_dependency run glibc
Add_dependency run zlib
Add_dependency run cloog-ppl
@ -18,15 +20,11 @@ Add_dependency run gcc-objc ">=$version"
do_install()
{
local triplet=
# create version -> major symlink
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
if [ "${xbps_machine}" = "x86_64" ]; then
triplet="${xbps_machine}-unknown-linux-gnu"
else
triplet="${xbps_machine}-pc-linux-gnu"
fi
mkdir -p ${DESTDIR}/usr/libexec/gcc/${triplet}/${version}
mv ${SRCPKGDESTDIR}/usr/libexec/gcc/${triplet}/${version}/cc1objplus \
${DESTDIR}/usr/libexec/gcc/${triplet}/${version}
vmove usr/lib/gcc/${_triplet}/${_majorver}/cc1objplus \
usr/lib/gcc/${_triplet}/${_majorver}
}

View file

@ -5,6 +5,8 @@ long_desc="${long_desc}
This package contains GCC Objective-C support."
revision=1
Add_dependency run glibc
Add_dependency run zlib
Add_dependency run cloog-ppl
@ -18,19 +20,13 @@ Add_dependency run libobjc ">=$version"
do_install()
{
local triplet=
# create version -> major symlink
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
if [ "${xbps_machine}" = "x86_64" ]; then
triplet="${xbps_machine}-unknown-linux-gnu"
else
triplet="${xbps_machine}-pc-linux-gnu"
fi
mkdir -p ${DESTDIR}//usr/lib/gcc/${triplet}/${version}
mkdir -p ${DESTDIR}/usr/libexec/gcc/${triplet}/${version}/include
mv ${SRCPKGDESTDIR}/usr/lib/gcc/${triplet}/${version}/include/objc \
${DESTDIR}/usr/lib/gcc/${triplet}/${version}/include
mv ${SRCPKGDESTDIR}/usr/libexec/gcc/${triplet}/${version}/cc1obj \
${DESTDIR}/usr/libexec/gcc/${triplet}/${version}
vmove usr/lib/gcc/${_triplet}/${_majorver}/include/objc \
usr/lib/gcc/${_triplet}/${_majorver}/include
vmove usr/lib/gcc/${_triplet}/${_majorver}/cc1obj \
usr/lib/gcc/${_triplet}/${_majorver}
}

View file

@ -5,19 +5,18 @@ long_desc="${long_desc}
This package contains the GCC Fortran headers and static libraries."
revision=1
Add_dependency run libgfortran ">=${version}"
do_install()
{
local triplet=
if [ "${xbps_machine}" = "x86_64" ]; then
triplet="${xbps_machine}-unknown-linux-gnu"
else
triplet="${xbps_machine}-pc-linux-gnu"
fi
# create version -> major symlink
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
vmove usr/lib/libgfortran.a usr/lib
vmove usr/lib/gcc/${triplet}/${version}/libgfortranbegin.a \
usr/lib/gcc/${triplet}/${version}
vmove usr/lib/gcc/${_triplet}/${_majorver}/libgfortranbegin.a \
usr/lib/gcc/${_triplet}/${_majorver}
}

View file

@ -6,24 +6,21 @@ long_desc="${long_desc}
This package contains the Stack Smashing Protection development
files provided by GCC."
revision=1
Add_dependency run glibc-devel
Add_dependency run libssp
do_install()
{
local triplet=
# create version -> major symlink
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
if [ "${xbps_machine}" = "x86_64" ]; then
triplet="${xbps_machine}-unknown-linux-gnu"
else
triplet="${xbps_machine}-pc-linux-gnu"
fi
vmove "usr/lib/libssp*.a" usr/lib
vmove usr/lib/libssp.so usr/lib
mkdir -p ${DESTDIR}/usr/lib/gcc/${triplet}/${version}/include
mkdir -p ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/libssp*.a ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/libssp.so ${DESTDIR}/usr/lib
mv ${SRCPKGDESTDIR}/usr/lib/gcc/${triplet}/${version}/include/ssp \
${DESTDIR}/usr/lib/gcc/${triplet}/${version}/include
vmove usr/lib/gcc/${_triplet}/${_majorver}/include/ssp \
${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/include
}

View file

@ -6,11 +6,15 @@ long_desc="${long_desc}
This package contains GCC Header files and libraries for
C++ development."
revision=1
Add_dependency run libstdc++ ">=$version"
do_install()
{
vmove "usr/lib/libstdc++.*a" usr/lib
vmove "usr/lib/libsupc++.*" usr/lib
vmove usr/include/c++ usr/include
vmove usr/include/c++/${_majorver} usr/include/c++
ln -sf /usr/include/c++/${_majorver} \
${DESTDIR}/usr/include/c++/${version}
}

View file

@ -2,7 +2,9 @@
#
# NOTE: don't forget to sync with gcc-multilib when this package is updated.
pkgname=gcc
version=4.6.1
_majorver=4.6
version=${_majorver}.1
revision=1
distfiles="http://ftp.gnu.org/pub/gnu/gcc/gcc-$version/gcc-$version.tar.bz2"
build_style=custom-install
short_desc="The GNU C Compiler"
@ -56,6 +58,12 @@ if [ -n "$BOOTSTRAP_PKG_REBUILD" ]; then
Add_dependency build flex
fi
if [ "${xbps_machine}" = "x86_64" ]; then
_triplet="${xbps_machine}-unknown-linux-gnu"
else
_triplet="${xbps_machine}-pc-linux-gnu"
fi
do_build()
{
if [ -n "$BOOTSTRAP_PKG_REBUILD" ]; then
@ -69,8 +77,8 @@ do_build()
# Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
./configure ${CONFIGURE_SHARED_ARGS} \
--enable-clocale=gnu --disable-bootstrap \
./configure ${CONFIGURE_SHARED_ARGS} --libexecdir=/usr/lib \
--enable-clocale=gnu --disable-bootstrap --libdir=/usr/lib \
--enable-threads=posix --enable-__cxa_atexit --disable-multilib \
--enable-languages=c,c++,objc,obj-c++,fortran,go,lto --enable-tls \
--with-mpfr=$XBPS_MASTERDIR/usr --with-gmp=$XBPS_MASTERDIR/usr \
@ -87,18 +95,29 @@ do_build()
do_install()
{
if [ "$xbps_machine" = "x86_64" ]; then
mkdir -p ${SRCPKGDESTDIR}/usr/lib
cd ${SRCPKGDESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc}
vmkdir usr/lib
cd ${DESTDIR}/usr && ln -sf lib lib64 && cd ${wrksrc}
fi
make DESTDIR=${DESTDIR} install
cd ${DESTDIR}/usr/bin && ln -sf gcc cc
#
# 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}
ln -sf /usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
# Ditto for c++ headers.
mv ${DESTDIR}/usr/include/c++/${version} \
${DESTDIR}/usr/include/c++/${_majorver}
ln -sf /usr/include/c++/${_majorver} \
${DESTDIR}/usr/include/c++/${version}
# cc symlink.
ln -sf /usr/bin/gcc ${DESTDIR}/usr/bin/cc
# rpcgen wants /lib/cpp, make a symlink.
#
mkdir -p ${DESTDIR}/lib
cd ${DESTDIR}/lib && ln -sf ../usr/bin/cpp .
vmkdir lib
ln -sf /usr/bin/cpp ${DESTDIR}/lib/cpp
rm -f ${DESTDIR}/usr/lib64
# Remove libffi stuff.
@ -115,7 +134,7 @@ do_install()
# Install c89 and c99 wrappers and its manpages, from NetBSD.
for f in c89 c99; do
install -m755 ${FILESDIR}/${f}.sh ${DESTDIR}/usr/bin/${f}
vinstall ${FILESDIR}/${f}.sh 755 usr/bin ${f}
vinstall ${FILESDIR}/${f}.1 644 usr/share/man/man1 ${f}.1
done
install -m644 ${FILESDIR}/*.1 ${DESTDIR}/usr/share/man/man1
}