summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e648dd48ca9874a8f5d238a6f0e6d32f0a040e74 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: thenomadcode <thenomadcodeinfo@gmail.com>

pkgname=stably-orca-bin
pkgver=1.4.68
pkgrel=1
pkgdesc="Stably AI Orca - Electron-based agentic coding IDE (prebuilt AppImage)"
arch=('x86_64')
url="https://github.com/stablyai/orca"
license=('MIT')
depends=(
  'zlib'
  'hicolor-icon-theme'
  'gtk3'
  'nss'
  'alsa-lib'
  'libnotify'
  'libxss'
  'libxtst'
  'libsecret'
)
provides=('stably-orca')
conflicts=('stably-orca' 'stably-orca-git')
options=('!strip' '!debug')
source=(
  "${pkgname}-${pkgver}.AppImage::${url}/releases/download/v${pkgver}/orca-linux.AppImage"
  'stably-orca.sh'
  'stably-orca.desktop'
)
sha256sums=('2aebc2e27b7464fa35d850bcb5af046492a02992dc64018ef3118f1d17568c1a'
            '99a4d39e313a217f68cae6eb5e5437f2522da037b99de989291e34524484795c'
            '6e05296c09a37e0c28b9a2886b804d167a0c025ef1e72f955e9ba744be2f1dcd')
noextract=("${pkgname}-${pkgver}.AppImage")

prepare() {
  chmod +x "${srcdir}/${pkgname}-${pkgver}.AppImage"
  cd "${srcdir}"
  "./${pkgname}-${pkgver}.AppImage" --appimage-extract >/dev/null
}

package() {
  local sqfs="${srcdir}/squashfs-root"

  # Install the extracted AppImage tree rather than the AppImage file.
  # AppImageLauncher hooks AppImage execution at the binfmt_misc level and
  # would intercept every launch; shipping a normal directory with AppRun
  # avoids that entirely, and also drops the fuse2 runtime dependency.
  install -dm755 "${pkgdir}/opt/stably-orca"
  cp -a "${sqfs}/." "${pkgdir}/opt/stably-orca/"
  # Extracted AppImages can ship with 0700 on the root dir; make everything
  # world-readable and dirs world-traversable so non-root users can launch.
  chmod -R u+rwX,go+rX "${pkgdir}/opt/stably-orca"
  chmod 755 "${pkgdir}/opt/stably-orca/AppRun"

  install -Dm755 "${srcdir}/stably-orca.sh" \
    "${pkgdir}/usr/bin/stably-orca"
  install -Dm644 "${srcdir}/stably-orca.desktop" \
    "${pkgdir}/usr/share/applications/stably-orca.desktop"

  # Theme-aware icon install (in addition to the copies inside /opt).
  local found=0
  for size in 16 32 48 64 128 256 512; do
    local src="${sqfs}/usr/share/icons/hicolor/${size}x${size}/apps/orca.png"
    if [[ -f "${src}" ]]; then
      install -Dm644 "${src}" \
        "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/stably-orca.png"
      found=1
    fi
  done
  if [[ "${found}" -eq 0 && -f "${sqfs}/orca.png" ]]; then
    install -Dm644 "${sqfs}/orca.png" \
      "${pkgdir}/usr/share/icons/hicolor/512x512/apps/stably-orca.png"
  fi
}