stargazing/notwa-util/cosmo-muon9

28 lines
869 B
Plaintext
Executable File

#!/usr/bin/false
if [ ! -e /cosmo-muon.done ]; then
: \
&& export CC=cosmocc CFLAGS="-Os -g -fdiagnostics-color=always" \
&& acquire from=sourcehut repo=lattis/muon dest=/root/muon env=MUON \
\
&& cd /root/muon \
&& ./bootstrap.sh build \
\
&& shed src/platform/posix/rpath_fixer.c \
'/\bcase ELFCLASS32:/,/\bbreak;/d' \
's@.*Elf32.*@/* & */@' \
&& echo >subprojects/bestline/bestline.c \
&& printf '%s\n' >subprojects/bestline/bestline.h \
'#include "third_party/linenoise/linenoise.h"' \
'#define bestlineHistoryAdd linenoiseHistoryAdd' \
'#define bestlineHistoryFree linenoiseHistoryFree' \
'#define bestlineWithHistory linenoiseWithHistory' \
\
&& build/muon setup -Dstatic=true build \
&& ninja -j2 -C build \
&& cd build \
&& mv muon muon.com.dbg \
&& objcopy -S -O binary muon.com.dbg muon.com \
&& touch /cosmo-muon.done \
|| exit $?
fi