Skip to content

Instantly share code, notes, and snippets.

@eggplants
Last active January 15, 2023 17:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eggplants/5b9f844e2bc220160b2f24577739eba6 to your computer and use it in GitHub Desktop.
Save eggplants/5b9f844e2bc220160b2f24577739eba6 to your computer and use it in GitHub Desktop.
build sl-h (patched sl, created by: jsdfq43wtr)
#!/usr/bin/env bash
# built binaries: https://github.com/eggplants/sl-h_binary
set -euo pipefail
set -x
# Ubuntu: apt update && apt install build-essential curl libncurses5-dev -y
# Mac: brew update && brew install curl gcc ncurses make
if ! command -v curl gcc make &> /dev/null; then
echo "require: build-essential curl libncurses5-dev" >&2
exit 1
elif command -v brew &> /dev/null && brew list | grep -q ncurses; then
echo "require: ncurses" >&2
exit 1
elif ! [ -f /usr/include/ncurses.h ]; then
echo "require: ncurses" >&2
exit 1
fi
# sl (2.02)
curl -Lo sl.tar 'https://web.archive.org/web/20070220170601if_/http://www.tkl.iis.u-tokyo.ac.jp:80/~toyoda/sl/sl.tar'
tar xopf sl.tar
(
cd sl
# sl-h (sl5-1.patch)
curl -Lo sl5-1.patch 'https://web.archive.org/web/20090316133609/http://www.izumix.org.uk:80/sl/sl5-1.patch'
patch -p1 < sl5-1.patch
sed s_ncurses/__ sl.c > _
mv _ sl.c
make && mv sl ../sl-h
)
rm -rf sl sl.tar
echo "done! Try: ./sl-h"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment