lbry-desktop/build.sh

87 lines
1.6 KiB
Bash
Raw Normal View History

2017-01-18 22:39:21 +01:00
#!/bin/bash
2017-01-16 20:06:53 +01:00
set -o xtrace
set -eu
2017-01-18 17:37:44 +01:00
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$(uname)" == "Darwin" ]; then
2017-01-27 01:21:27 +01:00
ICON="$ROOT/build/icon.icns"
else
2017-01-27 01:21:27 +01:00
ICON="$ROOT/build/icons/lbry48.png"
fi
2017-01-18 17:37:44 +01:00
if [ -n "${TEAMCITY_VERSION:-}" ]; then
# install dependencies
$ROOT/prebuild.sh
2017-01-19 10:51:54 +01:00
VENV="$ROOT/build_venv"
if [ -d "$VENV" ]; then
rm -rf "$VENV"
fi
virtualenv "$VENV"
set +u
source "$VENV/bin/activate"
set -u
pip install -U pip setuptools
2017-01-18 22:35:06 +01:00
fi
2017-01-18 22:33:27 +01:00
2017-01-18 17:37:44 +01:00
(
2017-01-27 01:21:27 +01:00
cd "$ROOT/app"
2017-01-18 17:37:44 +01:00
npm install
)
(
cd "$ROOT/lbry"
pip install -r requirements.txt
2017-01-26 23:27:07 +01:00
# need to install our version of lbryum, not
# what is currently on master
pushd "$ROOT/lbryum"
pip install .
popd
2017-01-18 17:37:44 +01:00
pip install .
)
(
cd "$ROOT/lbrynet"
2017-01-26 19:30:02 +01:00
pyinstaller lbry.onefile.spec -y --windowed --onefile
2017-01-18 17:37:44 +01:00
)
(
cd "$ROOT/lbry-web-ui"
npm install
node_modules/.bin/node-sass --output dist/css --sourcemap=none scss/
node_modules/.bin/webpack
2017-01-27 01:21:27 +01:00
rm -rf "$ROOT/app/dist"
cp -r dist "$ROOT/app/dist"
2017-01-18 17:37:44 +01:00
)
2017-01-27 01:21:27 +01:00
mv "$ROOT/lbrynet/dist/lbry" "$ROOT/app/dist"
2017-01-16 20:06:53 +01:00
2017-01-26 19:30:02 +01:00
if [ -n "${TEAMCITY_VERSION:-}" ]; then
2017-01-18 19:03:10 +01:00
(
if [ "$(uname)" == "Darwin" ]; then
2017-01-26 23:27:07 +01:00
security unlock-keychain -p ${KEYCHAIN_PASSWORD} osx-build.keychain
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
OS="linux"
PLATFORM="linux"
tar cvzf "lbry-${OS}.tgz" "LBRY-${PLATFORM}-x64/"
else
OS="unknown"
fi
)
2017-01-18 19:03:10 +01:00
node_modules/.bin/build
echo 'Build and packaging complete.'
else
echo 'Build complete. Run `electron electron` to launch the app'
fi
2017-01-18 22:33:27 +01:00
2017-01-19 10:51:54 +01:00
if [ -n "${TEAMCITY_VERSION:-}" ]; then
deactivate
fi