summarylogtreecommitdiffstats
path: root/playdate-sdk.install
blob: 27ae1a1e04a38477b173a2bc80f7b640293949cd (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
post_install() {
  echo >&2 'Installing icon set'
  find /opt/playdate-sdk/Resources/file-icon -name '*.png' -exec \
    bash -c '
      basename="$(basename -s .png "$1")"
      xdg-icon-resource install --mode system --context mimetypes \
        --size "${basename#data-}" "$1" application-x-playdate' \
    _ '{}' ';'

  if [[ -x /usr/bin/zeal ]]; then
    echo >&2
    echo >&2 'To install Playdate SDK’s docset into Zeal, run:'
    echo >&2
    printf >&2 '    cp -r -t %s %s\n' \
      '"${XDG_DATA_HOME:-"${HOME}/.local/share"}/Zeal/Zeal/docsets/"' \
      '/opt/playdate-sdk/PlaydateSDK.docset'
  fi

  echo >&2
  echo >&2 'Before you use the SDK, run this on your user account:'
  echo >&2
  echo >&2 '    mkdir -p "${XDG_DATA_HOME:-"${HOME}/.local/share"}/playdate-sdk"'
  echo >&2 '    cp -rvt "${XDG_DATA_HOME:-"${HOME}/.local/share"}/playdate-sdk" /opt/playdate-sdk/{bin,Disk,Examples}'
}

post_upgrade() {
  post_install
}

post_remove() {
  echo >&2
  echo >&2 'To remove all traces from your user account, remove the'
  echo >&2 'following directories:'
  echo >&2
  printf >&2 '    %s\n' \
    '~/.local/share/playdate-sdk' \
    '~/.Playdate\ Simulator'
}