aboutsummaryrefslogtreecommitdiff
path: root/muslbuild/tmux
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-09-26 10:48:02 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2021-09-26 10:48:02 -0400
commit06fd4a903b11d06c66c51207883b0b8f1d4f2fb7 (patch)
tree1d20efad6386edf655b4afaa3d98cdc2ef451092 /muslbuild/tmux
parent03976ecac8e5b062936f692f45768da512d89421 (diff)
downloaddotfiles-06fd4a903b11d06c66c51207883b0b8f1d4f2fb7.tar.gz
dotfiles-06fd4a903b11d06c66c51207883b0b8f1d4f2fb7.tar.xz
Add muslbuild, a small set of shell scripts to statically build a few things against musl libc
Diffstat (limited to 'muslbuild/tmux')
-rwxr-xr-xmuslbuild/tmux36
1 files changed, 36 insertions, 0 deletions
diff --git a/muslbuild/tmux b/muslbuild/tmux
new file mode 100755
index 0000000..f160062
--- /dev/null
+++ b/muslbuild/tmux
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -e
+set -x
+relver="3.2a"
+build_dir="/v/muslbuild/tmux"
+
+PREFIX="$HOME/musl"
+export CC="musl-gcc -static -I. -I$PREFIX/include/ncursesw -DHAVE_FORKPTY=1 -DHAVE_FDFORKPTY=1"
+
+if ! [ -d "$build_dir" ] ; then
+ mkdir -p "$build_dir"
+fi
+cd "$build_dir"
+
+arLoc="https://github.com/tmux/tmux/releases/download/%s/tmux-%s.tar.gz"
+arLoc="$(printf "$arLoc\n" "$relver" "$relver")"
+arFn="tmux-${relver}.tar.gz"
+
+checksum=551553a4f82beaa8dadc9256800bcc284d7c000081e47aa6ecbb6ff36eacd05f
+
+if ! [ -e "$arFn" ] ; then
+ curl -L -o "$arFn" "$arLoc"
+fi
+
+echo "${checksum} $arFn" | sha256sum -c
+
+tar xzvf "$arFn"
+cd "tmux-${relver}"
+./configure --prefix="$PREFIX" --bindir="$HOME/bin" \
+ --enable-static \
+ --host=x86_64-alpine-linux-musl \
+ --build=x86_64-alpine-linux-musl
+make clean
+make -j$(nproc)
+make install -j$(nproc)
+