Install
Three install paths — static binary first, manual per-target download second, source build third.
1. Static binary (one line)
The fastest and most portable install path. Use
x eget — x-cmd's
wrapper around the upstream GitHub release pipeline:
x eget ljh-sh/wdiff
The installed binaries are wdiff, diff,
and the man pages. The wdiff binary is compiled
with DIFF_PROGRAM absolute-pathed to the bundled
diff binary — so the runtime lookup of
diff is fully predictable, no
$PATH traversal.
After install:
$ wdiff --version | head -1
wdiff (GNU wdiff) 1.2.2
$ diff --version | head -1
diff (GNU diffutils) 3.10
What the eget install does
x eget ljh-sh/wdiff picks the right per-target
tarball for your OS/arch, downloads it, verifies its
SHA256 against the top-level SHA256SUMS shipped
in the GitHub release, and untars the bin/ +
man/ + README.md into your x-cmd
local directory. No sudo, no system-package
manager, no glibc / diff / ncurses to install.
2. Manual per-target download
If you can't use x-cmd, head to the
GitHub Releases
page and pick the tarball for your target. Each release
publishes 5 archives + 5 .sha256 + a top-level
SHA256SUMS.
Example (Linux x86_64 musl):
curl -L -o wdiff.tar.gz https://github.com/ljh-sh/wdiff/releases/latest/download/wdiff-x86_64-linux-musl.tar.gz
curl -L -o wdiff.tar.gz.sha256 https://github.com/ljh-sh/wdiff/releases/latest/download/wdiff-x86_64-linux-musl.tar.gz.sha256
sha256sum -c wdiff.tar.gz.sha256
tar xzf wdiff.tar.gz
sudo install -m 0755 wdiff-x86_64-linux-musl/bin/wdiff wdiff-x86_64-linux-musl/bin/diff /usr/local/bin/
sudo install -m 0644 wdiff-x86_64-linux-musl/man/man1/*.1 /usr/local/share/man/man1/ 2>/dev/null || true
On macOS, use shasum -a 256 instead of
sha256sum; on Windows, use
Get-FileHash -Algorithm SHA256.
3. Build from source (vendoring update)
This repo ships upstream/wdiff/ and
upstream/diffutils/ as clean copies (no local
patches). To refresh:
# wdiff
curl -L -o /tmp/wdiff.tar.gz https://ftp.gnu.org/gnu/wdiff/wdiff-1.2.2.tar.gz
rm -rf upstream/wdiff && tar xzf /tmp/wdiff.tar.gz -C upstream/ \
&& mv upstream/wdiff-1.2.2 upstream/wdiff
# diffutils
curl -L -o /tmp/diffutils.tar.xz https://ftp.gnu.org/gnu/diffutils/diffutils-3.10.tar.xz
rm -rf upstream/diffutils && tar xJf /tmp/diffutils.tar.xz -C upstream/ \
&& mv upstream/diffutils-3.10 upstream/diffutils
Then run bash scripts/build.sh && bash scripts/smoke.sh
to reproduce the CI locally. For a true musl-static build:
docker run --rm --platform linux/amd64 -v "$PWD":/w -w /w alpine:3.20 \
sh -c 'apk add --no-cache bash gettext-dev libxslt >/dev/null \
&& bash /w/scripts/build-alpine.sh && bash /w/scripts/smoke.sh'
See build audit for the
per-target SHAs and the
scripts/build.sh
source.