Skip to content

Commit

Permalink
GCC Gfortran recipe (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
miqlas authored and waddlesplash committed Dec 25, 2016
1 parent 0fa4a40 commit 9c08181
Showing 1 changed file with 73 additions and 8 deletions.
81 changes: 73 additions & 8 deletions sys-devel/gcc/gcc-5.4.0_2016_06_04.recipe
Expand Up @@ -5,7 +5,7 @@ HOMEPAGE="http://gcc.gnu.org"

SOURCE_URI="https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2"
CHECKSUM_SHA256="608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a"
REVISION="3"
REVISION="4"
LICENSE="
GNU GPL v3
GNU LGPL v3
Expand All @@ -20,15 +20,21 @@ SECONDARY_ARCHITECTURES="x86"
libatomicSoVersion="1"
libatomicLibVersion="1.1.0"

libgccSoVersion="1"
libgccLibVersion="1"

libgfortranSoVersion="3"
libgfortranLibVersion="3.0.0"

libgompSoVersion="1"
libgompLibVersion="1.0.0"

libquadmathSoVersion="0"
libquadmathLibVersion="0.0.0"

libstdcxxSoVersion="6"
libstdcxxLibVersion="6.0.21"

libgccSoVersion="1"
libgccLibVersion="1"

PROVIDES="
gcc$secondaryArchSuffix = $portVersion compat >= 5
cmd:c++$secondaryArchSuffix = $portVersion compat >= 5
Expand Down Expand Up @@ -111,7 +117,7 @@ BUILD()
--docdir=$docDir --enable-threads=posix \
--disable-nls --enable-shared --with-gnu-ld --with-gnu-as \
--enable-version-specific-runtime-libs \
--enable-languages=c,c++ --enable-lto --enable-frame-pointer \
--enable-languages=c,c++,fortran --enable-lto --enable-frame-pointer \
--with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \
--enable-__cxa-atexit --with-system-zlib --enable-checking=release \
--with-bug-url=http://dev.haiku-os.org/ \
Expand Down Expand Up @@ -198,6 +204,14 @@ INSTALL()
$libDir/
cp $gccLibDir/libatomic*.a $developLibDir/

# libgfortran
strip --strip-debug $gccLibDir/libgfortran.so.$libgfortranLibVersion
cp -d $gccLibDir/libgfortran.so \
$gccLibDir/libgfortran.so.$libgfortranSoVersion \
$gccLibDir/libgfortran.so.$libgfortranLibVersion \
$libDir/
cp $gccLibDir/libgfortran*.a $developLibDir/

# libgomp
strip --strip-debug $gccLibDir/libgomp.so.$libgompLibVersion
cp -d $gccLibDir/libgomp.so \
Expand All @@ -206,6 +220,14 @@ INSTALL()
$libDir/
cp $gccLibDir/libgomp*.a $developLibDir/

# libquadmath
strip --strip-debug $gccLibDir/libquadmath.so.$libquadmathLibVersion
cp -d $gccLibDir/libquadmath.so \
$gccLibDir/libquadmath.so.$libquadmathSoVersion \
$gccLibDir/libquadmath.so.$libquadmathLibVersion \
$libDir/
cp $gccLibDir/libquadmath*.a $developLibDir

# libstdc++
strip --strip-debug $gccLibDir/libstdc++.so.$libstdcxxLibVersion
cp -d $gccLibDir/libstdc++.so \
Expand Down Expand Up @@ -243,7 +265,7 @@ INSTALL()

cd $installDir
strip bin/*
for f in cc1 cc1plus collect2 lto1 lto-wrapper; do
for f in cc1 cc1plus collect2 f951 lto1 lto-wrapper; do
strip $gccLibDir/$f
done

Expand All @@ -261,7 +283,7 @@ INSTALL()
addattr SYS:ENV DISABLE_ASLR=1 $f
fi
done
for f in cc1 cc1plus collect2 lto1; do
for f in cc1 cc1plus collect2 f951 lto1; do
addattr SYS:ENV DISABLE_ASLR=1 \
$gccLibDir/$f
done
Expand All @@ -275,7 +297,7 @@ INSTALL()

# make all tools available via default paths
mkdir -p $binDir
for f in c++ cc cpp g++ gcc gcov; do
for f in c++ cc cpp g++ gcc gcov gfortran; do
symlinkRelative -sfn $installDir/bin/$f $binDir
done

Expand All @@ -287,15 +309,33 @@ INSTALL()

### Sub Packages ##########################################

packageEntries "fortran" \
$relativeBinDir/gfortran \
$developDir/tools/bin/*gfortran \
$installDir/$gccLibDir/f951 \
$installDir/$gccLibDir/finclude \
$installDir/$gccLibDir/libcaf_single.a \
$installDir/$gccLibDir/libgfortran.a \
$installDir/$gccLibDir/libgfortran.spec \
$installDir/$gccLibDir/libgfortranbegin.a

rm -rf $installDir/$gccLibDir/{f951, finclude, libcaf_single*, libgfortran*}

packageEntries "syslibs" \
$relativeLibDir/libatomic.so \
$relativeLibDir/libatomic.so.$libatomicSoVersion \
$relativeLibDir/libatomic.so.$libatomicLibVersion \
$relativeLibDir/libgcc_s.so \
$relativeLibDir/libgcc_s.so.$libgccSoVersion \
$relativeLibDir/libgfortran.so \
$relativeLibDir/libgfortran.so.$libgfortranSoVersion \
$relativeLibDir/libgfortran.so.$libgfortranLibVersion \
$relativeLibDir/libgomp.so \
$relativeLibDir/libgomp.so.$libgompSoVersion \
$relativeLibDir/libgomp.so.$libgompLibVersion \
$relativeLibDir/libquadmath.so \
$relativeLibDir/libquadmath.so.$libquadmathSoVersion \
$relativeLibDir/libquadmath.so.$libquadmathLibVersion \
$relativeLibDir/libstdc++.so \
$relativeLibDir/libstdc++.so.$libstdcxxSoVersion \
$relativeLibDir/libstdc++.so.$libstdcxxLibVersion \
Expand All @@ -308,6 +348,7 @@ INSTALL()
$relativeDevelopLibDir/libgcc_eh.a \
$relativeDevelopLibDir/libgcc_eh-kernel.a \
$relativeDevelopLibDir/libgomp.a \
$relativeDevelopLibDir/libquadmath.a \
$relativeDevelopLibDir/libstdc++.a \
$relativeDevelopLibDir/libsupc++.a \
$relativeDevelopLibDir/libsupc++-kernel.a \
Expand All @@ -317,6 +358,26 @@ INSTALL()
rm -rf $developLibDir
}

# ----- fortran package -----------------------------------------------

SUMMARY_fortran="C/C++-runtime static libraries and C++ headers, needed for gfortran"
DESCRIPTION_fortran="This package is not of general interest - it \
contains the set of gcc's C/C++-runtime libraries and headers that is \
required by gfortran to build fortran source code."

PROVIDES_fortran="
gcc${secondaryArchSuffix}_fortran = $portVersion compat >= 5
cmd:gfortran$secondaryArchSuffix = $portVersion compat >= 5
cmd:f951$secondaryArchSuffix = $portVersion compat >= 5
devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion
devel:libcaf_single$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion
devel:libgfortranbegin$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion
"
REQUIRES_fortran="
haiku$secondaryArchSuffix
gcc${secondaryArchSuffix}_syslibs == $portVersion base
"

# ----- syslibs package -----------------------------------------------------

SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs"
Expand All @@ -328,7 +389,9 @@ PROVIDES_syslibs="
gcc${secondaryArchSuffix}_syslibs = $portVersion compat >= 4
lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion
lib:libgcc_s$secondaryArchSuffix = $portVersion compat >= 4
lib:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion
lib:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion
lib:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion
lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4
lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 4
"
Expand All @@ -350,7 +413,9 @@ PROVIDES_syslibs_devel="
devel:libgcc$secondaryArchSuffix = $portVersion compat >= 4
devel:libgcc_eh$secondaryArchSuffix = $portVersion compat >= 4
devel:libgcc_eh_kernel$secondaryArchSuffix = $portVersion compat >= 4
devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion
devel:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion
devel:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion
devel:libstdc++$secondaryArchSuffix = $portVersion compat >= 4
devel:libsupc++$secondaryArchSuffix = $portVersion compat >= 4
devel:libsupc++_kernel$secondaryArchSuffix = $portVersion compat >= 4
Expand Down

0 comments on commit 9c08181

Please sign in to comment.