Skip to content

Commit

Permalink
Add lint github action (Chatterino#2473)
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada authored Feb 21, 2021
1 parent 714048a commit e015013
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 128 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Lint

on:
push:
branches:
- master
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]

- name: Lint Markdown files
uses: actionsx/prettier@v2
with:
# prettier CLI arguments.
args: --check '**/*.md'
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore submodule files
lib/*/
conan-pkgs/*/

.github/
6 changes: 6 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
trailingComma = "es5"

[[overrides]]
files = ["*.md"]
[overrides.options]
proseWrap = "preserve"
4 changes: 1 addition & 3 deletions BUILDING_ON_FREEBSD.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ high that this also works on older FreeBSD releases, architectures and
FreeBSD 13.0-CURRENT.

1. Install build dependencies from package sources (or build from the
ports tree): `# pkg install qt5-core qt5-multimedia qt5-svg
qt5-qmake qt5-buildtools gstreamer-plugins-good boost-libs
rapidjson`
ports tree): `# pkg install qt5-core qt5-multimedia qt5-svg qt5-qmake qt5-buildtools gstreamer-plugins-good boost-libs rapidjson`
1. go into project directory
1. create build folder `$ mkdir build && cd build`
1. `$ qmake .. && make`
19 changes: 15 additions & 4 deletions BUILDING_ON_LINUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,40 @@
Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.12 or newer**.

## Ubuntu 18.04
*most likely works the same for other Debian-like distros*

_most likely works the same for other Debian-like distros_

1. Install dependencies (and the C++ IDE Qt Creator) `sudo apt install qtcreator qtmultimedia5-dev libqt5svg5-dev libboost-dev libssl-dev libboost-system-dev libboost-filesystem-dev`
1. Open `chatterino.pro` with QT Creator and build

## Arch Linux

install [chatterino2-git](https://aur.archlinux.org/packages/chatterino2-git/) from the aur or build manually as follows:

1. `sudo pacman -S qt5-base qt5-multimedia qt5-svg gst-plugins-ugly gst-plugins-good boost rapidjson pkgconf openssl`
1. go into project directory
1. create build folder `mkdir build && cd build`
1. `qmake .. && make`

## Fedora 28 and above
*most likely works the same for other Red Hat-like distros. Substitue `dnf` with `yum`.*

_most likely works the same for other Red Hat-like distros. Substitue `dnf` with `yum`._

### Development dependencies

1. `sudo dnf install qt5-qtbase-devel qt5-qtmultimedia-devel qt5-qtsvg-devel libsecret-devel openssl-devel boost-devel`
1. go into project directory
1. create build folder `mkdir build && cd build`
1. `qmake-qt5 .. && make -j$(nproc)`

### Optional dependencies
*`gstreamer-plugins-good` package is retired in Fedora 31, see: [rhbz#1735324](https://bugzilla.redhat.com/show_bug.cgi?id=1735324)*
1. `sudo dnf install gstreamer-plugins-good` *(optional: for audio output)*

_`gstreamer-plugins-good` package is retired in Fedora 31, see: [rhbz#1735324](https://bugzilla.redhat.com/show_bug.cgi?id=1735324)_

1. `sudo dnf install gstreamer-plugins-good` _(optional: for audio output)_

## NixOS 18.09+

1. enter the development environment with all of the dependencies: `nix-shell -p openssl boost qt5.full pkg-config`
1. go into project directory
1. create build folder `mkdir build && cd build`
Expand Down
10 changes: 7 additions & 3 deletions BUILDING_ON_MAC.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Building on macOS

#### Note - If you want to develop Chatterino 2 you will also need to install Qt Creator (make sure to install **Qt 5.12 or newer**)

#### Note - Chatterino 2 is only tested on macOS 10.14 and above - anything below that is considered unsupported. It may or may not work on earlier versions

1. Install Xcode and Xcode Command Line Utilites
2. Start Xcode, settings -> Locations, activate your Command Line Tools
3. Install brew https://brew.sh/
4. `brew install boost openssl rapidjson`
5. `brew install qt`
6. Step 5 should output some directions to add qt to your path, you will need to do this for qmake
5. Go into project directory
6. Create build folder `mkdir build && cd build`
7. `qmake .. && make`
7. Go into project directory
8. Create build folder `mkdir build && cd build`
9. `qmake .. && make`

If the Project does not build at this point, you might need to add additional Paths/Libs, because brew does not install openssl and boost in the common path. You can get their path using

`brew info openssl`
`brew info boost`

If brew doesn't link openssl properly then you should be able to link it yourself using those two commands:

- `ln -s /usr/local/opt/openssl/lib/* /usr/local/lib`
- `ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl`

Expand Down
63 changes: 36 additions & 27 deletions BUILDING_ON_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ Download and install [Visual Studio 2019 Community](https://visualstudio.microso

Notes:

- This installation will take about 17 GB of disk space
- You do not need to sign in with a Microsoft account after setup completes. You may simply exit the login dialog.
- This installation will take about 17 GB of disk space
- You do not need to sign in with a Microsoft account after setup completes. You may simply exit the login dialog.

## Boost

1. First, download a boost installer appropriate for your version of Visual Studio.
- Visit the downloads list [on Bintray](https://dl.bintray.com/boostorg/release/).
- Select the latest version from the list and navigate into the `binaries/` directory.
- Download the `.exe` file appropriate to your Visual Studio installation version and system bitness (choose `x64` for 64-bit systems).
Visual Studio versions map as follows: `14.2` in the filename corresponds to MSVC 2019, `14.1` to 2017, `14.0` to 2015. _Anything prior to Visual Studio 2015 is unsupported. Please upgrade should you have an older installation._
**Convenience link for Visual Studio 2019: [Boost 1.75.0-MSVC-14.2](https://dl.bintray.com/boostorg/release/1.75.0/binaries/boost_1_75_0-msvc-14.2-64.exe)**

- Visit the downloads list [on Bintray](https://dl.bintray.com/boostorg/release/).
- Select the latest version from the list and navigate into the `binaries/` directory.
- Download the `.exe` file appropriate to your Visual Studio installation version and system bitness (choose `x64` for 64-bit systems).
Visual Studio versions map as follows: `14.2` in the filename corresponds to MSVC 2019, `14.1` to 2017, `14.0` to 2015. _Anything prior to Visual Studio 2015 is unsupported. Please upgrade should you have an older installation._

**Convenience link for Visual Studio 2019: [Boost 1.75.0-MSVC-14.2](https://dl.bintray.com/boostorg/release/1.75.0/binaries/boost_1_75_0-msvc-14.2-64.exe)**

2. When prompted where to install Boost, set the location to `C:\local\boost`.
3. After the installation finishes, rename the `C:\local\boost\lib64-msvc-14.2` (or similar) directory to simply `lib` (`C:\local\boost\lib`).

Note: This installation will take about 1.5 GB of disk space.

## OpenSSL

### For our websocket library, we need OpenSSL 1.1

1. Download OpenSSL for windows, version `1.1.1i`: **[Download](https://slproweb.com/download/Win64OpenSSL-1_1_1i.exe)**
2. When prompted, install OpenSSL to `C:\local\openssl`
3. When prompted, copy the OpenSSL DLLs to "The OpenSSL binaries (/bin) directory".

### For Qt SSL, we need OpenSSL 1.0

1. Download OpenSSL for windows, version `1.0.2u`: **[Download](https://slproweb.com/download/Win64OpenSSL-1_0_2u.exe)**
2. When prompted, install it to any arbitrary empty directory.
3. When prompted, copy the OpenSSL DLLs to "The OpenSSL binaries (/bin) directory".
Expand All @@ -46,47 +51,51 @@ Note: This installation will take about 1.5 GB of disk space.
Note: This installation will take about 200 MB of disk space.

## Qt

1. Visit the [Qt Open Source Page](https://www.qt.io/download-open-source).
2. Scroll down to the bottom
3. Then select "Download the Qt Online Installer"

Notes:
- Installing the latest **stable** Qt version is advised for new installations, but if you want to use your existing installation please ensure you are running **Qt 5.12 or later**.

- Installing the latest **stable** Qt version is advised for new installations, but if you want to use your existing installation please ensure you are running **Qt 5.12 or later**.

### When prompted which components to install:

1. Unfold the tree element that says "Qt"
2. Unfold the top most tree element (latest stable Qt version, e.g. `Qt 5.15.2`)
3. Under this version, select the following entries:
- `MSVC 2019 64-bit` (or alternative version if you are using that)
- `Qt WebEngine` (optional)
- `MSVC 2019 64-bit` (or alternative version if you are using that)
- `Qt WebEngine` (optional)
4. Under the "Tools" tree element (at the bottom), ensure that `Qt Creator X.X.X` and `Qt Creator X.X.X CDB Debugger Support` are selected. (they should be checked by default)
5. Continue through the installer and let the installer finish installing Qt.

Note: This installation will take about 2 GB of disk space.

## Compile with Breakpad support (Optional)

Compiling with Breakpad support enables crash reports that can be of use for developing/beta versions of Chatterino. If you have no interest in reporting crashes anyways, this optional dependency will probably be of no use to you.

1. Open up `lib/qBreakpad/handler/handler.pro`in Qt Creator
2. Build it in whichever mode you want to build Chatterino in (Debug/Profile/Release)
3. Copy the newly built `qBreakpad.lib` to the following directory: `lib/qBreakpad/build/handler` (You will have to manually create this directory)

## Run the build in Qt Creator

1. Open the `chatterino.pro` file by double-clicking or by opening it via Qt Creator.
2. You will be presented with a screen that is titled "Configure Project". In this screen, you should have at least one option present ready to be configured, like this:
![Qt Create Configure Project screenshot](https://i.imgur.com/dbz45mB.png)
![Qt Create Configure Project screenshot](https://i.imgur.com/dbz45mB.png)
3. Select the profile(s) you want to build with and click "Configure Project".

### How to run and produce builds

- In the main screen, click the green "play symbol" on the bottom left to run the project directly.
- Click the hammer on the bottom left to generate a build (does not run the build though).
- In the main screen, click the green "play symbol" on the bottom left to run the project directly.
- Click the hammer on the bottom left to generate a build (does not run the build though).

Build results will be placed in a folder at the same level as the "chatterino2" project folder (e.g. if your sources are at `C:\Users\example\src\chatterino2`, then the build will be placed in an automatically generated folder under `C:\Users\example\src`, e.g. `C:\Users\example\src\build-chatterino-Desktop_Qt_5_15_2_MSVC2019_64bit-Release`.)

- Note that if you are building chatterino purely for usage, not for development, it is recommended that you click the "PC" icon above the play icon and select "Release" instead of "Debug".
- Output and error messages produced by the compiler can be seen under the "4 Compile Output" tab in Qt Creator.
- Note that if you are building chatterino purely for usage, not for development, it is recommended that you click the "PC" icon above the play icon and select "Release" instead of "Debug".
- Output and error messages produced by the compiler can be seen under the "4 Compile Output" tab in Qt Creator.

## Producing standalone builds

Expand All @@ -96,21 +105,21 @@ To produce a standalone package, you need to generate all required files using t

To produce all supplement files for a standalone build, follow these steps (adjust paths as required):

1. Navigate to your build output directory with windows explorer, e.g. `C:\Users\example\src\build-chatterino-Desktop_Qt_5_15_2_MSVC2019_64bit-Release`
2. Enter the `release` directory
3. Delete all files except the `chatterino.exe` file. You should be left with a directory only containing `chatterino.exe`.
4. Open a `cmd` window and execute:
1. Navigate to your build output directory with windows explorer, e.g. `C:\Users\example\src\build-chatterino-Desktop_Qt_5_15_2_MSVC2019_64bit-Release`
2. Enter the `release` directory
3. Delete all files except the `chatterino.exe` file. You should be left with a directory only containing `chatterino.exe`.
4. Open a `cmd` window and execute:

cd C:\Users\example\src\build-chatterino-Desktop_Qt_5_15_2_MSVC2019_64bit-Release\release
C:\Qt\5.15.2\msvc2019_64\bin\windeployqt.exe chatterino.exe

5. Go to `C:\local\bin\` and copy these dll's into your `release folder`.
5. Go to `C:\local\bin\` and copy these dll's into your `release folder`.

libssl-1_1-x64.dll
libcrypto-1_1-x64.dll
ssleay32.dll
libeay32.dll

libssl-1_1-x64.dll
libcrypto-1_1-x64.dll
ssleay32.dll
libeay32.dll

6. The `releases` directory will now be populated with all the required files to make the chatterino build standalone.
6. The `releases` directory will now be populated with all the required files to make the chatterino build standalone.

You can now create a zip archive of all the contents in `releases` and distribute the program as is, without requiring any development tools to be present on the target system. (However, the vcredist package must be present, as usual - see the [README](README.md)).
Loading

0 comments on commit e015013

Please sign in to comment.