From 1b2270aa4ed963b64e841e42b3273fe9ffe56a5e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 14 Jun 2022 17:10:12 -0400 Subject: ci: add a Docker image to test out C++ modules with GCC --- .gitlab/ci/docker/gcc_cxx_modules/Dockerfile | 9 ++++++++ .gitlab/ci/docker/gcc_cxx_modules/install_deps.sh | 7 ++++++ .gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh | 26 +++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .gitlab/ci/docker/gcc_cxx_modules/Dockerfile create mode 100755 .gitlab/ci/docker/gcc_cxx_modules/install_deps.sh create mode 100755 .gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh diff --git a/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile b/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile new file mode 100644 index 0000000..e0af0b9 --- /dev/null +++ b/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile @@ -0,0 +1,9 @@ +FROM fedora:36 +MAINTAINER Ben Boeckel + +# Install build dependencies for packages. +COPY install_deps.sh /root/install_deps.sh +RUN sh /root/install_deps.sh + +COPY install_gcc.sh /root/install_gcc.sh +RUN sh /root/install_gcc.sh diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh new file mode 100755 index 0000000..2556b54 --- /dev/null +++ b/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +dnf install -y --setopt=install_weak_deps=False \ + gcc-c++ mpfr-devel libmpc-devel isl-devel flex bison file findutils diffutils +dnf clean all diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh new file mode 100755 index 0000000..20ea35f --- /dev/null +++ b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +readonly revision="p1689r5-cmake-ci-20220614" # 3075e510e3d29583f8886b95aff044c0474c84a5 +readonly tarball="https://github.com/mathstuf/gcc/archive/$revision.tar.gz" + +readonly workdir="$HOME/gcc" +readonly srcdir="$workdir/gcc" +readonly builddir="$workdir/build" +readonly njobs="$( nproc )" + +mkdir -p "$workdir" +cd "$workdir" +curl -L "$tarball" > "gcc-$revision.tar.gz" +tar xf "gcc-$revision.tar.gz" +mv "gcc-$revision" "$srcdir" +mkdir -p "$builddir" +cd "$builddir" +"$srcdir/configure" \ + --disable-multilib \ + --enable-languages=c,c++ \ + --prefix="/opt/gcc-p1689" +make "-j$njobs" +make "-j$njobs" install-strip +rm -rf "$workdir" -- cgit v0.12