galeb

Једноставна статичка дистрибуција заснована на musl-у
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 1466d3538fc39024ea60163afa67b9905343e940
родитељ b0e9f35e9acc3879c93dcb263b1e203a6133e015
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Fri,  8 Jul 2022 23:31:11 +0200

Chroot up to expat

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
M01-cross.sh | 68++++++++++++++++++++++++++++++++++++++------------------------------
M02-prep-chroot.sh | 8++++----
M03-chroot.sh | 770++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
MTODO | 7+++++--
Mlib/env.sh | 6++++--
Mlib/fun.sh | 32+++++++++++++++++++++++++++-----
измењених датотека: 6, додавања: 824(+), брисања: 67(-)

diff --git a/01-cross.sh b/01-cross.sh @@ -23,6 +23,7 @@ substep=1 check_dir ${CT} check_dir ${G_FIL} +check_dir ${G_LGL} check_dir ${G_PAT} check_dir ${G_PKG} check_dir ${G_SRC} @@ -30,7 +31,7 @@ check_dir ${G_SRC} msg info "Setup root structure" check_dir ${GR}/bin remove_file ${GR}/sbin -link_if_ne ../bin ${GR}/sbin +link_if_ne bin ${GR}/sbin check_dir ${GR}/include check_dir ${GR}/share check_dir ${GR}/sucks/bin @@ -830,6 +831,25 @@ else fi end_substep +begin_substep grep-3.7 +if [ -x ${TL}/bin/fgrep ]; then + msg info "%s exists, skipping %s" ${TL}/bin/fgrep ${pkg} +else + fetch_pkg https://ftp.gnu.org/gnu/${pkg%%-*}/${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + run_configure . \ + --prefix=/${TLD} \ + --build=${G_HOST} \ + --host=${G_TARGET} + run_make ${JN} + run_make install + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + begin_substep gzip-1.12 if [ -x ${TL}/bin/gzip ]; then msg info "%s exists, skipping %s" ${TL}/bin/gzip ${pkg} @@ -983,34 +1003,6 @@ else fi end_substep -begin_substep tinycc -if [ -x ${TL}/bin/tcc ]; then - msg info "%s exists, skipping %s" ${TL}/bin/tcc ${pkg} -else - git_clone tinycc git://repo.or.cz/tinycc.git - ( - cd_or_fail ${G_SRC}/${pkg} - CFLAGS='-static --static -fcommon' - LDFLAGS='-static --static -fcommon' - export CFLAGS LDFLAGS - run_configure . \ - --prefix=/${TLD} \ - --bindir=/${TLD}/bin \ - --libdir=/${TLD}/lib \ - --tccdir=/${TLD}/lib/tcc \ - --includedir=/${TLD}/include \ - --sharedir=/${TLD}/share \ - --config-musl \ - --sysincludepaths=/${TLD}/include \ - --crtprefix=/${TLD}/lib \ - --libpaths=/${TLD}/lib:/lib - run_make - run_make install - unset CFLAGS LDFLAGS - ) || exit 1 -fi -end_substep - begin_substep coreutils-9.1 if [ -x ${TL}/bin/ls ]; then msg info "%s exists, skipping %s" ${TL}/bin/ls ${pkg} @@ -1266,9 +1258,25 @@ git_clone 9base-20220706 git://git.suckless.org/9base fetch_pkg https://libisl.sourceforge.io/isl-0.24.tar.xz libisl-0.24.tar.xz fetch_pkg https://github.com/shadow-maint/shadow/releases/download/v4.11.1/\ shadow-4.11.1.tar.xz +git_clone tinycc-20220708 git://repo.or.cz/tinycc.git fetch_pkg https://github.com/facebook/zstd/releases/download/v1.5.0/\ zstd-1.5.0.tar.gz - +fetch_pkg https://download.savannah.gnu.org/releases/attr/attr-2.5.1.tar.gz +fetch_pkg https://download.savannah.gnu.org/releases/acl/acl-2.3.1.tar.xz +fetch_pkg https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/\ +libcap-2.62.tar.xz +fetch_pkg https://sourceforge.net/projects/psmisc/files/psmisc/psmisc-23.4.tar.xz +fetch_pkg https://github.com/Mic92/iana-etc/releases/download/20210611/\ +iana-etc-20210611.tar.gz +fetch_pkg https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz +fetch_pkg https://dev.gentoo.org/~xen0n/distfiles/pax-utils-1.3.4.tar.xz +fetch_pkg https://www.greenwoodsoftware.com/less/less-590.tar.gz +fetch_pkg https://ftp.gnu.org/gnu/gdbm/gdbm-1.20.tar.gz +fetch_pkg https://ftp.gnu.org/gnu/gperf/gperf-3.1.tar.gz +fetch_pkg https://prdownloads.sourceforge.net/expat/expat-2.4.8.tar.xz + +fetch_pkg https://mandoc.bsd.lv/snapshots/mdocml-1.14.1.tar.gz +fetch_pkg https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz fetch_pkg https://ftp.gnu.org/gnu/texinfo/texinfo-6.8.tar.xz fetch_pkg https://distfiles.dereferenced.org/pkgconf/pkgconf-1.8.0.tar.xz fetch_pkg https://github.com/ericonr/argp-standalone/archive/refs/tags/\ diff --git a/02-prep-chroot.sh b/02-prep-chroot.sh @@ -137,10 +137,10 @@ fi link_if_ne /${TLD}/bin/lksh ${GR}/bin/sh link_if_ne /${TLD}/bin/bash ${GR}/bin/bash cp_or_fail ${WD}/03-chroot.sh ${GR}/bin/ -check_dir ${GR}/galeb -cp_or_fail ${WD}/lib/env.sh ${GR}/galeb/env.sh -/bin/sed -i 's,^\(GR=\).*,\1,' ${GR}/galeb/env.sh -cp_or_fail ${WD}/lib/fun.sh ${GR}/galeb/fun.sh +check_dir ${G_LIB} +cp_or_fail ${WD}/lib/env.sh ${G_LIB}/env.sh +/bin/sed -i 's,^\(GR=\).*,\1,' ${G_LIB}/env.sh +cp_or_fail ${WD}/lib/fun.sh ${G_LIB}/fun.sh msg warn "Next run 03-chroot.sh" msg query "Run as root [y/N]?" diff --git a/03-chroot.sh b/03-chroot.sh @@ -1,5 +1,5 @@ -. /galeb/env.sh -. /galeb/fun.sh +. /src/lib/env.sh +. /src/lib/fun.sh trap exit_cleanup HUP PIPE INT QUIT TERM EXIT @@ -172,7 +172,7 @@ mkpk_install() ( CC=${G_TARGET}-gcc CXX=${G_TARGET}-g++ - CFLAGS='-O3 -march=native' + CFLAGS='-O3 -march=native -mtune=native -pipe' export CC CXX CFLAGS DESTDIR=../build @@ -265,7 +265,7 @@ mkpk_name() mkpk_install() { - CFLAGS='-O3 -march=native' + CFLAGS='-O3 -march=native -mtune=native -pipe' export CFLAGS ./configure --prefix=/ \\ --libdir=/lib \\ @@ -305,7 +305,7 @@ mkpk_install() { ./configure --prefix=/ \\ --enable-static \\ - CFLAGS='-O3 -march=native -static --static -fcommon' \\ + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' \\ LDFLAGS='-static --static -fcommon' make ${JN} make DESTDIR=/build install-strip @@ -344,7 +344,7 @@ mkpk_install() ./configure --prefix=/sucks \\ --disable-static \\ --docdir=/sucks/share/doc/readline-8.1 \\ - CFLAGS='-O3 -march=native' + CFLAGS='-O3 -march=native -mtune=native -pipe' make ${JN} SHLIB_LIBS='-L/tools/lib -lncursesw' make SHLIB_LIBS='-L/tools/lib -lncursesw' DESTDIR=/build install } @@ -380,7 +380,7 @@ mkpk_name() mkpk_install() { ./configure --prefix=/sucks \\ - CFLAGS='-O3 -march=native' + CFLAGS='-O3 -march=native -mtune=native -pipe' make ${JN} make DESTDIR=/build install-strip } @@ -416,18 +416,18 @@ mkpk_install() --sysconfdir=/etc \\ --localstatedir=/var \\ --with-pkg-config-dir=/lib/pkgconfig:/share/pkgconfig:\\ -/opt/qt5/lib/pkgconfig +/sucks/lib/pkgconfig:/sucks/share/pkgconfig:/opt/qt5/lib/pkgconfig make ${JN} make DESTDIR=/build install - mkdir -p /build/bin + mkdir -pv ../build/bin - ln -s pkgconf /build/bin/${G_TARGET}-pkg-config - ln -s pkgconf /build/bin/pkg-config + ln -sv pkgconf ../build/bin/${G_TARGET}-pkg-config + ln -sv pkgconf ../build/bin/pkg-config - mkdir -p /build/share/man/man1 + mkdir -pv ../build/share/man/man1 - ln -s pkgconf.1 /build/share/man/man1/pkg-config.1 + ln -sv pkgconf.1 ../build/share/man/man1/pkg-config.1 } ! mkpk ${pkg} @@ -466,7 +466,7 @@ mkpk_install() timezones='africa antarctica asia australasia europe northamerica'\\ ' southamerica etcetera backward factory' make DESTDIR=../build prefix= \\ - CFLAGS='-O3 -march=native -static -fcommon -DHAVE_STDINT_H=1' \\ + CFLAGS='-O3 -march=native -mtune=native -pipe -static -fcommon -DHAVE_STDINT_H=1' \\ LDFLAGS='-static -fcommon' \\ TZDIR=/share/zoneinfo make -C posixtz-0.5 posixtz @@ -567,7 +567,7 @@ mkpk_name() mkpk_install() { - CFLAGS='-O3 -march=native' + CFLAGS='-O3 -march=native -mtune=native -pipe' DESTDIR=/build EXTRA_CONFIG=' --enable-targets=x86_64-pep ' export CFLAGS DESTDIR EXTRA_CONFIG @@ -801,7 +801,7 @@ mkpk_name() mkpk_install() { - CFLAGS='-O3 -march=native -static --static -fcommon '\ + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon '\ '-DENCRYPTMETHOD_SELECT' LDFLAGS='-static --static -fcommon' DESTDIR=/build @@ -872,8 +872,8 @@ mkpk_name() mkpk_install() { - CFLAGS='-O3 -march=native' - CXXFLAGS='-O3 -march=native' + CFLAGS='-O3 -march=native -mtune=native -pipe' + CXXFLAGS='-O3 -march=native -mtune=native -pipe' DESTDIR=/build export CFLAGS CXXFLAGS DESTDIR @@ -962,6 +962,62 @@ LD=/sucks/bin/ld STRIP=/sucks/bin/strip export CC CXX AR AS RANLIB LD STRIP +begin_substep tinycc-20220708 +if [ -x /bin/tcc ]; then + msg info "%s exists, skipping %s" /bin/tcc ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + git_clone ${pkg} git://repo.or.cz/tinycc.git + ( + cd_or_fail ${G_SRC}/${pkg} + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon -fPIC' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure \\ + --prefix=/ \\ + --bindir=/bin \\ + --libdir=/lib \\ + --tccdir=/lib/tcc \\ + --includedir=/include \\ + --docdir=/share/doc/${pkg} \\ + --sharedir=/share \\ + --config-musl \\ + --sysincludepaths=/include:/sucks/include \\ + --crtprefix=/lib \\ + --libpaths=/lib:/sucks/lib + + make ${JN} + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + #remove_dir ${G_SRC}/${pkg} +fi +end_substep + + begin_substep bzip2-1.0.8 if [ -x /bin/bzip2 ]; then msg info "%s exists, skipping %s" /bin/bzip2 ${pkg} @@ -1000,7 +1056,7 @@ mkpk_install() STRIP=/sucks/bin/strip export CC CXX AR AS RANLIB LD STRIP - CFLAGS='-O3 -march=native -static --static -fcommon -fPIC' + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon -fPIC' LDFLAGS='-static --static -fcommon' DESTDIR=/build export CFLAGS LDFLAGS DESTDIR @@ -1056,8 +1112,7 @@ mkpk_install() STRIP=/sucks/bin/strip export CC CXX AR AS RANLIB LD STRIP - CFLAGS='-O3 -march=native' - LDFLAGS= + CFLAGS='-O3 -march=native -mtune=native -pipe' DESTDIR=/build export CFLAGS DESTDIR @@ -1077,8 +1132,675 @@ mkpk_install() fi end_substep -# Move after autotools -if false; then +begin_substep netbsd-curses-0.3.2 +if [ -e /lib/libncurses.so ]; then + msg info "%s exists, skipping %s" /lib/libncurses.so ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://ftp.barfooze.de/pub/sabotage/tarballs/${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe' + DESTDIR=/build + export CFLAGS DESTDIR + + make ${JN} PREFIX=/ all install || exit 1 +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep attr-2.5.1 +if [ -x /bin/attr ]; then + msg info "%s exists, skipping %s" /bin/attr ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://download.savannah.gnu.org/releases/${pkg%%-*}/\ +${pkg}.tar.gz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/ \ + --bindir=/bin \ + --sysconfdir=/etc \ + --docdir=/share/doc/${pkg} + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep acl-2.3.1 +if [ -x /bin/getfacl ]; then + msg info "%s exists, skipping %s" /bin/getfacl ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://download.savannah.gnu.org/releases/${pkg%%-*}/\ +${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/ \ + --bindir=/bin \ + --libexecdir=/lib \ + --docdir=/share/doc/${pkg} + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep libcap-2.62 +if [ -x /sucks/bin/getcap ]; then + msg info "%s exists, skipping %s" /sucks/bin/getcap ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://www.kernel.org/pub/linux/libs/security/linux-privs/\ +libcap2/${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe' + DESTDIR=/build + export CFLAGS DESTDIR + + make ${JN} prefix=/sucks lib=lib || exit 1 + make prefix=/sucks lib=lib PKGCONFDIR=/sucks/lib/pkgconfig install +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep psmisc-23.4 +if [ -x /bin/killall ]; then + msg info "%s exists, skipping %s" /bin/killall ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://sourceforge.net/projects/${pkg%%-*}/files/${pkg%%-*}/\ +${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ac_cv_func_malloc_0_nonnull=yes \ + ac_cv_func_realloc_0_nonnull=yes \ + ./configure --prefix=/ \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-selinux \ + --enable-harden-flags \ + --enable-ipv6 + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep iana-etc-20210611 +if [ -e /etc/services ]; then + msg info "%s exists, skipping %s" /etc/services ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://github.com/Mic92/iana-etc/releases/download/20210611/\ +${pkg}.tar.gz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + mkdir -p ../build/etc + cp services protocols ../build/etc +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep libtool-2.4.6 +if [ -x /bin/libtool ]; then + msg info "%s exists, skipping %s" /bin/libtool ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://ftp.gnu.org/gnu/${pkg%%-*}/${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/ + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep pax-utils-1.3.4 +if [ -x /bin/scanelf ]; then + msg info "%s exists, skipping %s" /bin/scanelf ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://dev.gentoo.org/~xen0n/distfiles/${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/ + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + #unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep less-590 +if [ -x /bin/less ]; then + msg info "%s exists, skipping %s" /bin/less ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://www.greenwoodsoftware.com/${pkg%%-*}/${pkg}.tar.gz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + export CFLAGS LDFLAGS + + ./configure --prefix=/build/ --sysconfdir=/etc + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep gdbm-1.20 +if [ -x /sucks/bin/gdbmtool ]; then + msg info "%s exists, skipping %s" /sucks/bin/gdbmtool ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://ftp.gnu.org/gnu/gdbm/${pkg}.tar.gz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe' + LDFLAGS= + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks \ + --disable-static \ + --enable-libgdbm-compat + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep gperf-3.1 +if [ -x /sucks/bin/gperf ]; then + msg info "%s exists, skipping %s" /sucks/bin/gperf ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://ftp.gnu.org/gnu/gperf/${pkg}.tar.gz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe' + CXXFLAGS='-O3 -march=native -mtune=native -pipe' + LDFLAGS= + DESTDIR=/build + export CFLAGS CXXFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks \ + --docdir=/share/doc/${pkg} + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep expat-2.4.8 +if [ -x /sucks/bin/xmlwf ]; then + msg info "%s exists, skipping %s" /sucks/bin/xmlwf ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://prdownloads.sourceforge.net/expat/${pkg}.tar.xz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + CFLAGS='-O3 -march=native -mtune=native -pipe' + LDFLAGS= + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks \ + --disable-static \ + --docdir=/share/doc/${pkg} + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + + +if false; then +# Needs CMake (BMLFS) +begin_substep musl-locales-20220708 +if [ -x /bin/locale ]; then + msg info "%s exists, skipping %s" /bin/locale ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + git_clone ${pkg} https://git.adelielinux.org/adelie/musl-locales.git + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + cat <<@ >configure.local +CC=/sucks/bin/gcc +AR=/sucks/bin/ar +MANPATH_DEFAULT=/share/man:/X11R6/man:/sucks/share/man +MANPATH_BASE=/share/man:/X11R6/man:/sucks/share/man +OSNAME='Galeb 2.0' +PREFIX=/ +CFLAGS='-O3 -march=native -mtune=native -pipe' +LDFLAGS='-Wl,-z,relro' +STATIC='-static --static -fcommon' +BUILD_CATMAN=1 +@ + ./configure + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + #unpack_pkg ${pkg} / + ) || exit 1 + #remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep mandoc-1.14.6 +if [ -x /bin/mandoc ]; then + msg info "%s exists, skipping %s" /bin/mandoc ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + fetch_pkg https://mandoc.bsd.lv/snapshots/mdocml-1.14.1.tar.gz + fetch_pkg https://mandoc.bsd.lv/snapshots/${pkg}.tar.gz + extract_pkg ${G_SRC} mdocml-1.14.1 mdocml-1.14.1.tar.gz + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CC=/sucks/bin/gcc + CXX=/sucks/bin/g++ + AR=/sucks/bin/ar + AS=/sucks/bin/as + RANLIB=/sucks/bin/ranlib + LD=/sucks/bin/ld + STRIP=/sucks/bin/strip + export CC CXX AR AS RANLIB LD STRIP + + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + cat <<@ >configure.local +CC=/sucks/bin/gcc +AR=/sucks/bin/ar +MANPATH_DEFAULT=/share/man:/X11R6/man:/sucks/share/man +MANPATH_BASE=/share/man:/X11R6/man:/sucks/share/man +OSNAME='Galeb 2.0' +PREFIX=/ +CFLAGS='-O3 -march=native -mtune=native -pipe' +LDFLAGS='-Wl,-z,relro' +STATIC='-static --static -fcommon' +BUILD_CATMAN=1 +@ + ./configure + + make ${JN} || exit 1 + make install-strip +} +! + mkpk ${pkg} + #unpack_pkg ${pkg} / + ) || exit 1 + #remove_dir ${G_SRC}/${pkg} +fi +end_substep + +# Move after autotools begin_substep argp-standalone-1.4.1 if [ -x /bin/argp ]; then msg info "%s exists, skipping %s" /bin/pkg-config ${pkg} @@ -1105,7 +1827,7 @@ mkpk_install() { chmod +x configure - CFLAGS='-O3 -march=native -fPIC' \\ + CFLAGS='-O3 -march=native -mtune=native -pipe -fPIC' \\ ./configure --prefix=/ \\ --sysconfdir=/etc \\ --localstatedir=/var diff --git a/TODO b/TODO @@ -3,9 +3,12 @@ TODO [ ] Add || exit 1 to mkpk_install scripts; revise () || exit 1 -[ ] /share/legal - [ ] Organize downloads better: TSV db, fetch all at once at the start +[x] /share/legal + +[x] /galeb -> /src/lib + < > Optimize environment variable assignment + [ ] Instead of CC=/sucks/bin/gcc, set PATH diff --git a/lib/env.sh b/lib/env.sh @@ -23,12 +23,14 @@ G_ARCH_EXT_ALT=x86_64 #G_HOST=$(gcc -dumpmachine) G_FIFO=${GR}/fifo G_HOST=$(gcc -dumpmachine | sed 's/\([^-]\+-\)[^-]\+\(-.*\)/\1cross\2/g') +G_LGL=${GR}/share/legal G_LOG=${GR}/log G_SRC=${GR}/src G_SHORTLOG=${GR}/shortlog G_SPKG=${GR}/pkg G_FIL=${G_SRC}/${FLD} +G_LIB=${G_SRC}/lib G_PAT=${G_SRC}/${PTD} G_PKG=${G_SRC}/pkg G_TARGET=x86_64-galeb-linux-musl @@ -36,5 +38,5 @@ G_VER=2.0 JN=-j$(($(grep ^processor /proc/cpuinfo | wc -l) * 3)) export CT_TRI GR_TRI GHOME GUID GGID GR CTD FLD PTD TLD CT TL G_ARCH G_ARCH_EXT -export G_ARCH_EXT_ALT G_FIFO G_LOG G_FIL G_PAT G_PKG G_SHORTLOG G_SPKG G_SRC -export G_TARGET G_VER JN +export G_ARCH_EXT_ALT G_FIFO G_LGL G_LOG G_FIL G_LIB G_PAT G_PKG G_SHORTLOG +export G_SPKG G_SRC G_TARGET G_VER JN diff --git a/lib/fun.sh b/lib/fun.sh @@ -156,8 +156,8 @@ exit_cleanup() { [ -p ${G_FIFO} ] && rm ${G_FIFO} unset CT_TRI GR_TRI GHOME GUID GGID GR CTD FLD PTD TLD CT TL G_ARCH - unset G_ARCH_EXT G_ARCH_EXT_ALT G_FIFO G_LOG G_FIL G_PAT G_PKG - unset G_SHORTLOG G_SPKG G_SRC G_TARGET G_VER JN + unset G_ARCH_EXT G_ARCH_EXT_ALT G_FIFO G_LGL G_LOG G_FIL G_LIB G_PAT + unset G_PKG G_SHORTLOG G_SPKG G_SRC G_TARGET G_VER JN } extract_pkg() @@ -236,7 +236,7 @@ git_clone() msg err "git clone %s failed" "$*" exit 1 fi - mv_or_fail "${repo}" "${dir}" + mv_or_fail "${repo%%.git}" "${dir}" rm ${G_FIFO} } @@ -281,7 +281,7 @@ mkpk() fi cd .. - mkdir -p bin build dev etc include lib sucks tmp tools + mkdir -p bin build dev etc include sucks tmp tools msg info "mkpk mounting..." mount -B /bin ./bin -o ro mount -B /dev ./dev @@ -302,6 +302,28 @@ mkpk() if [ ${fail} -ne 0 ]; then echo Failed sh + else + legalfiles= + [ -e LEGAL ] && legalfiles=LEGAL + [ -e LICENSE ] && legalfiles+=' LICENSE' + [ -e License ] && legalfiles+=' License' + [ -e COPYING ] && legalfiles+=' COPYING' + [ -e COPYRIGHT ] && legalfiles+=' COPYRIGHT' + [ -e doc/LEGAL ] && legalfiles+=' doc/LEGAL' + [ -e doc/LICENSE ] && legalfiles+=' doc/LICENSE' + [ -e doc/License ] && legalfiles+=' doc/License' + [ -e doc/COPYING ] && legalfiles+=' doc/COPYING' + [ -e doc/COPYRIGHT ] && legalfiles+=' doc/COPYRIGHT' + + if [ -n "${legalfiles}" ]; then + check_dir ../build/${G_LGL}/${pkg} + for lfile in ${legalfiles} + do + if [ -n "${lfile}" ]; then + cp_or_fail "${lfile}*" ../build/${G_LGL}/${pkg}/ + fi + done + fi fi msg info "mkpk umounting..." @@ -332,7 +354,7 @@ mkpk() rm -fr build rm -fr sucks rm usr - rmdir bin dev etc include lib tmp tools + rmdir bin dev etc include tmp tools exit ${fail} ) || { msg err "mkpk failed"