|
1 |
| -Copyright (c) 2009-2012 Bitcoin Developers |
2 |
| -Copyright (c) 2013 NovaCoin Developers |
3 |
| -Distributed under the MIT/X11 software license, see the accompanying file |
4 |
| -license.txt or http://www.opensource.org/licenses/mit-license.php. This |
5 |
| -product includes software developed by the OpenSSL Project for use in the |
6 |
| -OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic |
7 |
| -software written by Eric Young ( [email protected]) and UPnP software written by |
8 |
| -Thomas Bernard. |
| 1 | +Mac OS X Build Instructions and Notes |
| 2 | +==================================== |
| 3 | +This guide will show you how to build novacoind(headless client) for OSX. |
9 | 4 |
|
| 5 | +Notes |
| 6 | +----- |
10 | 7 |
|
11 |
| -Mac OS X novacoind build instructions |
12 |
| -Laszlo Hanyecz < [email protected]> |
13 |
| - |
| 8 | +* Tested on OS X 10.7 through 10.10 on 64-bit Intel processors only. |
14 | 9 |
|
| 10 | +* All of the commands should be executed in a Terminal application. The |
| 11 | +built-in one is located in `/Applications/Utilities`. |
15 | 12 |
|
16 |
| -See readme-qt.rst for instructions on building NovaCoin QT, the |
17 |
| -graphical user interface. |
| 13 | +Preparation |
| 14 | +----------- |
18 | 15 |
|
19 |
| -Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian. |
| 16 | +You need to install XCode with all the options checked so that the compiler |
| 17 | +and everything is available in /usr not just /Developer. XCode should be |
| 18 | +available on your OS X installation media, but if not, you can get the |
| 19 | +current version from https://developer.apple.com/xcode/. If you install |
| 20 | +Xcode 4.3 or later, you'll need to install its command line tools. This can |
| 21 | +be done in `Xcode > Preferences > Downloads > Components` and generally must |
| 22 | +be re-done or updated every time Xcode is updated. |
20 | 23 |
|
21 |
| -All of the commands should be executed in Terminal.app.. it's in |
22 |
| -/Applications/Utilities |
| 24 | +There's also an assumption that you already have `git` installed. If |
| 25 | +not, it's the path of least resistance to install [Github for Mac](https://mac.github.com/) |
| 26 | +(OS X 10.7+) or |
| 27 | +[Git for OS X](https://code.google.com/p/git-osx-installer/). It is also |
| 28 | +available via Homebrew. |
23 | 29 |
|
24 |
| -You need to install XCode with all the options checked so that the compiler and |
25 |
| -everything is available in /usr not just /Developer I think it comes on the DVD |
26 |
| -but you can get the current version from http://developer.apple.com |
| 30 | +You will also need to install [Homebrew](http://brew.sh) in order to install library |
| 31 | +dependencies. |
27 | 32 |
|
| 33 | +The installation of the actual dependencies is covered in the Instructions |
| 34 | +sections below. |
28 | 35 |
|
29 |
| -1. Clone the github tree to get the source code: |
| 36 | +Instructions: Homebrew |
| 37 | +---------------------- |
30 | 38 |
|
31 |
| -git clone https://github.com/novacoin-project/novacoin |
| 39 | +#### Install dependencies using Homebrew |
32 | 40 |
|
33 |
| -2. Download and install MacPorts from http://www.macports.org/ |
| 41 | + brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt qrencode |
34 | 42 |
|
35 |
| -2a. (for 10.7 Lion) |
36 |
| - Edit /opt/local/etc/macports/macports.conf and uncomment "build_arch i386" |
| 43 | +#### Installing berkeley-db4 using Homebrew |
37 | 44 |
|
38 |
| -3. Install dependencies from MacPorts |
| 45 | +The homebrew package for berkeley-db4 has been broken for some time. It will install without Java though. |
39 | 46 |
|
40 |
| -sudo port install boost db48 openssl miniupnpc |
| 47 | +Running this command takes you into brew's interactive mode, which allows you to configure, make, and install by hand: |
| 48 | +``` |
| 49 | +$ brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java |
| 50 | +``` |
41 | 51 |
|
42 |
| -Optionally install qrencode (and set USE_QRCODE=1): |
43 |
| -sudo port install qrencode |
| 52 | +The rest of these commands are run inside brew interactive mode: |
| 53 | +``` |
| 54 | +/private/tmp/berkeley-db4-UGpd0O/db-4.8.30 $ cd .. |
| 55 | +/private/tmp/berkeley-db4-UGpd0O $ db-4.8.30/dist/configure --prefix=/usr/local/Cellar/berkeley-db4/4.8.30 --mandir=/usr/local/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx |
| 56 | +/private/tmp/berkeley-db4-UGpd0O $ make |
| 57 | +/private/tmp/berkeley-db4-UGpd0O $ make install |
| 58 | +/private/tmp/berkeley-db4-UGpd0O $ exit |
| 59 | +``` |
44 | 60 |
|
45 |
| -4. Now you should be able to build novacoind: |
| 61 | +After exiting, you'll get a warning that the install is keg-only, which means it wasn't symlinked to `/usr/local`. You don't need it to link it to build novacoin, but if you want to, here's how: |
46 | 62 |
|
47 |
| -cd novacoin/src |
48 |
| -make -f makefile.osx |
| 63 | + $ brew link --force berkeley-db4 |
49 | 64 |
|
50 |
| -Run: |
51 |
| - ./novacoind --help # for a list of command-line options. |
52 |
| -Run |
53 |
| - ./novacoind -daemon # to start the novacoin daemon. |
54 |
| -Run |
55 |
| - ./novacoind help # When the daemon is running, to get a list of RPC commands |
| 65 | + |
| 66 | +### Building `novacoind` |
| 67 | + |
| 68 | +1. Clone the github tree to get the source code and go into the directory. |
| 69 | + |
| 70 | + git clone https://github.com/novacoin-project/novacoin.git |
| 71 | + cd novacoin |
| 72 | + |
| 73 | +2. Build NovaCoin-Qt application: |
| 74 | + qmake |
| 75 | + make |
| 76 | + |
| 77 | +3. Build bitcoind: |
| 78 | + cd src |
| 79 | + make -f makefile.osx novacoind |
| 80 | + |
| 81 | +Use Qt Creator as IDE |
| 82 | +------------------------ |
| 83 | +You can use Qt Creator as IDE, for debugging and for manipulating forms, etc. |
| 84 | +Download Qt Creator from http://www.qt.io/download/. Download the "community edition" and only install Qt Creator (uncheck the rest during the installation process). |
| 85 | + |
| 86 | +1. Make sure you installed everything through homebrew mentioned above |
| 87 | +2. In Qt Creator do "File" -> "Open Project" |
| 88 | +3. Select novacoin-qt.pro as project file. |
| 89 | +4. In the "Projects" tab select "Manage Kits..." |
| 90 | +5. Select the default "Desktop" kit and select "Clang (x86 64bit in /usr/bin)" as compiler |
| 91 | +6. Select LLDB as debugger (you might need to set the path to your installtion) |
| 92 | +7. Start debugging with Qt Creator |
| 93 | + |
| 94 | +Creating a release build |
| 95 | +------------------------ |
| 96 | +You can ignore this section if you are building `novacoind` for your own use. |
| 97 | + |
| 98 | +novacoind binary isn't included in the NovaCoin-Qt.app bundle. |
| 99 | + |
| 100 | +If you are building `novacoind` or `NovaCoin-Qt` for others, your build machine should be set up |
| 101 | +as follows for maximum compatibility: |
| 102 | + |
| 103 | +All dependencies should be compiled with these flags: |
| 104 | + |
| 105 | + -mmacosx-version-min=10.7 |
| 106 | + -arch x86_64 |
| 107 | + -isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk |
| 108 | + |
| 109 | +Once dependencies are compiled, you can create the .dmg disk image: |
| 110 | + |
| 111 | +./contrib/macdeploy/macdeployqtplus NovaCoin-Qt.app -dmg -fancy ./contrib/macdeploy/fancy.plist |
| 112 | + |
| 113 | +Running |
| 114 | +------- |
| 115 | + |
| 116 | +It's now available at `./novacoind`, provided that you are still in the `src` |
| 117 | +directory. We have to first create the RPC configuration file, though. |
| 118 | + |
| 119 | +Run `./novacoind` to get the filename where it should be put, or just try these |
| 120 | +commands: |
| 121 | + |
| 122 | + echo -e "rpcuser=novacoinrpc\nrpcpassword=$(xxd -l 16 -p /dev/urandom)" > "/Users/${USER}/Library/Application Support/NovaCoin/novacoin.conf" |
| 123 | + chmod 600 "/Users/${USER}/Library/Application Support/NovaCoin/novacoin.conf" |
| 124 | + |
| 125 | +The next time you run it, it will start downloading the blockchain, but it won't |
| 126 | +output anything while it's doing this. This process may take several hours; |
| 127 | +you can monitor its process by looking at the debug.log file, like this: |
| 128 | + |
| 129 | + tail -f $HOME/Library/Application\ Support/NovaCoin/debug.log |
| 130 | + |
| 131 | +Other commands: |
| 132 | +------- |
| 133 | + |
| 134 | + ./novacoind -daemon # to start the bitcoin daemon. |
| 135 | + ./novacoind --help # for a list of command-line options. |
| 136 | + ./novacoind help # When the daemon is running, to get a list of RPC commands |
0 commit comments