nandi/freeqsay-nimpublic Fork 0
b248dcf
Commits
Clone
git clone https://git.rickub.com/nandi/freeqsay-nim.git
git clone ssh://git@rickub.com/nandi/freeqsay-nim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

just install: put the static binary on PATH

Installs ./freeqsay-static as freeqsay in ~/.local/bin, overridable by
argument or PREFIX, with uninstall alongside. The recipe checks whether the
target directory is actually on PATH and prints the export line when it is
not — an install nobody can run is not an install.

Also gives every recipe a single-line doc comment: just --list shows only the
last line of a comment block, which had been mangling static and shot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-19T18:18:25-07:00 Browse files
b248dcf parent: ed15d1f
modified README.md +5 -0
@@ -52,6 +52,7 @@ of them.
5252 ```bash
5353 just build # optimized binary → ./freeqsay
5454 just static # fully static binary → ./freeqsay-static
55+just install # static binary → ~/.local/bin/freeqsay
5556 just test # test suite
5657 just run <handle> <message> # run from source, no build
5758 just shot <handle> <message> # gapless termshot png
@@ -66,6 +67,10 @@ fetches that exact release asset, checks its hash and caches it. A static binary
6667 `SSL_CERT_FILE` when resolving handles on a host without one at the default
6768 path.
6869
70+`just install` puts the static build on your PATH as `freeqsay`; it takes a
71+directory (`just install ~/bin`) or `PREFIX`, and says so when the target is
72+not actually on your PATH. `just uninstall` removes it again.
73+
6974 `nimble build` and `nimble test` work too. `-d:ssl` is set in `config.nims`,
7075 since handle resolution goes over HTTPS through the stdlib client.
7176
@@ -52,6 +52,7 @@ of them.
52 ```bash52 ```bash
53 just build # optimized binary → ./freeqsay53 just build # optimized binary → ./freeqsay
54 just static # fully static binary → ./freeqsay-static54 just static # fully static binary → ./freeqsay-static
55+just install # static binary → ~/.local/bin/freeqsay
55 just test # test suite56 just test # test suite
56 just run <handle> <message> # run from source, no build57 just run <handle> <message> # run from source, no build
57 just shot <handle> <message> # gapless termshot png58 just shot <handle> <message> # gapless termshot png
@@ -66,6 +67,10 @@ fetches that exact release asset, checks its hash and caches it. A static binary
66 `SSL_CERT_FILE` when resolving handles on a host without one at the default67 `SSL_CERT_FILE` when resolving handles on a host without one at the default
67 path.68 path.
68 69
70+`just install` puts the static build on your PATH as `freeqsay`; it takes a
71+directory (`just install ~/bin`) or `PREFIX`, and says so when the target is
72+not actually on your PATH. `just uninstall` removes it again.
73+
69 `nimble build` and `nimble test` work too. `-d:ssl` is set in `config.nims`,74 `nimble build` and `nimble test` work too. `-d:ssl` is set in `config.nims`,
70 since handle resolution goes over HTTPS through the stdlib client.75 since handle resolution goes over HTTPS through the stdlib client.
71 76
modified justfile +27 -6
@@ -1,5 +1,7 @@
11 # freeqsay recipes. Everything here assumes nim on PATH.
22
3+bindir := env_var_or_default("PREFIX", env_var("HOME") / ".local/bin")
4+
35 # Show the recipes.
46 default:
57 @just --list
@@ -8,12 +10,32 @@ default:
810 build:
911 nim c -d:release -d:ssl --hints:off -o:freeqsay src/freeqsay.nim
1012
11-# Fully static binary → ./freeqsay-static. No glibc, no dlopen'd OpenSSL, so it
12-# runs on any Linux. tools/nimstatic is a DotSlash file: the first run fetches
13-# the pinned nimstatic build, verifies its hash and caches it.
13+# Compile a fully static binary → ./freeqsay-static (no glibc, no dlopen'd TLS).
1414 static:
15+ # tools/nimstatic is a DotSlash file: the first run fetches the pinned
16+ # nimstatic release, verifies its hash and caches it.
1517 ./tools/nimstatic src/freeqsay.nim -o freeqsay-static -- -d:ssl
1618
19+# Install the static binary as `freeqsay` (default ~/.local/bin, or `just install ~/bin`).
20+install dir=bindir: static
21+ #!/usr/bin/env bash
22+ set -euo pipefail
23+ mkdir -p "{{dir}}"
24+ install -m755 freeqsay-static "{{dir}}/freeqsay"
25+ echo "installed {{dir}}/freeqsay"
26+ # An install nobody can run is not an install: say so now rather than let
27+ # it be discovered later.
28+ case ":$PATH:" in
29+ *":{{dir}}:"*) "{{dir}}/freeqsay" did:plc:ewvi7nmzuoqusbcablsm7c4h "on your PATH" ;;
30+ *) echo "note: {{dir}} is not on your PATH. Add to your shell profile:"
31+ echo " export PATH=\"{{dir}}:\$PATH\"" ;;
32+ esac
33+
34+# Remove an installed freeqsay.
35+uninstall dir=bindir:
36+ rm -f "{{dir}}/freeqsay"
37+ @echo "removed {{dir}}/freeqsay"
38+
1739 # Run the test suite.
1840 test:
1941 nim c -d:ssl --hints:off -r tests/test_avatar.nim
@@ -22,11 +44,10 @@ test:
2244 run *args:
2345 nim r -d:ssl --hints:off src/freeqsay.nim {{args}}
2446
25-# Screenshot the output, gapless (termshot-tight sets lineSpacing 1.0):
26-# `just shot jay.bsky.team hello`. Writes freeqsay.png.
47+# Screenshot the output, gapless: `just shot jay.bsky.team hello`.
2748 shot *args:
2849 termshot -c -C 80 -f freeqsay.png -- nim r -d:ssl --hints:off src/freeqsay.nim {{args}}
2950
3051 # Remove build output and caches.
3152 clean:
32- rm -rf freeqsay tests/test_avatar nimcache tests/nimcache
53+ rm -rf freeqsay freeqsay-static tests/test_avatar nimcache tests/nimcache
@@ -1,5 +1,7 @@
1 # freeqsay recipes. Everything here assumes nim on PATH.1 # freeqsay recipes. Everything here assumes nim on PATH.
2 2
3+bindir := env_var_or_default("PREFIX", env_var("HOME") / ".local/bin")
4+
3 # Show the recipes.5 # Show the recipes.
4 default:6 default:
5 @just --list7 @just --list
@@ -8,12 +10,32 @@ default:
8 build:10 build:
9 nim c -d:release -d:ssl --hints:off -o:freeqsay src/freeqsay.nim11 nim c -d:release -d:ssl --hints:off -o:freeqsay src/freeqsay.nim
10 12
11-# Fully static binary → ./freeqsay-static. No glibc, no dlopen'd OpenSSL, so it13+# Compile a fully static binary → ./freeqsay-static (no glibc, no dlopen'd TLS).
12-# runs on any Linux. tools/nimstatic is a DotSlash file: the first run fetches
13-# the pinned nimstatic build, verifies its hash and caches it.
14 static:14 static:
15+ # tools/nimstatic is a DotSlash file: the first run fetches the pinned
16+ # nimstatic release, verifies its hash and caches it.
15 ./tools/nimstatic src/freeqsay.nim -o freeqsay-static -- -d:ssl17 ./tools/nimstatic src/freeqsay.nim -o freeqsay-static -- -d:ssl
16 18
19+# Install the static binary as `freeqsay` (default ~/.local/bin, or `just install ~/bin`).
20+install dir=bindir: static
21+ #!/usr/bin/env bash
22+ set -euo pipefail
23+ mkdir -p "{{dir}}"
24+ install -m755 freeqsay-static "{{dir}}/freeqsay"
25+ echo "installed {{dir}}/freeqsay"
26+ # An install nobody can run is not an install: say so now rather than let
27+ # it be discovered later.
28+ case ":$PATH:" in
29+ *":{{dir}}:"*) "{{dir}}/freeqsay" did:plc:ewvi7nmzuoqusbcablsm7c4h "on your PATH" ;;
30+ *) echo "note: {{dir}} is not on your PATH. Add to your shell profile:"
31+ echo " export PATH=\"{{dir}}:\$PATH\"" ;;
32+ esac
33+
34+# Remove an installed freeqsay.
35+uninstall dir=bindir:
36+ rm -f "{{dir}}/freeqsay"
37+ @echo "removed {{dir}}/freeqsay"
38+
17 # Run the test suite.39 # Run the test suite.
18 test:40 test:
19 nim c -d:ssl --hints:off -r tests/test_avatar.nim41 nim c -d:ssl --hints:off -r tests/test_avatar.nim
@@ -22,11 +44,10 @@ test:
22 run *args:44 run *args:
23 nim r -d:ssl --hints:off src/freeqsay.nim {{args}}45 nim r -d:ssl --hints:off src/freeqsay.nim {{args}}
24 46
25-# Screenshot the output, gapless (termshot-tight sets lineSpacing 1.0):47+# Screenshot the output, gapless: `just shot jay.bsky.team hello`.
26-# `just shot jay.bsky.team hello`. Writes freeqsay.png.
27 shot *args:48 shot *args:
28 termshot -c -C 80 -f freeqsay.png -- nim r -d:ssl --hints:off src/freeqsay.nim {{args}}49 termshot -c -C 80 -f freeqsay.png -- nim r -d:ssl --hints:off src/freeqsay.nim {{args}}
29 50
30 # Remove build output and caches.51 # Remove build output and caches.
31 clean:52 clean:
32- rm -rf freeqsay tests/test_avatar nimcache tests/nimcache53+ rm -rf freeqsay freeqsay-static tests/test_avatar nimcache tests/nimcache