| freeqsay: Nim port of the Clojure implementation fa53aa2 nandi 21h ago | 1 | # freeqsay recipes. Everything here assumes nim on PATH. |
| 2 | |
| just install: put the static binary on PATH b248dcf nandi 12h ago | 3 | bindir := env_var_or_default("PREFIX", env_var("HOME") / ".local/bin") |
| 4 | |
| freeqsay: Nim port of the Clojure implementation fa53aa2 nandi 21h ago | 5 | # Show the recipes. |
| 6 | default: |
| 7 | @just --list |
| 8 | |
| 9 | # Compile the standalone binary (optimized). |
| 10 | build: |
| 11 | nim c -d:release -d:ssl --hints:off -o:freeqsay src/freeqsay.nim |
| 12 | |
| just install: put the static binary on PATH b248dcf nandi 12h ago | 13 | # Compile a fully static binary → ./freeqsay-static (no glibc, no dlopen'd TLS). |
| just static: fully static builds through a pinned nimstatic 078b24d nandi 18h ago | 14 | static: |
| just install: put the static binary on PATH b248dcf nandi 12h ago | 15 | # tools/nimstatic is a DotSlash file: the first run fetches the pinned |
| 16 | # nimstatic release, verifies its hash and caches it. |
| just static: fully static builds through a pinned nimstatic 078b24d nandi 18h ago | 17 | ./tools/nimstatic src/freeqsay.nim -o freeqsay-static -- -d:ssl |
| 18 | |
| just install: put the static binary on PATH b248dcf nandi 12h ago | 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 | |
| freeqsay: Nim port of the Clojure implementation fa53aa2 nandi 21h ago | 39 | # Run the test suite. |
| 40 | test: |
| 41 | nim c -d:ssl --hints:off -r tests/test_avatar.nim |
| 42 | |
| 43 | # Run from source, without an optimized build: `just run jay.bsky.team hello`. |
| 44 | run *args: |
| 45 | nim r -d:ssl --hints:off src/freeqsay.nim {{args}} |
| 46 | |
| just install: put the static binary on PATH b248dcf nandi 12h ago | 47 | # Screenshot the output, gapless: `just shot jay.bsky.team hello`. |
| freeqsay: Nim port of the Clojure implementation fa53aa2 nandi 21h ago | 48 | shot *args: |
| 49 | termshot -c -C 80 -f freeqsay.png -- nim r -d:ssl --hints:off src/freeqsay.nim {{args}} |
| 50 | |
| 51 | # Remove build output and caches. |
| 52 | clean: |
| just install: put the static binary on PATH b248dcf nandi 12h ago | 53 | rm -rf freeqsay freeqsay-static tests/test_avatar nimcache tests/nimcache |