aboutsummaryrefslogtreecommitdiff
path: root/BUILDING.md
blob: 43e895cc8d8276a5cb4735391f43b7e833b1583e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Building

Here you can find build instructions for Kristall.

## Requirements

- Qt 5.9 or higher with `widgets` and `network` modules

## Build

### *nix

There's a small `Makefile` provided that does all necessary steps and creates a build directory, then copies the build artifact from the build directory. Just do `make` in the root directory, it should work.

Or you can use the usual Qt5 build process:

```sh
mkdir build
cd build
qmake ../src/kristall.pro
make
```

#### Notes for OpenBSD
- It seems like Qt wants `libzstd.so.3.1` instead of `libzstd.so.3.2`. Just symlink that file into the build directory
- Use `make` and not `gmake` to build the project.

#### Notes on FreeBSD
- Kristall can't be used with LibreSSL, but requires OpenSSL (probably because of Qt)
- Required packages
  - `qt5`
  - `make`
  - `git` - optional, for cloning from CLI
 - Additionally, the following must be exported for qmake: `export QMAKESPEC=freebsd-clang`

#### Notes for Ubuntu and Debian
- Supported Versions:
  - Ubuntu: 18.04, 20.04
  - Debian: 10, 11, 12 (TBA)

- Unsupported Versions
  - Ubuntu: 16.04
  - Debian: 9

- Required packages
  - `qt5-default`
  - `qt5-qmake`
  - `qttools5-dev-tools`
  - `qtmultimedia5-dev`
  - `libqt5svg5-dev`
  - `libssl-dev`
  - `make`
  - `g++`

- Additional packages (to use dynamic libraries)
  - `libcmark-dev`
  - `libgumbo-dev`

#### Notes for Fedora 32 (and probably other recent versions)
In the small `Makefile` mentioned above, comment out the line:

* `QMAKE_COMMAND := qmake`

And uncomment the line:
* `# QMAKE_COMMAND := /usr/bin/qmake-qt5`

This is because Fedora has a different naming scheme for the qmake executable. 

- Key required packages
    - `qt5-qtbase`
    - `qt5-qtbase-devel`
    - `qt5-qtmultimedia-devel`
    - `qt5-qtsvg-devel`
    - `qt5-linguist`
    - `ccache-3.7.7-1.fc32.x86_64`
    - `make`
    - `openssl-devel`
    - And the packages they depend on

#### Notes for Manjaro/Arch
- Required packages
  - `qt5-base`
  - `qt5-multimedia`
  - `qt5-svg`
  - `openssl` or `libressl`
  - `qt5-tools`

#### Notes on void linux
- set env variable `QT_SELECT=5`

#### Notes on alpine linux
- Required packages for 0.3
  - `qt5-qtbase-dev`
  - `qtchooser`
  - `qt5-qtsvg-dev`
  - `qt5-qtmultimedia-dev`
- Additionally for current state (38b353e)
  - `qt5-qttools-dev`
  - `bash`

#### Windows (MinGW)
Install Qt via the Qt installer. Install the following components:

**Required:**
- `Qt/Qt 5.15.0/MinGW 8.1.0 64-bit`
- `Qt/Developer and Designer Tools/MinGW 8.1.0 64 bit`
- `Qt/Developer and Designer Tools/OpenSSL 64-bit binaries`
**Optional:**
- `Qt/Developer and Designer Tools/Qt Creator 4.12.3 CDB Debugger Support`
- `Qt/Developer and Designer Tools/Debugging Tools for Windows`
- `Qt/Developer and Designer Tools/Qt Creator 4.12.3 CDB Debugger Support`
- `Qt/Developer and Designer Tools/OpenSSL source code`

If you didn't istall Qt to `C:\Qt`, you have to adjust the paths in `src/kristall.pro` for the `win32-g++` adjustments to the path you used.

Then open `src/kristall.pro` with Qt creator to compile the project. Alternatively you can use `ci\build-and-deploy.bat`, but note that this script tries to deploy the file to `random-projects.net`, so this will fail in the end.

**Troubleshouting:**
If you get an error message that `MSVCR100.dll` is missing, you may need to install the [Microsoft C++ Runtime](https://www.microsoft.com/en-us/download/details.aspx?id=14632).

**Troubleshouting:**
*QtCreator says the exe crashed when starting.* This happens when you are missing the OpenSSL dlls. Copy them from `C:\Qt\Tools\OpenSSL\Win_x64\bin\libcrypto-1_1-x64.dll` and `C:\Qt\Tools\OpenSSL\Win_x64\bin\libssl-1_1-x64.dll` to the debug/release folder of your build. Then the exe should be starting.

#### Windows MSVC (not up to date)

Compile OpenSSL with the following steps:  
- Install [Perl](https://www.perl.org/get.html) (either ActiveState or Strawberry)
- Install [NASM](https://www.nasm.us/)
- Add both to your PATH
- Clone [OpenSSL](https://github.com/openssl/openssl)
- Open a Visual Studio Developer Command Prompt (or a command prompt that has ran vcvarsall.bat). You will need Administrator privileges for the install step
- In the OpenSSL root directory, run `perl Configure VC-WIN32` if compiling for 32 bit, `perl Configure VC-WIN64A` for 64 bit
- Run `nmake`
- Run `nmake install` to install OpenSSL in `C:\Program Files\OpenSSL`

Use QtCreator to build `./src/kristall.pro` with default settings.

#### macOS

1. Run `brew install qt@5 openssl` to install the `qt` and `openssl` packages with [Homebrew](https://brew.sh/).
2. Run `brew link qt5` to enable the use of `qmake`
3. Run `make build/kristall` to build `kristall.app` in the `build` directory.

#### Haiku

1. Install the following packages with `pkgman`:
    - `qt5`
    - `qt5_devel`
    - `qt5_tools`
    - `libiconv_devel`
    - `openssl_devel` (should be preinstalled)
2. Use `make` to build the executable

#### Haiku x86

1. Install the following packages with `pkgman`:
    - `qt5_x86`
    - `qt5_x86_devel`
    - `qt5_x86_tools`
    - `libiconv_x86_devel`
    - `openssl_x86_devel` (should be preinstalled)
2. run `setarch x86`
3. Use `make` to build the executable

## Manual Installation

### Unix / XDG

The provided desktop file and additional mime types (along with the text/gemini) can be installed into the local system
```sh
cp Kristall.desktop ~/.local/share/applications/kristall.desktop
cp kristall-mime-info.xml ~/.local/share/mime/packages/kristall-mime-info.xml
update-desktop-database ~/.local/share/applications
update-mime-database ~/.local/share/mime
```

### macOS

Copy `kristall.app` from the `build` directory to `/Applications`.

### Haiku

Link the `kristall` executable to your applications menu:

```sh
cd ~/config/settings/deskbar/menu/Applications/
ln -s /path/to/kristall .
```