-
-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into scaling-is-fun
- Loading branch information
Showing
773 changed files
with
52,664 additions
and
15,639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,100 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
breakline() { | ||
printf "================================================================================\n\n" | ||
} | ||
|
||
# Configured in the CI step | ||
install_prefix="appdir/usr" | ||
|
||
# The directory we finally pack into our .deb package | ||
packaging_dir="package" | ||
|
||
# Get the Ubuntu Release (e.g. 20.04 or 22.04) | ||
ubuntu_release="$(lsb_release -rs)" | ||
|
||
# The final path where we'll save the .deb package | ||
deb_path="Chatterino-ubuntu-${ubuntu_release}-x86_64.deb" | ||
|
||
# Refactor opportunity: | ||
case "$ubuntu_release" in | ||
20.04) | ||
dependencies="libc6, libstdc++6, libqt5core5a, libqt5concurrent5, libqt5dbus5, libqt5gui5, libqt5network5, libqt5svg5, libqt5widgets5, qt5-image-formats-plugins, libboost-filesystem1.71.0" | ||
;; | ||
22.04) | ||
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" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Building Ubuntu .deb file on '$ubuntu_release'" | ||
echo "Dependencies: $dependencies" | ||
|
||
if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then | ||
echo "ERROR: No chatterino binary file found. This script must be run in the build folder, and chatterino must be built first." | ||
exit 1 | ||
fi | ||
|
||
chatterino_version=$(git describe | cut -c 2-) | ||
echo "Found Chatterino version $chatterino_version via git" | ||
chatterino_version=$(git describe 2>/dev/null) || true | ||
if [ "$(echo "$chatterino_version" | cut -c1-1)" = 'v' ]; then | ||
chatterino_version="$(echo "$chatterino_version" | cut -c2-)" | ||
else | ||
chatterino_version="0.0.0-dev" | ||
fi | ||
|
||
rm -vrf "./package" || true # delete any old packaging dir | ||
# Make sure no old remnants of a previous packaging remains | ||
rm -vrf "$packaging_dir" | ||
|
||
# create ./package/ from scratch | ||
mkdir package/DEBIAN -p | ||
packaging_dir="$(realpath ./package)" | ||
mkdir -p "$packaging_dir/DEBIAN" | ||
|
||
echo "Making control file" | ||
cat >> "$packaging_dir/DEBIAN/control" << EOF | ||
Package: chatterino | ||
Section: net | ||
Priority: optional | ||
Version: $chatterino_version | ||
Architecture: amd64 | ||
Maintainer: Mm2PL <mm2pl@kotmisia.pl> | ||
Description: Testing out chatterino as a Ubuntu package | ||
Depends: libc6, libqt5concurrent5, libqt5core5a, libqt5dbus5, libqt5gui5, libqt5multimedia5, libqt5network5, libqt5svg5, libqt5widgets5, libssl1.1, libstdc++6 | ||
Depends: $dependencies | ||
Section: net | ||
Priority: optional | ||
Homepage: https://github.com/Chatterino/chatterino2 | ||
Description: Ubuntu package built for $ubuntu_release | ||
EOF | ||
echo "Version: $chatterino_version" >> "$packaging_dir/DEBIAN/control" | ||
cat "$packaging_dir/DEBIAN/control" | ||
breakline | ||
|
||
|
||
echo "Running make install" | ||
make install | ||
find "$install_prefix" | ||
breakline | ||
|
||
|
||
echo "Merge install into packaging dir" | ||
cp -rv "$install_prefix/" "$packaging_dir/" | ||
find "$packaging_dir" | ||
breakline | ||
|
||
|
||
echo "Building package" | ||
dpkg-deb --build "$packaging_dir" "$deb_path" | ||
breakline | ||
|
||
|
||
echo "Package info" | ||
dpkg --info "$deb_path" | ||
breakline | ||
|
||
echo "Running make install in package dir" | ||
DESTDIR="$packaging_dir" make INSTALL_ROOT="$packaging_dir" -j"$(nproc)" install; find "$packaging_dir/" | ||
echo "" | ||
|
||
echo "Building package..." | ||
dpkg-deb --build "$packaging_dir" "Chatterino.deb" | ||
echo "Package contents" | ||
dpkg --contents "$deb_path" | ||
breakline |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
if (-not (Test-Path -PathType Container Chatterino2)) { | ||
Write-Error "Couldn't find a folder called 'Chatterino2' in the current directory."; | ||
exit 1 | ||
} | ||
|
||
# Check if we're on a tag | ||
$OldErrorActionPref = $ErrorActionPreference; | ||
$ErrorActionPreference = 'Continue'; | ||
git describe --exact-match --match 'v*' *> $null; | ||
$isTagged = $?; | ||
$ErrorActionPreference = $OldErrorActionPref; | ||
|
||
$defines = $null; | ||
if ($isTagged) { | ||
# This is a release. | ||
# Make sure, any existing `modes` file is overwritten for the user, | ||
# for example when updating from nightly to stable. | ||
Write-Output "" | Out-File Chatterino2/modes -Encoding ASCII; | ||
$installerBaseName = "Chatterino.Installer"; | ||
} | ||
else { | ||
Write-Output nightly | Out-File Chatterino2/modes -Encoding ASCII; | ||
$defines = "/DIS_NIGHTLY=1"; | ||
$installerBaseName = "Chatterino.Nightly.Installer"; | ||
} | ||
|
||
if ($Env:GITHUB_OUTPUT) { | ||
# This is used in CI when creating the artifact | ||
"C2_INSTALLER_BASE_NAME=$installerBaseName" >> "$Env:GITHUB_OUTPUT" | ||
} | ||
|
||
# Copy vc_redist.x64.exe | ||
if ($null -eq $Env:VCToolsRedistDir) { | ||
Write-Error "VCToolsRedistDir is not set. Forgot to set Visual Studio environment variables?"; | ||
exit 1 | ||
} | ||
Copy-Item "$Env:VCToolsRedistDir\vc_redist.x64.exe" .; | ||
|
||
$VCRTVersion = (Get-Item "$Env:VCToolsRedistDir\vc_redist.x64.exe").VersionInfo; | ||
|
||
# Build the installer | ||
ISCC ` | ||
/DWORKING_DIR="$($pwd.Path)\" ` | ||
/DINSTALLER_BASE_NAME="$installerBaseName" ` | ||
/DSHIPPED_VCRT_BUILD="$($VCRTVersion.FileBuildPart)" ` | ||
/DSHIPPED_VCRT_VERSION="$($VCRTVersion.FileDescription)" ` | ||
$defines ` | ||
/O. ` | ||
"$PSScriptRoot\chatterino-installer.iss"; | ||
|
||
Move-Item "$installerBaseName.exe" "$installerBaseName$($Env:VARIANT_SUFFIX).exe" |
Oops, something went wrong.