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:
Alex Liebowitz 2017-10-26 23:30:48 -04:00 committed by Alex Grintsvayg
parent 85f391e8a1
commit cb88b306ab
5 changed files with 24 additions and 20 deletions

View file

@ -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. To install from source or make changes to the application, continue reading below.
## Development ## Development on Linux and macOS
### One-time Setup ### 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) 1. Clone this repo
2. Install keytar and libsecret (see [keytar repository](https://github.com/atom/node-keytar) ) 2. `INSTALL_DEPENDENCIES=true ./build.sh`
3. Install yarn by running: npm install -g yarn (may require elevated permissions)
4. Check out this repo. 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.
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).
### Running ### Running

View file

@ -3,6 +3,7 @@
"version": "0.18.0rc4", "version": "0.18.0rc4",
"main": "main.js", "main": "main.js",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"homepage": "https://github.com/lbryio/lbry-app",
"author": { "author": {
"name": "LBRY Inc.", "name": "LBRY Inc.",
"email": "hello@lbry.io" "email": "hello@lbry.io"

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
# this is here because teamcity runs /build.sh to build the project # this is here because teamcity runs /build.sh to build the project
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$DIR/build/build.sh "$DIR/build/build.sh"

View file

@ -29,14 +29,19 @@ FULL_BUILD="${FULL_BUILD:-false}"
if [ -n "${TEAMCITY_VERSION:-}" -o -n "${APPVEYOR:-}" ]; then if [ -n "${TEAMCITY_VERSION:-}" -o -n "${APPVEYOR:-}" ]; then
FULL_BUILD="true" FULL_BUILD="true"
fi 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 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 # install dependencies
echo -e "\033[0;32mInstalling Dependencies\x1b[m" echo -e "\033[0;32mInstalling Dependencies\x1b[m"
$BUILD_DIR/prebuild.sh "$BUILD_DIR/prebuild.sh"
VENV="$BUILD_DIR/venv" VENV="$BUILD_DIR/venv"
if [ -d "$VENV" ]; then if [ -d "$VENV" ]; then
@ -46,7 +51,8 @@ if [ "$FULL_BUILD" == "true" ]; then
set +u set +u
source "$VENV/bin/activate" source "$VENV/bin/activate"
set -u 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" python "$BUILD_DIR/set_version.py"
fi fi
@ -90,7 +96,7 @@ DAEMON_URL=$(echo ${DAEMON_URL_TEMPLATE//DAEMONVER/$DAEMON_VER} | sed "s/OSNAME/
DAEMON_VER_PATH="$BUILD_DIR/daemon.ver" DAEMON_VER_PATH="$BUILD_DIR/daemon.ver"
echo "$DAEMON_VER_PATH" echo "$DAEMON_VER_PATH"
if [[ ! -f $DAEMON_VER_PATH || ! -f $ROOT/app/dist/lbrynet-daemon || "$(< "$DAEMON_VER_PATH")" != "$DAEMON_VER" ]]; then 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/" unzip "$BUILD_DIR/daemon.zip" -d "$ROOT/app/dist/"
rm "$BUILD_DIR/daemon.zip" rm "$BUILD_DIR/daemon.zip"
echo "$DAEMON_VER" > "$DAEMON_VER_PATH" echo "$DAEMON_VER" > "$DAEMON_VER_PATH"

View file

@ -18,7 +18,7 @@ fi
SUDO='' SUDO=''
if $LINUX && (( $EUID != 0 )); then if (( $EUID != 0 )); then
SUDO='sudo' SUDO='sudo'
fi fi
@ -41,7 +41,7 @@ set -eu
if $LINUX; then if $LINUX; then
INSTALL="$SUDO apt-get install --no-install-recommends -y" 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 elif $OSX && ! cmd_exists brew ; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi fi
@ -64,11 +64,10 @@ fi
if ! cmd_exists pip; then if ! cmd_exists pip; then
if $LINUX; then if $LINUX; then
$INSTALL python-pip $INSTALL python-pip
$SUDO pip install --upgrade pip elif $OSX; then
else $SUDO easy_install pip
echo "Pip required"
exit 1
fi fi
$SUDO pip install --upgrade pip
fi fi
if $LINUX && [ "$(pip list --format=columns | grep setuptools | wc -l)" -ge 1 ]; then if $LINUX && [ "$(pip list --format=columns | grep setuptools | wc -l)" -ge 1 ]; then