Skip to content

Commit

Permalink
Minimal Dockerfile with latest purple-gowhatsapp and tdlib-purple (#502)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: vitalyster <vitalyster@gmail.com>
  • Loading branch information
theassemblerguy and vitalyster authored Aug 22, 2024
1 parent c3a93c5 commit 7d1bb5e
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,12 @@ jobs:
set PATH=%PATH%;%cd%\deps32\bin
cd tests\libtransport\RelWithDebInfo
libtransport_test
linux-debian:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build from Dockerfile\.trixie
run: docker build -f Dockerfile\.trixie -t spectrum:trixie \.
113 changes: 113 additions & 0 deletions Dockerfile.trixie
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
FROM debian:trixie as base

ARG DEBIAN_FRONTEND=noninteractive
ARG APT_LISTCHANGES_FRONTEND=none

RUN apt-get update -qq
RUN apt-get install --no-install-recommends -y dpkg-dev devscripts curl git
#RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/spectrumim.gpg] https://packages.spectrum.im/spectrum2/ bullseye main" | tee -a /etc/apt/sources.list
#RUN echo "deb-src [signed-by=/etc/apt/trusted.gpg.d/spectrumim.gpg] https://packages.spectrum.im/spectrum2/ bullseye main" | tee -a /etc/apt/sources.list
#RUN curl https://packages.spectrum.im/packages.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/spectrumim.gpg

RUN apt-get update -qq
RUN apt-get install --no-install-recommends -y libminiupnpc-dev libnatpmp-dev spectrum2 libpurple-dev cmake libssl-dev
COPY . spectrum2/

FROM base as staging

ARG DEBIAN_FRONTEND=noninteractive
ARG APT_LISTCHANGES_FRONTEND=none

WORKDIR /spectrum2/packaging/debian/

RUN apt-get install --no-install-recommends -y libjson-glib-dev \
graphicsmagick-imagemagick-compat libsecret-1-dev libnss3-dev \
libwebp-dev libgcrypt20-dev libpng-dev libglib2.0-dev \
libprotobuf-c-dev protobuf-c-compiler libmarkdown2-dev libopusfile-dev build-essential

RUN echo "---> Installing purple-instagram" && \
git clone https://github.com/EionRobb/purple-instagram.git && \
cd purple-instagram && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> Installing icyque" && \
git clone https://github.com/EionRobb/icyque.git && \
cd icyque && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> Install Steam" && \
git clone https://github.com/EionRobb/pidgin-opensteamworks.git && \
cd pidgin-opensteamworks/steam-mobile && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> Install Teams" && \
git clone https://github.com/EionRobb/purple-teams.git && \
cd purple-teams && \
make && \
make DESTDIR=/tmp/out install
RUN echo "---> Install Skypeweb" && \
git clone https://github.com/EionRobb/skype4pidgin.git && \
cd skype4pidgin/skypeweb && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> purple-gowhatsapp" && \
apt-get -y install golang && \
git clone https://github.com/hoehermann/purple-gowhatsapp.git && \
cd purple-gowhatsapp && \
git checkout v1.16.0 && \
git submodule update --init && \
cmake . && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> purple-battlenet" && \
git clone --recursive https://github.com/EionRobb/purple-battlenet && \
cd purple-battlenet && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> purple-hangouts" && \
git clone --recursive https://github.com/EionRobb/purple-hangouts && \
cd purple-hangouts && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> purple-mattermost" && \
git clone --recursive https://github.com/EionRobb/purple-mattermost && \
cd purple-mattermost && \
make && \
make DESTDIR=/tmp/out install

RUN echo "---> tdlib-purple" && \
apt install -y gperf && \
apt install -y gettext && \
cd /tmp && ( git clone https://github.com/tdlib/td.git ; cd td && git checkout 8d08b34 && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd) .. && make && make install/strip ) && ( git clone -b tdlib-1.8.34 https://github.com/667bdrm/tdlib-purple.git ; mkdir -p tdlib-purple/build && cd tdlib-purple/build && cmake -DCMAKE_BUILD_TYPE=Release -DTd_DIR=/tmp/td/build/lib/cmake/Td/ -DNoVoip=1 .. && make install/strip DESTDIR=/tmp/out install)

FROM debian:trixie as production

EXPOSE 8080
VOLUME ["/etc/spectrum2/transports", "/var/lib/spectrum2"]

RUN apt-get update -qq
RUN apt-get install --no-install-recommends -y curl ca-certificates gnupg1 gpg gpg-agent

COPY --from=staging spectrum2/packaging/debian/*.deb /tmp/


RUN echo "---> Installing libpurple plugins" && \
DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y \
purple-discord \
libmarkdown2 \
libogg0 libopusfile0 \
nodejs \
&& rm -rf /var/lib/apt/lists/*
COPY --from=staging /tmp/out/* /usr/
COPY --from=staging spectrum2/packaging/docker/run.sh /run.sh

RUN rm -rf /tmp/*.deb

ENTRYPOINT ["/run.sh"]

0 comments on commit 7d1bb5e

Please sign in to comment.