mirror of
https://github.com/wahyd4/skaware.git
synced 2026-08-09 04:35:57 +10:00
133 lines
3.5 KiB
Bash
Executable File
133 lines
3.5 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 \
|
|
--prefix=$HOME/usr \
|
|
--enable-static-libc \
|
|
--disable-shared
|
|
|
|
# replace SKALIBS_ETC to "/etc"
|
|
sed -i '/.*SKALIBS_ETC.*/c\#define SKALIBS_ETC \"\/etc\"' src/include/skalibs/config.h
|
|
|
|
${MAKE_4x}
|
|
${MAKE_4x} install
|
|
|
|
# install execline
|
|
cd /build
|
|
git clone https://github.com/skarnet/execline.git
|
|
cd execline
|
|
|
|
CC="musl-gcc -static" \
|
|
./configure \
|
|
--prefix=$HOME/usr \
|
|
--exec-prefix=$HOME/dist/execline/usr \
|
|
--with-include=$HOME/usr/include \
|
|
--with-lib=$HOME/usr/lib/skalibs \
|
|
--enable-static-libc \
|
|
--disable-shared
|
|
${MAKE_4x}
|
|
${MAKE_4x} install
|
|
|
|
tar \
|
|
-zcvf $HOME/dist/execline-latest-linux-amd64.tar.gz \
|
|
-C $HOME/dist/execline \
|
|
./
|
|
|
|
# install s6
|
|
cd /build
|
|
git clone https://github.com/skarnet/s6.git
|
|
cd s6
|
|
|
|
CC="musl-gcc -static" \
|
|
./configure \
|
|
--prefix=$HOME/usr \
|
|
--exec-prefix=$HOME/dist/s6/usr \
|
|
--with-include=$HOME/usr/include \
|
|
--with-lib=$HOME/usr/lib/skalibs \
|
|
--with-lib=$HOME/usr/lib/execline \
|
|
--enable-static-libc \
|
|
--disable-shared
|
|
${MAKE_4x}
|
|
${MAKE_4x} install
|
|
|
|
mkdir -p $HOME/dist/s6/etc
|
|
install -D -m644 $HOME/usr/etc/* $HOME/dist/s6/etc/
|
|
|
|
tar \
|
|
-zcvf $HOME/dist/s6-latest-linux-amd64.tar.gz \
|
|
-C $HOME/dist/s6 \
|
|
./
|
|
|
|
# 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 \
|
|
--prefix=$HOME/usr \
|
|
--exec-prefix=$HOME/dist/s6-portable-utils/usr \
|
|
--with-include=$HOME/usr/include \
|
|
--with-lib=$HOME/usr/lib/skalibs \
|
|
--enable-static-libc \
|
|
--disable-shared
|
|
${MAKE_4x}
|
|
${MAKE_4x} install
|
|
|
|
tar \
|
|
-zcvf $HOME/dist/s6-portable-utils-latest-linux-amd64.tar.gz \
|
|
-C $HOME/dist/s6-portable-utils \
|
|
./
|
|
|
|
# copy results
|
|
cp $HOME/dist/execline-latest-linux-amd64.tar.gz /dist
|
|
cp $HOME/dist/s6-latest-linux-amd64.tar.gz /dist
|
|
cp $HOME/dist/s6-portable-utils-latest-linux-amd64.tar.gz /dist
|