Skip to content

Commit

Permalink
feat: add tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
cktii committed Aug 28, 2024
1 parent e932328 commit 82ac4ac
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 5 deletions.
10 changes: 5 additions & 5 deletions procps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ trap 'handle_err $LINENO' ERR
# -- EDIT BELOW THIS LINE --

# Configuration
export NCURSES_VERSION="6.5"
export NCURSES_URL="https://ftp.gnu.org/gnu/ncurses/ncurses-${NCURSES_VERSION}.tar.gz"
export PROCPS_REPO="https://gitlab.com/procps-ng/procps.git"
export EXPECTED_BINARIES="free hugetop pgrep vmstat watch sysctl slabtop pwdx pkill pmap pidwait pidof kill ps/pscommand top/top"
NCURSES_VERSION="6.5"
NCURSES_URL="https://ftp.gnu.org/gnu/ncurses/ncurses-${NCURSES_VERSION}.tar.gz"
PROCPS_REPO="https://gitlab.com/procps-ng/procps.git"
EXPECTED_BINARIES="free hugetop pgrep vmstat watch sysctl slabtop pwdx pkill pmap pidwait pidof kill ps/pscommand top/top"

build_libncurses() {
. fetch_archive $NCURSES_URL
Expand All @@ -28,7 +28,7 @@ build_libncurses() {
--disable-db-install \
--enable-widec
make -j"$(/bin/get_cores)"
make install || true
make install
}

build_procps() {
Expand Down
10 changes: 10 additions & 0 deletions tmux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM aarch64_musl_cross:v1.0

# Copy the build script into the container
COPY build.sh /build/

# Make the build script executable
RUN chmod +x /build/build.sh

# Set the entrypoint to the build script
ENTRYPOINT ["/build/build.sh"]
67 changes: 67 additions & 0 deletions tmux/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
set -euo pipefail
trap 'handle_err $LINENO' ERR
. wrunf

# -- EDIT BELOW THIS LINE --

# Configuration
NCURSES_VERSION="6.5"
NCURSES_URL="https://ftp.gnu.org/gnu/ncurses/ncurses-${NCURSES_VERSION}.tar.gz"
LIBEVENT_REPO="https://github.com/libevent/libevent.git"
TMUX_REPO="https://github.com/tmux/tmux.git"

build_libevent() {
. fetch_repo $LIBEVENT_REPO

./autogen.sh
./configure --prefix="$STATIC_LIBS_PATH" \
--host="$HOST"

make -j"$(/bin/get_cores)"
make install
}

build_libncurses() {
. fetch_archive $NCURSES_URL

./configure --prefix="$STATIC_LIBS_PATH" \
--host="$HOST" \
--without-ada \
--without-cxx \
--without-cxx-binding \
--without-manpages \
--without-progs \
--disable-tic-depends \
--without-tests \
--disable-stripping \
--with-terminfo-dirs="/etc/terminfo:/lib/terminfo:/usr/share/terminfo" \
--disable-db-install \
--enable-widec
make -j"$(/bin/get_cores)"
make install
}

build_tmux() {
. fetch_repo $TMUX_REPO

./autogen.sh
CFLAGS="-static -s -I$STATIC_LIBS_PATH/include" \
LDFLAGS="-static -s -L$STATIC_LIBS_PATH/lib" \
LIBNCURSES_CFLAGS="-I$STATIC_LIBS_PATH/include/ncursesw" \
LIBNCURSES_LIBS="-L$STATIC_LIBS_PATH/lib -lncursesw" \
./configure \
--enable-static \
--host="$HOST"

make -j"$(/bin/get_cores)"
}

log "Starting tmux build process..."
log "Building libevent dep..."
wrunf build_libevent
log "Building libncurses-dev dep..."
wrunf build_libncurses
log "Building tmux"
wrunf build_tmux
verify_build tmux

0 comments on commit 82ac4ac

Please sign in to comment.