Skip to content

Instantly share code, notes, and snippets.

@bsmt
Last active December 14, 2015 18:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bsmt/5130568 to your computer and use it in GitHub Desktop.
Save bsmt/5130568 to your computer and use it in GitHub Desktop.
Package Armory into an app bundle for OS X.
#!/bin/bash
cd "${0%/*}"
export DYLD_LIBRARY_PATH=../Dependencies/QtCore.framework/Versions/Current:../Dependencies/QtGui.framework/Versions/Current:../Dependencies:$DYLD_LIBRARY_PATH
bin/python armorybuild/ArmoryQt.py &
# take bitcoin armory source and make a .app
# install build dependencies
brew install cryptopp swig qt pyqt wget
sudo pip install virtualenv
LAUNCHER="https://gist.github.com/bsmt/5130568/raw/4ff4f1c1eeb075b7b0ae58ac0a62971046f298a4/Armory"
INFO_PLIST="https://gist.github.com/bsmt/5130568/raw/00a9cb8f61665ecb08d26653a4a0022313fcb879/Info.plist"
APP_PATH=~/Desktop/Armory.app
cd /tmp
# setup virtualenv
virtualenv env
cd env
# get Armory dependencies
bin/pip install twisted
cd ..
# idk why these people can't make a setup.py
wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.14.4/sip-4.14.4.tar.gz
tar -zxvf sip-4.14.4.tar.gz
cd sip-4.14.4
../env/bin/python configure.py
make && sudo make install
cd ..
# I mean, come on...
wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10/PyQt-mac-gpl-4.10.tar.gz
tar -zxvf PyQt-mac-gpl-4.10.tar.gz
cd PyQt-mac-gpl-4.10
../env/bin/python configure.py
make && sudo make install
cd ..
rm -rf PyQt-mac-gpl-4.10
rm -rf PyQt-mac-gpl-4.10.tar.gz
rm -rf sip-4.14.4
rm -rf sip-4.14.4.tar.gz
mkdir -p $APP_PATH/Contents
sudo mv /tmp/env $APP_PATH/Contents/MacOS # put our dependencies in
# Build Armory
git clone https://github.com/etotheipi/BitcoinArmory.git
cd BitcoinArmory
make
python -m py_compile *.py # compile to pyc
mv ArmoryQt.py ArmoryQt.backup # we need to save this, though
rm -rf *.py # source no longer needed
mv ArmoryQt.backup ArmoryQt.py
# remove more unnecessary stuff
rm -rf cppForSwig dpkgfiles extras windowsbuild *.txt .git .gitignore
cd ..
mv BitcoinArmory $APP_PATH/Contents/MacOS/armorybuild
# move Qt to app
mkdir -p $APP_PATH/Contents/Dependencies
cp -r /usr/local/lib/QtCore.framework $APP_PATH/Contents/Dependencies/QtCore.framework
cp -r /usr/local/lib/QtGui.framework $APP_PATH/Contents/Dependencies/QtGui.framework
cp /usr/local/lib/libpng15.15.dylib $APP_PATH/Contents/Dependencies/libpng15.15.dylib
# add the rest
wget $LAUNCHER
wget $INFO_PLIST
sudo chmod +x Armory
sudo mv Armory $APP_PATH/Contents/MacOS/Armory
sudo mv Info.plist $APP_PATH/Contents/Info.plist
# Clean
rm -rf /tmp/PyQt*
rm -rf /tmp/sip*
# done
echo "$APP_PATH"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Armory</string>
<key>CFBundleExecutable</key>
<string>Armory</string>
<key>CFBundleIdentifier</key>
<string>com.uwot.mate</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Wunderlist</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSMinimumSystemVersion</key>
<string>10.6.0</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment