summaryrefslogtreecommitdiff
path: root/.github/dockerfiles/Dockerfile.debian-base
blob: 416edd97c9e66d38178026f70f26c18a353b369e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
##
## This docker file will build a base image for building Erlang/OTP
##
ARG BASE=debian
FROM $BASE
## Need to have a second arg here as the first does not expose the $BASE in the script below
ARG BASE=debian

ARG HOST_TRIP=x86_64-linux-gnu
ENV HOST_TRIP=$HOST_TRIP

ENV INSTALL_LIBS="zlib1g-dev libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxbase3.0-dev libwxgtk3.0-dev libwxgtk-webview3.0-gtk3-dev libsctp-dev lksctp-tools"

## See https://wiki.debian.org/Multiarch/HOWTO for details on how to install things
##
## 1. Install build-essential to get access to dpkg-architecture
## 2. Use dpkg-architecture to figure out what we are runnon on
## 3. If the HOST_TRIP does not equal BUILD_TRIP we should cross compile
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential && \
        BUILD_TRIP=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_MULTIARCH` && \
        BUILD_ARCH=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_ARCH` && \
        if [ "$HOST_TRIP" != "$BUILD_TRIP" ]; then \
          HOST_ARCH=`dpkg-architecture -t${HOST_TRIP} -qDEB_HOST_ARCH` && \
          dpkg --add-architecture $HOST_ARCH && \
          sed -i "s:deb http:deb [arch=$BUILD_ARCH,$HOST_ARCH] http:g" /etc/apt/sources.list; \
        fi && \
        apt-get update && \
        apt-get install -y build-essential m4 autoconf fop xsltproc default-jdk libxml2-utils \
          $INSTALL_LIBS && \
        if [ "$HOST_TRIP" != "$BUILD_TRIP" ]; then \
          apt-get install -y \
          crossbuild-essential-$HOST_ARCH \
          $(for LIB in $INSTALL_LIBS; do echo "$LIB:$HOST_ARCH"; done) && \
          for dir in `find / -type d -name $HOST_TRIP`; do \
            echo -n "$dir: /buildroot/sysroot"; \
            echo `dirname $dir`; \
            mkdir -p /buildroot/sysroot$dir; \
            cp -r `dirname $dir`/* `dirname /buildroot/sysroot$dir`; \
            cp -r $dir/* `dirname /buildroot/sysroot$dir`; \
          done; \
        fi && \
        update-alternatives --set wx-config /usr/lib/${BUILD_TRIP}/wx/config/gtk3-unicode-3.0 && \
        rm -rf /var/lib/apt/lists/*