pollymc/BUILD.md

153 lines
6.5 KiB
Markdown
Raw Normal View History

2013-09-23 00:56:10 +05:30
Build Instructions
==================
2013-09-22 19:02:55 +05:30
2013-09-23 00:56:10 +05:30
# Contents
2015-10-01 01:30:31 +05:30
* [Note](#note)
2015-10-01 01:30:31 +05:30
* [Getting the source](#source)
2013-09-22 19:02:55 +05:30
* [Linux](#linux)
2013-09-22 20:32:01 +05:30
* [Windows](#windows)
2013-09-23 00:56:10 +05:30
* [OS X](#os-x)
# Note
MultiMC is a portable application and is not supposed to be installed into any system folders.
That would be anything outside your home folder. Before runing `make install`, make sure
you set the install path to something you have write access to. Never build this under
an administrator/root level account. Don't use `sudo`. It won't work and it's not supposed to work.
2013-09-22 19:02:55 +05:30
2015-10-01 01:30:31 +05:30
# Getting the source
2013-09-23 00:56:10 +05:30
2015-10-01 01:30:31 +05:30
Clone the source code using git and grab all the submodules:
2013-09-23 00:56:10 +05:30
2015-10-01 01:30:31 +05:30
```
git clone git@github.com:MultiMC/MultiMC5.git
git submodule init
git submodule update
```
2013-09-22 19:02:55 +05:30
2015-10-01 01:30:31 +05:30
# Linux
2013-09-22 19:02:55 +05:30
2015-10-01 01:30:31 +05:30
Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution.
## Build dependencies
* Ideally a compiler capable of building C++14 code (for example, GCC 5.2 and above).
* Qt 5.5.1+ Development tools (http://qt-project.org/downloads) ("Qt Online Installer for Linux (64 bit)") or the equivalent from your package manager
* cmake 3.1 or newer
2015-10-01 01:30:31 +05:30
* zlib (for example, `zlib1g-dev`)
* java (for example, `openjdk-8-jdk`)
* GL headers (for example, `libgl1-mesa-dev`)
### Installing Qt using the installer
1. Run the Qt installer.
2. Choose a place to install Qt.
3. Choose the components you want to install.
- You need Qt 5.5.1/gcc 64-bit ticked.
2015-10-01 01:30:31 +05:30
- You need Tools/Qt Creator ticked.
- Other components are selected by default, you can untick them if you don't need them.
2015-10-01 01:30:31 +05:30
4. Accept the license agreements.
5. Double check the install details and then click "Install".
- Installation can take a very long time, go grab a cup of tea or something and let it work.
2013-09-22 19:02:55 +05:30
2015-10-01 01:30:31 +05:30
### Loading the project in Qt Creator
1. Open Qt Creator.
2. Choose `File->Open File or Project`.
3. Navigate to the MultiMC5 source folder you cloned and choose CMakeLists.txt.
4. Read the instructions that just popped up about a build location and choose one.
5. You should see "Run CMake" in the window.
- Make sure that Generator is set to "Unix Generator (Desktop Qt 5.4.1 GCC 64bit)".
- Hit the "Run CMake" button.
- You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window.
- Hit "Finish" if CMake ran successfully.
2015-10-01 01:30:31 +05:30
6. Cross your fingers and press the Run button (bottom left of Qt Creator).
- If the project builds successfully it will run and the MultiMC5 window will pop up.
2013-09-22 19:02:55 +05:30
2015-10-01 01:30:31 +05:30
**If this doesn't work for you, let us know on IRC ([Esper/#MultiMC](http://webchat.esper.net/?nick=&channels=MultiMC))!**
2013-09-22 19:02:55 +05:30
2013-09-23 00:56:10 +05:30
# Windows
2013-09-22 19:02:55 +05:30
2015-10-01 01:30:31 +05:30
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.
2013-09-22 20:26:14 +05:30
2013-09-23 00:56:10 +05:30
## Dependencies
* [Qt 5.5.1+ Development tools](http://qt-project.org/downloads) -- Qt Online Installer for Windows
* [OpenSSL](http://slproweb.com/products/Win32OpenSSL.html) -- Newest Win32 OpenSSL Light
- Microsoft Visual C++ 2008 Redist is required for this, there's a link on the OpenSSL download page above next to the main download.
- We use a custom build of OpenSSL that doesn't have this dependency. For normal development, the custom build is not necessary though.
* [zlib 1.2.8+](http://zlib.net/zlib128-dll.zip)
* [CMake](http://www.cmake.org/cmake/resources/software.html) -- Windows (Win32 Installer)
* [patch.exe from the GnuWin project](http://gnuwin32.sourceforge.net/packages/patch.htm).
Put it somewhere on the `PATH`, so that it is accessible from the console.
2013-09-22 20:26:14 +05:30
2013-09-23 00:56:10 +05:30
## Getting set up
2013-09-22 20:26:14 +05:30
2013-09-23 00:56:10 +05:30
### Installing Qt
2013-09-22 20:26:14 +05:30
1. Run the Qt installer
2. Choose a place to install Qt (C:\Qt is the default),
3. Choose the components you want to install
2015-10-01 01:30:31 +05:30
- You need Qt 5.4.1/MinGW 4.9 (32 bit) ticked,
2013-09-22 20:26:14 +05:30
- You need Tools/Qt Creator ticked,
- Other components are selected by default, you can untick them if you don't need them.
4. Accept the license agreements,
5. Double check the install details and then click "Install"
- Installation can take a very long time, go grab a cup of tea or something and let it work.
2013-09-23 00:56:10 +05:30
### Installing OpenSSL
2013-09-22 20:26:14 +05:30
1. Run the OpenSSL installer,
2015-10-01 01:30:31 +05:30
2. It's best to choose the option to copy OpenSSL DLLs to the `/bin` directory
- If you do this you'll need to add that directory (the default being `C:\OpenSSL-Win32\bin`) to your PATH system variable (Google how to do this, or use this guide for Java: http://www.java.com/en/download/help/path.xml).
2013-09-22 20:26:14 +05:30
2013-09-23 00:56:10 +05:30
### Installing CMake
2013-09-22 20:26:14 +05:30
1. Run the CMake installer,
2. It's easiest if you choose to add CMake to the PATH for all users,
- If you don't choose to do this, remember where you installed CMake.
2013-09-23 00:56:10 +05:30
### Loading the project
2013-09-22 20:26:14 +05:30
1. Open Qt Creator,
2. Choose File->Open File or Project,
3. Navigate to the MultiMC5 source folder you cloned and choose CMakeLists.txt,
4. Read the instructions that just popped up about a build location and choose one,
5. If you chose not to add CMake to the system PATH, tell Qt Creator where you installed it,
- Otherwise you can skip this step.
6. You should see "Run CMake" in the window,
2015-10-01 01:30:31 +05:30
- Make sure that Generator is set to "MinGW Generator (Desktop Qt 5.4.1 MinGW 32bit)",
2013-09-22 20:26:14 +05:30
- Hit the "Run CMake" button,
- You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window.
- Hit "Finish" if CMake ran successfully.
7. Cross your fingers and press the Run button (bottom left of Qt Creator)!
- If the project builds successfully it will run and the MultiMC5 window will pop up,
- 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.
2015-10-01 01:30:31 +05:30
**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))!**
2013-09-22 19:02:55 +05:30
2013-09-23 00:56:10 +05:30
# OS X
2013-09-22 19:02:55 +05:30
### Install prerequisites:
2015-10-01 01:30:31 +05:30
* install homebrew
* then:
```
brew install qt5
brew tap homebrew/versions
brew install gcc48
brew install cmake
```
### Build
2015-10-01 01:30:31 +05:30
```
git clone https://github.com/MultiMC/MultiMC5.git
git submodule init
git submodule update
cd MultiMC5
mkdir build
cd build
export CMAKE_PREFIX_PATH=/usr/local/opt/qt5
export CC=/usr/local/bin/gcc-4.8
export CXX=/usr/local/bin/g++-4.8
cmake ..
make
```
2015-10-01 01:30:31 +05:30
**These build instructions were taken and adapted from https://gist.github.com/number5/7250865 If they don't work for you, let us know on IRC ([Esper/#MultiMC](http://webchat.esper.net/?nick=&channels=MultiMC))!**