1+ OTP_VERSION=${STACK_VERSION}
2+ REBAR3_VERSION=$( curl -Ls https://github.com/erlang/rebar3/releases| grep /erlang/rebar3/releases/tag/ | sed -E ' s/.*\/erlang\/rebar3\/releases\/tag\/([0-9\.]{1,}(-rc.[0-9]{1,})?)".*/\1/g' | head -1)
3+
4+ set -xe \
5+ && OTP_DOWNLOAD_URL=" https://github.com/erlang/otp/archive/OTP-${OTP_VERSION} .tar.gz" \
6+ && OTP_DOWNLOAD_SHA256=" 2854318d12d727fc508e8fd5fe6921c0cbc7727d1183ad8f6f808585496e42d6" \
7+ && runtimeDeps=' libodbc1 libsctp1 libwxgtk3.0' \
8+ && buildDeps=' unixodbc-dev libsctp-dev libwxgtk-webview3.0-gtk3-dev' \
9+ && apt-get update \
10+ && apt-get install -y --no-install-recommends $runtimeDeps \
11+ && apt-get install -y --no-install-recommends $buildDeps \
12+ && curl -fSL -o otp-src.tar.gz " $OTP_DOWNLOAD_URL " \
13+ && echo " $OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \
14+ && export ERL_TOP=" /usr/src/otp_src_${OTP_VERSION%%@* } " \
15+ && mkdir -vp $ERL_TOP \
16+ && tar -xzf otp-src.tar.gz -C $ERL_TOP --strip-components=1 \
17+ && rm otp-src.tar.gz \
18+ && ( cd $ERL_TOP \
19+ && ./otp_build autoconf \
20+ && gnuArch=" $( dpkg-architecture --query DEB_HOST_GNU_TYPE) " \
21+ && ./configure --build=" $gnuArch " --prefix=/opt/drycc/erlang \
22+ && make -j$( nproc) \
23+ && make -j$( nproc) docs DOC_TARGETS=chunks \
24+ && make install install-docs DOC_TARGETS=chunks ) \
25+ && find /opt/drycc/erlang -name examples | xargs rm -rf \
26+ && apt-get purge -y --auto-remove $buildDeps \
27+ && rm -rf $ERL_TOP /var/lib/apt/lists/*
28+
29+ set -xe \
30+ && REBAR3_DOWNLOAD_URL=" https://github.com/erlang/rebar3/archive/${REBAR3_VERSION} .tar.gz" \
31+ && REBAR3_DOWNLOAD_SHA256=" cce1925d33240d81d0e4d2de2eef3616d4c17b0532ed004274f875e6607d25d2" \
32+ && mkdir -p /usr/src/rebar3-src \
33+ && curl -fSL -o rebar3-src.tar.gz " $REBAR3_DOWNLOAD_URL " \
34+ && echo " $REBAR3_DOWNLOAD_SHA256 rebar3-src.tar.gz" | sha256sum -c - \
35+ && tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
36+ && rm rebar3-src.tar.gz \
37+ && cd /usr/src/rebar3-src \
38+ && HOME=$PWD ./bootstrap \
39+ && install -v ./rebar3 /opt/drycc/erlang/bin/ \
40+ && rm -rf /usr/src/rebar3-src
0 commit comments