diff --git a/Dockerfile.misc b/Dockerfile.misc index 610eacb..0cd6c76 100644 --- a/Dockerfile.misc +++ b/Dockerfile.misc @@ -44,7 +44,8 @@ RUN apt update -y -q && apt upgrade -y -q && apt update -y -q && \ re2c \ perl \ cpanminus \ - openssh-client + openssh-client \ + libgmp-dev RUN cd /tmp && \ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ diff --git a/misc/build-wyrm-transpiler.sh b/misc/build-wyrm-transpiler.sh new file mode 100755 index 0000000..a9a77a6 --- /dev/null +++ b/misc/build-wyrm-transpiler.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -ex +source common.sh + +VERSION=$1 +if [[ "${VERSION}" = "trunk" ]]; then + VERSION=trunk-$(date +%Y%m%d) + BRANCH=main +else + BRANCH=V${VERSION} +fi + +URL=https://github.com/jeremy-rifkin/wyrm.git + +FULLNAME=wyrm-${VERSION}.tar.xz +OUTPUT=$2/${FULLNAME} + +REVISION="wyrm-$(get_remote_revision "${URL}" "heads/${BRANCH}")" +LAST_REVISION="${3:-}" + +initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}" + +DIR=$(pwd)/wyrm +STAGING_DIR=/opt/compiler-explorer/wyrm-${VERSION} + +git clone "${URL}" "${DIR}" + +cd "${DIR}/transpiler" + +mkdir build +cd build +export CXX=/opt/compiler-explorer/gcc-12.1.0/bin/g++ +export CC=/opt/compiler-explorer/gcc-12.1.0/bin/gcc +cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$STAGING_DIR" +ninja install + +cp -v libplugin.so "${STAGING_DIR}" + +patchelf --set-rpath '$ORIGIN/lib:/opt/compiler-explorer/gcc-12.1.0/lib64/' "${STAGING_DIR}/libplugin.so" + +complete "${STAGING_DIR}" "wyrm-${VERSION}" "${OUTPUT}"