Bitcoin Forum
April 25, 2024, 09:18:58 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 6 7 8 9 10 »  All
  Print  
Author Topic: Building Armory on OSX  (Read 32280 times)
Haplo
Full Member
***
Offline Offline

Activity: 168
Merit: 100



View Profile
May 17, 2012, 01:58:12 AM
 #41

Well, I tried exporting CFLAGS and ARCHFLAGS, but the result was the same o.0. Oh well.

I'm So Meta, Even This Acronym
1714036738
Hero Member
*
Offline Offline

Posts: 1714036738

View Profile Personal Message (Offline)

Ignore
1714036738
Reply with quote  #2

1714036738
Report to moderator
1714036738
Hero Member
*
Offline Offline

Posts: 1714036738

View Profile Personal Message (Offline)

Ignore
1714036738
Reply with quote  #2

1714036738
Report to moderator
1714036738
Hero Member
*
Offline Offline

Posts: 1714036738

View Profile Personal Message (Offline)

Ignore
1714036738
Reply with quote  #2

1714036738
Report to moderator
The Bitcoin software, network, and concept is called "Bitcoin" with a capitalized "B". Bitcoin currency units are called "bitcoins" with a lowercase "b" -- this is often abbreviated BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714036738
Hero Member
*
Offline Offline

Posts: 1714036738

View Profile Personal Message (Offline)

Ignore
1714036738
Reply with quote  #2

1714036738
Report to moderator
1714036738
Hero Member
*
Offline Offline

Posts: 1714036738

View Profile Personal Message (Offline)

Ignore
1714036738
Reply with quote  #2

1714036738
Report to moderator
1714036738
Hero Member
*
Offline Offline

Posts: 1714036738

View Profile Personal Message (Offline)

Ignore
1714036738
Reply with quote  #2

1714036738
Report to moderator
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
June 20, 2012, 12:17:06 AM
Last edit: June 20, 2012, 05:24:50 AM by Red Emerald
 #42

I was able to compile in Lion.  It's a weird mix of system and brew though and I'm not sure I like it.  I don't understand what exactly is going on, but it compiles.

I'll have updated instructions up sometime soon.

EDIT: It seems like this would be a breeze if you didn't use bsddb.  It's been depreciated in python 2.6 and completely removed in 3.0.  I'm not sure if pybsddb even supports the newest version of berkeley-db4 (and berkeley-db5 has been out a while).

Looks like I had an older version in my pip cache.  I downloaded http://pypi.python.org/packages/source/b/bsddb3/bsddb3-5.3.0.tar.gz#md5=d5aa4f293c4ea755e84383537f74be82 and installed that easily.

Code:
Install homebrew packages:
$ brew install python cryptopp swig sip qt pyqt berkeley-db

$ export PATH=`brew --prefix`/share/python:$PATH
$ export CFLAGS="-arch x86_64"
$ export ARCHFLAGS="-arch x86_64"
$ export BERKELEYDB_INCDIR=`brew --prefix berkeley-db`/include
$ export BERKELEYDB_LIBDIR=`brew --prefix berkeley-db`/lib
$ export PYTHONPATH=`brew –prefix`/lib/python2.7/site-packages:$PYTHONPATH

$ pip install twisted bsddb3

$ mkdir ~/src
$ cd ~/src
$ git clone git://github.com/etotheipi/BitcoinArmory.git

$ cd BitcoinArmory/cppForSwig

This is where it gets weird.  I want this to work:

Code:
$ ln -s `brew --prefix`/lib/python2.7/config/libpython2.7.a .

But that fails with:

Code:
g++ -shared -lpthread  UniversalTimer.o BinaryData.o FileDataPtr.o BtcUtils.o BlockObj.o BlockUtils.o EncryptionUtils.o libcryptopp.a libpython2.7.a CppBlockUtils_wrap.o -o ../_CppBlockUtils.so
Undefined symbols for architecture x86_64:
  "_environ", referenced from:
      _initposix in libpython2.7.a(posixmodule.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [swig] Error 1

So instead I'm building against the system python v2.7.1 (even though all the modules and such are brew's v2.7.3)

Code:
$ ln -s /usr/lib/python2.7/config/libpython2.7.a .

I also had to edit the makefile

Code:
vim Makefile
================================================================================
diff --git a/cppForSwig/Makefile b/cppForSwig/Makefile
index de3bb1d..716a039 100755
--- a/cppForSwig/Makefile
+++ b/cppForSwig/Makefile
@@ -8,10 +8,10 @@ OBJS = UniversalTimer.o BinaryData.o FileDataPtr.o BtcUtils.o BlockObj.o BlockUt
 
 INCLUDE_OPTS += -Icryptopp -DUSE_CRYPTOPP -D__STDC_LIMIT_MACROS
 LIBRARY_OPTS += -lpthread
-SWIG_INC     += -I/usr/include/python2.7
+SWIG_INC     += -I/usr/local/include/python2.7
 SWIG_OPTS    += -c++ -python -classic
 
-ifneq (exists, $(shell [ -d /usr/include/python2.7 ]  && echo exists ))
+ifneq (exists, $(shell [ -d /usr/local/include/python2.7 ]  && echo exists ))
    SWIG_INC     = -I/usr/include/python2.6
    LIBRARY_OPTS = -lpthread
    ifneq (exists, $(shell [ -d /usr/include/python2.6 ]  && echo exists ))
@@ -26,7 +26,7 @@ all :
        make BlockUtilsTest.out
        
 swig : $(OBJS) CppBlockUtils_wrap.o
-       g++ -shared $(LIBRARY_OPTS) $(OBJS) libpython2.6.a CppBlockUtils_wrap.o -o ../_CppBlockUtils.so
+       g++ -shared $(LIBRARY_OPTS) $(OBJS) libpython2.7.a CppBlockUtils_wrap.o -o ../_CppBlockUtils.so
        pyrcc4 -o ../qrc_img_resources.py ../imgList.xml
 
 BlockUtilsTest.out : $(OBJS) BlockUtilsTest.cpp
================================================================================

And then its just a little bit of waiting
Code:
make clean
make swig

cd ..
/usr/bin/python ArmoryQt.py

Note that is "/usr/bin/python" not brew's python.  I don't get it, but it works because of PYTHONPATH (I think)

Quote
Loading blockchain took 83.3 seconds

EDIT: I just clicked "Filter:" and everything locked up Sad

Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
July 06, 2012, 06:15:09 AM
 #43

I'm compiling .82 in Lion now.

The Makefile changes made my tweaks even easier.  I just changed 2 lines and no more need for symlinks.

I use brew to install all of the dependencies (including python) and then this.  I can't get it to compile against brew's libpython2.7.a, but if you export PYTHONPATH, it can use brew's pyqt and such.

Code:
$ git diff HEAD
diff --git a/cppForSwig/Makefile b/cppForSwig/Makefile
index d5b4340..ad646bf 100755
--- a/cppForSwig/Makefile
+++ b/cppForSwig/Makefile
@@ -7,14 +7,14 @@ LINKER = g++
 OBJS = UniversalTimer.o BinaryData.o FileDataPtr.o BtcUtils.o BlockObj.o BlockUtils.o EncryptionUtils.o libcryptopp.a
 
 
-DEPSDIR ?= /usr
+DEPSDIR ?= /usr/local
 
 INCLUDE_OPTS += -Icryptopp -DUSE_CRYPTOPP -D__STDC_LIMIT_MACROS
 LIBRARY_OPTS += -lpthread
 SWIG_OPTS    += -c++ -python -classic
 PYVER           += `python -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])'`
 SWIG_INC     += -I"$(DEPSDIR)/include/python$(PYVER)"
-STATICPYTHON +=   "$(DEPSDIR)/lib/libpython$(PYVER).a"
+STATICPYTHON +=   "/usr/lib/python2.7/config/libpython2.7.a"
 
 
 #**************************************************************************

etotheipi (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
July 09, 2012, 11:49:49 PM
 #44

Sorry to be a n00b, but I will use this thread for my own education.  I have never touched Mac/OSX machine in my life.   Just now, I finally got a VM setup that looks like it will work.  But I have no idea where to go...

I got git installed, from what looks like a .dmg file, which opened up in to a .pkg file which actually installed it.  Is this how OSX programs are typically packaged?  If I were to eventually create an installer/uninstaller, what would be the best target format for it?

How am I typically going to install programs and packages in OSX?  Go to website, download some file, double click?  Is there any command-line utility like apt-get for retrieving dependencies?

What is the difference between xcode and brew?  To me, it sounds like to two different flavors of build systems.  I was surprised to find see a lack of google hits for "xcode vs brew", so I suspect they are not simply flavors of the same thing.

Btw, I am running Lion, and plan to compile 64-bit binaries.  I was told that 32-bit OSX is not common at all, is that true?  Can I avoid dealing with 32-bit?  It sounds like what code I compile may not work on 10.4 (Tiger) because of Qt libraries...

Do you think it's possible that Armory could be distributed as a python script like it is in Linux?  It is "installed" by simply copying all the necessary code and binaries into /usr/share/armory, and then the shortcut is just "python /usr/share/armory/ArmoryQt.py".  I say this because I expect issues with creating a real executable out of it (like with the Mac-equiv of py2exe).

I haven't even tried the existing compilation instructions yet.  I'm currently exploring the filesystem structure and how programs work.   I just want to get some base information down about how I'm going to operating in OSX and compiling stuff.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
July 10, 2012, 05:49:26 PM
 #45

Sorry to be a n00b, but I will use this thread for my own education.  I have never touched Mac/OSX machine in my life.   Just now, I finally got a VM setup that looks like it will work.  But I have no idea where to go...

I got git installed, from what looks like a .dmg file, which opened up in to a .pkg file which actually installed it.  Is this how OSX programs are typically packaged?  If I were to eventually create an installer/uninstaller, what would be the best target format for it?
Usually all files are distributed in a .dmg.  Programs that install binaries and such around the system usually come as pkgs.  Standalone applications usually come as .app

http://www.tuaw.com/2007/05/02/mac-101-dmg-files-are-disk-images/
http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html

Quote
How am I typically going to install programs and packages in OSX?  Go to website, download some file, double click?
Most mac applications (that aren't in the App Store) use this workflow: go to website, download some file, double click, drag application into application folder.

Quote
Is there any command-line utility like apt-get for retrieving dependencies?

What is the difference between xcode and brew?  To me, it sounds like to two different flavors of build systems.  I was surprised to find see a lack of google hits for "xcode vs brew", so I suspect they are not simply flavors of the same thing.
brew is kind of like apt or yum.  Xcode is an editor and some command line tools.  Brew uses Xcode's command line tools for compiling.  It isn't a one vs the other kind of thing.

Quote
Btw, I am running Lion, and plan to compile 64-bit binaries.  I was told that 32-bit OSX is not common at all, is that true?  Can I avoid dealing with 32-bit?  It sounds like what code I compile may not work on 10.4 (Tiger) because of Qt libraries...
I don't have too much experience compiling distributable binaries.  10.6 and later include a 64-bit kernel.  10.7 comes with Python 2.7.  I'd be fine with just 64 bit, but I recall someone else having PPC.  Although that is probably too old to deal with binaries for.  Older systems can compile themselves (once those instructions get figured out).  I'd recommend starting with just one binary.  Then you can worry about building for multiple systems.

Quote
Do you think it's possible that Armory could be distributed as a python script like it is in Linux?  It is "installed" by simply copying all the necessary code and binaries into /usr/share/armory, and then the shortcut is just "python /usr/share/armory/ArmoryQt.py".  I say this because I expect issues with creating a real executable out of it (like with the Mac-equiv of py2exe).

I haven't even tried the existing compilation instructions yet.  I'm currently exploring the filesystem structure and how programs work.   I just want to get some base information down about how I'm going to operating in OSX and compiling stuff.
I'm sure you could get a script to work, but you should look into py2app. Pretty much all it does is compile everything into one folder and then make a shortcut.  I got it half working a couple versions ago.  I'll try again now that you compile against python differently.  You should also look at platypus.

It's not very common for apps to stick files in /usr on a Mac.  Applications usually go into /Applications.

http://sveinbjorn.org/platypus

Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
July 14, 2012, 05:19:07 AM
 #46

New and improved instructions for 64-bit Lion!

Code:
Install homebrew packages:
$ brew install python cryptopp swig sip qt pyqt berkeley-db

$ export PATH=`brew --prefix`/share/python:$PATH
$ export CFLAGS="-arch x86_64"
$ export ARCHFLAGS="-arch x86_64"
$ export BERKELEYDB_INCDIR=`brew --prefix berkeley-db`/include
$ export BERKELEYDB_LIBDIR=`brew --prefix berkeley-db`/lib

$ pip install twisted bsddb3

$ mkdir ~/src
$ cd ~/src
$ git clone git://github.com/etotheipi/BitcoinArmory.git
$ cd BitcoinArmory

Now edit the DEPSDIR and STATICPYTHON in cppForSwig/Makefile

Code:
$ git diff HEAD cppForSwig/Makefile
diff --git a/cppForSwig/Makefile b/cppForSwig/Makefile
index d5b4340..c20b9a1 100755
--- a/cppForSwig/Makefile
+++ b/cppForSwig/Makefile
@@ -7,14 +7,14 @@ LINKER = g++
 OBJS = UniversalTimer.o BinaryData.o FileDataPtr.o BtcUtils.o BlockObj.o BlockUtils.o EncryptionUtils.o libcryptopp.a
 
 
-DEPSDIR ?= /usr
+DEPSDIR ?= /usr/local
 
 INCLUDE_OPTS += -Icryptopp -DUSE_CRYPTOPP -D__STDC_LIMIT_MACROS
 LIBRARY_OPTS += -lpthread
 SWIG_OPTS    += -c++ -python -classic
 PYVER           += `python -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])'`
 SWIG_INC     += -I"$(DEPSDIR)/include/python$(PYVER)"
-STATICPYTHON +=   "$(DEPSDIR)/lib/libpython$(PYVER).a"
+STATICPYTHON +=   "$(DEPSDIR)/lib/libpython$(PYVER).dylib"
 
 
 #**************************************************************************

Almost there!
Code:
$ make clean
$ make

$ python ArmoryQt.py
********************************************************************************
Loading Armory Engine:
   Armory Version:       0.82
   PyBtcAddress Version: 1.00
   PyBtcWallet  Version: 1.35
Detected Operating system: Mac/OSX
   User home-directory   : /Users/bwstitt/Library/Application Support
   Satoshi BTC directory : /Users/bwstitt/Library/Application Support/Bitcoin/
   Armory home dir       : /Users/bwstitt/Library/Application Support/Armory/
Using settings file: /Users/bwstitt/Library/Application Support/Armory/ArmorySettings.txt
Loading wallets...
Number of wallets read in: 4
   Wallet (---------):    "Primary Cold Wallet (Watch)     "    (No Encryption)
   Wallet (---------):    "Foobar                          "    (No Encryption)
   Wallet (---------):    "Satoshi Wallet                  "    (Encrypted)
   Wallet (---------):    "Primary Hot Wallet              "    (Encrypted)
Internet connection is Available:  True
Bitcoin-Qt/bitcoind is Available:  True
Loading blockchain
Opening file 1: /Users/bwstitt/Library/Application Support/Bitcoin//blk0001.dat
Opening file 2: /Users/bwstitt/Library/Application Support/Bitcoin//blk0002.dat
Highest blkXXXX.dat file: 2
Attempting to read blockchain from file: /Users/bwstitt/Library/Application Support/Bitcoin//blk0001.dat
/Users/bwstitt/Library/Application Support/Bitcoin//blk0001.dat is 2000.04 MB
Attempting to read blockchain from file: /Users/bwstitt/Library/Application Support/Bitcoin//blk0002.dat
/Users/bwstitt/Library/Application Support/Bitcoin//blk0002.dat is 4.13251 MB
Syncing wallets with blockchain...
Syncing wallet:  ---------
Syncing wallet:  ---------
Syncing wallet:  ---------
Syncing wallet:  ---------
Loading blockchain took 123.4 seconds

Since I am using brew's libpython2.7.dylib, we don't need to set PYTHONPATH

Clicking "Filter:" still locks everything up Sad

If you copy these instructions to your site, be careful that the backticks and quotes transfer properly.

torusJKL
Hero Member
*****
Offline Offline

Activity: 619
Merit: 500


View Profile
August 04, 2012, 06:25:36 PM
Last edit: August 04, 2012, 07:16:49 PM by torusJKL
 #47

New and improved instructions for 64-bit Lion!

Thanks Red Emerald.
The changes in the Makefile work also on Snow Leopard with Armory 0.81-alpha.

For those who get this error
Code:
$ python ArmoryQt.py 
Traceback (most recent call last):
  File "ArmoryQt.py", line 37, in <module>
    from PyQt4.QtCore import *
ImportError: dlopen(/usr/local/lib/python/PyQt4/QtCore.so, 2): Symbol not found: __cg_TIFFClientOpen
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libTIFF.dylib
 in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

Don't use the homebrew version but the one from the system
Code:
sudo rm /usr/local/lib/libtiff.dylib
sudo cp /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Resources/libTIFF.dylib /usr/local/lib/

If you find my post useful send some Bitcoin: 167XM1Za8aG9CdbYuHFMpL2kvPsw6uC8da
Bitrated || bitcoin-otc || Moon Bitcoin Faucet
gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
August 04, 2012, 06:27:07 PM
 #48

anyone know if the lion instructions work on mountain lion?
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
August 09, 2012, 09:01:11 PM
 #49

anyone know if the lion instructions work on mountain lion?
They worked for me on both.

gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
August 09, 2012, 10:52:07 PM
Last edit: August 09, 2012, 11:31:37 PM by gweedo
 #50

anyone know if the lion instructions work on mountain lion?
They worked for me on both.

how did you get sip to work? I can't get it to work on mountain lion
Code:
Error: Failed executing: make install (sip.rb:41)

EDIT: Nevermind I had to update my GCC
gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
August 10, 2012, 12:34:54 AM
 #51

Code:
make[1]: *** [CppBlockUtils_wrap.o] Error 1
make: *** [all] Error 2

I am getting tis error on mountain lion any help?
etotheipi (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 12, 2012, 05:05:04 AM
 #52

EDIT: It seems like this would be a breeze if you didn't use bsddb.  It's been depreciated in python 2.6 and completely removed in 3.0.  I'm not sure if pybsddb even supports the newest version of berkeley-db4 (and berkeley-db5 has been out a while).

Looks like I had an older version in my pip cache.  I downloaded http://pypi.python.org/packages/source/b/bsddb3/bsddb3-5.3.0.tar.gz#md5=d5aa4f293c4ea755e84383537f74be82 and installed that easily.

Is this still an issue?  Now that I have removed the functionality for reading Satoshi wallets (because it only worked with older wallets that no one uses anymore), I can remove the bsddb depedency completely.  Would that be worth it?  I never had any interest in using bsddb myself, but obviously I have no choice if I want to read Bitcoin-Qt wallets.  However, leaving it in there would be slightly preferable in case I want to support those old wallets in the future (the new deterministic wallet formats coming at some point, will not use BSDDB).

On the topic of OSX compiling...  I have still been swamped with... life.  So I haven't had much time for development, but dabbling in OSX is a good exercise while I'm not doing other things.  So I have started learning how to compile things... why are there not packages for anything?  Is that what homebrew is for?

I got swig compiled and running without brew.  It was a good exercise.  Unnecessary complex though (downloaded pcre separately, and used the Tools/pcre-build.sh script with swig).  But from looking at instructions, it looks like I can avoid a lot of pain by just going with brew...?


Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
August 16, 2012, 02:51:38 AM
 #53

EDIT: It seems like this would be a breeze if you didn't use bsddb.  It's been depreciated in python 2.6 and completely removed in 3.0.  I'm not sure if pybsddb even supports the newest version of berkeley-db4 (and berkeley-db5 has been out a while).

Looks like I had an older version in my pip cache.  I downloaded http://pypi.python.org/packages/source/b/bsddb3/bsddb3-5.3.0.tar.gz#md5=d5aa4f293c4ea755e84383537f74be82 and installed that easily.

Is this still an issue?  Now that I have removed the functionality for reading Satoshi wallets (because it only worked with older wallets that no one uses anymore), I can remove the bsddb depedency completely.  Would that be worth it?  I never had any interest in using bsddb myself, but obviously I have no choice if I want to read Bitcoin-Qt wallets.  However, leaving it in there would be slightly preferable in case I want to support those old wallets in the future (the new deterministic wallet formats coming at some point, will not use BSDDB).
Please get rid of bsddb.

Quote
On the topic of OSX compiling...  I have still been swamped with... life.  So I haven't had much time for development, but dabbling in OSX is a good exercise while I'm not doing other things.  So I have started learning how to compile things... why are there not packages for anything?  Is that what homebrew is for?
Yes.

Quote
I got swig compiled and running without brew.  It was a good exercise.  Unnecessary complex though (downloaded pcre separately, and used the Tools/pcre-build.sh script with swig).  But from looking at instructions, it looks like I can avoid a lot of pain by just going with brew...?
Oh god.  Don't torture yourself, dude.  Manual dependency tracking is not something worth wasting your time on.  Use homebrew.  It takes all of 10 seconds to install and makes everything way easier. 

etotheipi (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 16, 2012, 08:54:46 PM
 #54

Please get rid of bsddb.

Done!  Will commit it in the next release.  I haven't really tested it, but I just commented out all the code that relies on bsddb, and it shouldn't make a difference because the only module that calls any of that code is the Satoshi-wallet import code that is disabled anyway.

I have been doing one command line call per day, between random other things.  So far, brew has been good to me.  I will try to finish the instructions you posted and maybe I'll finally have Armory working on OSX!

Anyone have advice for how I can distribute it?  The OSX equivalent of py2exe does not look... reliable.  I'll try it, but I would prefer to avoid the complexities and run it as a native python script, if possible.  Perhaps bundle up all the site-packages into the install directory so that it can be standalone without having to install extra dependencies...? 

I'm guessing that packaging and distribution will be the biggest hurdle to getting Armory released on OSX.  Perhaps someone with more OSX experience can provide guidance...

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
jim618
Legendary
*
Offline Offline

Activity: 1708
Merit: 1066



View Profile WWW
August 17, 2012, 08:29:07 AM
 #55

Hello Alan,

For the Mac OSX packaging you might want to liaise with Tachikoma, as he is working on the same thing for Electrum.

I posted on the old Electrum thread how I do it for MultiBit - some of that might be useful to you (but of course it is Java rather than python). The post is here:

https://bitcointalk.org/index.php?topic=50936.msg1075679#msg1075679

Jim

MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
etotheipi (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 18, 2012, 05:13:42 AM
 #56

Well, I got Armory working on OSX!  I need to play around with it a little bit, but it looks like it mostly works (except for some of the text labels being cut off on the bottom... might consider some OSX-specific settings for the GUI).  I haven't actually moved any coins around with it yet, but creating wallets worked, and I was even able to change the filter (didn't freeze... though I didn't have any tx in it...)

Red Emerald:  thanks so much for the great instructions!  I did some digging around and found about 30 different copies of python and various subdirs that were all candidates for linking/include options and environment variables.  I even tried some of the others thinking I knew better than you (I wanted to try to get everything running from the same python directory tree), but nothing worked except exactly what you posted.  Thanks!


Hello Alan,

For the Mac OSX packaging you might want to liaise with Tachikoma, as he is working on the same thing for Electrum.

I posted on the old Electrum thread how I do it for MultiBit - some of that might be useful to you (but of course it is Java rather than python). The post is here:

https://bitcointalk.org/index.php?topic=50936.msg1075679#msg1075679


I'm a little bothered by the over-protectiveness of Apple (signing keys, app store reviews, etc), but I guess that's one reason many end users like them, but it really makes me not want to develop for them. 

I found a couple links for creating dmg files.  Perhaps I can copy in all the necessary site-packages directories and try to override the PYTHONPATH variable is part of running when OSX is detected.  Then it looks like I just create the .dmg and the user can expand it and drag it into the applications folder...?

http://stackoverflow.com/questions/116657/how-do-you-create-an-osx-application-dmg-from-a-python-package
http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools

It looks like those two links together might give me what I need to create an automatic-dmg-creator for Armory.  I just have to experiment a bit...

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Haplo
Full Member
***
Offline Offline

Activity: 168
Merit: 100



View Profile
August 18, 2012, 07:08:20 AM
 #57

Anyone have advice for how I can distribute it?  The OSX equivalent of py2exe does not look... reliable.  I'll try it, but I would prefer to avoid the complexities and run it as a native python script, if possible.  Perhaps bundle up all the site-packages into the install directory so that it can be standalone without having to install extra dependencies...? 

I'm guessing that packaging and distribution will be the biggest hurdle to getting Armory released on OSX.  Perhaps someone with more OSX experience can provide guidance...

Well, you have to install brew manually on OSX, but if it's already installed it might be possible to make up a .pkg for it with a script that will install everything else required and compile/copy all the necessary parts. Not really certain how well that would work, but failing that you could just use a zip or tarball as you would in a manual installation on linux. App file bundles on OSX might also theoretically be used to contain a python script, but I don't know that the functionality is quite flexible enough for that. If you want to dissect some .app files to see how they work, right click->show contents is what you'll want to look at.

One thing that sucks on OSX though, and I'm not sure if this applies to newer versions, but filepaths which contain spaces tend to seriously mess with makefile type scripts, which cause all kinds of corruption and errors. I don't think the same applies for pkgs, but usually those are installed from a dmg which allows you to control the path name.

I'm So Meta, Even This Acronym
etotheipi (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 18, 2012, 09:32:17 PM
 #58

Anyone have advice for how I can distribute it?  The OSX equivalent of py2exe does not look... reliable.  I'll try it, but I would prefer to avoid the complexities and run it as a native python script, if possible.  Perhaps bundle up all the site-packages into the install directory so that it can be standalone without having to install extra dependencies...? 

I'm guessing that packaging and distribution will be the biggest hurdle to getting Armory released on OSX.  Perhaps someone with more OSX experience can provide guidance...

Well, you have to install brew manually on OSX, but if it's already installed it might be possible to make up a .pkg for it with a script that will install everything else required and compile/copy all the necessary parts. Not really certain how well that would work, but failing that you could just use a zip or tarball as you would in a manual installation on linux. App file bundles on OSX might also theoretically be used to contain a python script, but I don't know that the functionality is quite flexible enough for that. If you want to dissect some .app files to see how they work, right click->show contents is what you'll want to look at.

One thing that sucks on OSX though, and I'm not sure if this applies to newer versions, but filepaths which contain spaces tend to seriously mess with makefile type scripts, which cause all kinds of corruption and errors. I don't think the same applies for pkgs, but usually those are installed from a dmg which allows you to control the path name.

I definitely can't bank on the user having the stuff installed already.  It seems like it would be... "irresponsible"... to have the install script actually install brew and all the brew packages.  Perhaps there's a way to make a completely self-contained directory tree (that has python and all dependencies pre-compiled and included).  I don't see why not, it just seems like a mess.

Maybe I should try py2app... but so far I've only heard gripes about things not working right, so I imagine I won't be figuring it out, either (I'd need some serious tinkering time available). 

So, perhaps someone here could donate some time to try this.  I bet it would be even easier with:  Portable Python.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
August 18, 2012, 11:06:03 PM
 #59

Anyone have advice for how I can distribute it?  The OSX equivalent of py2exe does not look... reliable.  I'll try it, but I would prefer to avoid the complexities and run it as a native python script, if possible.  Perhaps bundle up all the site-packages into the install directory so that it can be standalone without having to install extra dependencies...? 

I'm guessing that packaging and distribution will be the biggest hurdle to getting Armory released on OSX.  Perhaps someone with more OSX experience can provide guidance...

Well, you have to install brew manually on OSX, but if it's already installed it might be possible to make up a .pkg for it with a script that will install everything else required and compile/copy all the necessary parts. Not really certain how well that would work, but failing that you could just use a zip or tarball as you would in a manual installation on linux. App file bundles on OSX might also theoretically be used to contain a python script, but I don't know that the functionality is quite flexible enough for that. If you want to dissect some .app files to see how they work, right click->show contents is what you'll want to look at.

One thing that sucks on OSX though, and I'm not sure if this applies to newer versions, but filepaths which contain spaces tend to seriously mess with makefile type scripts, which cause all kinds of corruption and errors. I don't think the same applies for pkgs, but usually those are installed from a dmg which allows you to control the path name.

I definitely can't bank on the user having the stuff installed already.  It seems like it would be... "irresponsible"... to have the install script actually install brew and all the brew packages.  Perhaps there's a way to make a completely self-contained directory tree (that has python and all dependencies pre-compiled and included).  I don't see why not, it just seems like a mess.

Maybe I should try py2app... but so far I've only heard gripes about things not working right, so I imagine I won't be figuring it out, either (I'd need some serious tinkering time available). 

So, perhaps someone here could donate some time to try this.  I bet it would be even easier with:  Portable Python.
I think py2app is what you should be doing.  I'll play around with it if I can get some time.

etotheipi (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 19, 2012, 02:54:51 AM
 #60

Red Emerald,

I just committed a Makefile modification to the dev branch.  It's basically just the current master with a bug fix and the updated Makefile.  Can you do a fresh checkout and confirm it works on your system, too?  Just want to make sure I did it right.  It works on the OSX VM I have.

I think py2app is what you should be doing.  I'll play around with it if I can get some time.

I will try it, too.  I just don't have high expectations.  I also had to reinstall my Win64 VM and can't get py2exe working.  I've spent hours on it and even my existing config that works on another machine isn't helping me figure it out.  Not looking forward to doing it again on OSX...

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Pages: « 1 2 [3] 4 5 6 7 8 9 10 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!