Update build script

setup_uri_handler.py has moved, update build script to reflect
 again, setup_uri_handler changed location
 remove pipe to /dev/null
 try updating openssl
 try deep signing
 another file renamed
 install a dependency
 prereqs
 install requirements
 install certifi
 only install requirements on osx
 thin binaries only if they're actually fat
This commit is contained in:
Job Evers-Meltzer 2016-06-20 03:42:43 -05:00
parent 628d052749
commit f16111369f
3 changed files with 35 additions and 87 deletions

View file

@ -17,7 +17,13 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install python; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip install --upgrade pip virtualenv; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then virtualenv $HOME/venv && source $HOME/venv/bin/activate; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated gmp || brew upgrade gmp; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated openssl || brew upgrade openssl; fi
# the default py2app (v0.9) has a bug that is fixed in the head of /metachris/py2app
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install git+https://github.com/metachris/py2app; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install jsonrpc; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install -r requirements.txt; fi
install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./packaging/travis/install_dependencies_and_run_tests.sh; fi
@ -28,10 +34,6 @@ before_script:
script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash packaging/ubuntu/ubuntu_package_setup.sh -t; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade gmp; fi
# the default py2app (v0.9) has a bug that is fixed in the head of /metachris/py2app
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install git+https://github.com/metachris/py2app; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install jsonrpc; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd packaging/osx/lbry-osx-app && ./setup_app.sh && cd $TRAVIS_BUILD_DIR; fi
# fail the build if this is a build for a tag and we don't have the versions matching
- if [[ -n "${TRAVIS_TAG}" ]]; then if [[ "v`python setup.py -V`" = "${TRAVIS_TAG}" ]]; then true; else false; fi; fi

View file

@ -1,63 +0,0 @@
dest=`pwd`
tmp="${dest}/build"
id=`cat id.conf`
rm -rf build dist LBRY.app
mkdir -p $tmp
cd $tmp
echo "Updating lbryum"
git clone --depth 1 http://github.com/lbryio/lbryum.git
cd lbryum
python setup.py install &>/dev/null
cd ..
echo "Updating lbrynet"
git clone --depth 1 -b development http://github.com/lbryio/lbry.git
cd lbry
python setup.py install &>/dev/null
cd $dest
echo "Building URI Handler"
python setup_uri_handler.py py2app &>/dev/null
echo "Signing URI Handler"
codesign -s "Developer ID Application: LBRY Inc (${id})" -f "dist/LBRYURIHandler.app/Contents/Frameworks/Python.framework/Versions/2.7"
codesign -s "Developer ID Application: LBRY Inc (${id})" -f "dist/LBRYURIHandler.app/Contents/MacOS/python"
codesign -s "Developer ID Application: LBRY Inc (${id})" -f "dist/LBRYURIHandler.app/Contents/MacOS/LBRYURIHandler"
codesign -vvvv "dist/LBRYURIHandler.app"
mv "dist/LBRYURIHandler.app" "LBRYURIHandler.app"
rm -rf build dist
echo "Building app"
python setup_app.py py2app &>/dev/null
echo "Moving in correct libgmp"
rm "${dest}/dist/LBRY.app/Contents/Frameworks/libgmp.10.dylib"
cp "${dest}/libgmp.10.dylib" "${dest}/dist/LBRY.app/Contents/Frameworks"
echo "Removing i386 libraries"
remove_arch () {
lipo -output build/lipo.tmp -remove "$1" "$2" && mv build/lipo.tmp "$2"
}
for i in dist/LBRY.app/Contents/Resources/lib/python2.7/lib-dynload/* ; do
#remove_arch ppc ${i}
remove_arch i386 ${i}
done
echo "Moving LBRYURIHandler.app into LBRY.app"
mv "${dest}/LBRYURIHandler.app" "${dest}/dist/LBRY.app/Contents/Resources"
echo "Signing LBRY.app"
codesign -s "Developer ID Application: LBRY Inc (${id})" -f "${dest}/dist/LBRY.app/Contents/Frameworks/Python.framework/Versions/2.7"
codesign -s "Developer ID Application: LBRY Inc (${id})" -f "${dest}/dist/LBRY.app/Contents/Frameworks/libgmp.10.dylib"
codesign -s "Developer ID Application: LBRY Inc (${id})" -f "${dest}/dist/LBRY.app/Contents/MacOS/python"
codesign -s "Developer ID Application: LBRY Inc (${id})" -f "${dest}/dist/LBRY.app/Contents/MacOS/LBRY"
codesign -vvvv "${dest}/dist/LBRY.app"
rm -rf $tmp
mv dist/LBRY.app LBRY.app
rm -rf dist
chown -R ${SUDO_USER} LBRY.app

View file

@ -3,8 +3,8 @@
set -o errexit
set -o xtrace
dest=`pwd`
tmp="${dest}/build"
DEST=`pwd`
tmp="${DEST}/build"
rm -rf build dist LBRY.app
@ -23,41 +23,50 @@ else
LBRY=${TRAVIS_BUILD_DIR}
fi
python setup.py install
echo "Building URI Handler"
cd "${DEST}"
rm -rf build dist
python setup_uri_handler.py py2app
echo "Signing URI Handler"
codesign -s "${LBRY_DEVELOPER_ID}" -f "${LBRY}/dist/LBRYURIHandler.app/Contents/Frameworks/Python.framework/Versions/2.7"
codesign -s "${LBRY_DEVELOPER_ID}" -f "${LBRY}/dist/LBRYURIHandler.app/Contents/MacOS/python"
codesign -s "${LBRY_DEVELOPER_ID}" -f "${LBRY}/dist/LBRYURIHandler.app/Contents/MacOS/LBRYURIHandler"
codesign -vvvv "${LBRY}/dist/LBRYURIHandler.app"
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"
cd $dest
python setup.py py2app &>/dev/null
# why isn't certifi installed automatically by setup_app.py?
pip install certifi
python setup_app.py py2app
echo "Moving in correct libgmp"
rm "${dest}/dist/LBRY.app/Contents/Frameworks/libgmp.10.dylib"
cp "${dest}/libgmp.10.dylib" "${dest}/dist/LBRY.app/Contents/Frameworks"
rm "${DEST}/dist/LBRY.app/Contents/Frameworks/libgmp.10.dylib"
cp "${DEST}/libgmp.10.dylib" "${DEST}/dist/LBRY.app/Contents/Frameworks"
echo "Removing i386 libraries"
remove_arch () {
lipo -output build/lipo.tmp -remove "$1" "$2" && mv build/lipo.tmp "$2"
if [[ `lipo "$2" -verify_arch "$1"` ]]; then
lipo -output build/lipo.tmp -remove "$1" "$2" && mv build/lipo.tmp "$2"
fi
}
for i in dist/LBRY.app/Contents/Resources/lib/python2.7/lib-dynload/* ; do
remove_arch i386 ${i}
for i in `find dist/LBRY.app/Contents/Resources/lib/python2.7/lib-dynload/ -name "*.so"`; do
remove_arch i386 $i
done
echo "Moving LBRYURIHandler.app into LBRY.app"
mv "${LBRY}/dist/LBRYURIHandler.app" "${dest}/dist/LBRY.app/Contents/Resources"
mv "${DEST}/dist/LBRYURIHandler.app" "${DEST}/dist/LBRY.app/Contents/Resources"
echo "Signing LBRY.app"
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"
codesign -s "${LBRY_DEVELOPER_ID}" -f "${dest}/dist/LBRY.app/Contents/MacOS/LBRY"
codesign -vvvv "${dest}/dist/LBRY.app"
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"
rm -rf $tmp
mv dist/LBRY.app LBRY.app