docker/ci: install android sdk&ndk
[nit.git] / misc / docker / ci / Dockerfile
1 # This is a basic install of Nit on a debian base.
2
3 FROM debian:stretch
4 MAINTAINER Jean Privat <jean@pryen.org>
5
6 # Install dependencies
7 RUN dpkg --add-architecture i386 \
8         && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9                 # Recomanded builds pakages
10                 build-essential \
11                 ccache \
12                 libgc-dev \
13                 graphviz \
14                 libunwind-dev \
15                 pkg-config \
16                 # Get the code!
17                 git \
18                 ca-certificates \
19                 curl \
20                 libcurl4-openssl-dev \
21                 # For nit manpages :)
22                 man \
23                 # Get pip3 for junit2html
24                 python3-dev \
25                 python3-pip \
26                 python3-setuptools \
27                 python3-wheel \
28                 # Packages needed for lib/
29                 gettext \
30                 libegl1-mesa-dev \
31                 libevent-dev \
32                 libgles1-mesa-dev \
33                 libgles2-mesa-dev \
34                 libgtk-3-dev \
35                 libgmp-dev \
36                 libmongoc-dev \
37                 libbson-dev libssl-dev \
38                 libncurses5-dev \
39                 libpq-dev \
40                 libreadline-dev \
41                 libsdl-image1.2-dev \
42                 libsdl-ttf2.0-dev \
43                 libsdl1.2-dev \
44                 libsdl2-dev \
45                 libsdl2-image-dev \
46                 libsdl2-mixer-dev \
47                 libsqlite3-dev \
48                 libx11-dev \
49                 libxdg-basedir-dev \
50                 postgresql \
51                 # Packages needed for contrib, platforms and FFI
52                 ant \
53                 clang \
54                 cmake \
55                 default-jdk \
56                 file \
57                 gnupg \
58                 gnuplot-nox \
59                 inkscape \
60                 libopenmpi-dev \
61                 time \
62                 unzip \
63                 valgrind \
64                 zipalign \
65                 # Android
66                 libc6:i386 \
67                 libstdc++6:i386 \
68                 zlib1g:i386 \
69                 # TODO neo4j mongodb neo4j emscripten test_glsl_validation
70         && curl -sL https://deb.nodesource.com/setup_8.x | bash - \
71         && apt-get install -y nodejs \
72         && rm -rf /var/lib/apt/lists/*
73
74 # Install OpenGL validator
75 RUN git clone https://github.com/KhronosGroup/glslang.git --depth=1 \
76         && mkdir -p glslang/build \
77         && cd glslang/build \
78         && cmake .. \
79         && make \
80         && make install
81
82 # Install android sdk/ndk
83 RUN mkdir -p /opt \
84         && cd /opt \
85         # Android SDK
86         && curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -o android-sdk-linux.zip \
87         && unzip -q android-sdk-linux.zip -d android-sdk-linux \
88         # Download a specific ndk version because old versions are not available trough sdkmanager
89         && curl https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip -o android-ndk-linux.zip \
90         && unzip -q android-ndk-linux.zip \
91         && mv android-ndk-r17c android-sdk-linux/ndk-bundle \
92         && rm android-sdk-linux.zip android-ndk-linux.zip
93 RUN cd /opt \
94         && yes | android-sdk-linux/tools/bin/sdkmanager "build-tools;27.0.0" "cmake;3.6.4111459" platform-tools tools  --verbose\
95         && yes | android-sdk-linux/tools/bin/sdkmanager --licenses --verbose
96 # TODO: predownload bwdgc and gradle?
97
98 # Setup environment variables
99 ENV ANDROID_HOME=/opt/android-sdk-linux/
100 ENV JAVA_HOME=/usr/lib/jvm/default-java/
101 ENV JNI_LIB_PATH=$JAVA_HOME/jre/lib/amd64/server/
102 ENV LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server/
103
104 # Used by CI to render junit files to html
105 RUN pip3 install junit2html
106
107 #  Prepare to install npm (npm is not packaged for debian:stretch)
108 RUN npm install pug-cli -g