summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f157164d9111a033637ff52ebabd7357e703e8fa (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Maintainer: dizziee <jjdizz1l@proton.me>
#
# Nuvio — desktop media player (AUR VCS package).
# Builds the latest upstream Dev branch (NuvioMedia/NuvioDesktop) from
# source via the Gradle wrapper and bundles a Temurin 21 jpackage runtime,
# so no system Java is required at runtime. Playback uses system libmpv
# (mpv dependency). The dist/arch/PKGBUILD in NuvioLinux-unofficial is the
# versioned-stable equivalent.
#
# NOTE: the Gradle build downloads its toolchain and dependencies at build
# time, so building requires network access (standard for Gradle AUR
# packages). The Linux player bridge is compiled against system mpv and
# webkit2gtk-4.1 headers at build time.

pkgname=nuvio-linux-git
pkgver=r3259.g25390def
pkgrel=1
pkgdesc="Nuvio desktop media player — upstream source packaged for Arch Linux (git)"
arch=('x86_64')
url="https://github.com/NuvioMedia/NuvioDesktop"
license=('GPL3')
depends=('mpv' 'webkit2gtk-4.1' 'gtk3' 'glibc' 'gcc-libs' 'libx11' 'libxcomposite' 'libxext' 'libxrender' 'libxi' 'libxtst')
makedepends=('git' 'jdk21-temurin' 'gcc' 'mpv' 'webkit2gtk-4.1' 'gtk3' 'libxcomposite' 'libxext')
install=nuvio-linux-git.install
provides=('nuvio-linux')
conflicts=('nuvio-linux' 'nuvio-linux-bin')
options=('!strip')
source=("git+https://github.com/NuvioMedia/NuvioDesktop.git#branch=Dev")
sha256sums=('SKIP')

# Supabase backend + Trakt/Simkl OAuth + TMDB API key — public client config
# shared with the upstream app. These are required at build time so account
# sign-in works; they are client-side (anon) credentials and are identical
# in every shipped binary. (Trakt/Simkl IDs extracted from an upstream
# AppImage; shipping "" for them breaks offline Trakt/Simkl sign-in — same
# lesson as the main PKGBUILD's pkgrel 3. TMDB_API_KEY is new in upstream
# 0.1.24 — extracted from upstream's 0.1.24 AppImage. MDBLIST_CLIENT_ID is
# new in upstream 0.1.26 (MdbListConfig.kt) but upstream's own 0.1.26
# AppImage ships it empty — mirrored here for inventory completeness; fill
# it in if upstream ever publishes a key.)
NUVIO_SUPABASE_URL="https://api.nuvio.tv"
NUVIO_SUPABASE_ANON_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzgxNTIxMzQ2LCJleHAiOjE5MzkyMDEzNDZ9.tmQaj682pwzehpqlgCDMnySOqiUvpgRbrE43T4VJpDI"
NUVIO_SUPABASE_FALLBACK_URL="https://api-two.nuvioapp.space"
TRAKT_CLIENT_ID="5783db7c46a5b22f072d4b224f9bd7dc2cbaba66dbe3515d1feb59e3ca72394c"
TRAKT_CLIENT_SECRET="bf6e7561dafee902f5a2a67d2b31feac1563632f331f3958c978aff6389ea384"
SIMKL_CLIENT_ID="dc20e0db975583b15096267cee79cd23b1f56d4bd301ce3c51e4a96a49c834a6"
TMDB_API_KEY="01926d2187b6a5d861eefc750e9df3e3"
MDBLIST_CLIENT_ID=""

pkgver() {
  cd "$srcdir/NuvioDesktop"
  printf "r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "$srcdir/NuvioDesktop"

  # Baseline x86-64 JDK (Temurin 21 LTS, AUR) — set unconditionally so the
  # bundled jpackage runtime stays portable (never a -march=v3|v4 JDK build).
  export JAVA_HOME="/usr/lib/jvm/java-21-temurin"

  # generateRuntimeConfigs requires local.properties to exist (it is gitignored
  # and absent from the archive); write the public Supabase client config so
  # account sign-in works in the built app.
  cat > local.properties <<EOF
NUVIO_SUPABASE_URL=${NUVIO_SUPABASE_URL}
NUVIO_SUPABASE_ANON_KEY=${NUVIO_SUPABASE_ANON_KEY}
NUVIO_SUPABASE_FALLBACK_URL=${NUVIO_SUPABASE_FALLBACK_URL}
TRAKT_CLIENT_ID=${TRAKT_CLIENT_ID}
TRAKT_CLIENT_SECRET=${TRAKT_CLIENT_SECRET}
SIMKL_CLIENT_ID=${SIMKL_CLIENT_ID}
TMDB_API_KEY=${TMDB_API_KEY}
MDBLIST_CLIENT_ID=${MDBLIST_CLIENT_ID}
EOF

  echo "[nuvio-linux-git] building with JAVA_HOME=${JAVA_HOME}"
  ./gradlew --no-daemon :composeApp:createReleaseDistributable
}

package() {
  cd "$srcdir/NuvioDesktop"
  local APP_DIR="${pkgdir}/opt/Nuvio"

  # Self-contained jpackage app-image (upstream packageName="Nuvio").
  install -d "${APP_DIR}"
  cp -r composeApp/build/compose/binaries/main-release/app/Nuvio/. "${APP_DIR}/"

  # Launcher on PATH
  install -d "${pkgdir}/usr/bin"
  ln -s /opt/Nuvio/bin/Nuvio "${pkgdir}/usr/bin/nuvio"

  # Desktop entry + icon (upstream ships no Linux .desktop)
  install -d "${pkgdir}/usr/share/applications" "${pkgdir}/usr/share/pixmaps"
  cat > "${pkgdir}/usr/share/applications/nuvio.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=Nuvio
Comment=Nuvio desktop media player
Exec=/opt/Nuvio/bin/Nuvio
Icon=nuvio
Terminal=false
Categories=AudioVideo;Video;Player;
EOF
  install -Dm644 composeApp/src/desktopMain/resources/icons/nuvio-app-icon-transparent.png \
    "${pkgdir}/usr/share/pixmaps/nuvio.png"

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}