summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d32309b84443af0713a6a1f78e1994021957567a (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
45
46
_pkgname=roam-research
pkgname=roam-research
pkgver=0.0.18
pkgrel=1
pkgdesc="A note-taking tool for networked thought"
arch=('any')
url="https://roamresearch.com/"
license=('custom')
depends=()
source=(
  "$_pkgname-$pkgver.tgz::https://roam-electron-deploy.s3.us-east-2.amazonaws.com/${_pkgname}_${pkgver}_amd64.deb"
  "LICENSE"
)
md5sums=(
  '702abbceae4bb920d779f7c2b23ebd1c'
  '34234c4e196ceeaf00e4ee7f29b9fb63'
)

prepare() {
  tar -xvf data.tar.xz
}

package() {
  cd "$srcdir"

  # Making paths work with a space is error-prone, so let's replace with a simpler kebab-case directory
  sed -i "s/\/opt\/Roam Research/\/opt\/$_pkgname/" usr/share/applications/roam-research.desktop

  # Install all the things
  install -d "$pkgdir"/{opt/$_pkgname,usr/share,usr/bin}
  cp -r opt/Roam\ Research/* -t "$pkgdir"/opt/$_pkgname
  cp -r usr/share/* -t "$pkgdir"/usr/share

  # Make the desktop icons available
  # (not sure why they're under 0x0? Where is that used?)
  install -d "$pkgdir"/usr/share/icons/hicolor/1024x1024
  cp -r usr/share/icons/hicolor/0x0/* -t "$pkgdir"/usr/share/icons/hicolor/1024x1024
  install -d "$pkgdir"/usr/share/pixmaps
  install -D usr/share/icons/hicolor/0x0/apps/roam-research.png -t "$pkgdir"/usr/share/pixmaps

  # Make the binary available in the $PATH
  ln -s /opt/${_pkgname}/${_pkgname} "${pkgdir}"/usr/bin/${_pkgname}

  # Add a license that links to the Terms and Conditions and Privacy Policy from https://roamresearch.com
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}