summaryrefslogtreecommitdiff
path: root/qutebrowser-from-source
blob: b856e0787f845b1fe5c0e19edd9f989086e7c63a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#
# Wrapper for building/running qutebrowser from source
#
# Since it's already avaiable in most distros (like Debian), you
# might be interested in the official builds.
#

if [ "$1" != "update" ] && [ -x "$HOME/apps/qutebrowser/dist/.venv/bin/python3" ]; then
  # See http://qutebrowser.org/doc/install.html#tox
  #export LD_LIBRARY_PATH=/usr/lib/openssl-1.0
  #export LD_LIBRARY_PATH=/usr/lib/`arch`-linux-gnu/openssl-1.0.2
  OPTS="--qt-flag disable-reading-from-canvas"
  source `dirname $0`/lib/qutebrowser-exec
  $HOME/apps/qutebrowser/dist/.venv/bin/python3 -m qutebrowser $OPTS "$@"
else
  # Go to project folder
  cd `dirname $0`

  # Grab quebrowser source
  git submodule update --init

  # Check for tox
  #if ! which tox &> /dev/null; then
  #  sudo apt install -y tox
  #fi

  # Build qutebrowser
  #cd dist &> /dev/null && tox -r -e mkvenv-pypi
  cd dist &> /dev/null && python3 scripts/mkvenv.py

  # Check for doc builder
  if ! dpkg-query -W -f='${Status}' asciidoc | grep -q '^install ok'; then
    sudo apt install -y --no-install-recommends asciidoc source-highlight
  fi

  # Build docs
  python3 scripts/asciidoc2html.py

  # Run this script again
  if [ "$1" != "update" ]; then
    $0 "$@"
  fi
fi