1
0
mirror of https://github.com/renbaoshuo/s2oj-gcc.git synced 2024-11-23 11:38:44 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
04c8c795bb
fix: ci
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-16 21:24:31 +08:00
c15f259b72
fix: ci 2023-11-16 20:29:49 +08:00
2 changed files with 19 additions and 8 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 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}
patch -p1 < ../patches/gcc-$GCC_VERSION.patch
cd ${CURRENT_DIR}
build_cd ${GCC_SRC}
patch -p1 < ${CURRENT_DIR}/patches/gcc-$GCC_VERSION.patch
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