linksy-bin

LOW
maintainer Ishan-Parihar 0 votes scanned 2026-10-23 01:36:19.947355
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: Ishan Parihar (Ishan-Parihar)
2# Upstream: https://github.com/LinkSy-mg/linksy-releases (desktop track: linux-vX.Y.Z)
3
4pkgname=linksy-bin
5pkgver=0.8.3 # fallback, overridden by pkgver()
6pkgrel=1
7pkgdesc="Your devices, connected: direct file/clipboard/screen/camera sharing between Linux and Android, no cloud"
8arch=('x86_64')
9url="https://github.com/LinkSy-mg/linksy-releases"
10license=('AGPL-3.0-only')
11depends=(
12 'gtk4' # libgtk-4.so.1
13 'libadwaita' # libadwaita-1.so.0
14 'gstreamer' # libgstreamer-1.0.so.0
15 'gst-plugins-base-libs'
16 'gst-plugins-good' # rtp/v4l2/pulse audio in/out (deb: gstreamer1.0-plugins-good)
17 'gst-plugin-gtk4' # gtk4 render/video sink (deb: gstreamer1.0-gtk4)
18 'gst-plugin-pipewire' # pipewire audio (deb: gstreamer1.0-pipewire)
19 'gst-libav' # h264 software codecs (deb recommends: gstreamer1.0-libav)
20 'gst-plugins-bad' # extra codecs (deb recommends: gstreamer1.0-plugins-bad)
21 'avahi' # mDNS discovery
22 'wl-clipboard' # wayland clipboard (deb recommends)
23 'xdg-desktop-portal' # file portal (deb depends)
24)
25optdepends=(
26 'v4l2loopback-dkms: phone camera as webcam device'
27 'v4l2loopback-utils: manage the loopback camera device'
28)
29provides=("${pkgname%-bin}=${pkgver}")
30conflicts=("${pkgname%-bin}")
31options=('!strip' '!emptydirs')
32install=linksy-bin.install
33source=(
34 # dummy VCS source -> yay --devel reruns pkgver() on every -Syu; upstream repo
35 # is tiny (104K) and always non-empty (the empty AUR base breaks the first
36 # clone). No #tag pin: source= expands before pkgver() runs, so a pin would
37 # fetch a stale tag after a bump (see skill: makepkg ordering).
38 "linksy-releases::git+https://github.com/LinkSy-mg/linksy-releases.git"
39)
40sha256sums=('SKIP')
41# The deb is fetched and verified (against upstream SHA256SUMS) in prepare(),
42# because its name changes with the version and source= is expanded before
43# pkgver() runs (see skill: makepkg ordering).
44
45# The repo has TWO release tracks: android (vX.Y.Z) and desktop (linux-vX.Y.Z).
46# /releases/latest points at the android track, so we must filter for linux- tags.
47# The VCS source is already cloned before pkgver() runs, so read tags locally —
48# no API call, no rate limit (strongest form of the redirect-first rule).
49pkgver() {
50 _latest=$(git -C "$srcdir/linksy-releases" tag --list 'linux-v*' --sort=-v:refname 2>/dev/null | head -1 | sed 's|^linux-v||')
51 if [[ -z "$_latest" || "$_latest" == "null" ]]; then
52 _latest=$(curl -sL "https://api.github.com/repos/LinkSy-mg/linksy-releases/releases?per_page=30" \
53 | jq -r '[.[] | select(.tag_name | startswith("linux-"))][0].tag_name' 2>/dev/null \
54 | sed 's|^linux-v||')
55 fi
56 if [[ -n "$_latest" && "$_latest" != "null" && "$_latest" =~ ^[0-9] ]]; then
57 printf "%s" "$_latest"
58 else
59 printf "%s" "0.8.3"
60 fi
61}
62
63prepare() {
64 _deb="linksy_${pkgver}_amd64.deb"
65 # resolve asset URL via API first (handles %2F tag encoding), fall back to the
66 # direct URL. These lookups are optional with fallbacks; guard with || true so
67 # a rate-limited/unreachable API cannot abort prepare() under makepkg's set -e.
68 _url_api=$(curl -sL "https://api.github.com/repos/LinkSy-mg/linksy-releases/releases/tags/linux-v${pkgver}" \
69 | jq -r ".assets[] | select(.name==\"${_deb}\") | .browser_download_url" 2>/dev/null) || true
70 _urls=()
71 [[ -n "$_url_api" && "$_url_api" != "null" ]] && _urls+=("$_url_api")
72 _urls+=("https://github.com/LinkSy-mg/linksy-releases/releases/download/linux-v${pkgver}/${_deb}")
73
74 # cache-aware: reuse cached deb when it exists and is valid
75 _ok=0
76 if [[ -f "$srcdir/$_deb" ]]; then
77 if bsdtar -tf "$srcdir/$_deb" >/dev/null 2>&1; then
78 echo "Using cached $_deb"
79 _ok=1
80 else
81 rm -f "$srcdir"/linksy_*_amd64.deb
82 fi
83 fi
84 if [[ $_ok -eq 0 ]]; then
85 for _u in "${_urls[@]}"; do
86 echo "Fetching $_u ..."
87 if curl -fL -o "$srcdir/$_deb" "$_u" && bsdtar -tf "$srcdir/$_deb" >/dev/null 2>&1; then
88 _ok=1
89 break
90 fi
91 done
92 fi
93 [[ $_ok -eq 1 ]] || { echo "Failed to fetch a valid linksy deb for ${pkgver}" >&2; exit 1; }
94
95 # verify against upstream SHA256SUMS when available (integrity of artifact chain)
96 _sums_url="https://github.com/LinkSy-mg/linksy-releases/releases/download/linux-v${pkgver}/SHA256SUMS"
97 _want=$(curl -fsSL "$_sums_url" 2>/dev/null | awk -v f="$_deb" '$2==f {print $1}') || true
98 _have=$(sha256sum "$srcdir/$_deb" | awk '{print $1}')
99 if [[ -n "$_want" ]]; then
100 [[ "$_want" == "$_have" ]] || { echo "SHA256 mismatch vs upstream SHA256SUMS" >&2; exit 1; }
101 echo "SHA256 verified against upstream SHA256SUMS"
102 fi
103
104 bsdtar -xf "$srcdir/$_deb" -C "$srcdir"
105 [[ -f "$srcdir/data.tar.xz" ]] || { echo "data.tar.xz missing from deb" >&2; exit 1; }
106 bsdtar -xf "$srcdir/data.tar.xz" -C "$srcdir"
107 [[ -d "$srcdir/usr" ]] || { echo "deb payload missing usr/ tree" >&2; exit 1; }
108}
109
110build() {
111 # map Debian dependency names to Arch package names for the smoke test report
112 echo "Linksy deb repack for Arch - binaries present:"
113 ls -1 "$srcdir/usr/bin/"
114}
115
116check() {
117 cd "$srcdir"
118
119 # 1. Every shared library resolves against the target system (a missing one
120 # fails before main() ever runs).
121 for _bin in usr/bin/linksy usr/bin/linksy-app usr/bin/linksyd usr/bin/linksy-screen; do
122 if ldd "$_bin" | grep -q "not found"; then
123 echo "ldd failure on $_bin:" >&2
124 ldd "$_bin" | grep "not found" >&2
125 return 1
126 fi
127 done
128 echo "ldd: all libraries resolve"
129
130 # 2. The GUI app parses its args headlessly (real GLib/GApplication init path).
131 env -u WAYLAND_DISPLAY -u DISPLAY usr/bin/linksy-app --help >/dev/null 2>&1
132 [[ $? -eq 0 ]] || { echo "linksy-app --help failed headlessly" >&2; return 1; }
133 echo "linksy-app: GApplication init OK"
134
135 # 3. The background daemon starts, binds its UDP port, and keeps running
136 # (a daemon's job). "Still alive after 8s" = clean startup path; a startup
137 # throw would have exited early. Then confirm it shuts down when asked.
138 # Isolated HOME so the smoke test leaves no ~/Downloads/Linksy behind.
139 # The outer timeout (12s) sits beyond the check window (8s) so the kill
140 # can never race the liveness check.
141 _smoke_home="$srcdir/linksyd-smoke-home"
142 mkdir -p "$_smoke_home"
143 HOME="$_smoke_home" timeout 12 usr/bin/linksyd --name aur-smoke-test --port 47201 >"$srcdir/linksyd-smoke.log" 2>&1 &
144 _pid=$!
145 _alive=1
146 for _i in $(seq 1 16); do
147 sleep 0.5
148 kill -0 "$_pid" 2>/dev/null || { _alive=0; break; }
149 done
150 [[ $_alive -eq 1 ]] || { echo "linksyd exited during startup" >&2; cat "$srcdir/linksyd-smoke.log" >&2; return 1; }
151 grep -q "ready" "$srcdir/linksyd-smoke.log" || { echo "linksyd never reported ready" >&2; cat "$srcdir/linksyd-smoke.log" >&2; return 1; }
152 kill -TERM "$_pid" 2>/dev/null || true
153 wait "$_pid" 2>/dev/null || true
154 # linksyd catches SIGTERM; give the log a moment to confirm the clean shutdown
155 for _i in $(seq 1 10); do
156 grep -q "shutting down" "$srcdir/linksyd-smoke.log" && break
157 sleep 0.5
158 done
159 grep -q "shutting down" "$srcdir/linksyd-smoke.log" || { echo "linksyd did not shut down cleanly" >&2; cat "$srcdir/linksyd-smoke.log" >&2; return 1; }
160 echo "linksyd: started, reported ready, alive after 8s, clean shutdown"
161
162 # 4. Desktop entry + icon shipped correctly (launcher integration).
163 desktop-file-validate usr/share/applications/mg.diary.linksy.Linksy.desktop
164 [[ -f usr/share/icons/hicolor/scalable/apps/mg.diary.linksy.Linksy.svg ]] \
165 || { echo "hicolor icon missing" >&2; return 1; }
166 echo "desktop file + icon OK"
167}
168
169package() {
170 bsdtar -xf "$srcdir/data.tar.xz" -C "$pkgdir"
171
172 # deb postinst equivalents handled at system level (not inside the chroot-ish package()):
173 # - systemctl --global enable linksyd.service -> linksy-bin.install post_install
174 # - udev reload/trigger -> linksy-bin.install post_install
175 # - firewall config (firewalld/ufw) -> NOT automatic; app's Finish Setup dialog handles it
176
177 # licenses: deb ships them under /usr/share/licenses/linksy; keep and point at upstream repo
178 if [[ -d "$pkgdir/usr/share/licenses/linksy" ]]; then
179 mv "$pkgdir/usr/share/licenses/linksy" "$pkgdir/usr/share/licenses/$pkgname"
180 else
181 install -Dm644 /dev/null "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
182 echo "AGPL-3.0-only — see $url" > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
183 fi
184 chmod 0755 "$pkgdir/usr/bin/linksy" "$pkgdir/usr/bin/linksy-app" "$pkgdir/usr/bin/linksy-screen" "$pkgdir/usr/libexec/linksy/"*
185}
186

Scan history

Scanned at (UTC)SeverityRules
2026-10-23 01:36:19 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