diff --git a/pkg.info b/pkg.info index b6c458c..678fde3 100644 --- a/pkg.info +++ b/pkg.info @@ -1,9 +1,16 @@ name: gcc description: The GNU C Compiler -version: 15.1.0 +version: 15.2.0 url: https://gcc.gnu.org/ -license: GPL3-with-GCC-exception +license: GPL3-or-later,LGPL3-or-later,GPL3 with GCC-exception architecture: any -depends: ["binutils","gcc","mpc","zstd"] make_depends: ["python3","dejagnu","expect","inetutils","tcl"] type: source +split_packages: + - name: gcc + license: GPL3-or-later,LGPL3-or-later + depends: ["binutils","gcc-libs","mpc","zstd"] + - name: gcc-libs + description: GCC runtime libraries + license: GPL3 with GCC-exception + depends: ["glibc"] diff --git a/source.sh b/source.sh index ab38fb2..3911695 100644 --- a/source.sh +++ b/source.sh @@ -49,7 +49,7 @@ check() { # The package function is executed in the source directory # This function is used to move the compiled files into the output directory -package() { +package_gcc() { cd build make DESTDIR="$BPM_OUTPUT" install @@ -69,6 +69,26 @@ package() { install -dm755 "$BPM_OUTPUT"/usr/share/gdb/auto-load/usr/lib mv "$BPM_OUTPUT"/usr/lib/*gdb.py "$BPM_OUTPUT"/usr/share/gdb/auto-load/usr/lib + # Move runtime libraries to gcc-libs package + 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 + 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/ + # Install package license - install -Dm644 "$BPM_SOURCE"/gcc/COPYING "$BPM_OUTPUT"/usr/share/licenses/gcc/COPYING + 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" + + # Install package license + install -Dm644 "$BPM_SOURCE"/{COPYING3,COPYING.RUNTIME} -t "$BPM_OUTPUT"/usr/share/licenses/gcc-libs/ }