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 egetx-cmd's wrapper around the upstream GitHub release pipeline:

x eget ljh-sh/dwdiff

The installed binary is dwdiff (with the bundled ICU 78.3 statically linked — no system ICU needed). The binary is large (~30 MB) because of the embedded ICU; install size is the price for full CJK + Unicode-segmentation support.

After install:

$ dwdiff --version | head -1
dwdiff 2.1.4

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 dwdiff.tar.gz https://github.com/ljh-sh/dwdiff/releases/latest/download/dwdiff-x86_64-linux-musl.tar.gz
curl -L -o dwdiff.tar.gz.sha256 https://github.com/ljh-sh/dwdiff/releases/latest/download/dwdiff-x86_64-linux-musl.tar.gz.sha256
sha256sum -c dwdiff.tar.gz.sha256
tar xzf dwdiff.tar.gz
sudo install -m 0755 dwdiff-x86_64-linux-musl/bin/dwdiff dwdiff-x86_64-linux-musl/bin/dwfilter /usr/local/bin/
sudo install -m 0644 dwdiff-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/dwdiff/ and upstream/icu/ as clean copies (no local patches). To refresh:

# dwdiff
curl -L -o /tmp/dwdiff.tar.bz2 https://os.ghalkes.nl/dist/dwdiff-2.1.4.tar.bz2
rm -rf upstream/dwdiff && tar xjf /tmp/dwdiff.tar.bz2 -C /tmp/ \
  && mv /tmp/dwdiff-2.1.4 upstream/dwdiff
# Preserve config.pkg (configure overwrites it)
cp /tmp/dwdiff-2.1.4/config.pkg upstream/dwdiff/config.pkg

# ICU
curl -L -o /tmp/icu-sources.tgz \
  https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz
rm -rf upstream/icu && tar xzf /tmp/icu-sources.tgz -C /tmp/ \
  && mv /tmp/icu upstream/icu

Then run bash scripts/build.sh && bash scripts/smoke.sh to reproduce the CI locally. The ICU build is the slow step (~10 min) — be patient. 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 autoconf automake libtool make g++ \
      linux-headers >/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.