X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=doc%2Fbuild-osx.txt;h=337fff95a8c1ebdd57e2ac78251aba7604b01f28;hb=7483713823cea61963ae0051f3e17ffd4b9be706;hp=52d876d82b3c0d35acbcd72e72588dcff5fbc615;hpb=b4ada906c03111404c29b115ab37afbad92f4cf1;p=novacoin.git diff --git a/doc/build-osx.txt b/doc/build-osx.txt index 52d876d..337fff9 100644 --- a/doc/build-osx.txt +++ b/doc/build-osx.txt @@ -1,278 +1,56 @@ -Copyright (c) 2010 Laszlo Hanyecz -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. +Copyright (c) 2017-2019 42 Developers +Copyright (c) 2019 NovaCoin Developers +Mac OS X Build Instructions and Notes +===================================== -Mac OS X build instructions -Laszlo Hanyecz -Douglas Huff +MacOS 10.11.6 - El Capitan was used in this manual. All of the commands should be executed in a Terminal application. The built-in one is located in /Applications/Utilities. +1. Install Xcode (7.3.1 for El Capitan), run it and accept the license agreement: -Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian. +https://developer.apple.com/xcode/ -All of the commands should be executed in Terminal.app.. it's in -/Applications/Utilities +Install Xcode command line tools: -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 +xcode-select --install +2. Install MacPorts with main dependencies: -1. Pick a directory to work inside.. something like ~/bitcoin works. The -structure I use looks like this: +https://distfiles.macports.org/MacPorts/MacPorts-2.3.5-10.11-ElCapitan.pkg -(~ is your home directory) +sudo port install autoconf automake libtool pkgconfig db60 openssl qrencode qt5 -~/bitcoin -~/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 +sudo ln -s /opt/local/libexec/qt5/bin/qmake /opt/local/bin/qmake -Just execute: mkdir ~/bitcoin -This will create the top dir for you.. +3. Install Homebrew(http://brew.sh) with dependencies: -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. +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -2. Check out the bitcoin code from github: +brew install python2 boost@1.60 -cd ~/bitcoin -git clone https://github.com/bitcoin/bitcoin.git -ln -s bitcoin/src src +brew link --force boost@1.60 -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. +4. Add to PATH: -3. Get and build the dependencies +nano ~/.profile +export PATH=$PATH:~/opt/local/lib/db6.0 +export PATH=$PATH:~/opt/local/lib/db60/include +export PATH=$PATH:~/usr/local/Cellar/boost@1.60/1.60.0/include/boost/thread.hpp -Boost ------ +Ctrl+O, Enter, Ctrl+X -Download from http://www.boost.org/users/download/ -I'm assuming it ended up in ~/Downloads.. +5. Clone the github tree: -mkdir ~/bitcoin/deps -cd ~/bitcoin/deps -tar xvjf ~/Downloads/boost_1_42_0.tar.bz2 -cd boost_1_42_0 -./bootstrap.sh -./bjam architecture=combined address-model=32_64 macosx-version=10.5 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install +git clone https://github.com/novacoin-project/novacoin.git -If you're using Snow Leopard, you will need to specify 10.6 as your Mac OS X -version instead of 10.5. +6. Build novacoin-Qt application: -This part takes a while.. use your judgement and fix it if something doesn't -build for some reason. - -Change the prefix to whatever your directory is (my username in this example -is macosuser). I'm also running on 10.6 so i have macosx-version=10.6 change -to 10.5 if you're using leopard. - -This is what my output looked like at the end: -...failed updating 2 targets... -...skipped 144 targets... -...updated 8074 targets... - - -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 -2 times and join it together here.. If you downloaded with safari it already -uncompressed it so it will just be a tar not a tar.gz - -cd ~/bitcoin/deps -tar xvf ~/Downloads/openssl-1.0.0.tar -mv openssl-1.0.0 openssl-1.0.0-i386 -tar xvf ~/Downloads/openssl-1.0.0.tar -mv openssl-1.0.0 openssl-1.0.0-x86_64 -# build i386 (32 bit intel) binary -cd openssl-1.0.0-i386 -./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin-i386-cc && make -make install # only do this on one of the architectures, to install the headers -cd .. -# build x86_64 (64 bit intel) binary -cd openssl-1.0.0-x86_64 -./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/bitcoin/deps/openssl darwin64-x86_64-cc && make -cd .. - -# combine the libs -cd ~/bitcoin/deps -lipo -arch i386 openssl-1.0.0-i386/libcrypto.a -arch x86_64 openssl-1.0.0-x86_64/libcrypto.a -o lib/libcrypto.a -create -lipo -arch i386 openssl-1.0.0-i386/libssl.a -arch x86_64 openssl-1.0.0-x86_64/libssl.a -o lib/libssl.a -create - -Verify your binaries - -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 - - -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.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.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.6-i386 -export CFLAGS="-arch i386" -export LDFLAGS="-arch i386" -export PREFIX="/Users/macuser/bitcoin/deps" +cd novacoin +qmake make -# combine the libs -cd ~/bitcoin/deps -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 - -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 - - -Berkeley DB ------------ - -(System or MacPorts version work fine.) - -Download from http://freshmeat.net/projects/berkeleydb/ - -cd ~/bitcoin/deps -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 - -cd ~/bitcoin/deps -svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets-trunk - -This will make a wxWidgets-trunk directory in deps. - -Use this script snippet, change your prefix to whatever your dir is: - -PREFIX=~/bitcoin/deps -SRCDIR="$PREFIX/wxWidgets-trunk" -BUILDDIR="$SRCDIR/macbuild" - -cd "$PREFIX" && -#svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets-trunk && -cd "$SRCDIR" && - -[ -f include/wx/hashmap.h.orig ] || cp include/wx/hashmap.h include/wx/hashmap.h.orig && -sed 's/if wxUSE_STL/if 0 \&\& wxUSE_STL/g' < include/wx/hashmap.h.orig > include/wx/hashmap.h && - -[ -f include/wx/hashset.h.orig ] || cp include/wx/hashset.h include/wx/hashset.h.orig && -sed 's/if wxUSE_STL/if 0 \&\& wxUSE_STL/g' < include/wx/hashset.h.orig > include/wx/hashset.h && - - - -rm -vrf "$BUILDDIR" && -mkdir "$BUILDDIR" && -cd "$BUILDDIR" && - -../configure --prefix="$PREFIX" \ ---with-osx_cocoa \ ---disable-shared \ ---disable-debug_flag \ ---with-macosx-version-min=10.5 \ ---enable-stl \ ---enable-utf8 \ ---enable-universal_binary \ ---with-libjpeg=builtin \ ---with-libpng=builtin \ ---with-regex=builtin \ ---with-libtiff=builtin \ ---with-zlib=builtin \ ---with-expat=builtin \ ---with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk && - - -find . -name Makefile | -while read i; do - echo $i; - sed 's/-arch i386/-arch i386 -arch x86_64/g' < "$i" > "$i".new && - mv "$i" "$i".old && - mv "$i".new "$i"; -done - - - -make && -make install - - - -Now you should be able to build bitcoin - -cd ~/bitcoin/src -make -f makefile.osx bitcoin - -Before you can run it, you need to create an application bundle for Mac OS. - -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. +7. Create the .dmg disk image: +sudo easy_install appscript +./contrib/macdeploy/macdeployqtplus novacoin-Qt.app -dmg -fancy ./contrib/macdeploy/fancy.plist \ No newline at end of file