Files
skaware/skarnet-builder/install-latest-git
T

96 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
set -x
# make version (for skarnet)
make_version=4.1
# skarnet versions
musl_version=1.0.4
# point to make
MAKE_4x=/usr/local/bin/make
# configures /dev/random in order to disable hangs
rm /dev/random
mknod /dev/random c 1 9
# create build dir
mkdir -p /build
# install make
cd /build
curl -R -L -O http://ftp.gnu.org/gnu/make/make-${make_version}.tar.gz
tar xf make-${make_version}.tar.gz
cd make-${make_version}
./configure
make
make install
# install musl
cd /build
curl -R -L -O http://www.musl-libc.org/releases/musl-${musl_version}.tar.gz
tar xf musl-${musl_version}.tar.gz
cd musl-${musl_version}
CFLAGS="-fno-toplevel-reorder -fno-stack-protector" \
./configure \
--prefix=/usr/musl \
--exec-prefix=/usr \
--disable-shared
make
make install
# install skalibs
cd /build
git clone https://github.com/skarnet/skalibs.git
cd skalibs
CC="musl-gcc -static" \
./configure \
--enable-static-libc \
--disable-shared
${MAKE_4x}
${MAKE_4x} install
# install execline
cd /build
git clone https://github.com/skarnet/execline.git
cd execline
CC="musl-gcc -static" \
./configure \
--with-lib=/usr/lib/skalibs \
--enable-static-libc \
--disable-shared
${MAKE_4x}
${MAKE_4x} install
# install s6
cd /build
git clone https://github.com/skarnet/s6.git
cd s6
CC="musl-gcc -static" \
./configure \
--with-lib=/usr/lib/skalibs \
--with-lib=/usr/lib/execline \
--enable-static-libc \
--disable-shared
${MAKE_4x}
${MAKE_4x} install
# install s6-portable-utils
cd /build
git clone https://github.com/skarnet/s6-portable-utils.git
cd s6-portable-utils
CC="musl-gcc -static" \
./configure \
--with-lib=/usr/lib/skalibs \
--enable-static-libc \
--disable-shared
${MAKE_4x}
${MAKE_4x} install