summaryrefslogtreecommitdiffhomepage
path: root/packaging/PKGBUILD
blob: 73039fbd4e2c5f10e92c2793017a36ba09c42e01 (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
# Maintainer: unbox
#
# Local PKGBUILD for the unbox Wayland desktop environment. Builds the CURRENT
# WORKING TREE (the repo this PKGBUILD lives in), not a clean VCS checkout — so
# `makepkg` packages exactly what is checked out, and reuses the already-fetched
# meson subprojects (RmlUi/doctest/toml++) under ../subprojects with no network.
#
# Build + install on this machine:
#     cd packaging && makepkg -si
# Rebuild after changes:    makepkg -sif      Remove:    pacman -R unbox

pkgname=unbox
pkgver=0.0.1
pkgrel=1
pkgdesc="Experimental Wayland desktop environment: monolithic wlroots compositor + embedded RMLUi"
arch=('x86_64')
url="https://github.com/anomalyco/opencode"
license=('custom')
# Runtime libraries (RMLUi, doctest, toml++ are static meson subprojects, so they
# are NOT runtime deps). dbus provides dbus-run-session for the session wrapper.
depends=('wlroots0.20' 'wayland' 'libxkbcommon' 'pixman' 'libglvnd' 'freetype2'
         'seatd' 'dbus')
makedepends=('meson' 'ninja' 'cmake' 'wayland-protocols' 'pkgconf')
provides=('unbox')
conflicts=('unbox-git')
# No separate -debug package (buildtype=plain, no -g); keep it to one artifact.
options=('!debug')
source=()

# NOTE: $srcdir/$startdir/$pkgdir are only set INSIDE the functions, so the build
# dir + source root are computed there (the repo root is packaging/..).

build() {
    # Plain meson (no devtools/arch-meson dependency, so this builds on any Arch
    # box). Source is the WORKING TREE; the build dir is private to makepkg
    # ($srcdir/build) so the dev build/ and build-asan/ trees are untouched. The
    # meson subprojects (RmlUi/doctest/toml++) come along in the synced tree.
    #
    # ALWAYS configure fresh: the toml++ default_library=static override (and any
    # other subproject option) only applies on a subproject's FIRST configuration,
    # so a reused/stale build dir would silently fall back to the wrapped default
    # (shared) and reintroduce the libtomlplusplus.so runtime dependency.
    rm -rf "$srcdir/build"
    meson setup --prefix=/usr --libexecdir=lib --buildtype=plain \
        -Db_pie=true "$startdir/.." "$srcdir/build"
    meson compile -C "$srcdir/build"
}

package() {
    # Installs /usr/bin/unbox + /usr/share/unbox/<unit>/*.rml,*.rcss (the assets
    # the compiled-in UNBOX_ASSET_DIR_DEFAULT=/usr/share/unbox resolves at runtime).
    meson install -C "$srcdir/build" --destdir "$pkgdir"

    # The session wrapper (dbus-run-session -- unbox), mirroring start-labwc.sh.
    install -Dm755 "$startdir/start-unbox" "$pkgdir/usr/bin/start-unbox"

    # A wayland-sessions entry so a display manager (if ever used) can list unbox;
    # harmless on a bare-TTY setup.
    install -Dm644 /dev/stdin "$pkgdir/usr/share/wayland-sessions/unbox.desktop" <<'EOF'
[Desktop Entry]
Name=unbox
Comment=Experimental wlroots + RMLUi Wayland desktop
Exec=start-unbox
Type=Application
EOF
}