1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-05 21:07:52 +00:00

Refactor dockerfile, build cmake from source.

This commit is contained in:
Brenden Matthews 2021-02-27 11:59:17 -06:00
parent 2de1818c43
commit 36fab8594c
No known key found for this signature in database
GPG Key ID: B49ABB7270D9D4FD
2 changed files with 32 additions and 4 deletions

View File

@ -26,3 +26,6 @@ lua/libimlib2.c
# Ignore vscode stuff # Ignore vscode stuff
.vscode .vscode
*.code-workspace *.code-workspace
# Ignore tests
tests/

View File

@ -1,11 +1,12 @@
FROM ubuntu:focal AS builder FROM ubuntu:focal AS builder
RUN apt-get update \ RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \ && DEBIAN_FRONTEND=noninteractive \
apt-get install -qy --no-install-recommends \ apt-get install -qy --no-install-recommends \
cmake \
git \
build-essential \
audacious-dev \ audacious-dev \
ca-certificates \
clang \
git \
libaudclient-dev \ libaudclient-dev \
libcairo2-dev \ libcairo2-dev \
libcurl4-openssl-dev \ libcurl4-openssl-dev \
@ -16,8 +17,10 @@ RUN apt-get update \
liblua5.3-dev \ liblua5.3-dev \
libmicrohttpd-dev \ libmicrohttpd-dev \
libmysqlclient-dev \ libmysqlclient-dev \
libncurses-dev \
libpulse-dev \ libpulse-dev \
librsvg2-dev \ librsvg2-dev \
libssl-dev \
libsystemd-dev \ libsystemd-dev \
libxdamage-dev \ libxdamage-dev \
libxext-dev \ libxext-dev \
@ -26,14 +29,33 @@ RUN apt-get update \
libxml2-dev \ libxml2-dev \
libxmmsclient-dev \ libxmmsclient-dev \
libxnvctrl-dev \ libxnvctrl-dev \
ncurses-dev make \
patch \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Compile CMake, we need the latest because the bug here (for armv7 builds):
# https://gitlab.kitware.com/cmake/cmake/-/issues/20568
WORKDIR /cmake
RUN wget -q https://github.com/Kitware/CMake/releases/download/v3.19.6/cmake-3.19.6.tar.gz \
&& tar xf cmake-3.19.6.tar.gz \
&& cd cmake-3.19.6 \
&& ./bootstrap \
&& make -j5 \
&& make -j5 install \
&& cd \
&& rm -rf /cmake
COPY . /conky COPY . /conky
WORKDIR /conky/build WORKDIR /conky/build
ARG X11=yes ARG X11=yes
RUN sh -c 'if [ "$X11" = "yes" ] ; then \ RUN sh -c 'if [ "$X11" = "yes" ] ; then \
cmake \ cmake \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX=/opt/conky \ -DCMAKE_INSTALL_PREFIX=/opt/conky \
-DBUILD_AUDACIOUS=ON \ -DBUILD_AUDACIOUS=ON \
-DBUILD_HTTP=ON \ -DBUILD_HTTP=ON \
@ -54,6 +76,8 @@ RUN sh -c 'if [ "$X11" = "yes" ] ; then \
../ \ ../ \
; else \ ; else \
cmake \ cmake \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX=/opt/conky \ -DCMAKE_INSTALL_PREFIX=/opt/conky \
-DBUILD_AUDACIOUS=ON \ -DBUILD_AUDACIOUS=ON \
-DBUILD_HTTP=ON \ -DBUILD_HTTP=ON \
@ -94,6 +118,7 @@ RUN apt-get update \
libncurses6 \ libncurses6 \
libpulse0 \ libpulse0 \
librsvg2-2 \ librsvg2-2 \
libsm6 \
libsystemd0 \ libsystemd0 \
libxcb-xfixes0 \ libxcb-xfixes0 \
libxdamage1 \ libxdamage1 \