xdm-app

LOW
maintainer HanHaocheng 0 votes scanned 2026-10-30 09:55:25.758986
View on AUR
Why flagged

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

PKGBUILD

1# Maintainer: HanHaocheng <1849397656@qq.com>
2#
3# Source package for XDM 9.0.8, built from the upstream tag tarball.
4#
5# Why this is a source package and not another -bin:
6# xdm-app-bin only repackages the release tarball that GitHub publishes. This
7# package compiles the 9.0.8 tag (commit 2f46454fe513edaaa943d097c93673746919b0fb)
8# with Maven and then runs upstream's own packaging/build-bundle.sh to
9# jlink/jpackage the app image, so the result follows the upstream sources and
10# can be rebuilt or patched locally at any time - no prebuilt app blob, and no
11# dependence on the release assets staying online.
12#
13# Why a prebuilt JetBrains Runtime has to be downloaded as a source:
14# 1. The app image is linked with jlink from a *pinned* JDK. build-bundle.sh
15# hard-refuses any java on PATH that is not the JetBrains Runtime build
16# named in packaging/jdk.properties (jbr.version=25.0.4.1,
17# jbr.build=b635.70). --any-jdk exists for local experiments and must not
18# be used for a package: the AppCDS class lists under packaging/cds are
19# recorded on that exact build and only hold for it.
20# 2. The vendor alone already rules out Arch's jdk-openjdk/jdk25-openjdk:
21# XDM's Linux UI needs JBR's java.desktop, whose native Wayland toolkit is
22# a JetBrains patch that upstream OpenJDK does not carry.
23# 3. That JBR build is not in the Arch repositories, so it is fetched from
24# JetBrains' cache-redirector (the same host upstream's Linux Docker build
25# uses) and verified against the SHA-512 JetBrains publishes for it, then
26# used as the build JDK (JAVA_HOME/PATH) and as the Maven JDK 25 toolchain.
27# The JBR is a build-time tool only: at runtime the package uses the jlink'd
28# runtime inside /opt/xdm-app/lib/runtime, so the JBR is not a dependency.
29#
30# The tag tarball is a generated archive; if GitHub ever regenerates it the
31# sha256 below changes and the build stops at the checksum, as intended.
32#
33# Dependency, description and desktop metadata match the published xdm-app-bin.
34
35pkgname=xdm-app
36pkgver=9.0.8
37pkgrel=2
38pkgdesc='Fast, resumable download accelerator and video downloader with HLS/DASH support'
39arch=('x86_64' 'aarch64')
40url='https://xtremedownloadmanager.com/'
41license=('GPL-3.0-only')
42depends=('libx11' 'libxext' 'libxrender' 'libxtst' 'libxi' 'freetype2' 'fontconfig' 'ttf-font')
43optdepends=(
44 'wayland: use the native Wayland toolkit instead of XWayland'
45 'libxkbcommon: use the native Wayland toolkit instead of XWayland'
46 'gtk3: native GTK file chooser dialogs'
47 'alsa-lib: sound notifications'
48)
49makedepends=('maven' 'zip' 'unzip' 'binutils')
50# xdman-bin repackages the same upstream 9.x app image into the same /opt/xdm-app
51# (it installs /usr/bin/xdm-app and /usr/bin/xdman), so more than one of these can
52# never be installed at once.
53conflicts=('xdm-app-bin' 'xdman-bin' 'xdman' 'xdman_gtk')
54replaces=('xdman' 'xdman_gtk')
55options=('!strip' '!debug')
56
57# Common source: the 9.0.8 tag. Renamed because the archive's own file name
58# would be 9.0.8.tar.gz; it unpacks to $srcdir/xdm-9.0.8.
59source=("xdm-$pkgver.tar.gz::https://github.com/subhra74/xdm/archive/refs/tags/$pkgver.tar.gz")
60sha256sums=('236967d717238616c6c252760b48ff382d1c6f5b83d4cffca5f992260e1f7d3a')
61
62# The pinned build JDK (packaging/jdk.properties: jbr.version=25.0.4.1,
63# jbr.build=b635.70). Checksums are the SHA-512s JetBrains publishes next to
64# each archive at <url>.checksum, and are the ones upstream's Docker build
65# verifies. Note makepkg matches <integ>sums_<arch> against source_<arch> only,
66# so the common tarball keeps sha256sums and the JBR uses sha512sums_<arch>.
67_jbr_ver=25.0.4.1
68_jbr_build=b635.70
69_jbr_base=https://cache-redirector.jetbrains.com/intellij-jbr
70# makepkg unpacks every source archive itself (the PKGBUILD-level "noextract"
71# option is gone in pacman 7), and this one has a single top-level directory
72# whose name is the archive name minus ".tar.gz" - which is exactly a JDK home.
73# build() therefore uses that directory as JAVA_HOME instead of re-extracting.
74source_x86_64=("$_jbr_base/jbrsdk-$_jbr_ver-linux-x64-$_jbr_build.tar.gz")
75sha512sums_x86_64=('15b9e9788a1d658851a1bf32fc998fc6660f5f8084e4c303b42fd0f13cc2b2b77b72fab1b86476b066cadaa95f6a7186a058e5487128eb259a875e9c6d456f56')
76source_aarch64=("$_jbr_base/jbrsdk-$_jbr_ver-linux-aarch64-$_jbr_build.tar.gz")
77sha512sums_aarch64=('22771d9d166bd0f9d477c0100fc10bb32b11bc5c942953cf949f7e24d548f42e50e7c6f1c426eed590ca5326acb75e899c4b9f06ba13128aeb2876ca5d96a5f6')
78
79build() {
80 cd "$srcdir"
81
82 # ---- build JDK: the JBR tree makepkg already unpacked -------------------
83 # Only one of the two JBR archives is fetched per architecture, so a single
84 # match is expected; the glob keeps this architecture-neutral ($srcdir is
85 # cleared between builds, so a stale second copy cannot be picked up).
86 local jbr_home jbr_jdk_version jbr_runtime_version release_file
87 jbr_home=$(find "$srcdir" -maxdepth 1 -mindepth 1 -type d \
88 -name "jbrsdk-$_jbr_ver-linux-*-$_jbr_build" | head -n1)
89 if [[ -z $jbr_home ]]; then
90 echo "no jbrsdk-$_jbr_ver-linux-*-$_jbr_build directory in $srcdir" >&2
91 return 1
92 fi
93 # Make sure what makepkg unpacked is a real JDK home instead of relying on
94 # the archive layout staying the same.
95 [[ -x $jbr_home/bin/java ]] ||
96 { echo "unexpected JBR layout: $jbr_home/bin/java is missing" >&2; return 1; }
97
98 # JDK release files quote values, but not always; strip the quotes.
99 _release_field() { grep -m1 "^$2=" "$1" | cut -d= -f2- | tr -d '"'; }
100
101 # build-bundle.sh reads these two fields out of $JAVA_HOME/release and
102 # refuses to build unless JAVA_VERSION == jbr.version and
103 # JAVA_RUNTIME_VERSION ends in -jbr.build. Checking here fails early and
104 # with a clear message instead of inside jlink.
105 release_file=$jbr_home/release
106 [[ -f $release_file ]] || { echo "missing $release_file" >&2; return 1; }
107 jbr_jdk_version=$(_release_field "$release_file" JAVA_VERSION)
108 jbr_runtime_version=$(_release_field "$release_file" JAVA_RUNTIME_VERSION)
109
110 if [[ $jbr_jdk_version != "$_jbr_ver" ]]; then
111 echo "JBR JAVA_VERSION is '$jbr_jdk_version', expected '$_jbr_ver'" >&2
112 return 1
113 fi
114 if [[ $jbr_runtime_version != *"-$_jbr_build"* ]]; then
115 echo "JBR JAVA_RUNTIME_VERSION is '$jbr_runtime_version'," >&2
116 echo "expected it to contain '-$_jbr_build'" >&2
117 return 1
118 fi
119
120 export JAVA_HOME="$jbr_home"
121 export PATH="$JAVA_HOME/bin:$PATH"
122
123 # ---- Maven toolchain ---------------------------------------------------
124 # The root pom's maven-toolchains-plugin selects a JDK 25 toolchain, which is
125 # independent of whatever JVM Maven itself runs on. The file is generated in
126 # $srcdir (never in ~/.m2) and points at the unpacked JBR.
127 cat > "$srcdir/toolchains.xml" <<EOF
128<?xml version="1.0" encoding="UTF-8"?>
129<toolchains>
130 <toolchain>
131 <type>jdk</type>
132 <provides>
133 <version>25</version>
134 </provides>
135 <configuration>
136 <jdkHome>$JAVA_HOME</jdkHome>
137 </configuration>
138 </toolchain>
139</toolchains>
140EOF
141
142 cd "$srcdir/xdm-$pkgver"
143
144 # ---- fat jar -----------------------------------------------------------
145 # Maven runs on the JBR (JAVA_HOME + PATH above). The local repository is kept
146 # inside $srcdir so the build never reads or writes the user's ~/.m2.
147 mvn -q clean package -DskipTests -t "$srcdir/toolchains.xml" -Dmaven.repo.local="$srcdir/m2repo"
148
149 [[ -f xdm-app/target/xdm-app.jar ]] ||
150 { echo "xdm-app/target/xdm-app.jar was not produced" >&2; return 1; }
151
152 # ---- app image ---------------------------------------------------------
153 # -s: reuse the jar just built. The pinned JBR is re-stated on the command
154 # line because the script validates (and then uses for jlink/jpackage) the
155 # java it finds on PATH.
156 PATH="$JAVA_HOME/bin:$PATH" JAVA_HOME="$JAVA_HOME" packaging/build-bundle.sh -s -t app-image -o "$srcdir/dist"
157
158 [[ -x "$srcdir/dist/xdm-app/bin/xdm-app" ]] ||
159 { echo "app image not produced at $srcdir/dist/xdm-app" >&2; return 1; }
160}
161
162package() {
163 install -dm755 "$pkgdir/opt" "$pkgdir/usr/bin" \
164 "$pkgdir/usr/share/applications" \
165 "$pkgdir/usr/share/icons/hicolor/256x256/apps"
166
167 # The app image is self-contained: bin/xdm-app, lib/app, lib/runtime.
168 cp -a "$srcdir/dist/xdm-app" "$pkgdir/opt/xdm-app"
169 ln -s /opt/xdm-app/bin/xdm-app "$pkgdir/usr/bin/xdm-app"
170
171 # The image ships a single (256 px) icon; desktops scale it as needed.
172 install -Dm644 "$srcdir/dist/xdm-app/lib/xdm-app.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/xdm-app.png"
173
174 # Verbatim copy of packaging/linux/xdm-app.desktop at the 9.0.8 tag.
175 cat > "$pkgdir/usr/share/applications/xdm-app.desktop" <<'DESKTOP'
176[Desktop Entry]
177Type=Application
178Name=Xtreme Download Manager
179GenericName=Download Manager
180Comment=Download accelerator and video downloader
181Exec=/opt/xdm-app/bin/xdm-app %U
182Icon=xdm-app
183Terminal=false
184Categories=Network;FileTransfer;
185Keywords=download;accelerator;video;hls;dash;
186MimeType=x-scheme-handler/xdm-app;
187# No launch feedback: GNOME ends its busy cursor when the first window hands back the launch's
188# XDG_ACTIVATION_TOKEN, and JBR's Wayland toolkit never does, so the cursor stayed busy until the
189# timeout (PACKAGING.md 7.2).
190StartupNotify=false
191# X11 window class; under native Wayland the window's app id is xdm-app, which matches this file's name.
192StartupWMClass=xdm-app-AppMain
193DESKTOP
194 chmod 644 "$pkgdir/usr/share/applications/xdm-app.desktop"
195}
196

Scan history

Scanned at (UTC)SeverityRules
2026-10-30 09:55:25 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion