1
0
mirror of https://github.com/renbaoshuo/s2oj-gcc.git synced 2024-12-27 20:21:54 +00:00

fix: ci
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-11-16 21:24:31 +08:00
parent c15f259b72
commit 04c8c795bb
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 18 additions and 7 deletions

View File

@ -15,7 +15,7 @@ steps:
- sed -i 's@//.*archive.ubuntu.com@//mirror-cdn.xtom.com@g' /etc/apt/sources.list &&
sed -i 's@//security.ubuntu.com@//mirror-cdn.xtom.com@g' /etc/apt/sources.list
- apt update &&
apt install -y curl git make gcc g++ libgmp-dev libmpfr-dev libmpc-dev gcc-multilib
apt install -y curl bzip2 git make gcc g++ libgmp-dev libmpfr-dev libmpc-dev gcc-multilib
- bash build.sh
environment:
GITEA_ENDPOINT: https://git.m.ac

View File

@ -5,21 +5,32 @@ GCC_VERSION="13.2.0"
# GCC_GIT="git://gcc.gnu.org/git/gcc.git"
GCC_GIT="https://git.m.ac/mirrors/gcc.git"
GCC_SRC="${CURRENT_DIR}/../gcc"
BUILD_DIR="build"
build_cd() {
cd $@
echo "****** Now at: $(pwd)"
}
# Clone GCC
echo "===> Cloning GCC..."
git clone -b "releases/gcc-$GCC_VERSION" --depth 1 "${GCC_GIT}" "${GCC_SRC}"
# Download prerequisites
echo "===> Downloading prerequisites..."
build_cd ${GCC_SRC}
./contrib/download_prerequisites
build_cd ${CURRENT_DIR}
# Apply patches
echo "===> Applying patches..."
cd ${GCC_SRC}
build_cd ${GCC_SRC}
patch -p1 < ${CURRENT_DIR}/patches/gcc-$GCC_VERSION.patch
cd ${CURRENT_DIR}
build_cd ${CURRENT_DIR}
# Configure GCC
echo "===> Configuring GCC..."
cd ${CURRENT_DIR}/${BUILD_DIR}
build_cd ${CURRENT_DIR}/build
echo " Now at: $(pwd)"
${GCC_SRC}/configure -v \
--enable-languages=c,c++ \
--prefix=/usr \
@ -35,7 +46,7 @@ make -j$(nproc)
# Make .deb package
echo "===> Making .deb package \"s2oj-gcc-$GCC_VERSION~1baoshuo1.deb\" ..."
make -j$(nproc) DESTDIR=${CURRENT_DIR}/deb install
cd ${CURRENT_DIR}/deb
build_cd ${CURRENT_DIR}/deb
mkdir -p DEBIAN
cat << EOF > DEBIAN/control
Package: s2oj-gcc
@ -46,7 +57,7 @@ Architecture: amd64
Maintainer: Baoshuo <i@baoshuo.ren>
Description: GCC $GCC_VERSION for S2OJ
EOF
cd ${CURRENT_DIR}
build_cd ${CURRENT_DIR}
dpkg-deb --build deb s2oj-gcc-$GCC_VERSION~1baoshuo1.deb
# Upload package to Gitea