Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into refactor/message-pa…
Browse files Browse the repository at this point in the history
…inting
  • Loading branch information
pajlada committed Jul 30, 2023
2 parents d117036 + c496a68 commit e12079f
Show file tree
Hide file tree
Showing 212 changed files with 8,310 additions and 3,091 deletions.
16 changes: 13 additions & 3 deletions .CI/CreateAppImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then
exit 1
fi

echo "Qt5_DIR set to: ${Qt5_DIR}"
if [ -n "$Qt5_DIR" ]; then
echo "Using Qt DIR from Qt5_DIR: $Qt5_DIR"
_QT_DIR="$Qt5_DIR"
elif [ -n "$Qt6_DIR" ]; then
echo "Using Qt DIR from Qt6_DIR: $Qt6_DIR"
_QT_DIR="$Qt6_DIR"
fi

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

script_path=$(readlink -f "$0")
script_dir=$(dirname "$script_path")
Expand Down
46 changes: 33 additions & 13 deletions .CI/CreateDMG.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
#!/bin/sh
#!/usr/bin/env bash

if [ -d bin/chatterino.app ] && [ ! -d chatterino.app ]; then
>&2 echo "Moving bin/chatterino.app down one directory"
mv bin/chatterino.app chatterino.app
set -eo pipefail

if [ ! -d chatterino.app ]; then
echo "ERROR: No 'chatterino.app' dir found in the build directory. Make sure you've run ./CI/MacDeploy.sh"
exit 1
fi

if [ -z "$OUTPUT_DMG_PATH" ]; then
echo "ERROR: Must specify the path for where to save the final .dmg. Make sure you've set the OUTPUT_DMG_PATH environment variable."
exit 1
fi

if [ -z "$SKIP_VENV" ]; then
echo "Creating python3 virtual environment"
python3 -m venv venv
echo "Entering python3 virtual environment"
. venv/bin/activate
echo "Installing dmgbuild"
python3 -m pip install dmgbuild
fi

if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
echo "Codesigning force deep inside the app"
codesign -s "$MACOS_CODESIGN_CERTIFICATE" --deep --force chatterino.app
echo "Done!"
fi

echo "Running MACDEPLOYQT"
$Qt5_DIR/bin/macdeployqt chatterino.app
echo "Creating python3 virtual environment"
python3 -m venv venv
echo "Entering python3 virtual environment"
. venv/bin/activate
echo "Installing dmgbuild"
python3 -m pip install dmgbuild
echo "Running dmgbuild.."
dmgbuild --settings ./../.CI/dmg-settings.py -D app=./chatterino.app Chatterino2 chatterino-osx.dmg
dmgbuild --settings ./../.CI/dmg-settings.py -D app=./chatterino.app Chatterino2 "$OUTPUT_DMG_PATH"
echo "Done!"

if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
echo "Codesigning the dmg"
codesign -s "$MACOS_CODESIGN_CERTIFICATE" --deep --force "$OUTPUT_DMG_PATH"
echo "Done!"
fi
7 changes: 6 additions & 1 deletion .CI/CreateUbuntuDeb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ case "$ubuntu_release" in
dependencies="libc6, libstdc++6, libqt5core5a, libqt5concurrent5, libqt5dbus5, libqt5gui5, libqt5network5, libqt5svg5, libqt5widgets5, qt5-image-formats-plugins, libboost-filesystem1.71.0"
;;
22.04)
dependencies="libc6, libstdc++6, libqt5core5a, libqt5concurrent5, libqt5dbus5, libqt5gui5, libqt5network5, libqt5svg5, libqt5widgets5, qt5-image-formats-plugins, libboost-filesystem1.74.0"
if [ -n "$Qt6_DIR" ]; then
echo "Qt6_DIR set, assuming Qt6"
dependencies="libc6, libstdc++6, libqt6core6, libqt6widgets6, libqt6network6, libqt6core5compat6, libqt6svg6, qt6-qpa-plugins, qt6-image-formats-plugins"
else
dependencies="libc6, libstdc++6, libqt5core5a, libqt5concurrent5, libqt5dbus5, libqt5gui5, libqt5network5, libqt5svg5, libqt5widgets5, qt5-image-formats-plugins, libboost-filesystem1.74.0"
fi
;;
*)
echo "Unsupported Ubuntu release $ubuntu_release"
Expand Down
39 changes: 39 additions & 0 deletions .CI/MacDeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# Bundle relevant qt & system dependencies into the ./chatterino.app folder

set -eo pipefail

if [ -d bin/chatterino.app ] && [ ! -d chatterino.app ]; then
>&2 echo "Moving bin/chatterino.app down one directory"
mv bin/chatterino.app chatterino.app
fi

if [ -n "$Qt5_DIR" ]; then
echo "Using Qt DIR from Qt5_DIR: $Qt5_DIR"
_QT_DIR="$Qt5_DIR"
elif [ -n "$Qt6_DIR" ]; then
echo "Using Qt DIR from Qt6_DIR: $Qt6_DIR"
_QT_DIR="$Qt6_DIR"
fi

if [ -n "$_QT_DIR" ]; then
export PATH="${_QT_DIR}/bin:$PATH"
else
echo "No Qt environment variable set, assuming system-installed Qt"
fi

echo "Running MACDEPLOYQT"

_macdeployqt_args=()

if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
_macdeployqt_args+=("-codesign=$MACOS_CODESIGN_CERTIFICATE")
fi

macdeployqt chatterino.app "${_macdeployqt_args[@]}"

if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
# Validate that chatterino.app was codesigned correctly
codesign -v chatterino.app
fi
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ CheckOptions:
value: CamelCase
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalVariableCase
value: UPPER_CASE
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-implicit-bool-conversion.AllowPointerConditions
Expand Down
59 changes: 59 additions & 0 deletions .docker/Dockerfile-ubuntu-22.04-qt6-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
ARG UBUNTU_VERSION=22.04

FROM ubuntu:$UBUNTU_VERSION

ARG QT_VERSION=6.2.4
ARG BUILD_WITH_QT6=ON

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

RUN apt-get update && apt-get -y install --no-install-recommends \
cmake \
virtualenv \
rapidjson-dev \
libfuse2 \
libssl-dev \
libboost-dev \
libxcb-randr0-dev \
libboost-system-dev \
libboost-filesystem-dev \
libpulse-dev \
libxkbcommon-x11-0 \
build-essential \
libgl1-mesa-dev \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0 \
libfontconfig1-dev

RUN apt-get -y install \
git \
lsb-release \
python3-pip && \
apt-get clean all

# Install Qt as we do in CI

RUN pip3 install -U pip && \
pip3 install aqtinstall && \
aqt install-qt linux desktop $QT_VERSION -O /opt/qt --modules qt5compat

ADD . /src

RUN mkdir /src/build

# cmake
RUN cd /src/build && \
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 \
-DBUILD_WITH_QTKEYCHAIN=OFF \
..

# build
RUN cd /src/build && \
make -j8
23 changes: 23 additions & 0 deletions .docker/Dockerfile-ubuntu-22.04-qt6-package
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG UBUNTU_VERSION=22.04

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

WORKDIR /src/build

ADD .CI /src/.CI

# Install dependencies necessary for AppImage packaging
RUN apt-get update && apt-get -y install --no-install-recommends \
curl \
libxcb-shape0 \
libfontconfig1 \
file

# package deb
RUN ./../.CI/CreateUbuntuDeb.sh

# package appimage
RUN ./../.CI/CreateAppImage.sh
Loading

0 comments on commit e12079f

Please sign in to comment.