Fix build script to permit paths with spaces
- Quote dynamic command names - Use "python pip" instead of "pip" when in virtualenv (pip can't handle paths with spaces inside of a virtualenv, may be fixed in pip 10).
This commit is contained in:
parent
85f391e8a1
commit
cb88b306ab
5 changed files with 24 additions and 20 deletions
12
README.md
12
README.md
|
@ -18,16 +18,14 @@ Our [releases page](https://github.com/lbryio/lbry-app/releases/latest) also con
|
|||
|
||||
To install from source or make changes to the application, continue reading below.
|
||||
|
||||
## Development
|
||||
## Development on Linux and macOS
|
||||
|
||||
### One-time Setup
|
||||
|
||||
1. Install npm and node (v6 and above required, use [nvm](https://github.com/creationix/nvm/blob/master/README.md) if having trouble)
|
||||
2. Install keytar and libsecret (see [keytar repository](https://github.com/atom/node-keytar) )
|
||||
3. Install yarn by running: npm install -g yarn (may require elevated permissions)
|
||||
4. Check out this repo.
|
||||
5. Set up a Python virtual environment, or live on the wild side.
|
||||
6. Run `./build.sh`. This builds the UI assets and puts them into `app/dist`. It also downloads [lbry daemon](https://github.com/lbryio/lbry/releases).
|
||||
1. Clone this repo
|
||||
2. `INSTALL_DEPENDENCIES=true ./build.sh`
|
||||
|
||||
This will download and install the LBRY app and its dependencies, including [the LBRY daemon](https://github.com/lbryio/lbry) and command line utilities like `node` and `yarn`. The LBRY app requires Node >= 6; if you have an earlier version of Node installed and want to keep it, you can use [nvm](https://github.com/creationix/nvm) to switch back and forth.
|
||||
|
||||
### Running
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"version": "0.18.0rc4",
|
||||
"main": "main.js",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"homepage": "https://github.com/lbryio/lbry-app",
|
||||
"author": {
|
||||
"name": "LBRY Inc.",
|
||||
"email": "hello@lbry.io"
|
||||
|
|
2
build.sh
2
build.sh
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
# this is here because teamcity runs /build.sh to build the project
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
$DIR/build/build.sh
|
||||
"$DIR/build/build.sh"
|
||||
|
|
|
@ -29,14 +29,19 @@ FULL_BUILD="${FULL_BUILD:-false}"
|
|||
if [ -n "${TEAMCITY_VERSION:-}" -o -n "${APPVEYOR:-}" ]; then
|
||||
FULL_BUILD="true"
|
||||
fi
|
||||
if [ "$FULL_BUILD" != "true" ]; then
|
||||
echo -e "\033[1;36mDependencies will NOT be installed. Run with 'FULL_BUILD=true' to install dependencies.\x1b[m"
|
||||
fi
|
||||
|
||||
if [ "$FULL_BUILD" == "true" ]; then
|
||||
INSTALL_DEPENDENCIES="true"
|
||||
else
|
||||
INSTALL_DEPENDENCIES="${INSTALL_DEPENDENCIES:-false}"
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_DEPENDENCIES" != "true" ]; then
|
||||
echo -e "\033[1;36mDependencies will NOT be installed. Run with \"INSTALL_DEPENDENCIES=true\" to install dependencies, or \"FULL_BUILD=true\" to install dependencies and build a complete app.\x1b[m"
|
||||
else
|
||||
# install dependencies
|
||||
echo -e "\033[0;32mInstalling Dependencies\x1b[m"
|
||||
$BUILD_DIR/prebuild.sh
|
||||
"$BUILD_DIR/prebuild.sh"
|
||||
|
||||
VENV="$BUILD_DIR/venv"
|
||||
if [ -d "$VENV" ]; then
|
||||
|
@ -46,7 +51,8 @@ if [ "$FULL_BUILD" == "true" ]; then
|
|||
set +u
|
||||
source "$VENV/bin/activate"
|
||||
set -u
|
||||
pip install -r "$BUILD_DIR/requirements.txt"
|
||||
# "python pip install" required to support path names with spaces (may be fixed in pip 10)
|
||||
python "`which pip`" install -r "$BUILD_DIR/requirements.txt"
|
||||
python "$BUILD_DIR/set_version.py"
|
||||
fi
|
||||
|
||||
|
@ -90,7 +96,7 @@ DAEMON_URL=$(echo ${DAEMON_URL_TEMPLATE//DAEMONVER/$DAEMON_VER} | sed "s/OSNAME/
|
|||
DAEMON_VER_PATH="$BUILD_DIR/daemon.ver"
|
||||
echo "$DAEMON_VER_PATH"
|
||||
if [[ ! -f $DAEMON_VER_PATH || ! -f $ROOT/app/dist/lbrynet-daemon || "$(< "$DAEMON_VER_PATH")" != "$DAEMON_VER" ]]; then
|
||||
wget --quiet "$DAEMON_URL" -O "$BUILD_DIR/daemon.zip"
|
||||
curl -sL -o "$BUILD_DIR/daemon.zip" "$DAEMON_URL"
|
||||
unzip "$BUILD_DIR/daemon.zip" -d "$ROOT/app/dist/"
|
||||
rm "$BUILD_DIR/daemon.zip"
|
||||
echo "$DAEMON_VER" > "$DAEMON_VER_PATH"
|
||||
|
|
|
@ -18,7 +18,7 @@ fi
|
|||
|
||||
|
||||
SUDO=''
|
||||
if $LINUX && (( $EUID != 0 )); then
|
||||
if (( $EUID != 0 )); then
|
||||
SUDO='sudo'
|
||||
fi
|
||||
|
||||
|
@ -41,7 +41,7 @@ set -eu
|
|||
|
||||
if $LINUX; then
|
||||
INSTALL="$SUDO apt-get install --no-install-recommends -y"
|
||||
$INSTALL build-essential libssl-dev libffi-dev libgmp3-dev python2.7-dev libsecret-1-dev wget
|
||||
$INSTALL build-essential libssl-dev libffi-dev libgmp3-dev python2.7-dev libsecret-1-dev curl
|
||||
elif $OSX && ! cmd_exists brew ; then
|
||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
fi
|
||||
|
@ -64,11 +64,10 @@ fi
|
|||
if ! cmd_exists pip; then
|
||||
if $LINUX; then
|
||||
$INSTALL python-pip
|
||||
$SUDO pip install --upgrade pip
|
||||
else
|
||||
echo "Pip required"
|
||||
exit 1
|
||||
elif $OSX; then
|
||||
$SUDO easy_install pip
|
||||
fi
|
||||
$SUDO pip install --upgrade pip
|
||||
fi
|
||||
|
||||
if $LINUX && [ "$(pip list --format=columns | grep setuptools | wc -l)" -ge 1 ]; then
|
||||
|
|
Loading…
Reference in a new issue