#!/bin/sh -e HERE="$(dirname $(readlink -f ${0}))"; DEST=/usr/local; git config --global http.sslCAInfo "${CURL_CA_BUNDLE}"; mkdir -p "${DEST}"; cd "${DEST}"; # this directory will already exist if correct ## # musl # # This provides the dynamic loader for the foreign (target) arch # so that we do not have to force building static musl binaries. # nmus=musl; vmus=1.2.3; test ! -f ._${nmus}-${vmus} && \ ( test ! -d ${nmus}-${vmus} \ && curl -sL https://musl.libc.org/releases/${nmus}-${vmus}.tar.gz \ | tar -xzf - \ ; cd ${nmus}-${vmus}; rm -fr x; mkdir x; cd x; ../configure \ --prefix=/usr \ --enable-static \ --enable-shared \ ; make -j$(nproc); make install; ) touch ._${nmus}-${vmus}; rm -fr ${nmus}-${vmus}; ## # OpenSSL # nssl=openssl; #vssl=1.1.1v; vssl=1.1.1w; test ! -f ._${nssl}-${vssl} && \ ( #https://www.openssl.org/source/${nssl}-${vssl}.tar.gz temp=https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz; test ! -d ${nssl}-${vssl} \ && curl -sL ${temp} \ | tar -xzf - \ ; cd ${nssl}-${vssl}; rm -fr x; mkdir x; cd x; ../Configure cc \ --prefix="${DEST}" \ --openssldir="${DEST}" \ no-shared \ ; make -j$(nproc); make install_sw install_ssldirs; ) touch ._${nssl}-${vssl}; rm -fr ${nssl}-${vssl}; ## # zlib # nzlb=zlib; vzlb=1.3.1; test ! -f ._${nzlb}-${vzlb} && \ ( test ! -d ${nzlb}-${vzlb} \ && curl -sL https://www.zlib.net/${nzlb}-${vzlb}.tar.gz \ | tar -xzf - \ ; cd ${nzlb}-${vzlb}; rm -fr x; mkdir x; cd x; ../configure \ --prefix="${DEST}" \ --static \ ; make -j$(nproc); make install; ) touch ._${nzlb}-${vzlb}; rm -fr ${nzlb}-${vzlb}; ## # abuild # nbld=abuild; vbld=f75ebd1953f6e41416b5037c4049b55b9a21a1ea; test ! -f ._${nbld}-${vbld} && \ ( test ! -d ${nbld}-${vbld} \ && git clone https://git.adelielinux.org/adelie/${nbld}.git ${nbld}-${vbld} \ ; cd abuild-${vbld}; git checkout ${vbld}; while read k; do curl -sL ${k} | patch -p1 || true; done < ${f} "#include "; cat libfakeroot.c >> ${f}; mv ${f} libfakeroot.c; rm -fr x; mkdir x; cd x; CFLAGS="-static -D_STAT_VER=0 $CFLAGS" \ ../configure \ --prefix="${DEST}" \ --host="$(${CC} -dumpmachine)" \ ; sed -i Makefile \ -e '/^SUBDIRS =/ s/doc//g' \ ; make -j$(nproc) install; ) touch ._${nfrt}-${vfrt}; rm -fr ${nfrt}-${vfrt}; ## # attr # natt=attr; vatt=2979615e71fb53b3f2f9085eea516d4e2b3174ea; test ! -f ._${natt}-${vatt} && ( test ! -d ${natt}-${vatt} \ && git clone https://git.savannah.nongnu.org/git/${natt}.git ${natt}-${vatt} \ ; cd ${natt}-${vatt}; git checkout ${vatt}; ./autogen.sh; CFLAGS="-static" \ ./configure \ --prefix="${DEST}" \ --host="$(${CC} -dumpmachine)" \ --enable-static \ --disable-shared \ ; make -j$(nproc) install; ) touch ._${natt}-${vatt}; rm -fr ${natt}-${vatt};