Merge pull request #50 from lbryio/lbrycrd-in-bundle

Add lbrycrd to app bundle on macos
This commit is contained in:
Job Evers‐Meltzer 2016-07-04 15:42:24 -05:00 committed by GitHub
commit d504c8f4a3
2 changed files with 17 additions and 3 deletions

View file

@ -293,7 +293,14 @@ class LBRYDaemon(jsonrpc.JSONRPC):
else:
self.wallet_dir = os.path.join(get_path(FOLDERID.RoamingAppData, UserHandle.current), "lbryum")
elif sys.platform == "darwin":
self.lbrycrdd_path = "./lbrycrdd"
# use the path from the bundle if its available.
try:
import Foundation
bundle = Foundation.NSBundle.mainBundle()
self.lbrycrdd_path = bundle.pathForResource_ofType_('lbrycrdd', None)
except Exception:
log.exception('Failed to get path from bundle, falling back to default')
self.lbrycrdd_path = "./lbrycrdd"
if self.wallet_type == "lbrycrd":
self.wallet_dir = user_data_dir("lbrycrd")
else:

View file

@ -46,7 +46,13 @@ codesign --deep -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRYURIHandler.app/Co
codesign -vvvv "${DEST}/dist/LBRYURIHandler.app"
pip install certifi pyobjc-core pyobjc-framework-Cocoa pyobjc-framework-CFNetwork
python setup_app.py py2app
# add lbrycrdd as a resource. Following
# http://stackoverflow.com/questions/11370012/can-executables-made-with-py2app-include-other-terminal-scripts-and-run-them
wget https://github.com/lbryio/lbrycrd/releases/download/v0.3-osx/lbrycrdd
python setup_app.py py2app --resources lbrycrdd
chmod +x "${DEST}/dist/LBRY.app/Contents/Resources/lbrycrdd"
echo "Removing i386 libraries"
@ -74,5 +80,6 @@ codesign -vvvv "${DEST}/dist/LBRY.app"
rm -rf $tmp
mv dist/LBRY.app LBRY.app
rm -rf dist
rm -rf dist "${NAME}.${VERSION}.dmg"
# TODO: make this pretty!
hdiutil create "${NAME}.${VERSION}.dmg" -volname lbry -srcfolder LBRY.app