Bump version to 0.4.7
[novacoin.git] / doc / build-osx.txt
index 7927983..52d876d 100644 (file)
@@ -1,14 +1,16 @@
 Copyright (c) 2010 Laszlo Hanyecz
-Distributed under the MIT/X11 software license, see the accompanying
-file license.txt or http://www.opensource.org/licenses/mit-license.php.
-This product includes software developed by the OpenSSL Project for use in
-the OpenSSL Toolkit (http://www.openssl.org/).  This product includes
-cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP
-software written by Thomas Bernard.
+Portions Copyright (c) 2011 Douglas Huff
+Distributed under the MIT/X11 software license, see the accompanying file
+license.txt or http://www.opensource.org/licenses/mit-license.php.  This
+product includes software developed by the OpenSSL Project for use in the
+OpenSSL Toolkit (http://www.openssl.org/).  This product includes cryptographic
+software written by Eric Young (eay@cryptsoft.com) and UPnP software written by
+Thomas Bernard.
 
 
 Mac OS X build instructions
-Laszlo Hanyecz (solar@heliacal.net)
+Laszlo Hanyecz <solar@heliacal.net>
+Douglas Huff <dhuff@jrbobdobbs.org>
 
 
 Tested on 10.5 and 10.6 intel.  PPC is not supported because it's big-endian.
@@ -16,18 +18,19 @@ Tested on 10.5 and 10.6 intel.  PPC is not supported because it's big-endian.
 All of the commands should be executed in Terminal.app.. it's in
 /Applications/Utilities
 
-You need to install XCode with all the options checked so that the compiler
-and everything is available in /usr not just /Developer
-I think it comes on the DVD but you can get the current version from
-http://developer.apple.com
+You need to install XCode with all the options checked so that the compiler and
+everything is available in /usr not just /Developer I think it comes on the DVD
+but you can get the current version from http://developer.apple.com
 
 
 1.  Pick a directory to work inside.. something like ~/bitcoin works.  The
 structure I use looks like this:
+
 (~ is your home directory)
 
 ~/bitcoin
-~/bitcoin/trunk         # source code
+~/bitcoin/bitcoin       # Upstream source tree
+~/bitcoin/src           # source code (symlink to ~/bitcoin/bitcoin/src)
 ~/bitcoin/deps          # dependencies.. like libraries and headers needed to compile
 ~/bitcoin/Bitcoin.app   # the application bundle where you can run the app
 
@@ -38,12 +41,15 @@ WARNING: do not use the ~ notation with the configure scripts.. use the full
 name of the directory, for example /Users/james/bitcoin/deps for a user named
 'james'.  In my examples I am using 'macosuser' so make sure you change that.
 
-2.  Check out the trunk version of the bitcoin code from subversion:
+2.  Check out the bitcoin code from github:
 
 cd ~/bitcoin
-svn checkout https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk
+git clone https://github.com/bitcoin/bitcoin.git
+ln -s bitcoin/src src
 
-This will make ~/bitcoin/trunk for you with all the files from subversion. 
+This will make ~/bitcoin/bitcoin for you with all the files from git. This puts
+the actual sources in ~/bitcoin/bitcoin/src and create a symlink src in
+~/bitcoin to this location.
 
 3.  Get and build the dependencies
 
@@ -80,6 +86,8 @@ This is what my output looked like at the end:
 OpenSSL
 -------
 
+(System or MacPorts openssl will work fine. Optional.)
+
 Download from http://www.openssl.org/source/
 
 We would like to build this as a 32 bit/64 bit library so we actually build it
@@ -113,30 +121,32 @@ file lib/libcrypto.a
 output should look like this:
 
 lib/libcrypto.a: Mach-O universal binary with 2 architectures
-lib/libcrypto.a (for architecture i386):       current ar archive random library
-lib/libcrypto.a (for architecture x86_64):     current ar archive random library
+lib/libcrypto.a (for architecture i386):  current ar archive random library
+lib/libcrypto.a (for architecture x86_64):  current ar archive random library
 
 
 miniupnpc
 ---------
 
+(MacPorts miniupnpc package works fine. You will need to modify makefile.)
+
 The process for miniupnpc (optional) is similar to that of OpenSSL.
 
 Download from http://miniupnp.tuxfamily.org/files/.
 
 cd ~/bitcoin/deps
-tar xvf ~/Downloads/miniupnpc-1.5.tar
-mv miniupnpc-1.5 miniupnpc-1.5-x86_64
-tar xvf ~/Downloads/miniupnpc-1.5.tar
-mv miniupnpc-1.5 miniupnpc-1.5-i386
+tar xvf ~/Downloads/miniupnpc-1.6.tar
+mv miniupnpc-1.6 miniupnpc-1.6-x86_64
+tar xvf ~/Downloads/miniupnpc-1.6.tar
+mv miniupnpc-1.6 miniupnpc-1.6-i386
 # build x86_64 (64 bit intel) binary
-cd miniupnpc-1.5-x86_64
+cd miniupnpc-1.6-x86_64
 export CFLAGS="-arch x86_64"
 export LDFLAGS="-arch x86_64"
 export PREFIX="/Users/macuser/bitcoin/deps"
 make && make install
 # build i386 (32 bit intel) binary
-cd miniupnpc-1.5-i386
+cd miniupnpc-1.6-i386
 export CFLAGS="-arch i386"
 export LDFLAGS="-arch i386"
 export PREFIX="/Users/macuser/bitcoin/deps"
@@ -144,7 +154,7 @@ make
 
 # combine the libs
 cd ~/bitcoin/deps
-lipo -arch i386 miniupnpc-1.5-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.5-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create
+lipo -arch i386 miniupnpc-1.6-i386/libminiupnpc.a -arch x86_64 miniupnpc-1.6-x86_64/libminiupnpc.a -o lib/libminiupnpc.a -create
 
 Verify your binaries
 
@@ -153,24 +163,28 @@ file lib/libminiupnpc.a
 output should look like this:
 
 lib/libminiupnpc.a: Mach-O universal binary with 2 architectures
-lib/libminiupnpc.a (for architecture i386):    current ar archive random library
-lib/libminiupnpc.a (for architecture x86_64):  current ar archive random library
+lib/libminiupnpc.a (for architecture i386): current ar archive random library
+lib/libminiupnpc.a (for architecture x86_64): current ar archive random library
 
 
 Berkeley DB
 -----------
 
+(System or MacPorts version work fine.)
+
 Download from http://freshmeat.net/projects/berkeleydb/
 
 cd ~/bitcoin/deps
-tar xvf ~/Downloads/db-4.8.26.tar
-cd db-4.8.26/build_unix
+tar xvf ~/Downloads/db-4.8.30.tar
+cd db-4.8.30/build_unix
 ../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install
 
 
 wxWidgets
 ---------
 
+(The wxWidgets-devel MacPorts package will work but will throw annoying assertion dialogs.)
+
 This is the big one..
 
 Check it out from svn
@@ -236,26 +250,29 @@ make install
 
 Now you should be able to build bitcoin
 
-cd ~/bitcoin/trunk
+cd ~/bitcoin/src
 make -f makefile.osx bitcoin
 
 Before you can run it, you need to create an application bundle for Mac OS.
-Create the directories in terminal using mkdir and copy the files into place.
-They are available at http://heliacal.net/~solar/bitcoin/mac-build/
-You need the Info.plist and the .ins file.  The Contents/MacOS/bitcoin file is
-the output of the build.
-Your directory structure should look like this:
-
-Bitcoin.app
-Bitcoin.app/Contents
-Bitcoin.app/Contents/Info.plist
-Bitcoin.app/Contents/MacOS
-Bitcoin.app/Contents/MacOS/bitcoin
-Bitcoin.app/Contents/Resources
-Bitcoin.app/Contents/Resources/BitcoinAppIcon.icns
-
-To run it you can just click the Bitcoin.app in Finder, or just do open
-~/bitcoin/Bitcoin.app
+
+A bundle is provided in contrib/Bitcoin.app.
+
+Copy the bitcoin binary in to it like this:
+  cp -pR ~/bitcoin/bitcoin/contrib/Bitcoin.app ~/bitcoin/
+  cp ~/bitcoin/src/bitcoin ~/bitcoin/Bitcoin.app/Contents/MacOS/
+
+To run it you can just click the Bitcoin.app in Finder, or just do:
+open ~/bitcoin/Bitcoin.app
+
 If you want to run it with arguments you can just run it without backgrounding
 by specifying the full name in terminal:
+
 ~/bitcoin/Bitcoin.app/Contents/MacOS/bitcoin -addnode=192.75.207.66
+
+You can also run it with arguments in the background with output going to the
+normal places for apps (Console) like this:
+
+open ~/bitcoin/Bitcoin.app --args -connect=192.75.207.66
+
+It is advisable to relocate Bitcoin.app to /Applications or $HOME/Applications.
+