File: .tox_build_taskwarrior.sh

package info (click to toggle)
taskw 2.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: python: 2,691; makefile: 4
file content (28 lines) | stat: -rwxr-xr-x 864 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env bash

set -e

TW_GIT_REPO="https://github.com/GothenburgBitFactory/taskwarrior.git"

if [ -z "$1" ]; then
  echo "envdir not specified"
  echo 'Usage: .tox_build_taskwarrior.sh "{envdir}" "{toxinidir}"'
  exit 1
fi

if [ ! -x "$1/bin/task" ]; then
    rm -rf "${1?}/task"
    # --branch is misleading - it also accepts tags
    # So we can do a shallow checkout of a specific tag:
    git clone --depth 1 "${TW_GIT_REPO?}" $1/task --branch ${TASKWARRIOR?}
    cd $1/task
    # Use the 'release build' just to make things faster
    # Note about prefix: we are in {envdir}/task, so our install prefix
    # is out level up (thus '..').
    cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX:PATH=.. .
    # Run parralell build as majority of environments these days would have at
    # least two CPUs.
    make -j2
    make install
    cd $2
fi