2016-06-20 10:42:06 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o xtrace
|
|
|
|
|
2016-06-20 10:42:43 +02:00
|
|
|
DEST=`pwd`
|
|
|
|
tmp="${DEST}/build"
|
2016-06-20 10:42:06 +02:00
|
|
|
|
|
|
|
rm -rf build dist LBRY.app
|
|
|
|
|
|
|
|
mkdir -p $tmp
|
|
|
|
cd $tmp
|
|
|
|
|
|
|
|
echo "Updating lbrynet"
|
|
|
|
if [ -z ${TRAVIS_BUILD_DIR+x} ]; then
|
|
|
|
# building locally
|
|
|
|
git clone --depth 1 http://github.com/lbryio/lbry.git
|
|
|
|
cd lbry
|
|
|
|
LBRY="${tmp}/lbry"
|
|
|
|
else
|
|
|
|
# building on travis
|
|
|
|
cd ${TRAVIS_BUILD_DIR}
|
|
|
|
LBRY=${TRAVIS_BUILD_DIR}
|
|
|
|
fi
|
|
|
|
python setup.py install
|
2016-06-20 10:42:43 +02:00
|
|
|
|
2016-06-20 10:42:06 +02:00
|
|
|
echo "Building URI Handler"
|
2016-06-20 10:42:43 +02:00
|
|
|
cd "${DEST}"
|
2016-06-20 10:42:06 +02:00
|
|
|
rm -rf build dist
|
|
|
|
python setup_uri_handler.py py2app
|
|
|
|
|
|
|
|
echo "Signing URI Handler"
|
2016-06-20 10:42:43 +02:00
|
|
|
codesign -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRYURIHandler.app/Contents/Frameworks/Python.framework/Versions/2.7"
|
|
|
|
codesign -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRYURIHandler.app/Contents/MacOS/python"
|
|
|
|
# not sure if --deep is appropriate here, but need to get LBRYURIHandler.app/Contents/Frameworks/libcrypto.1.0.0.dylib signed
|
|
|
|
codesign --deep -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRYURIHandler.app/Contents/MacOS/LBRYURIHandler"
|
|
|
|
codesign -vvvv "${DEST}/dist/LBRYURIHandler.app"
|
2016-06-20 10:42:06 +02:00
|
|
|
|
2016-06-20 10:42:43 +02:00
|
|
|
# why isn't certifi installed automatically by setup_app.py?
|
|
|
|
pip install certifi
|
|
|
|
python setup_app.py py2app
|
2016-06-20 10:42:06 +02:00
|
|
|
|
|
|
|
echo "Moving in correct libgmp"
|
2016-06-20 10:42:43 +02:00
|
|
|
rm "${DEST}/dist/LBRY.app/Contents/Frameworks/libgmp.10.dylib"
|
|
|
|
cp "${DEST}/libgmp.10.dylib" "${DEST}/dist/LBRY.app/Contents/Frameworks"
|
2016-06-20 10:42:06 +02:00
|
|
|
|
|
|
|
echo "Removing i386 libraries"
|
|
|
|
|
|
|
|
remove_arch () {
|
2016-06-20 10:42:43 +02:00
|
|
|
if [[ `lipo "$2" -verify_arch "$1"` ]]; then
|
|
|
|
lipo -output build/lipo.tmp -remove "$1" "$2" && mv build/lipo.tmp "$2"
|
|
|
|
fi
|
2016-06-20 10:42:06 +02:00
|
|
|
}
|
2016-06-20 10:42:43 +02:00
|
|
|
|
|
|
|
for i in `find dist/LBRY.app/Contents/Resources/lib/python2.7/lib-dynload/ -name "*.so"`; do
|
|
|
|
remove_arch i386 $i
|
2016-06-20 10:42:06 +02:00
|
|
|
done
|
|
|
|
|
2016-06-20 10:42:43 +02:00
|
|
|
|
2016-06-20 10:42:06 +02:00
|
|
|
echo "Moving LBRYURIHandler.app into LBRY.app"
|
2016-06-20 10:42:43 +02:00
|
|
|
mv "${DEST}/dist/LBRYURIHandler.app" "${DEST}/dist/LBRY.app/Contents/Resources"
|
2016-06-20 10:42:06 +02:00
|
|
|
|
|
|
|
echo "Signing LBRY.app"
|
2016-06-20 10:42:43 +02:00
|
|
|
codesign -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRY.app/Contents/Frameworks/Python.framework/Versions/2.7"
|
|
|
|
codesign -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRY.app/Contents/Frameworks/libgmp.10.dylib"
|
|
|
|
codesign -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRY.app/Contents/MacOS/python"
|
|
|
|
# adding deep here as well because of subcomponent issues
|
|
|
|
codesign --deep -s "${LBRY_DEVELOPER_ID}" -f "${DEST}/dist/LBRY.app/Contents/MacOS/LBRY"
|
|
|
|
codesign -vvvv "${DEST}/dist/LBRY.app"
|
2016-06-20 10:42:06 +02:00
|
|
|
|
|
|
|
rm -rf $tmp
|
|
|
|
mv dist/LBRY.app LBRY.app
|
|
|
|
rm -rf dist
|