summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 85fca5617ef9ae5e83c6bc8f87e917255ce7ee68 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: Cameron Slipp <cdslipp@hey.com>
pkgname=ontime-git
pkgver=4.7.0.r0.g176e53dd7
pkgrel=1
pkgdesc="Time keeping for live events (built from source)"
arch=('x86_64')
url="https://github.com/cpvalente/ontime"
license=('AGPL-3.0-only')
depends=('zlib' 'hicolor-icon-theme' 'fuse2')
makedepends=('git' 'nodejs>=22' 'pnpm>=10')
provides=('ontime')
conflicts=('ontime' 'ontime-bin')
options=('!strip')

source=("ontime::git+https://github.com/cpvalente/ontime.git#branch=master")
sha256sums=('SKIP')

pkgver() {
  cd ontime
  # This generates a version string based on the latest git tag and commit count
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed 's/^v//'
}

build() {
  cd ontime
  pnpm install
  pnpm build
  pnpm dist-linux
}

package() {
  cd ontime
  # Path to the built AppImage (matches upstream electron-builder output)
  local _appimage="apps/electron/dist/ontime-linux-x86_64.AppImage"
  local _icon="apps/electron/src/assets/icon.png"

  # 1. Install the AppImage to /opt and symlink into /usr/bin
  install -Dm755 "$_appimage" "${pkgdir}/opt/ontime/ontime.AppImage"
  install -dm755 "${pkgdir}/usr/bin"
  ln -s /opt/ontime/ontime.AppImage "${pkgdir}/usr/bin/ontime"

  # 2. Install the icon
  install -Dm644 "$_icon" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/ontime.png"

  # 3. Create the .desktop file
  install -dm755 "${pkgdir}/usr/share/applications"
  cat > "${pkgdir}/usr/share/applications/ontime.desktop" << EOF
[Desktop Entry]
Version=1.0
Name=Ontime
Comment=Time keeping for live events
Exec=ontime
Terminal=false
Type=Application
Icon=ontime
StartupNotify=true
StartupWMClass=ontime
Categories=AudioVideo;Productivity;
EOF
}