Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Commit acd7dbe

Browse files
committed
Merge branch 'polymc' into develop
2 parents 8c3067c + d673f2d commit acd7dbe

File tree

468 files changed

+20183
-13902
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

468 files changed

+20183
-13902
lines changed

.clang-format

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Chromium
4+
IndentWidth: 4
5+
AlignConsecutiveMacros: false
6+
AlignConsecutiveAssignments: false
7+
AllowShortIfStatementsOnASingleLine: false
8+
BraceWrapping:
9+
AfterFunction: true
10+
SplitEmptyFunction: false
11+
SplitEmptyRecord: false
12+
SplitEmptyNamespace: false
13+
BreakBeforeBraces: Custom
14+
BreakConstructorInitializers: BeforeComma
15+
ColumnLimit: 140
16+
Cpp11BracedListStyle: false

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ CMakeLists.txt.user.*
1414
/.project
1515
/.settings
1616
/.idea
17+
/.vscode
1718
cmake-build-*/
1819
Debug
1920

2021
# Build dirs
2122
build
23+
dist
2224
/build-*
2325

2426
# Install dirs
@@ -37,4 +39,12 @@ tags
3739
branding/
3840
secrets/
3941
run/
40-
dist/
42+
43+
.cache/
44+
45+
# Nix/NixOS
46+
result/
47+
48+
# Flatpak
49+
.flatpak-builder
50+
flatbuild

.gitmodules

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[submodule "depends/libnbtplusplus"]
22
path = libraries/libnbtplusplus
3-
url = https://github.com/MultiMC/libnbtplusplus.git
4-
pushurl = git@github.com:MultiMC/libnbtplusplus.git
3+
url = https://github.com/PolyMC/libnbtplusplus.git
4+
pushurl = git@github.com:PolyMC/libnbtplusplus.git
5+
56
[submodule "libraries/quazip"]
6-
path = libraries/quazip
7-
url = https://github.com/MultiMC/quazip.git
8-
pushurl = git@github.com:MultiMC/quazip.git
7+
path = libraries/quazip
8+
url = https://github.com/stachenov/quazip.git

BUILD.md

Lines changed: 3 additions & 219 deletions
Original file line numberDiff line numberDiff line change
@@ -1,221 +1,5 @@
1-
Build Instructions
2-
==================
1+
# Build Instructions
32

4-
# Contents
3+
Build instructions are available on [the website](https://polymc.org/wiki/development/build-instructions/).
54

6-
* [Note](#note)
7-
* [Getting the source](#source)
8-
* [Linux](#linux)
9-
* [Windows](#windows)
10-
* [macOS](#macos)
11-
12-
# Note
13-
14-
MultiMC is a portable application and is not supposed to be installed into any system folders.
15-
That would be anything outside your home folder. Before running `make install`, make sure
16-
you set the install path to something you have write access to. Never build this under
17-
an administrator/root level account. Don't use `sudo`. It won't work and it's not supposed to work.
18-
Also note that this guide is for development purposes only.
19-
**No support is given for building your own fork or special build for any reason whatsoever**.
20-
21-
# Branding, identifying marks and API keys
22-
23-
The logo and related assets are All Rights Reserved and may only be used in official builds of MultiMC hosted on multimc.org, and as such, are not, and will not be included in this repository. The source is only provided for the purpose of collaboration.
24-
25-
API keys are necessary for Microsoft account functionality. More info in [(Not) Secrets](https://github.com/MultiMC/Launcher/tree/develop/notsecrets)
26-
27-
# Getting the source
28-
29-
Clone the source code using git and grab all the submodules:
30-
31-
```
32-
git clone https://github.com/MultiMC/Launcher.git
33-
git submodule init
34-
git submodule update
35-
```
36-
37-
# Linux
38-
39-
Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution.
40-
41-
## Build dependencies
42-
* A C++ compiler capable of building C++11 code.
43-
* Qt 5.6+ Development tools (http://qt-project.org/downloads) ("Qt Online Installer for Linux (64 bit)") or the equivalent from your package manager. It is always better to use the Qt from your distribution, as long as it has a new enough version. (for example, `qttools5-dev`)
44-
* cmake 3.1 or newer
45-
* zlib (for example, `zlib1g-dev`)
46-
* Java JDK 8 (for example, `openjdk-8-jdk`)
47-
* GL headers (for example, `libgl1-mesa-dev`)
48-
49-
### Building from command line
50-
You need a source folder, a build folder and an install folder.
51-
52-
Let's say you want everything in `~/MultiMC/`:
53-
54-
```
55-
# make all the folders
56-
mkdir ~/MultiMC && cd ~/MultiMC
57-
mkdir build
58-
mkdir install
59-
# clone the complete source
60-
git clone --recursive https://github.com/MultiMC/Launcher.git src
61-
# configure the project
62-
cd build
63-
cmake -DCMAKE_INSTALL_PREFIX=../install ../src
64-
# build & install (use -j with the number of cores your CPU has)
65-
make -j8 install
66-
```
67-
68-
You can use IDEs like KDevelop or QtCreator to open the CMake project if you want to work on the code.
69-
70-
### Installing Qt using the installer (optional)
71-
1. Run the Qt installer.
72-
2. Choose a place to install Qt.
73-
3. Choose the components you want to install.
74-
- You need Qt 5.6.x 64-bit ticked.
75-
- You need Tools/Qt Creator ticked.
76-
- Other components are selected by default, you can untick them if you don't need them.
77-
4. Accept the license agreements.
78-
5. Double check the install details and then click "Install".
79-
- Installation can take a very long time, go grab a cup of tea or something and let it work.
80-
81-
### Loading the project in Qt Creator (optional)
82-
1. Open Qt Creator.
83-
2. Choose `File->Open File or Project`.
84-
3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt.
85-
4. Read the instructions that just popped up about a build location and choose one.
86-
5. You should see "Run CMake" in the window.
87-
- Make sure that Generator is set to "Unix Generator (Desktop Qt 5.6.x GCC 64bit)".
88-
- Hit the "Run CMake" button.
89-
- You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window.
90-
- Hit "Finish" if CMake ran successfully.
91-
6. Cross your fingers and press the Run button (bottom left of Qt Creator).
92-
- If the project builds successfully it will run and the Launcher window will pop up.
93-
94-
**If this doesn't work for you, let us know on IRC ([Esper/#MultiMC](http://webchat.esper.net/?nick=&channels=MultiMC))!**
95-
96-
# Windows
97-
98-
Getting the project to build and run on Windows is easy if you use Qt's IDE, Qt Creator. The project will simply not compile using Microsoft build tools, because that's not something we do. If it does compile, it is by chance only.
99-
100-
## Dependencies
101-
* [Qt 5.6+ Development tools](http://qt-project.org/downloads) -- Qt Online Installer for Windows
102-
- http://download.qt.io/new_archive/qt/5.6/5.6.0/qt-opensource-windows-x86-mingw492-5.6.0.exe
103-
- Download the MinGW version (MSVC version does not work).
104-
* [OpenSSL](https://github.com/IndySockets/OpenSSL-Binaries/tree/master/Archive/) -- Win32 OpenSSL, version 1.0.2g (from 2016)
105-
- https://github.com/IndySockets/OpenSSL-Binaries/raw/master/Archive/openssl-1.0.2g-i386-win32.zip
106-
- the usual OpenSSL for Windows (http://slproweb.com/products/Win32OpenSSL.html) only provides the newest version of OpenSSL, and we need the 1.0.2g version
107-
- **Download the 32-bit version, not 64-bit.**
108-
- Microsoft Visual C++ 2008 Redist is required for this, there's a link on the OpenSSL download page above next to the main download.
109-
- We use a custom build of OpenSSL that doesn't have this dependency. For normal development, the custom build is not necessary though.
110-
* [zlib 1.2+](http://gnuwin32.sourceforge.net/packages/zlib.htm) - the Setup is fine
111-
* [Java JDK 8](https://adoptium.net/releases.html?variant=openjdk8) - Use the MSI installer.
112-
* [CMake](http://www.cmake.org/cmake/resources/software.html) -- Windows (Win32 Installer)
113-
114-
Ensure that OpenSSL, zlib, Java and CMake are on `PATH`.
115-
116-
## Getting set up
117-
118-
### Installing Qt
119-
1. Run the Qt installer
120-
2. Choose a place to install Qt (C:\Qt is the default),
121-
3. Choose the components you want to install
122-
- You need Qt 5.6 (32 bit) ticked,
123-
- You need Tools/Qt Creator ticked,
124-
- Other components are selected by default, you can untick them if you don't need them.
125-
4. Accept the license agreements,
126-
5. Double check the install details and then click "Install"
127-
- Installation can take a very long time, go grab a cup of tea or something and let it work.
128-
129-
### Installing OpenSSL
130-
1. Download .zip file from the link above.
131-
2. Unzip and add the directory to PATH, so CMake can find it.
132-
133-
### Installing CMake
134-
1. Run the CMake installer,
135-
2. It's easiest if you choose to add CMake to the PATH for all users,
136-
- If you don't choose to do this, remember where you installed CMake.
137-
138-
### Loading the project
139-
1. Open Qt Creator,
140-
2. Choose File->Open File or Project,
141-
3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt,
142-
4. Read the instructions that just popped up about a build location and choose one,
143-
5. If you chose not to add CMake to the system PATH, tell Qt Creator where you installed it,
144-
- Otherwise you can skip this step.
145-
6. You should see "Run CMake" in the window,
146-
- Make sure that Generator is set to "MinGW Generator (Desktop Qt 5.6.x MinGW 32bit)",
147-
- Hit the "Run CMake" button,
148-
- You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window.
149-
- Hit "Finish" if CMake ran successfully.
150-
7. Cross your fingers and press the Run button (bottom left of Qt Creator)!
151-
- If the project builds successfully it will run and the Launcher window will pop up,
152-
- Test OpenSSL by making an instance and trying to log in. If Qt Creator couldn't find OpenSSL during the CMake stage, login will fail and you'll get an error.
153-
154-
The following .dlls are needed for the app to run (copy them to build directory if you want to be able to move the build to another pc):
155-
```
156-
platforms/qwindows.dll
157-
libeay32.dll
158-
libgcc_s_dw2-1.dll
159-
libssp-0.dll
160-
libstdc++-6.dll
161-
libwinpthread-1.dll
162-
Qt5Core.dll
163-
Qt5Gui.dll
164-
Qt5Network.dll
165-
Qt5Svg.dll
166-
Qt5Widgets.dll
167-
Qt5Xml.dll
168-
ssleay32.dll
169-
zlib1.dll
170-
```
171-
172-
**These build instructions worked for me (Drayshak) on a fresh Windows 8 x64 Professional install. If they don't work for you, let us know on IRC ([Esper/#MultiMC](http://webchat.esper.net/?nick=&channels=MultiMC))!**
173-
### Compile from command line on Windows
174-
1. If you installed Qt with the web installer, there should be a shortcut called `Qt 5.4 for Desktop (MinGW 4.9 32-bit)` in the Start menu on Windows 7 and 10. Best way to find it is to search for it. Do note you cannot just use cmd.exe, you have to use the shortcut, otherwise the proper MinGW software will not be on the PATH.
175-
2. Once that is open, change into your user directory, and clone MultiMC by doing `git clone --recursive https://github.com/MultiMC/Launcher.git`, and change directory to the folder you cloned to.
176-
3. Make a build directory, and change directory to the directory and do `cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Path\that\makes\sense\for\you`. By default, it will install to C:\Program Files (x86), which you might not want, if you want a local installation. If you want to install it to that directory, make sure to run the command window as administrator.
177-
3. Do `mingw32-make -jX`, where X is the number of cores your CPU has plus one.
178-
4. Now to wait for it to compile. This could take some time. Hopefully it compiles properly.
179-
5. Run the command `mingw32-make install`, and it should install MultiMC, to whatever the `-DCMAKE_INSTALL_PREFIX` was.
180-
6. In most cases, whenever compiling, the OpenSSL dll's aren't put into the directory to where MultiMC installs, meaning you cannot log in. The best way to fix this is just to do `copy C:\OpenSSL-Win32\*.dll C:\Where\you\installed\MultiMC\to`. This should copy the required OpenSSL dll's to log in.
181-
182-
# macOS
183-
184-
### Install prerequisites:
185-
- Install XCode Command Line tools
186-
- Install the official build of CMake (https://cmake.org/download/)
187-
- Install JDK 8 (https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html)
188-
- Get Qt 5.6 and install it (https://download.qt.io/new_archive/qt/5.6/5.6.3/)
189-
190-
### XCode Command Line tools
191-
192-
If you don't have XCode CommandLine tools installed, you can install them by using this command in the Terminal App
193-
194-
```bash
195-
xcode-select --install
196-
```
197-
198-
### Build
199-
200-
Pick an installation path - this is where the final `.app` will be constructed when you run `make install`. Supply it as the `CMAKE_INSTALL_PREFIX` argument during CMake configuration.
201-
202-
```
203-
git clone --recursive https://github.com/MultiMC/Launcher.git
204-
cd Launcher
205-
mkdir build
206-
cd build
207-
cmake \
208-
-DCMAKE_C_COMPILER=/usr/bin/clang \
209-
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
210-
-DCMAKE_BUILD_TYPE=Release \
211-
-DCMAKE_INSTALL_PREFIX:PATH="$(dirname $PWD)/dist/" \
212-
-DCMAKE_PREFIX_PATH="/path/to/Qt5.6/" \
213-
-DQt5_DIR="/path/to/Qt5.6/" \
214-
-DLauncher_LAYOUT=mac-bundle \
215-
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \
216-
..
217-
make install
218-
```
219-
220-
**Note:** The final app bundle may not run due to code signing issues, which
221-
need to be fixed with `codesign -fs -`.
5+
If you would like to contribute or fix an issue with the Build instructions you can do so [here](https://github.com/PolyMC/polymc.github.io/blob/master/src/wiki/development/build-instructions.md).

0 commit comments

Comments
 (0)