Files
omarchy-pkgs/pkgbuilds/perplexity/PKGBUILD
T
Spencer Bull 55bc67834b perplexity: stop shipping upstream's /lib, fail closed on strays
26.9.1 added /lib/systemd/system/perplexity-local-runtime-setup.service
to the deb, and wholesale extraction made the package own /lib -- a
symlink owned by filesystem -- so pacman refused every install and
upgrade. The unit could never work here anyway: its setup script
apt-installs Docker and the NVIDIA Container Toolkit and exits on any
distro but Ubuntu, so the Arch equivalents ride optdepends instead.

package() now allowlists what leaves the deb: opt/, usr/, and that one
known unit path (deleted). Anything else stops the build rather than
shipping the next filesystem conflict.

Verified in a clean container: the published -1 reproduces the /lib
conflict; -2 installs fresh and upgrades from 26.8.4 cleanly.
2026-09-03 22:52:22 -05:00

134 lines
4.6 KiB
Bash

# Maintainer: Spencer Bull <spencer@omarchy.org>
# Omarchy tracks Perplexity's own Debian repository, the feed the app updates
# itself from. .omarchy/upstream.sh rewrites the version and checksums below
# from that repository's package index.
pkgname=perplexity
pkgver=26.9.1+build61614
pkgrel=2
pkgdesc="Official Perplexity desktop app"
arch=('x86_64' 'aarch64')
url="https://www.perplexity.ai"
# Upstream ships no license text with the app; its terms live at
# https://www.perplexity.ai/hub/legal/terms-of-service
license=('custom')
depends=(
'alsa-lib'
'at-spi2-core'
'bash'
'bubblewrap'
'cairo'
'dbus'
'expat'
'gcc-libs'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libglvnd'
'libnotify'
'libsecret'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'libxss'
'libxtst'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'util-linux-libs'
'vulkan-icd-loader'
'xdg-utils'
)
optdepends=(
'apparmor: confine the app with the bundled user-namespace profile'
'libappindicator-gtk3: tray icon support'
'docker: containerized local GPU runtime for on-device models'
'nvidia-container-toolkit: containerized local GPU runtime for on-device models'
)
makedepends=('libarchive')
options=('!debug' '!strip')
# Omarchy: the build image compresses with zstd at its default level. Maximum
# zstd buys roughly a third off this ~600 MB Electron tree for a few extra
# minutes of build time -- worth it for a package this large on the fast ring,
# same reasoning as openai-codex-desktop.
COMPRESSZST=(zstd -c -z -q --ultra -22 --threads=0 -)
# The pool filename carries a build number the index's Version field drops, and
# upstream rebuilds under the same marketing version, so pkgver is the full
# string from the filename. The pool's storage treats a literal '+' in a URL as
# a space and answers 403, hence the %2B in the download URL only.
_deb_x86_64="perplexity_${pkgver}_amd64.deb"
_deb_aarch64="perplexity_${pkgver}_arm64.deb"
_pool="https://packages.perplexity.ai/deb/pool/main/p/perplexity"
source=('perplexity-launcher.sh')
source_x86_64=("${_deb_x86_64}::${_pool}/${_deb_x86_64//+/%2B}")
source_aarch64=("${_deb_aarch64}::${_pool}/${_deb_aarch64//+/%2B}")
noextract=("${_deb_x86_64}" "${_deb_aarch64}")
sha256sums=('b180ca6fbd268712a277a34d4215f176001c0031a4f6360686458623f47fad65')
sha256sums_x86_64=('2fc95f5500335e661af6901bbad5c95e8805cc9f43d9f0b979787c7249c15c33')
sha256sums_aarch64=('917562bad5ab319612c22fca49773cdee163b2e7c9f0c3dd5569fc4878f10237')
package() {
cd "${srcdir}"
local deb_var="_deb_${CARCH}"
local deb="${!deb_var}"
bsdtar -xOf "${deb}" data.tar.xz |
bsdtar --no-same-owner -xf - -C "${pkgdir}"
# 26.9.1 started shipping a systemd unit under /lib, and owning /lib -- a
# symlink owned by the filesystem package -- makes pacman refuse the whole
# transaction. The unit is also a no-op here:
# its setup script apt-installs Docker and the NVIDIA Container Toolkit and
# exits on any distro but Ubuntu (install those yourself; see optdepends).
# Delete it, but only it: anything else arriving outside the trees this
# PKGBUILD expects stops the build rather than shipping the next conflict.
local unexpected
unexpected=$(cd "${pkgdir}" && find . \( -type f -o -type l \) | grep -vE \
'^\./(opt|usr)/|^\./lib/systemd/system/perplexity-local-runtime-setup\.service$' || true)
if [[ -n "${unexpected}" ]]; then
echo "Unexpected files outside opt/ and usr/ in the upstream deb:" >&2
echo "${unexpected}" >&2
return 1
fi
rm -rf "${pkgdir}/lib"
# pacman never runs the deb's postinst, so the /usr/bin entry it would have
# symlinked is a launcher here instead, and the menu entry goes through it so
# the flags file applies there too. The scheme handler stays upstream's.
install -Dm755 perplexity-launcher.sh "${pkgdir}/usr/bin/perplexity"
sed -i 's|^Exec=.*|Exec=perplexity %U|' \
"${pkgdir}/usr/share/applications/perplexity.desktop"
# Arch ships Chromium's and Electron's own sandbox helper setuid, which is
# what keeps the sandbox up on a kernel that denies unprivileged user
# namespaces -- linux-hardened, mainly -- instead of aborting the app. The
# deb leaves this bit to its postinst.
chmod 4755 "${pkgdir}/opt/Perplexity/chrome-sandbox"
# The profile upstream's postinst would install. It names /opt/Perplexity
# paths, which this package keeps.
install -Dm644 "${pkgdir}/opt/Perplexity/resources/apparmor-profile" \
"${pkgdir}/etc/apparmor.d/perplexity"
# Debian package-policy files are not used on Arch Linux.
rm -rf "${pkgdir}/usr/share/doc"
}