Files
binary-repo/system/devel/gcc/ympbuild
T
2022-11-16 20:58:49 +00:00

72 lines
1.7 KiB
Bash

#!/usr/bin/env bash
name='gcc'
release='1'
version='12.2.0'
url='https://ftp.gnu.org/gnu/gcc/'
description='GNU Compiler Collection'
email=' parduscix@yandex.ru'
maintainer=' sulincix'
license=('GPLv3')
source=('https://ftp.gnu.org/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.xz')
depends=(zlib)
makedepends=( )
md5sums=('73bafd0af874439dcdb9fc063b6fb069')
arch=('x86_64')
group=(system.devel)
uses_extra=(langs)
cd $name-$version
export CFLAGS="-O2 -s"
export CXXFLAGS="-O2 -s"
unset LDFLAGS
prepare(){
cd ..
# tar permissions and owners is not supported by ymp sandbox.
# we remove broken source and extract again without permission and owners
rm -rf $name-$version
tar --no-same-owner --no-same-permissions -xvf $name-$version.tar.xz
}
setup(){
options=(
--prefix=/usr
--libdir=/usr/lib
--libexecdir=/usr/lib
--mandir=/usr/share/man
--infodir=/usr/share/info
--with-pkgversion="Sulix"
--with-bugurl=https://gitlab.com/groups/sulix/-/issues
--disable-checking
--disable-fixed-point
--disable-libstdcxx-pch
--enable-plugin
--enable-languages=c,c++$(use_opt langs ",fortran,go,objc,obj-c++" "")
--enable-multilib
--enable-shared
--without-zstd
--with-system-zlib
--disable-nls
)
mkdir build
cd build
../configure ${options[@]}
}
build(){
cd build
make -j`nproc`
}
package(){
cd build
make install -j`nproc`
mkdir -p ${DESTDIR}/usr/lib64/
# move lib to lib64
cp -prf ${DESTDIR}/usr/lib/* ${DESTDIR}/usr/lib64/
rm -rf ${DESTDIR}/usr/lib/
# strip all binaries for minimize size
find ${DESTDIR} -type f -exec strip {} \; 2>/dev/null || true
}