Skip to content

Commit bbf92d0

Browse files
Create build-qt-osx.md
1 parent f8fd090 commit bbf92d0

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

doc/build-qt-osx.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Instructions to build GUI CloakCoin wallet on Mac OS X
2+
3+
## Introduction
4+
5+
This is a tutorial to build the CloakCoin wallet with a graphical user interface (GUI), intended for end-users.
6+
7+
It is designed to walk you through all the steps required to build the wallet from scratch.
8+
9+
If you are experienced, there are short instructions in the README.
10+
11+
You will need about 3Go of free space, unless you need to install Xcode, in which case you will need somewhere around 10Go, depending on the Xcode version.
12+
13+
It should take less than 1 hour to complete this guide, provided you have a good connection and good computer (just copy-pasting the commands on fiber connection and recent computer could be completed in under 20 minutes).
14+
15+
16+
## Install a package manager
17+
18+
To build the wallet, you first need to install a package manager, which will let you install dependencies easily.
19+
20+
On Mac OS X, there is no pre-installed package manager, but there are several you can install.
21+
22+
The one CloakCoin use is HomeBrew.
23+
24+
First, **go on [HomeBrew main page](https://brew.sh/) and follow the instructions to install it.**
25+
26+
27+
## Installing the dependencies
28+
29+
To install dependencies, you need to open the Terminal app and run commands.
30+
31+
The command to install dependencies is `brew install` followed by a package name.
32+
33+
When you do that, HomeBrew will download the pre-compiled package and installed it in a pre-determined folder.
34+
35+
*Warning*: if HomeBrew doesn't have the pre-compiled package for your OS version (generally if you have an older version of Mac OS X), it will need to compile it. To do that, it will require that you **install Xcode**. To do that, go over to [from Apple Developer](http://developer.apple.com/download/more/) and find a version of Xcode compatible with your OS version.
36+
37+
You can install dependencies one-by-one, or all at once.
38+
To install all at once, **run: `brew install qt [email protected] leveldb curl openssl libevent berkeley-db@4 miniupnpc qrencode`**
39+
40+
Otherwise, here is the detail:
41+
* Qt is required for the graphical interface: `brew install qt`
42+
* Boost 1.57 is required for various utilities, and that specific version is required (newer won't work): `brew install [email protected]`
43+
* LevelDB is required to save some data: `brew install leveldb`
44+
* Berkeley DB 4.8 is required to save some other data, and that specific version is required (newer won't work): `brew install berkeley-db@4`
45+
* Curl is required to communicate: `brew install curl`
46+
* OpenSSL is required to secure communications: `brew install openssl`
47+
* Libevent is required to handle events internally : `brew install libevent`
48+
* Miniupnpc can be used to communicate using UPnP protocol: `brew install miniupnpc`
49+
* Qrencode can be used to provide QR codes: `brew install qrencode`
50+
51+
52+
## Expose qmake
53+
54+
To compile the code, you will need your Terminal to have access to the `qmake` command, which was installed with Qt.
55+
To do that, **run the command `echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile`**, then restart your terminal.
56+
57+
## Download the code
58+
59+
You can either [download a .zip of the code](https://github.com/CloakProject/CloakCoin/archive/master.zip) or **clone the repository using `git` (which is pre-installed on all Macs): `git clone https://github.com/CloakProject/CloakCoin.git`**.
60+
61+
## Compiling the wallet
62+
63+
In the Terminal, go where you downloaded the code using the `cd` command. For example, if you cloned the repository, **run `cd CloakCoin`.**
64+
65+
Then, **run `qmake && make`**, and wait until it finishes (it will take a few minutes and display a lot of things, be patient).
66+
67+
**Congratulations**, you now have the CloakCoin wallet you built yourself. Be advised that by downloading from the repo, you got a bleeding edge version, that may contain bugs.
68+
It is advised not to use it to store your real CloakCoin. By default, this version will be on TestNet anyway.
69+
70+
## Compiling using Qt Creator
71+
72+
There is an alternate way to build the wallet instead of running `qmake && make`: you can use Qt Creator. Download it, import the `.pro` file, then build it.
73+
74+
## Package dependencies inside the app
75+
76+
To be able to run the app on another Mac which doesn't have all the dependencies installed, you need to package dependencies inside the app.
77+
78+
There is a convenient tool named `macdeployqt` which does exactly that. Just **run `macdeployqt cloakcoin-qt.app`**
79+
80+
## Creating a .dmg to distribute the app
81+
82+
Users expect a .dmg where they can just drag&drop the app to their Applications folder. There are several ways to do this.
83+
You can use [create-dmg](https://github.com/andreyvit/create-dmg). **Clone it and make create-dmg accessible in your `$PATH`, then run:**
84+
```
85+
mkdir cloakcoin-release
86+
mv cloakcoin-qt.app cloakcoin-release/CloakCoin.app
87+
create-dmg --volname "CloakCoin" --volicon "src/qt/res/icons/CloakCoin.icns" --background "contrib/macdeploy/background.png" --window-pos 200 120 --window-size 500 320 --icon-size 100 --icon CloakCoin.app 120 150 --hide-extension CloakCoin.app --app-drop-link 380 150 CloakCoin.dmg cloakcoin-release/
88+
```
89+
90+
## Troubleshooting
91+
92+
If you have an issue with this guide, please open issue with:
93+
* your Mac OS X version
94+
* the result of `brew list`
95+
96+
We'll try to help you as best as we can.
97+
98+
## Known issues
99+
100+
#### qmake: command not found
101+
102+
Ensure qmake is in your $PATH. On Mac, using HomeBrew, `echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile` and restart your terminal.
103+
104+
#### Qt Creator
105+
106+
If you see `symbol not found` errors, ensure your DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH are correct in `Projects` -> `Run` -> `Run environment`.

0 commit comments

Comments
 (0)