summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a17ef64b4910de04be45dbd25ae16b84f1dc6cd0 (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
74
75
76
77
78
# Maintainer: Konstantin Martianov <k.s.martianov@yandex.com>
pkgname=shader-desk-git
_pkgname=shader-desk
pkgver=r73.941ab03 # Automatically updated by pkgver()
pkgrel=1
pkgdesc="Interactive Wayland wallpaper engine using OpenGL GLESv2 shaders"
arch=('x86_64' 'aarch64')
url="https://github.com/KMartianov/shader-desk"
license=('MPL2' 'custom:CC-BY-NC-SA')

# Runtime dependencies
depends=(
  'wayland'         # Basic Wayland support
  'libglvnd'        # Vendor-neutral dispatch layer for EGL and GLESv2
  'luajit'          # High-performance scripting engine
  'nlohmann-json'   # JSON configuration parsing
  'glm'             # Mathematics for OpenGL
  'libpulse'        # PulseAudio/PipeWire support for audio-daemon
  'fftw'            # Fast Fourier Transform for audio-daemon
  'libevdev'        # Input device reading for evdev-daemon
  'mpv'             # Video playback backend for video-bg plugin
  'python'          # Required for the plugin generation script
)

# Build dependencies
makedepends=(
  'git'
  'cmake'
  'ninja'           # Faster build system (highly recommended for modern AUR packages)
  'wayland-protocols' # XML protocol files required during compilation
)

provides=("${_pkgname}")
conflicts=("${_pkgname}")

# Source code repositories
# The 'sol2' library is fetched here to comply with Arch packaging guidelines 
# requiring offline builds. CMake's FetchContent will be overridden to use this local copy.
source=(
  "${_pkgname}::git+${url}.git"
  "sol2::git+https://github.com/ThePhD/sol2.git#branch=main"
)
sha256sums=('SKIP' 'SKIP') # Skip checksums for VCS packages

pkgver() {
  cd "${srcdir}/${_pkgname}"
  
  # Generate version based on git tags. 
  # Fallback to revision count if no tags are found.
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  # Configure project in an isolated build directory.
  # -DFETCHCONTENT_SOURCE_DIR_SOL2 forces CMake to use the locally cloned sol2
  # preventing unauthorized network access during the build phase (Clean Chroot).
  cmake -B build -S "${_pkgname}" -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DFETCHCONTENT_SOURCE_DIR_SOL2="${srcdir}/sol2" \
    -DBUILD_AUDIO_DAEMON=ON \
    -DBUILD_EVDEV_DAEMON=ON \
    -DENABLE_PROFILING=OFF

  # Compile the project
  cmake --build build
}

package() {
  # Install binaries, systemd services, and plugins to pkgdir
  DESTDIR="${pkgdir}" cmake --install build

  # Install license (Strict requirement for the Arch Packaging Guidelines)
  install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}