Building a static binary for Telescope

A few days ago, a BBS user asked for pre-built binaries for the Telescope Gemini client, presumably for x86 Linux distributions:

=> BBS thread asking for a x86 Telescope binary

According to the project capsule, Telescope has few dependencies, namely:

=> Gemini capsule for the Telescope project

Therefore, I felt challenged to provide a static x86 binary that would literally work on any Linux distribution. So I made use of my existing project, spm-packages:

=> spm-packages project

spm-packages collects a bunch of Dockerfiles based on Alpine Linux (and, therefore, using musl as their libc) that can be thought as some sort of software packaging system. Of course, such Dockerfiles are not meant for end users, but only as a way for packages to define automated builds.

Projects can include their dependencies by dumping their prefix into /usr/local, via COPY. For example:

COPY --from=libopenssl:3.1.1-minimal /opt/spm/openssl-3.1.1/ /usr/local/

Then, it is expected to "docker cp" the final, stripped executable from the container to the host system, so it can be redistributed.

This method was used to distribute multi-arch (x86, x86_64, armv7l and aarch64) static Linux binaries for slcl:

=> slcl 0.1.0 release

So I used the same method for Telescope, with the resulting static binaries:

=> telescope-0.8.1 for linux-amd64 | telescope-0.8.1 for linux-x86

aarch64 and armv7l binaries should be easy to provide, too.

Because of limitations (see section below), the following error message shall appear (xterm-256color is my configured $TERM, so YMMV):

Error opening terminal: xterm-256color.

The terminal database is not accessible to Telescope, as it expects it on the prefix used to build Ncurses (namely, /opt/spm/libncurses-6.3). Therefore, execute the following command before running Telescope for the first time:

$ ln -s /usr/share/terminfo $HOME/.terminfo

xterm-256color might not be available on your system's terminal database, so set TERM explicitly to any other terminal name found in $HOME/.terminfo. xterm-xi seems to work well enough:

TERM=xterm-xi ./telescope-0.8.1-linux-x86

Now, Telescope should work. Enjoy!

Safety note

The binaries above were built using the steps exactly as described on the relevant Dockerfiles from the spm-packages project, which you are encouraged to read and improve. However, if you do not trust running random binaries from a random Gemini guy, remember to set up a proper sandbox environment beforehand e.g.: via firejail, chroot, Docker, etc.

Limitations

=> libfswrap, a C99 library that remaps standard I/O functions to in-memory buffers | fswrap, a code generator for libfswrap

=> Contact me | Back to main page

Proxy Information
Original URL
gemini://xavi.privatedns.org/telescope-static-binary.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
1188.465713 milliseconds
Gemini-to-HTML Time
3.571597 milliseconds

This content has been proxied by September (3851b).