Skip to content

Commit

Permalink
Fix AppImage build for Ubuntu 22.04 (#241)
Browse files Browse the repository at this point in the history
Co-authored-by: Nerixyz <[email protected]>
  • Loading branch information
jszeluga and Nerixyz authored Oct 3, 2023
1 parent 705318f commit be762f4
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .CI/CreateAppImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ else
echo "No Qt environment variable set, assuming system-installed Qt"
fi

if [ -n "$OPENSSL_1_1_1_DIR" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPENSSL_1_1_1_DIR/lib"
export PATH="$OPENSSL_1_1_1_DIR/bin:$PATH"
else
echo "No OpenSSL environment variable set, assuming system-installed OpenSSL"
fi

script_path=$(readlink -f "$0")
script_dir=$(dirname "$script_path")
chatterino_dir=$(dirname "$script_dir")
Expand Down
13 changes: 13 additions & 0 deletions .docker/Dockerfile-ubuntu-22.04-base
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ubuntu:22.04

ENV TZ=UTC
ENV OPENSSL_VER=1.1.1w
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && apt-get -y install --no-install-recommends \
Expand All @@ -27,8 +28,20 @@ RUN apt-get update && apt-get -y install --no-install-recommends \
RUN apt-get -y install \
git \
lsb-release \
checkinstall \
zlib1g-dev \
wget \
python3-pip && \
apt-get clean all


#Install OpenSSL 1.1
RUN wget https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz
RUN tar xf openssl-$OPENSSL_VER.tar.gz
RUN cd openssl-$OPENSSL_VER && \
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib && \
make -j8 && \
make install

# Install Qt as we do in CI

Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile-ubuntu-22.04-build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN mkdir /src/build

# cmake
RUN cd /src/build && \
CXXFLAGS=-fno-sized-deallocation cmake \
OPENSSL_ROOT_DIR=/usr/local/ssl CXXFLAGS=-fno-sized-deallocation cmake \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_PREFIX_PATH=/opt/qt515/lib/cmake \
-DBUILD_WITH_QTKEYCHAIN=OFF \
Expand Down
1 change: 1 addition & 0 deletions .docker/Dockerfile-ubuntu-22.04-package
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM chatterino-ubuntu-22.04-build

# In CI, this is set from the aqtinstall action
ENV Qt5_DIR=/opt/qt515
ENV OPENSSL_1_1_1_DIR=/usr/local/ssl

WORKDIR /src/build

Expand Down
16 changes: 15 additions & 1 deletion .docker/Dockerfile-ubuntu-22.04-qt6-build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG QT_VERSION=6.2.4
ARG BUILD_WITH_QT6=ON

ENV TZ=UTC
ENV OPENSSL_VER=1.1.1w
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && apt-get -y install --no-install-recommends \
Expand All @@ -32,9 +33,22 @@ RUN apt-get update && apt-get -y install --no-install-recommends \
RUN apt-get -y install \
git \
lsb-release \
checkinstall \
zlib1g-dev \
wget \
python3-pip && \
apt-get clean all


#Install OpenSSL 1.1
RUN wget https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz
RUN tar xf openssl-$OPENSSL_VER.tar.gz
RUN cd openssl-$OPENSSL_VER && \
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib && \
make -j8 && \
make install


# Install Qt as we do in CI

RUN pip3 install -U pip && \
Expand All @@ -47,7 +61,7 @@ RUN mkdir /src/build

# cmake
RUN cd /src/build && \
CXXFLAGS=-fno-sized-deallocation cmake \
OPENSSL_ROOT_DIR=/usr/local/ssl CXXFLAGS=-fno-sized-deallocation cmake \
-DBUILD_WITH_QT6=$BUILD_WITH_QT6 \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_PREFIX_PATH=/opt/qt/$QT_VERSION/gcc_64/lib/cmake \
Expand Down
1 change: 1 addition & 0 deletions .docker/Dockerfile-ubuntu-22.04-qt6-package
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM chatterino-ubuntu-$UBUNTU_VERSION-qt6-build

# In CI, this is set from the aqtinstall action
ENV Qt6_DIR=/opt/qt/6.2.4/gcc_64
ENV OPENSSL_1_1_1_DIR=/usr/local/ssl

WORKDIR /src/build

Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ env:
# Last known good conan version
# 2.0.3 has a bug on Windows (conan-io/conan#13606)
CONAN_VERSION: 2.0.2
OPENSSL_1_1_1_VERSION: 1.1.1w
OPENSSL_1_1_1_SHA256: "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8"
OPENSSL_1_1_1_DIR: /usr/local/ssl

jobs:
build:
Expand Down Expand Up @@ -294,20 +297,35 @@ jobs:
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0
libxcb-xinerama0 \
wget \
zlib1g-dev
- name: Apply Qt patches (Ubuntu)
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.qt-version, '5.')
run: |
patch "$Qt5_DIR/include/QtConcurrent/qtconcurrentthreadengine.h" .patches/qt5-on-newer-gcc.patch
shell: bash

- name: Build (Ubuntu)
- name: Build OpenSSL 1.1.1
if: startsWith(matrix.os, 'ubuntu')
run: |
cd $RUNNER_WORKSPACE
wget "https://www.openssl.org/source/openssl-$OPENSSL_1_1_1_VERSION.tar.gz"
echo "${{ env.OPENSSL_1_1_1_SHA256 }} openssl-$OPENSSL_1_1_1_VERSION.tar.gz" | sha256sum -c
tar xf "openssl-$OPENSSL_1_1_1_VERSION.tar.gz"
cd "openssl-$OPENSSL_1_1_1_VERSION"
./config --prefix="$OPENSSL_1_1_1_DIR" --openssldir="$OPENSSL_1_1_1_DIR" shared zlib
make -j"$(nproc)"
sudo make install
shell: bash

- name: Build (Ubuntu), Qt ${{ matrix.qt-version }}
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build
cd build
CXXFLAGS=-fno-sized-deallocation cmake \
OPENSSL_ROOT_DIR="$OPENSSL_1_1_1_DIR" CXXFLAGS=-fno-sized-deallocation cmake \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
Expand Down

0 comments on commit be762f4

Please sign in to comment.