summaryrefslogtreecommitdiff
path: root/tools/travis/linux_install.sh
blob: b2d11c2b84208b0ee4ca8343f2067b0b07c1a853 (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
#!/usr/bin/env bash
set -ex

# create new empty venv
virtualenv -p python ~/venv
source ~/venv/bin/activate

if [[ "${OPTIONAL_DEPS}" == 1 ]]; then

  # needed to build Python binding for GDAL
  export CPLUS_INCLUDE_PATH=/usr/include/gdal
  export C_INCLUDE_PATH=/usr/include/gdal

  # needed for view_graphviz and default_opener
  DIR=~/.local/share/applications
  mkdir -p $DIR
  FILE=$DIR/png.desktop
  cat <<EOF >$FILE
[Desktop Entry]
Name=png
MimeType=image/png;
Exec=/usr/bin/file
Type=Application
Terminal=true
NoDisplay=true
EOF

  xdg-mime default png.desktop image/png

fi

set +ex