Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feat/transparent-…
Browse files Browse the repository at this point in the history
…window
  • Loading branch information
Nerixyz committed Jul 3, 2024
2 parents 41816a3 + 7bfb5ac commit f3d4e93
Show file tree
Hide file tree
Showing 269 changed files with 8,795 additions and 2,803 deletions.
2 changes: 1 addition & 1 deletion .CI/build-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $VCRTVersion = (Get-Item "$Env:VCToolsRedistDir\vc_redist.x64.exe").VersionInfo;
ISCC `
/DWORKING_DIR="$($pwd.Path)\" `
/DINSTALLER_BASE_NAME="$installerBaseName" `
/DSHIPPED_VCRT_BUILD="$($VCRTVersion.FileBuildPart)" `
/DSHIPPED_VCRT_MINOR="$($VCRTVersion.FileMinorPart)" `
/DSHIPPED_VCRT_VERSION="$($VCRTVersion.FileDescription)" `
$defines `
/O. `
Expand Down
8 changes: 4 additions & 4 deletions .CI/chatterino-installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Chatterino"
#define MyAppVersion "2.4.6"
#define MyAppVersion "2.5.1"
#define MyAppPublisher "Chatterino Team"
#define MyAppURL "https://www.chatterino.com"
#define MyAppExeName "chatterino.exe"
Expand Down Expand Up @@ -120,15 +120,15 @@ begin
Result := VCRTVersion + ' is installed';
end;
// Checks if a new VCRT is needed by comparing the builds.
// Checks if a new VCRT is needed by comparing the minor version (the major one is locked at 14).
function NeedsNewVCRT(): Boolean;
var
VCRTBuild: Cardinal;
begin
Result := True;
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Bld', VCRTBuild) then
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Minor', VCRTBuild) then
begin
if VCRTBuild >= {#SHIPPED_VCRT_BUILD} then
if VCRTBuild >= {#SHIPPED_VCRT_MINOR} then
Result := False;
end;
end;
30 changes: 30 additions & 0 deletions .CI/deploy-crt.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
param (
[string] $InstallDir = "Chatterino2"
)

if ($null -eq $Env:VCToolsRedistDir) {
Write-Error "VCToolsRedistDir is not set. Forgot to set Visual Studio environment variables?";
exit 1
}

# A path to the runtime libraries (e.g. "$Env:VCToolsRedistDir\onecore\x64\Microsoft.VC143.CRT")
$vclibs = (Get-ChildItem "$Env:VCToolsRedistDir\onecore\x64" -Filter '*.CRT')[0].FullName;

# All executables and libraries in the installation directory
$targets = Get-ChildItem -Recurse -Include '*.dll', '*.exe' $InstallDir;
# All dependencies of the targets (with duplicates)
$all_deps = $targets | ForEach-Object { (dumpbin /DEPENDENTS $_.FullName) -match '^(?!Dump of).+\.dll$' } | ForEach-Object { $_.Trim() };
# All dependencies without duplicates
$dependencies = $all_deps | Sort-Object -Unique;

$n_deployed = 0;
foreach ($dll in $dependencies) {
Write-Output "Checking for $dll";
if (Test-Path -PathType Leaf "$vclibs\$dll") {
Write-Output "Deploying $dll";
Copy-Item "$vclibs\$dll" "$InstallDir\$dll" -Force;
$n_deployed++;
}
}

Write-Output "Deployed $n_deployed libraries";
34 changes: 34 additions & 0 deletions .CI/setup-clang-tidy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

set -ev;

# aqt installs into .qtinstall/Qt/<version>/gcc_64
# This is doing the same as jurplel/install-qt-action
# See https://github.com/jurplel/install-qt-action/blob/74ca8cd6681420fc8894aed264644c7a76d7c8cb/action/src/main.ts#L52-L74
qtpath=$(echo .qtinstall/Qt/[0-9]*/*/bin/qmake | sed -e s:/bin/qmake$::)
export LD_LIBRARY_PATH="$qtpath/lib"
export QT_ROOT_DIR=$qtpath
export QT_PLUGIN_PATH="$qtpath/plugins"
export PATH="$PATH:$(realpath "$qtpath/bin")"
export Qt6_DIR="$(realpath "$qtpath")"

cmake -S. -Bbuild-clang-tidy \
-DCMAKE_BUILD_TYPE=Debug \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCHATTERINO_LTO=Off \
-DCHATTERINO_PLUGINS=On \
-DBUILD_WITH_QT6=On \
-DBUILD_TESTS=On \
-DBUILD_BENCHMARKS=On

# Run MOC and UIC
# This will compile the dependencies
# Get the targets using `ninja -t targets | grep autogen`
cmake --build build-clang-tidy --parallel -t \
Core_autogen \
LibCommuni_autogen \
Model_autogen \
Util_autogen \
chatterino-lib_autogen
5 changes: 3 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
freebsd_instance:
image: freebsd-13-1-release-amd64
image_family: freebsd-14-0

task:
install_script:
- pkg install -y boost-libs git qt5-buildtools qt5-concurrent qt5-core qt5-multimedia qt5-svg qtkeychain-qt5 qt5-qmake cmake qt5-linguist
- pkg install -y boost-libs git qt6-base qt6-svg qt6-5compat qt6-imageformats qtkeychain-qt6 cmake
script: |
git submodule init
git submodule update
Expand All @@ -20,6 +20,7 @@ task:
-DUSE_SYSTEM_QTKEYCHAIN="ON" \
-DCMAKE_BUILD_TYPE="release" \
-DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \
-DBUILD_WITH_QT6="ON" \
..
cat compile_commands.json
make -j $(getconf _NPROCESSORS_ONLN)
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ PointerBindsToType: false
SpacesBeforeTrailingComments: 2
Standard: Auto
ReflowComments: false
InsertNewlineAtEOF: true
4 changes: 3 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ Checks: "-*,
-readability-magic-numbers,
-performance-noexcept-move-constructor,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-cppcoreguidelines-non-private-member-variables-in-classes,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-bugprone-easily-swappable-parameters,
-cert-err58-cpp,
-modernize-avoid-c-arrays
-modernize-avoid-c-arrays,
-misc-include-cleaner
"
CheckOptions:
- key: readability-identifier-naming.ClassCase
Expand Down
73 changes: 19 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:
submodules: recursive
fetch-depth: 0 # allows for tags access

- name: Fix git permission error
run: |
git config --global --add safe.directory '*'
- name: Build
run: |
mkdir build
Expand Down Expand Up @@ -112,24 +116,24 @@ jobs:
matrix:
include:
# macOS
- os: macos-latest
- os: macos-13
qt-version: 5.15.2
force-lto: false
plugins: false
plugins: true
skip-artifact: false
skip-crashpad: false
# Windows
- os: windows-latest
qt-version: 6.5.0
qt-version: 6.7.1
force-lto: false
plugins: false
plugins: true
skip-artifact: false
skip-crashpad: false
# Windows 7/8
- os: windows-latest
qt-version: 5.15.2
force-lto: false
plugins: false
plugins: true
skip-artifact: false
skip-crashpad: true

Expand All @@ -139,6 +143,8 @@ jobs:
C2_PLUGINS: ${{ matrix.plugins }}
C2_ENABLE_CRASHPAD: ${{ matrix.skip-crashpad == false }}
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') }}
C2_USE_OPENSSL3: ${{ startsWith(matrix.qt-version, '6.') && 'True' || 'False' }}
C2_CONAN_CACHE_SUFFIX: ${{ startsWith(matrix.qt-version, '6.') && '-QT6' || '' }}

steps:
- uses: actions/checkout@v4
Expand All @@ -148,35 +154,15 @@ jobs:

- name: Install Qt5
if: startsWith(matrix.qt-version, '5.')
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
version: ${{ matrix.qt-version }}

- name: Install Qt 6.5.3 imageformats
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/[email protected]
with:
cache: false
modules: qtimageformats
set-env: false
version: 6.5.3
extra: --noarchives

- name: Find Qt 6.5.3 Path
if: startsWith(matrix.qt-version, '6.') && startsWith(matrix.os, 'windows')
shell: pwsh
id: find-good-imageformats
run: |
cd "$Env:RUNNER_WORKSPACE/Qt/6.5.3"
cd (Get-ChildItem)[0].Name
cd plugins/imageformats
echo "PLUGIN_PATH=$(pwd)" | Out-File -Path "$Env:GITHUB_OUTPUT" -Encoding ASCII
- name: Install Qt6
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand All @@ -188,16 +174,9 @@ jobs:
if: startsWith(matrix.os, 'windows')
uses: ilammy/[email protected]

- name: Setup conan variables (Windows)
if: startsWith(matrix.os, 'windows')
run: |
"C2_USE_OPENSSL3=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "True" } else { "False" })" >> "$Env:GITHUB_ENV"
"C2_CONAN_CACHE_SUFFIX=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "-QT6" } else { "`" })" >> "$Env:GITHUB_ENV"
shell: powershell

- name: Setup sccache (Windows)
# sccache v0.7.4
uses: hendrikmuhs/[email protected].12
uses: hendrikmuhs/[email protected].13
if: startsWith(matrix.os, 'windows')
with:
variant: sccache
Expand Down Expand Up @@ -276,14 +255,9 @@ jobs:
cd build
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
cp bin/chatterino.exe Chatterino2/
..\.CI\deploy-crt.ps1 Chatterino2
echo nightly > Chatterino2/modes
- name: Fix Qt6 (windows)
if: startsWith(matrix.qt-version, '6.') && startsWith(matrix.os, 'windows')
working-directory: build
run: |
cp ${{ steps.find-good-imageformats.outputs.PLUGIN_PATH }}/qwebp.dll Chatterino2/imageformats/qwebp.dll
- name: Package (windows)
if: startsWith(matrix.os, 'windows')
working-directory: build
Expand Down Expand Up @@ -365,15 +339,15 @@ jobs:

# Windows
- uses: actions/download-artifact@v4
name: Windows Qt6.5.0
name: Windows Qt6.7.1
with:
name: chatterino-windows-x86-64-Qt-6.5.0.zip
name: chatterino-windows-x86-64-Qt-6.7.1.zip
path: release-artifacts/

- uses: actions/download-artifact@v4
name: Windows Qt6.5.0 symbols
name: Windows Qt6.7.1 symbols
with:
name: chatterino-windows-x86-64-Qt-6.5.0-symbols.pdb.7z
name: chatterino-windows-x86-64-Qt-6.7.1-symbols.pdb.7z
path: release-artifacts/

- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -406,18 +380,9 @@ jobs:
cp .CI/chatterino-nightly.flatpakref release-artifacts/
shell: bash

# macOS
- uses: actions/download-artifact@v4
name: macOS x86_64 Qt5.15.2 dmg
with:
name: chatterino-macos-Qt-5.15.2.dmg
path: release-artifacts/

- name: Rename artifacts
run: |
ls -l
# Rename the macos build to indicate that it's for macOS 10.15 users
mv chatterino-macos-Qt-5.15.2.dmg Chatterino-macOS-10.15.dmg
# Mark all Windows Qt5 builds as old
mv chatterino-windows-x86-64-Qt-5.15.2.zip chatterino-windows-old-x86-64-Qt-5.15.2.zip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: sudo apt-get -y install dos2unix

- name: Check formatting
uses: DoozyX/clang-format-lint-action@v0.16.2
uses: DoozyX/clang-format-lint-action@v0.17
with:
source: "./src ./tests/src ./benchmarks/src ./mocks/include"
extensions: "hpp,cpp"
Expand Down
Loading

0 comments on commit f3d4e93

Please sign in to comment.