Skip to content

Commit

Permalink
simplify and clean (#18)
Browse files Browse the repository at this point in the history
* simplify and clean build process
* use Ubuntu 16.04 as base for compatibility with more systems.
  • Loading branch information
nelsonenzo authored Jan 14, 2022
1 parent 00eefe6 commit 0e0e9ce
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 208 deletions.
74 changes: 0 additions & 74 deletions .drone.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
opt/releases/*
localnotes/*
dronesecrets.txt
.terraform
terraform/notes.md
terraform.tfstate
Expand Down
File renamed without changes.
51 changes: 32 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:18.04 as builder
FROM ubuntu:16.04 as builder
## docker build . -t tmux --build-arg TMUX_RELEASE_TAG=3.2a
RUN apt-get update && apt-get install -y \
pkg-config automake autoconf libtool libssl-dev bison byacc \
curl imagemagick git vim
Expand All @@ -9,26 +10,38 @@ RUN curl -OL https://github.com/linuxdeploy/linuxdeploy/releases/download/contin
&& ./linuxdeploy-x86_64.AppImage --appimage-extract \
&& ln -nfs /squashfs-root/usr/bin/linuxdeploy /usr/bin/linuxdeploy

WORKDIR /opt
ENV BUILD_DIR=/opt/build
ENV REPO_ROOT=/opt/tmux
RUN mkdir -p $BUILD_DIR
## Use --build-arg tmux_release_tag=3.2a to use a specific release version
ARG tmux_release_tag=master
ENV RELEASE_TAG=$tmux_release_tag
RUN git clone -b $RELEASE_TAG --depth 1 https://github.com/tmux/tmux.git
WORKDIR $REPO_ROOT

## Tmux dependencies libevent and ncurses.
ADD opt/pipeline /opt/pipeline
RUN /opt/pipeline/1_install_libevent.sh
RUN /opt/pipeline/2_install_ncurses.sh
ENV BUILD_DIR=/opt/build
RUN mkdir -p $BUILD_DIR/AppDir/usr

# libevent
WORKDIR $BUILD_DIR
RUN git clone https://github.com/libevent/libevent --depth 1 -b release-2.1.12-stable && \
cd libevent && \
sh autogen.sh && \
./configure --prefix="$BUILD_DIR/AppDir/usr" --enable-shared && \
make -j4 && \
make install

## ncurses
WORKDIR $BUILD_DIR
RUN curl -OL https://invisible-island.net/datafiles/release/ncurses.tar.gz && \
tar -xf ncurses.tar.gz && \
NCURSES_DIR="$PWD/ncurses-6.3" && \
cd "$NCURSES_DIR" && \
./configure --with-shared --prefix="$BUILD_DIR/AppDir/usr" --without-normal --without-debug && \
make -j4 && \
make install

FROM builder as appimage
ARG TMUX_RELEASE_TAG='master'
## Fetch Tmux Code
WORKDIR /opt
RUN git clone -b $TMUX_RELEASE_TAG --depth 1 https://github.com/tmux/tmux.git
ENV REPO_ROOT=/opt/tmux

## Tmux itself
WORKDIR /opt/tmux
## Build Tmux itself
WORKDIR $REPO_ROOT
ENV LD_LIBRARY_PATH="$BUILD_DIR/AppDir/usr/lib"
RUN sh autogen.sh
ENV CPPFLAGS="-I$BUILD_DIR/AppDir/usr/include -I$BUILD_DIR/AppDir/usr/include/ncurses"
Expand All @@ -37,10 +50,10 @@ ENV PKG_CONFIG_PATH=$BUILD_DIR/AppDir/usr/lib/pkgconfig
RUN ./configure --prefix="$BUILD_DIR/AppDir/usr"
RUN make -j4 && make install

## Appimage
ADD opt/AppRun $BUILD_DIR/AppDir/AppRun
## Create Appimage
ADD AppRun $BUILD_DIR/AppDir/AppRun
RUN chmod 755 $BUILD_DIR/AppDir/AppRun
ADD opt/tmux.desktop $BUILD_DIR/AppDir/tmux.desktop
ADD tmux.desktop $BUILD_DIR/AppDir/tmux.desktop
RUN convert "$REPO_ROOT/logo/favicon.ico" "$REPO_ROOT/logo/favicon.png" && \
cp "$REPO_ROOT/logo/favicon-1.png" "$BUILD_DIR/AppDir/favicon.png"

Expand Down
36 changes: 0 additions & 36 deletions Jenkinsfile

This file was deleted.

53 changes: 30 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,57 @@
# Tmux AppImage

One-liner to get the latest tmux.appimage build:
```
curl -s https://api.github.com/repos/nelsonenzo/tmux-appimage/releases/latest \
| grep "browser_download_url.*appimage" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi - \
&& chmod +x tmux.appimage
## optionaly, move it into your $PATH
mv tmux.appimage /usr/local/bin/tmux
tmux
```
### What is this?
Dockerfile to create an AppImage of tmux.
A Docker build of Tmux Appimage

### Why use Docker?
The advantages to doing it this way are:
The advantages of using docker:
- Obtain consistent build results on any computer.
- No need to install a slew of build packages on your own machine.
- You can trust the tmux developers code, not some rando's AppImage distribution on the interwebz :p

### How do build it?
### Build it yourself from source code
I assume you have docker installed already.
```
## clone me
#### clone me & change directory
git clone https://github.com/nelsonenzo/tmux-appimage.git
## change directory
cd tmux-appimage
## compile tmux from source by building container
#### Set the desired tmux release tag and build
export TMUX_RELEASE_TAG=3.2a
docker build . -t tmux --build-arg TMUX_RELEASE_TAG=$TMUX_RELEASE_TAG
docker build . -t tmux --build-arg tmux_release_tag=$TMUX_RELEASE_TAG
## extract the appimage file
#### extract the appimage file
docker create -ti --name tmuxcontainer tmux bash
docker cp tmuxcontainer:/opt/build/tmux.appimage .
docker rm -f tmuxcontainer
```


## To use AppImage
move appimage to executable location in your $PATH
```
mv tmux.appimage /usr/local/bin/tmux
tmux
ls -al tmux.appimage
```

### Where has the AppImage been tested to turn?
It has been tested on these fine Linux platforms and will likely work for anything newer than centos 6.9 (which is a few years old now.) Please file an issue if you find otherwise or need support on a different platform.
```
ubuntu 18
centos 6.9
centos 7.6
fedora 31
ubuntu 18.04
ubuntu 16.04
manjaro 19.02
centos 7
centos 8
fedora 33
```
The distributed build will not work on old os's (like Centos 6), since they have older glibc libraries.
If you need it to work on those systems, try modifying the Dockerfile to use an older ubuntu as the base image and doing a docker build.

### What is the sauce that makes this work?
The [Dockerfile](Dockerfile) contains all the magic ingredients to compile tmux.
Expand Down
8 changes: 0 additions & 8 deletions github.json

This file was deleted.

13 changes: 0 additions & 13 deletions opt/build.sh

This file was deleted.

18 changes: 0 additions & 18 deletions opt/pipeline/1_install_libevent.sh

This file was deleted.

15 changes: 0 additions & 15 deletions opt/pipeline/2_install_ncurses.sh

This file was deleted.

Binary file removed opt/tmux-logo-square.png
Binary file not shown.
File renamed without changes.

0 comments on commit 0e0e9ce

Please sign in to comment.