Enable additional languages

This commit is contained in:
2025-09-02 16:46:46 +03:00
parent cf978b9914
commit 78948ce7cd
2 changed files with 35 additions and 9 deletions
+4
View File
@@ -1,6 +1,7 @@
name: gcc
description: The GNU C Compiler
version: 15.2.0
revision: 2
url: https://gcc.gnu.org/
license: GPL3-or-later,LGPL3-or-later,GPL3 with GCC-exception
architecture: any
@@ -10,6 +11,9 @@ split_packages:
- name: gcc
license: GPL3-or-later,LGPL3-or-later
depends: ["binutils","gcc-libs","mpc","zstd"]
- name: gcc-fortran
description: "Fortran compiler from GCC"
depends: ["gcc"]
- name: gcc-libs
description: GCC runtime libraries
license: GPL3 with GCC-exception
+31 -9
View File
@@ -2,7 +2,7 @@
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
DOWNLOAD="https://ftp.gnu.org/gnu/gcc/gcc-${BPM_PKG_VERSION}/gcc-${BPM_PKG_VERSION}.tar.xz"
DOWNLOAD="https://fosszone.csd.auth.gr/gnu/gcc/gcc-${BPM_PKG_VERSION}/gcc-${BPM_PKG_VERSION}.tar.xz"
FILENAME="${DOWNLOAD##*/}"
# The prepare function is executed in the root of the temp directory
@@ -24,14 +24,14 @@ build() {
../configure --prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--enable-languages=c,c++ \
--enable-default-pie \
--enable-default-ssp \
--enable-host-pie \
--disable-multilib \
--disable-bootstrap \
--disable-fixincludes \
--with-system-zlib
--with-system-zlib \
--enable-languages=c,c++,fortran,objc,obj-c++,m2
make
}
@@ -73,22 +73,44 @@ package_gcc() {
mkdir "$BPM_SOURCE"/output-gcc-libs
install -d "$BPM_SOURCE"/output-gcc-libs/usr/lib
install -d "$BPM_SOURCE"/output-gcc-libs/usr/share/{info,locale/de/LC_MESSAGES,locale/fr/LC_MESSAGES}
for lib in libasan libatomic libgcc_s libgomp libitm liblsan libquadmath libstdc++ libtsan libubsan; do
for lib in libasan libatomic libgcc_s libgfortran libgomp libitm liblsan libobjc libquadmath libstdc++ libtsan libubsan; do
mv "$BPM_OUTPUT"/usr/lib/"$lib"* -t "$BPM_SOURCE"/output-gcc-libs/usr/lib/
done
mv "$BPM_OUTPUT"/usr/share/info/{libgomp,libitm,libquadmath}.info -t "$BPM_SOURCE"/output-gcc-libs/usr/share/info/
mv "$BPM_OUTPUT"/usr/share/locale/de/LC_MESSAGES/libstdc++.mo -t "$BPM_SOURCE"/output-gcc-libs/usr/share/locale/de/LC_MESSAGES/
mv "$BPM_OUTPUT"/usr/share/locale/fr/LC_MESSAGES/libstdc++.mo -t "$BPM_SOURCE"/output-gcc-libs/usr/share/locale/fr/LC_MESSAGES/
# Move fortran files to gcc-fortran package
mkdir "$BPM_SOURCE"/output-gcc-fortran
install -d "$BPM_SOURCE"/output-gcc-fortran/usr/bin
install -d "$BPM_SOURCE"/output-gcc-fortran/usr/lib/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/include/
install -d "$BPM_SOURCE"/output-gcc-fortran/usr/libexec/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/
install -d "$BPM_SOURCE"/output-gcc-fortran/usr/share/{info,man/man1}
mv "$BPM_OUTPUT"/usr/bin/{gfortran,x86_64-pc-linux-gnu-gfortran} -t "$BPM_SOURCE"/output-gcc-fortran/usr/bin/
mv "$BPM_OUTPUT"/usr/lib/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/{finclude,libcaf_single.a} -t "$BPM_SOURCE"/output-gcc-fortran/usr/lib/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/
mv "$BPM_OUTPUT"/usr/lib/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/include/ISO_Fortran_binding.h -t "$BPM_SOURCE"/output-gcc-fortran/usr/lib/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/include/
mv "$BPM_OUTPUT"/usr/libexec/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/f951 -t "$BPM_SOURCE"/output-gcc-fortran/usr/libexec/gcc/x86_64-pc-linux-gnu/"${BPM_PKG_VERSION}"/
mv "$BPM_OUTPUT"/usr/share/info/gfortran.info -t "$BPM_SOURCE"/output-gcc-fortran/usr/share/info/
mv "$BPM_OUTPUT"/usr/share/man/man1/gfortran.1 -t "$BPM_SOURCE"/output-gcc-fortran/usr/share/man/man1/
# Install package license
install -Dm644 "$BPM_SOURCE"/COPYING{,3}{,.LIB} -t "$BPM_OUTPUT"/usr/share/licenses/gcc/
}
package_gcc-libs() {
# Replace 'output' directory with 'output-gcc-libs'
rmdir "$BPM_OUTPUT"
mv "$BPM_SOURCE"/output-gcc-libs "$BPM_OUTPUT"
# Replace 'output' directory with 'output-gcc-libs'
rmdir "$BPM_OUTPUT"
mv "$BPM_SOURCE"/output-gcc-libs "$BPM_OUTPUT"
# Install package license
install -Dm644 "$BPM_SOURCE"/{COPYING3,COPYING.RUNTIME} -t "$BPM_OUTPUT"/usr/share/licenses/gcc-libs/
# Install package license
install -Dm644 "$BPM_SOURCE"/{COPYING3,COPYING.RUNTIME} -t "$BPM_OUTPUT"/usr/share/licenses/gcc-libs/
}
package_gcc-fortran() {
# Replace 'output' directory with 'output-gcc-fortran'
rmdir "$BPM_OUTPUT"
mv "$BPM_SOURCE"/output-gcc-fortran "$BPM_OUTPUT"
# Install package license
install -Dm644 "$BPM_SOURCE"/{COPYING3,COPYING.RUNTIME} -t "$BPM_OUTPUT"/usr/share/licenses/gcc-fortran/
}