Bitcoin Forum
December 04, 2016, 06:41:24 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoin Formula for Mac OS X  (Read 3687 times)
melek
Newbie
*
Offline Offline

Activity: 11


View Profile
February 28, 2011, 10:13:13 AM
 #1

I just created a homebrew formula for installation on Mac OS X

https://github.com/melek-bitcoin/homebrew/commit/eca924cddd868613937d692bab2c184187610020

Homebrew is a system similar to the gentoo port system, where all dependencies are resolved automatically and the installation is done by compilation from source, rather than downloading of binaries. You can read more about it here:

http://mxcl.github.com/homebrew/

Once you have Homebrew installed on your Mac, you can easily get bitcoind by typing

Code:
brew install bitcoind

and the dependencies on boost, boost, berkeley-db should be resolved automatically. OpenSSL is installed by default, and the bitcoind formula links against the default version.

All the linking is done dynamically rather than statically (unlike in the original source code).

I tested on 10.6 Snow Leopard:

Code:
$ brew install bitcoind
==> Downloading http://download.oracle.com/berkeley-db/db-5.1.19.tar.gz
==> ../dist/configure --disable-debug --prefix=/usr/local/Cellar/berkeley-db/5.1.19 --mandir=/usr/local/Cel
==> make install
/usr/local/Cellar/berkeley-db/5.1.19: 2634 files, 68M, built in 2.8 minutes
==> Downloading http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.3.20/bitcoin-0.3.20.01-macosx.zip
==> Downloading patches
==> Patching
patching file bitcoin-0.3.20.01/src/makefile.osx
==> make -f makefile.osx bitcoind -j3
/usr/local/Cellar/bitcoind/0.3.20.01: 1.8M, built in 73 seconds
1480876884
Hero Member
*
Offline Offline

Posts: 1480876884

View Profile Personal Message (Offline)

Ignore
1480876884
Reply with quote  #2

1480876884
Report to moderator
1480876884
Hero Member
*
Offline Offline

Posts: 1480876884

View Profile Personal Message (Offline)

Ignore
1480876884
Reply with quote  #2

1480876884
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
melek
Newbie
*
Offline Offline

Activity: 11


View Profile
February 28, 2011, 10:14:21 AM
 #2

I requested a merge to the default Homebrew branch, so the formula should be available shortly.
melek
Newbie
*
Offline Offline

Activity: 11


View Profile
February 28, 2011, 10:55:58 AM
 #3

Thus compile bitcoind and running it, leads to some kind of corruption in the data, and opening the official client gives an error. I am wondering what is causing that?

The only difference is that I am now dynamically linking, instead of statically linking the libraries. Am I using an outdated version of any of the libraries? Here is what I link against:

Code:
$ otool -L /usr/local/bin/bitcoind
/usr/local/bin/bitcoind:
/usr/local/Cellar/berkeley-db/5.1.19/lib/libdb_cxx-5.1.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
February 28, 2011, 12:48:51 PM
 #4

The official client uses an older version of Berkeley DB (4.8, according to build-osx.txt).

You're linking to Berkeley DB 5.1.19, so when you run your client it upgrades the bitcoin database files, which makes them incompatible with the official client.

How often do you get the chance to work on a potentially world-changing project?
melek
Newbie
*
Offline Offline

Activity: 11


View Profile
February 28, 2011, 04:19:49 PM
 #5

The official client uses an older version of Berkeley DB (4.8, according to build-osx.txt).

You're linking to Berkeley DB 5.1.19, so when you run your client it upgrades the bitcoin database files, which makes them incompatible with the official client.


Thanks for clarifying.

Are you planning to move the official client to the latest v5 at some point? Is v5 fully backward compatible with v4, i.e. can it read v4 wallets without modifications?
melek
Newbie
*
Offline Offline

Activity: 11


View Profile
February 28, 2011, 05:52:09 PM
 #6

I am not really sure how to make Homebrew install a specific version of berkeley-db. I will pay 10 BTC to whomever can fix the above formula so that it installs the correct version of the library. You may have to use the "keg_only" option to prevent conflicts with the main berkeley-db formula.
yomi
Jr. Member
*
Offline Offline

Activity: 40


View Profile
February 28, 2011, 06:47:02 PM
 #7

I am not really sure how to make Homebrew install a specific version of berkeley-db. I will pay 10 BTC to whomever can fix the above formula so that it installs the correct version of the library. You may have to use the "keg_only" option to prevent conflicts with the main berkeley-db formula.

Melek,

According to the wiki, there is no way to depend on a specific version of a formula.

I will try to see if it is possible to have a formula as berkeley-db4.

Thanks.

17qXiw646kuukEwjArHNKCNPUh3HnXfgbw
melek
Newbie
*
Offline Offline

Activity: 11


View Profile
February 28, 2011, 07:00:52 PM
 #8

Here is the suggested workaround:

https://github.com/mxcl/homebrew/issues/4472

and here is the updated formula:

https://github.com/mxcl/homebrew/issuesearch?state=open&q=bitcoin#issue/4461
yomi
Jr. Member
*
Offline Offline

Activity: 40


View Profile
February 28, 2011, 07:28:35 PM
 #9


Great!

Please let us know when they approve the pull request.

Thanks.

17qXiw646kuukEwjArHNKCNPUh3HnXfgbw
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!