1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:17:35 +00:00

Ports: Switch to new ports system (#594)

Much redundancy is removed from package scripts with this system.
It also supports simple dependency management, uninstalling (through
BSD ports style plist files), cleaning up after itself (with clean,
clean_dist, clean_all commands), etc.
This commit is contained in:
Larkin 2019-09-24 02:56:39 -04:00 committed by Andreas Kling
parent d5f1c57fe2
commit 18249b5996
47 changed files with 6563 additions and 428 deletions

View file

@ -1,33 +0,0 @@
#!/bin/sh
PORT_DIR=gcc
fetch() {
run_fetch_web "https://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz"
# Add the big GCC patch (same one used by toolchain.)
run_patch $SERENITY_ROOT/Toolchain/Patches/gcc.patch -p1
# Let GCC download mpfr, mpc and isl.
run_command contrib/download_prerequisites
# Patch mpfr, mpc and isl to teach them about "serenity" targets.
run_patch dependencies-config.patch -p1
}
configure() {
run_configure_autotools \
--target=i686-pc-serenity \
--with-sysroot=/ \
--with-build-sysroot=$SERENITY_ROOT/Root \
--with-newlib \
--enable-languages=c,c++ \
--disable-lto \
--disable-nls
}
build() {
MAKEOPTS=""
run_make all-gcc all-target-libgcc all-target-libstdc++-v3
run_command find ./host-i686-pc-serenity/gcc/ -maxdepth 1 -type f -executable -exec strip --strip-debug {} \; || echo
}
install() {
run_make $INSTALLOPTS DESTDIR="$SERENITY_ROOT"/Root install-gcc install-target-libgcc install-target-libstdc++-v3
}
. ../.port_include.sh

27
Ports/gcc/package.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash ../.port_include.sh
port=gcc
version=8.3.0
useconfigure=true
configopts="--target=i686-pc-serenity --with-sysroot=/ --with-build-sysroot=$SERENITY_ROOT/Root --with-newlib --enable-languages=c,c++ --disable-lto --disable-nls"
files="https://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz gcc-8.3.0.tar.xz"
makeopts="all-gcc all-target-libgcc all-target-libstdc++-v3"
installopts="DESTDIR=$SERENITY_ROOT/Root install-gcc install-target-libgcc install-target-libstdc++-v3"
depends="binutils"
fetch() {
read url filename <<< $(echo "$files")
run_nocd curl -O "$url" -o "$filename"
run_nocd tar xf "$filename"
run contrib/download_prerequisites
for f in patches/*; do
run patch -p1 < "$f"
done
}
build() {
run make $makeopts
run find ./host-i686-pc-serenity/gcc/ -maxdepth 1 -type f -executable -exec strip --strip-debug {} \; || echo
}
install() {
run make $installopts
}

6111
Ports/gcc/patches/gcc.patch Normal file

File diff suppressed because it is too large Load diff