Bitcoin Forum
November 09, 2024, 07:19:09 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 6 »  All
  Print  
Author Topic: The official Armory-for-OSX Bounty Thread [CLAIMED -- 25 BTC]  (Read 10439 times)
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 10, 2013, 11:03:10 PM
 #41

Anyways, revision 3: http://goo.gl/73v3b
Now it works on my mac. (the previous one had the same problem as listed above by picobit)

And for the swig dependency: I am trying to install it within virtualenv, but it again mixes up the global directories and the virtualenv ones. Then I tried to put it in one of the locations the makefiles tries, but even then there is some problem... So the build process is definitely not as straight-forward as your hand-written script suggests Smiley   (at least not when insisting on virtualenv)

All you should have to do is install swig with brew, though you also need cryptopp and qt as shown by WyseNynja's guide. I don't see how global python is getting confused with the virtualenv, you have to do bin/python, bin/pip etc in the directory to use the virtualenv. Logs would be awesome.

As for the script, I decided to have it just install swig, cryptopp, qt and virtualenv for you. Now all that's required is brew and pip, which you should have anyways.
saddambitcoin
Legendary
*
Offline Offline

Activity: 1610
Merit: 1004



View Profile
March 10, 2013, 11:03:43 PM
 #42

seems to be working fine for me, running on 10.8.2.  excited to finally use this!

vamdor
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
March 10, 2013, 11:12:27 PM
 #43

All you should have to do is install swig with brew. Are you using bin/python, bin/pip etc? Logs would be awesome.
I have a virtualenv started with -no-site-packages , so that I can be absolutely sure nothing interferes with already installed stuff, and is 100% reproducible in any system. I tried the configure & make route for installing, but unfortunately swig isn't just a python package, so won't respect the virtualenv. So I either give up on being system-independent and use the brew method, or find out where to put what. I copied the content of the built "Lib" dir to "./swig_lib" , which seems to be one of the search paths, but apparently it doesn't work.

Code:
:BitcoinArmory bj$ make
cd cppForSwig; make swig
swig -c++ -python -classic -threads -outdir ../ -v CppBlockUtils.i
Language subdirectory: python
Search paths:
   ./
   ./swig_lib/python/
   /usr/local/share/swig/2.0.9/python/
   ./swig_lib/
   /usr/local/share/swig/2.0.9/
Preprocessing...
:1: Error: Unable to find 'swig.swg'
:3: Error: Unable to find 'python.swg'
CppBlockUtils.i:22: Error: Unable to find 'std_string.i'
CppBlockUtils.i:23: Error: Unable to find 'std_vector.i'
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 10, 2013, 11:16:43 PM
 #44

Swig isn't a python package just like you said, so it doesn't matter if you're in an env or using global python. You should be able to use it anywhere.

Using brew isn't going to make it system-dependent. You're installing those so that you can either build armory or put qt into the package. In the end the only things going into the actual package are qt, some python packages installed in the env, python, and armory

Looks like the problem isn't where swig is installed, but that it can't find some files. I'm not sure what you're trying to do with the Lib folder from the env either...
vamdor
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
March 10, 2013, 11:25:39 PM
 #45

You're installing those so that you can either build armory or put qt into the package.

I see, but if someones 5 year from now tries to reproduce the steps, and by the time something not backward-compatibly changed in swig, that may lead to some frustration.

Anyway after installing it with brew, Armory compiles and builds.
vamdor
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
March 10, 2013, 11:46:30 PM
 #46

Okay, last few remarks then I am done for today, I need to sleep.



1. The sip installer in your script has the same idiotic problem I struggled with: it wants to put itself outside the virtualenv.  /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7.  It asks for root password when it gets to that point, that's when I killed it...

2. As I only used this system for iOS development, and I only use python on linux boxes, I didn't really have any "extra" packages. Only wget was missing (in addition to swig), so it's good, no exotic dependencies.

3. the "cd sip-4.14.4.tar.gz" line must be replaced to "cd sip-4.14.4"
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 10, 2013, 11:49:26 PM
 #47

Okay, last few remarks then I am done for today, I need to sleep.



1. The sip installer in your script has the same idiotic problem I struggled with: it wants to put itself outside the virtualenv.  /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7.  It asks for root password when it gets to that point, that's when I killed it...

2. As I only used this system for iOS development, and I only use python on linux boxes, I didn't really have any "extra" packages. Only wget was missing (in addition to swig), so it's good, no exotic dependencies.

3. the "cd sip-4.14.4.tar.gz" line must be replaced to "cd sip-4.14.4"

Thanks, I've fixed problem 1 and 3 already. I'm now testing and then I'll update the gist.
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 11, 2013, 02:16:48 AM
 #48

Alright guys, the script is done. I've tested it a few times and the .app it produces appears to work fine. None of the problems people have had before are present (afaik). I still can't test making transfers or anything like that, but I don't think the wrapper would affect it. How long is syncing the blockchain supposed to take for the first time?

Once again, download the buildarmory.sh file from https://gist.github.com/bsmt/5130568 and run it. You'll have to input your password a few times (unless you run it as root) and say "yes" to one license agreement. The dependencies it needs to run are xcode, brew, and pip. Aside from that, it will install cryptopp, swig, qt, pyqt and wget on your machine. It takes a while to build because it does everything from scratch and pyqt takes a looooooong time to make. There are some optimizations that could be made, but I'm going to hold off until I get feedback from etotheipi and everyone else.

It might be a good idea to integrate this into the Armory makefile, too, provided this is what etotheipi wants.
etotheipi (OP)
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
March 11, 2013, 02:22:52 AM
 #49

Alright guys, the script is done. I've tested it a few times and the .app it produces appears to work fine. None of the problems people have had before are present (afaik). I still can't test making transfers or anything like that, but I don't think the wrapper would affect it. How long is syncing the blockchain supposed to take for the first time?

Once again, download the buildarmory.sh file from https://gist.github.com/bsmt/5130568 and run it. You'll have to input your password a few times (unless you run it as root) and say "yes" to one license agreement. The dependencies it needs to run are xcode, brew, and pip. Aside from that, it will install cryptopp, swig, qt, pyqt and wget on your machine. It takes a while to build because it does everything from scratch and pyqt takes a looooooong time to make. There are some optimizations that could be made, but I'm going to hold off until I get feedback from etotheipi and everyone else.

It might be a good idea to integrate this into the Armory makefile, too, provided this is what etotheipi wants.

Fantastic.  The only problem is that I upgraded my OS recently and borked my OSX virtual machine.  I'm going to have to find another way to test this myself.  But as far as I can tell this is what I was looking for.  I assume I can setup this environment once, and hold the git repo inside it.  Then I can just pull the updates from my development machine and rebuild it and re-run the script to package it up...?   There's already a Darwin branch in the makefile... I can just expand it as necessary.

By the way, how big is the final .app file?  Compressed and uncompressed?  Is it normal to distribute apps as zip files?  If so, I guess the uncompressed size doesn't matter...

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!)
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 11, 2013, 02:27:51 AM
 #50

Fantastic.  The only problem is that I upgraded my OS recently and borked my OSX virtual machine.  I'm going to have to find another way to test this myself.  But as far as I can tell this is what I was looking for.  I assume I can setup this environment once, and hold the git repo inside it.  Then I can just pull the updates from my development machine and rebuild it and re-run the script to package it up...?   There's already a Darwin branch in the makefile... I can just expand it as necessary.

By the way, how big is the final .app file?  Compressed and uncompressed?  Is it normal to distribute apps as zip files?  If so, I guess the uncompressed size doesn't matter...

You'd have to modify the script a bit for what you want, especially if it's going to be in the makefile. I might play around with that later this week, I'll send you a pull request on github if I get any results.

The final app is about the same as my last version, 134.7MB for the actual app, 38.4MB zipped. Apps are almost always distributed in a zip or dmg, imo zip is better. Dmg doesn't really have any benefit other than being shiny.

Here's an app generated by the script: http://goo.gl/GWeoO
colindean
Newbie
*
Offline Offline

Activity: 43
Merit: 0



View Profile
March 11, 2013, 02:40:58 AM
 #51

higuys, I added a little bit to the end which should produce a valid dmg for it. I based this off my jperf ant script.

https://gist.github.com/colindean/5131539
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 11, 2013, 02:43:21 AM
 #52

higuys, I added a little bit to the end which should produce a valid dmg for it. I based this off my jperf ant script.

https://gist.github.com/colindean/5131539

Cool, is there a way to merge gists? I think I'll add codesigning later, once I better integrate it with the Armory source.
etotheipi (OP)
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
March 11, 2013, 02:48:39 AM
 #53

Also, if you haven't upgraded to Bitcoin-Qt 0.8, then you should do so.  The older versions sometimes took like 24 hours to sync the blockchain.  Version 0.8 takes only 5-6 hours (at least on Linux).  I'm going to work on getting by VM back up so I can test this!

By the way, does it have the Armory icon in the task tray (or whatever it's called)?  Do you know if there's a way to do that?  

Also, does anyone have experience with digitally signing .app's?  You said .dmgs are shinier... well I don't mind a little shiny, if it doesn't come with drawbacks (beside a little more up front cost of setting it up).  I'm still mostly going mostly by your guys' judgment on what's appropriate...

Sorry picobit... I appreciate you trying, but it looks like higuys just left all the competitors in the dust!

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!)
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 11, 2013, 02:53:03 AM
Last edit: March 11, 2013, 06:23:59 AM by higuys
 #54

Also, if you haven't upgraded to Bitcoin-Qt 0.8, then you should do so.  The older versions sometimes took like 24 hours to sync the blockchain.  Version 0.8 takes only 5-6 hours (at least on Linux).  I'm going to work on getting by VM back up so I can test this!

By the way, does it have the Armory icon in the task tray (or whatever it's called)?  Do you know if there's a way to do that?  

Also, does anyone have experience with digitally signing .app's?  You said .dmgs are shinier... well I don't mind a little shiny, if it doesn't come with drawbacks (beside a little more up front cost of setting it up).  I'm still mostly going mostly by your guys' judgment on what's appropriate...

Sorry picobit... I appreciate you trying, but it looks like higuys just left all the competitors in the dust!

Signing is easy. Once you have your cert you'll do codesign -s identity Path_to.app, easily scripted. You can check that it signed by making sure the _CodeSignature dir exists inside Contents.

You can add an icon to the app easily, too. It won't really do anything when Armory is running though, since python is a separate task. All you have to do is make an icns file (you can convert a png or something into one), put it in a Resources dir inside Contents of the app, and then add a CFBundleIconFile key to the Info.plist, the value being the name of the icns file (minus extension). By task tray I think you mean the dock, users choose what goes in that. If referring to the menu bar (at the top), then yes, the icon is there while running.

Thanks for reminding about bitcoin-qt, turns out I was on a super old version!
colindean
Newbie
*
Offline Offline

Activity: 43
Merit: 0



View Profile
March 11, 2013, 04:07:06 AM
 #55

higuys, I added a little bit to the end which should produce a valid dmg for it. I based this off my jperf ant script.

https://gist.github.com/colindean/5131539

Cool, is there a way to merge gists? I think I'll add codesigning later, once I better integrate it with the Armory source.

I don't think so, at least not on the interface. You could probably clone your gist locally and merge in mine...? Or just copy paste the differences visible through the revisions list. There's only a few changes.
picobit
Hero Member
*****
Offline Offline

Activity: 547
Merit: 500


Decor in numeris


View Profile
March 11, 2013, 07:40:11 AM
 #56

Sorry picobit... I appreciate you trying, but it looks like higuys just left all the competitors in the dust!

It was fun, but I knew from the start that if someone showed up that actually knows what he is doing, I wouldn't stand a chance. Smiley
I could have started earlier, I have been thinking about giving this a try for many weeks, just never got around to doing it. But next time I need to build some python stuff into a Mac application (not terribly likely to happen soon), I now know how to start!

vamdor
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
March 11, 2013, 09:39:03 AM
Last edit: March 11, 2013, 10:03:55 AM by vamdor
 #57

Once again, download the buildarmory.sh file from https://gist.github.com/bsmt/5130568 and run it.

I am confused. You start with
Code:
brew install cryptopp swig qt pyqt wget
installing pyqt (and its dependencies, including sip) into the system site-packages. Then you create a virtualenv only to download/build/install these two into it. At this point that seems unneccesary,   line 20-39 can be dropped completely.  (and it indeed worked when I tried, bit I didn't run your script)

edit: not only unnecessary, but it doesn't even work without the brew-installed pyqt package. The makefiles of PyQt are messed up, and don't like to be installed within a virtualenv, some paths will point to the system-wide packages, and will produce problems such as:

Code:
../../QtDBus/sipAPIQtDBus.h:33:10: fatal error: 'sip.h' file not found

This is one of the things that held me back yesterday when trying to do everything strictly inside the virtualenv. The solution is to
Code:
find . -name Makefile|xargs sed -i orig 's/\/System\/Library\/Frameworks\/Python\.framework\/Versions\/2\.7\/include/\/path_to_virtualenv\/include/g'
replacing all the incorrect include paths.
higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 11, 2013, 02:41:42 PM
 #58

It seems you need pyqt to make Armory, and it's also obviously needed inside the bundle. Not optimal, sure, but I was having trouble getting it to work otherwise.
vamdor
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
March 11, 2013, 09:54:57 PM
 #59

It seems you need pyqt to make Armory,
Well, considering that the build instructions say so, this is hardly surprising Smiley

Quote
but I was having trouble getting it to work otherwise.
Probably because what I said: PyQt needs some small changes to behave properly within the virtualenv. Still, those lines are unnecessary once PyQt is installed by brew.

higuys
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 11, 2013, 10:37:57 PM
Last edit: March 11, 2013, 11:24:44 PM by higuys
 #60

It seems you need pyqt to make Armory,
Well, considering that the build instructions say so, this is hardly surprising Smiley

Of course it's in the instructions, at first I was under the impression that pyqt was just needed at runtime, not for building. By the time everything was working I was rather tired and didn't feel like rewriting a good portion of it plus doing MORE testing just to remove that part, such is life.

Quote from: vamdor
Probably because what I said: PyQt needs some small changes to behave properly within the virtualenv. Still, those lines are unnecessary once PyQt is installed by brew.

It is because of what you said. I'm well aware they're unnecessary, but I'm not able to go through the whole gambit of fixing and testing right now. If you figured it out, that's great. Once I get over this damn flu I'll try to make it less gross, or you can fork that gist, I don't care. I should probably reiterate that this script was in no way intended for production use. I mean, it would work, but it was just intended to be a proof of concept.

Oh, and I'd like to point out that it doesn't actually need any changes. The configure.py file has some handy --bindir, --destdir and --sipdir options.

Is there are IRC channel for Armory or something like it? I'm tired of constantly checking the forum, live chat would be much easier.
Pages: « 1 2 [3] 4 5 6 »  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!