galeb

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

чување 909d252853ab7c7b3e98ef5371894d3c2ea0c34b
родитељ 2c8c1df9b920777197d53f2a9a75c934652c0813
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Mon, 11 Jul 2022 22:06:41 +0200

Chroot up to CMake + non-compilable mandoc

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

Diffstat:
M01-cross.sh | 17++++++++++++++++-
M03-chroot.sh | 614+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------
MFAQ | 9++++++++-
Mlib/fun.sh | 15++++++++++-----
Mlib/gensums | 5+++++
Mlib/pkgs.tsv | 8++++++++
Apat-11.2.1/gettext-tiny-galeb/autopoint.patch | 22++++++++++++++++++++++
Apat-11.2.1/libuv-mlfs/autogen-hardcode.patch | 11+++++++++++
измењених датотека: 8, додавања: 586(+), брисања: 115(-)

diff --git a/01-cross.sh b/01-cross.sh @@ -30,14 +30,26 @@ check_dir ${G_PAT} check_dir ${G_PKG} check_dir ${G_SRC} +check_dir ${G_SPKG} + msg info "Setup root structure" check_dir ${GR}/bin remove_file ${GR}/sbin link_if_ne bin ${GR}/sbin +check_dir ${GR}/etc check_dir ${GR}/include +check_dir ${GR}/local +check_dir ${GR}/local/bin +check_dir ${GR}/local/include +check_dir ${GR}/local/share +check_dir ${GR}/local/lib +link_if_ne bin ${GR}/local/sbin check_dir ${GR}/share check_dir ${GR}/sucks/bin check_dir ${GR}/sucks/lib +link_if_ne bin ${GR}/sucks/sbin + +:>${GR}/etc/fstab if [ ! -e /${CTD} ] && [ ! -e /${TLD} ]; then msg info "Linking %s and %s to / (needs root)" ${CTD} ${TLD} @@ -88,7 +100,10 @@ do lineno=$((lineno+1)) done <${WD}/lib/pkgs.tsv echo -unset lineno +unset lineno totallines + +msg info "Regenerating MD5 sums" +(cd ${WD}; ${WD}/lib/gensums) begin_substep linux-5.17.13 "Linux headers" if [ -e ${CT}/${G_TARGET}/include/linux/stddef.h ]; then diff --git a/03-chroot.sh b/03-chroot.sh @@ -210,13 +210,14 @@ mkpk_install() ln -sf libc.so ../build/lib/libc.musl-${G_ARCH_EXT_ALT}.so.1 sed -e 's,/usr/lib,/sucks/lib,g' \\ - -e 's,|/usr/local/lib/\*,,g' \\ + -e 's,|/usr\(/local/lib/\*\),|\1,g' \\ ../${FLD}/musl-alpine/ldconfig > ../build/bin/ldconfig chmod a+x ../build/bin/ldconfig mkdir -p ../build/etc cat <<@ >../build/etc/ld-musl-${G_ARCH_EXT_ALT}.path +/local/lib /lib /sucks/lib @ @@ -232,7 +233,7 @@ fi end_substep msg info "Cleaning up environment" -PATH=/bin:/sbin:/tools/bin:/plan9/bin +PATH=/local/bin:/bin:/sucks/bin:/tools/bin:/plan9/bin export PATH unset CC CXX AR AS RANLIB LD STRIP @@ -248,8 +249,10 @@ msg info "Adjusting specs" SPECFILE=$(realpath $(dirname $(gcc -print-libgcc-file-name)))/specs export SPECFILE gcc -dumpspecs | sed -e 's,/tools,,g' \ - -e '/\*startfile_prefix_spec:/{n;s,.*,/lib/ /sucks/lib/ ,}' \ - -e '/\*cpp:/{n;s,$, -isystem /include -isystem /sucks/include ,}' > specs + -e '/\*startfile_prefix_spec:/{n;s,.*,/local/lib/ /lib/ '\ +'/sucks/lib/ ,}' \ + -e '/\*cpp:/{n;s,$, -I /local/include -I /include '\ +'-I /sucks/include ,}' > specs mv_or_fail specs ${SPECFILE} unset SPECFILE @@ -398,8 +401,8 @@ fi end_substep begin_substep pkgconf-1.8.0 -if [ -L /bin/pkg-config ]; then - msg info "%s exists, skipping %s" /bin/pkg-config ${pkg} +if [ -L /sucks/bin/pkg-config ]; then + msg info "%s exists, skipping %s" /sucks/bin/pkg-config ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else @@ -414,27 +417,30 @@ mkpk_name() mkpk_install() { - ./configure --prefix=/ \\ - --docdir=/share/doc/pkgconf-1.80 \\ + ./configure --prefix=/sucks \\ + --docdir=/sucks/share/doc/pkgconf-1.80 \\ --sysconfdir=/etc \\ --localstatedir=/var \\ - --with-pkg-config-dir=/lib/pkgconfig:/share/pkgconfig:\\ -/sucks/lib/pkgconfig:/sucks/share/pkgconfig:/opt/qt5/lib/pkgconfig + --with-pkg-config-dir=/local/lib/pkgconfig:\\ +/local/share/pkgconfig:/lib/pkgconfig:/share/pkgconfig:\\ +/sucks/lib/pkgconfig:/sucks/share/pkgconfig:/opt/qt5/lib/pkgconfig \\ + --with-system-includedir=/local/include:/include:\\ +/sucks/include \\ + --with-system-libdir=/local/lib:/lib:/sucks/lib make ${JN} make DESTDIR=/build install - mkdir -pv ../build/bin + mkdir -pv ../build/sucks/bin - ln -sv pkgconf ../build/bin/${G_TARGET}-pkg-config - ln -sv pkgconf ../build/bin/pkg-config + ln -sv pkgconf ../build/sucks/bin/${G_TARGET}-pkg-config + ln -sv pkgconf ../build/sucks/bin/pkg-config - mkdir -pv ../build/share/man/man1 + mkdir -pv ../build/sucks/share/man/man1 - ln -sv pkgconf.1 ../build/share/man/man1/pkg-config.1 + ln -sv pkgconf.1 ../build/sucks/share/man/man1/pkg-config.1 } ! mkpk ${pkg} - remove_dir ${G_SRC}/${pkg} unpack_pkg ${pkg} / ) || exit 1 remove_dir ${G_SRC}/${pkg} @@ -567,10 +573,11 @@ mkpk_name() mkpk_install() { CFLAGS='-O3 -march=native -mtune=native -pipe' - CXXFLAGS='-O3 -march=native -mtune=native -pipe' + CXXFLAGS=\${CFLAGS} DESTDIR=/build EXTRA_CONFIG=' --enable-targets=x86_64-pep ' - export CFLAGS CXXFLAGS DESTDIR EXTRA_CONFIG + TARGET_LIB_PATH=/local/lib:/lib:/sucks/lib + export CFLAGS CXXFLAGS DESTDIR EXTRA_CONFIG TARGET_LIB_PATH ./configure \\ --prefix=/sucks \\ @@ -579,6 +586,7 @@ mkpk_install() --enable-plugins \\ --enable-shared \\ --disable-werror \\ + --includedir=/include \\ --with-system-zlib \\ --enable-relro \\ --enable-lto \\ @@ -591,7 +599,7 @@ mkpk_install() --enable-64-bit-bfd \\ --with-pic $EXTRA_CONFIG - make ${JN} tooldir=/sucks + make ${JN} tooldir=/sucks || exit 1 make tooldir=/sucks install-strip ln -sf ld.bfd ../build/sucks/bin/ld @@ -871,43 +879,45 @@ mkpk_install() DESTDIR=/build export CFLAGS CXXFLAGS DESTDIR - SED=/tools/bin/sed libat_cv_have_ifunc=no \ - ./configure \ - --prefix=/sucks \ - --build=${GR_TRI} \ - --enable-languages=c,c++,lto \ - --with-pkgversion='Galeb 2.0-20220707' \ - --with-arch=${G_ARCH_EXT} \ - --with-ppl=yes \ - --with-cloog=yes \ - --disable-libstdcxx-pch \ - --disable-nls \ - --disable-multilib \ - --disable-bootstrap \ - --disable-symvers \ - --disable-libsanitizer \ - --disable-libssp \ - --disable-libmpx \ - --disable-libmudflap \ - --disable-fixed-point \ - --disable-sjlj-exceptions \ - --disable-werror \ - --enable-threads=posix \ - --enable-clocale=generic \ - --enable-tls \ - --enable-libstdcxx-time \ - --enable-fully-dynamic-string \ - --enable-default-pie \ - --enable-default-ssp \ - --enable-linker-build-id \ - --enable-checking=release \ - --enable-cloog-backend \ - --enable-__cxa_atexit \ - --enable-lto \ - --enable-plugins \ - --with-system-zlib \ - --with-linker-hash-style=gnu \ - --with-isl \ + if false; then + SED=/tools/bin/sed libat_cv_have_ifunc=no \\ + ./configure \\ + --prefix=/sucks \\ + --build=${GR_TRI} \\ + --enable-languages=c,c++,lto \\ + --with-pkgversion='Galeb 2.0-20220707' \\ + --with-arch=${G_ARCH_EXT} \\ + --with-ppl=yes \\ + --with-cloog=yes \\ + --disable-libstdcxx-pch \\ + --disable-nls \\ + --disable-multilib \\ + --disable-bootstrap \\ + --disable-symvers \\ + --disable-libsanitizer \\ + --disable-libssp \\ + --disable-libmpx \\ + --disable-libmudflap \\ + --disable-fixed-point \\ + --disable-sjlj-exceptions \\ + --disable-werror \\ + --enable-threads=posix \\ + --enable-clocale=generic \\ + --enable-tls \\ + --enable-libstdcxx-time \\ + --enable-fully-dynamic-string \\ + --enable-default-pie \\ + --enable-default-ssp \\ + --enable-linker-build-id \\ + --enable-checking=release \\ + --enable-cloog-backend \\ + --enable-__cxa_atexit \\ + --enable-lto \\ + --enable-plugins \\ + --with-system-zlib \\ + --with-linker-hash-style=gnu \\ + --with-isl + fi make ${JN} || exit 1 make install-strip @@ -932,11 +942,12 @@ mkpk_install() ln -s gcc ../build/sucks/bin/cc install -dm 755 ../build/sucks/lib/bfd-plugins - ln -s ../../libexec/gcc/$(gcc -dumpmachine)/11.2.1/liblto_plugin.so \ + ln -s ../../libexec/gcc/$(gcc -dumpmachine)/11.2.1/liblto_plugin.so \\ ../build/sucks/lib/bfd-plugins/ install -dm 755 ../build/share/gdb/auto-load/usr/lib - mv ../build/sucks/lib64/*gdb.py ../build/share/gdb/auto-load/usr/lib + find ../build -name '*gdb.py' -exec mv {} \\ + ../build/share/gdb/auto-load/usr/lib \\; } ! mkpk ${pkg} @@ -947,18 +958,23 @@ fi end_substep msg info "Setting up environment to use newly built GCC" -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 +CC=gcc +CXX=g++ +AR=ar +AS=as +RANLIB=ranlib +LD=ld +STRIP=strip export CC CXX AR AS RANLIB LD STRIP PATH=/bin:/sucks/bin:/tools/bin export PATH +for lib in gcc_s.so gcc_s.so.1 stdc++.a stdc++.so stdc++.so.6 +do + remove_file /lib/lib${lib} +done + begin_substep tinycc-20220708 if [ -x /bin/tcc ]; then msg info "%s exists, skipping %s" /bin/tcc ${pkg} @@ -1080,8 +1096,10 @@ mkpk_name() mkpk_install() { CFLAGS='-O3 -march=native -mtune=native -pipe' + CXXFLAGS=\${CFLAGS} DESTDIR=/build - export CFLAGS DESTDIR + LIBS=-lstdc++ + export CFLAGS CXXFLAGS DESTDIR LIBS make ${JN} || exit 1 make -C contrib/pzstd || exit 1 @@ -1346,10 +1364,6 @@ mkpk_install() DESTDIR=/build export CFLAGS LDFLAGS DESTDIR - touch aclocal.m4 - touch Makefile.in - touch configure - ./configure --prefix=/sucks make ${JN} || exit 1 @@ -1675,7 +1689,7 @@ XML/Parser.pm ${pkg} elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then unpack_pkg ${pkg} / else - extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz touch + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz "" touch ( cd_or_fail ${G_SRC}/${pkg} @@ -2022,6 +2036,9 @@ else ( cd_or_fail ${G_SRC}/${pkg} + apply_patch final-system -Np1 -i \ + ${G_PAT}/gettext-tiny-galeb/autopoint.patch + cat <<! >MKPK mkpk_name() { @@ -2037,6 +2054,16 @@ LDFLAGS=-static --static -fcommon sed -i 's,/usr/local,,g' Makefile make LIBINTL=MUSL ${JN} || exit 1 make LIBINTL=MUSL DESTDIR=/build prefix=/ install + + # Fix sucky aclocal + mkdir -p /build/sucks/share/aclocal + cd /build/share/aclocal + find . -type l -cnewer /timestamp | \\ + while read -r link; do + ln -sv ../../../share/aclocal/\$(readlink \${link}) \\ + /build/sucks/share/aclocal/ + done + cd - >/dev/null 2>&1 } ! mkpk ${pkg} @@ -2153,9 +2180,9 @@ mkpk_install() autoreconf -vif - ./configure --prefix=/sucks \ - --disable-debuginfod \ - --enable-libdebuginfod=dummy + ./configure --prefix=/sucks \\ + --disable-debuginfod \\ + --enable-libdebuginfod=dummy || exit 1 make ${JN} -C lib || exit 1 make ${JN} -C libelf || exit 1 @@ -2312,6 +2339,398 @@ mkpk_install() ln -sv idle3.9 /build/sucks/bin/idle ln -sv pydoc3.9 /build/sucks/bin/pydoc ln -sv python3.9.1 /build/sucks/share/man/man1/python.1 + + # To get around Python scripts which hardcode shebang as /usr/bin/python + # or /usr/bin/python3 + mkdir -p /build/bin + ln -sv /sucks/bin/python3.9 /build/bin/python + ln -sv /sucks/bin/python3.9 /build/bin/python3 + ln -sv /sucks/bin/python3.9 /build/bin/python3.9 +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep samurai-1.2 +if [ -e /bin/ninja ]; then + msg info "%s exists, skipping %s" /bin/ninja ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + make PREFIX=/ ${JN} || exit 1 + make PREFIX=/ install + + ln -sv samu /build/bin/ninja +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep meson-0.61.3 +if [ -e /sucks/bin/meson ]; then + msg info "%s exists, skipping %s" /sucks/bin/meson ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-O3 -march=native -mtune=native -pipe' + LDFLAGS='' + export CFLAGS LDFLAGS + + python3 setup.py build + python3 setup.py install --root=/build +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep procps-ng-3.3.17 +if [ -e /sucks/bin/top ]; then + msg info "%s exists, skipping %s" /sucks/bin/top ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} procps-3.3.17 ${pkg}.tar.xz ${pkg} + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-O3 -march=native -mtune=native -pipe' + # Fix utmp + CFLAGS+=' -DUT_NAMESIZE=0 -DUT_LINESIZE=0 -DUT_HOSTSIZE=0' + CFLAGS+=' -D__UT_NAMESIZE=0 -D__UT_LINESIZE=0 -D__UT_HOSTSIZE=0' + LDFLAGS='' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + autoreconf -vif || exit 1 + + sed -i '1i#include <langinfo.h>' proc/escape.c + + ac_cv_func_malloc_0_nonnull=yes \ + ac_cv_func_realloc_0_nonnull=yes \ + ./configure --prefix=/sucks \ + --exec-prefix= \ + --libdir=/sucks/lib \ + --docdir=/sucks/share/doc/${pkg} \ + --disable-kill \ + --without-systemd \ + --disable-modern-top + + make ${JN} || exit 1 + make DESTDIR=\${DESTDIR} install + + mkdir -pv /build/sucks/bin + ln -sv bin /build/sucks/sbin + find /build/bin -type f -cnewer /timestamp | \\ + xargs -I{} mv -v {} /build/sucks/bin/ + find /build/sbin -type f -cnewer /timestamp | \\ + xargs -I{} mv -v {} /build/sucks/sbin/ + + # Overlap with ubase + for duplicate in free pidof ps pwdx sysctl uptime watch + do + rm -fv /build/sucks/bin/\${duplicate} + rm -fv /build/sucks/share/man/man1/\${duplicate}.1 + done +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep awk-20220709 +if [ -e /bin/awk ]; then + msg info "%s exists, skipping %s" /bin/awk ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + + sed -i -e 's/^HOSTCC =.*/HOSTCC = gcc -Wall/' \\ + -e 's/^CFLAGS =/#&/' \\ + -e "s/^#CFLAGS =\\$/CFLAGS = \${CFLAGS}&/" \\ + -e 's/^#\( YACC = yacc.*\)/\1/' \\ + -e 's/^\(YACC = bison.*\)/# \1/' \\ + makefile + + make ${JN} || exit 1 + + install -dm 755 /build/bin + install -dm 755 /build/share/man/man1 + install -m 755 a.out /build/bin/awk + install -m 644 awk.1 /build/share/man/man1/ +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 +fi +end_substep + +begin_substep check-0.15.2 +if [ -e /sucks/bin/checkmk ]; then + msg info "%s exists, skipping %s" /sucks/bin/checkmk ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-O3 -march=native -mtune=native -pipe' + LDFLAGS='' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks --disable-static + + make ${JN} || exit 1 + make install + + sed -i '1s,/tools,,' /build/sucks/bin/checkmk +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep diffutils-3.8 +if [ -e /sucks/bin/diff ]; then + msg info "%s exists, skipping %s" /sucks/bin/diff ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.xz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-O3 -march=native -mtune=native -pipe' + LDFLAGS='' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + ./configure --prefix=/sucks + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep groff-1.22.4 +if [ -e /sucks/bin/groff ]; then + msg info "%s exists, skipping %s" /sucks/bin/groff ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-O3 -march=native -mtune=native -pipe' + LDFLAGS='' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + PAGE=A4 \\ + ./configure --prefix=/sucks \\ + --with-urw-fonts-dir=/sucks/share/fonts/type1/gsfonts + +#'--with-urw-fonts-dir=DIR' +#http://downloads.ghostscript.com/public/fonts/urw-base35-v1.10.zip + + make || exit 1 + make install +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep libuv-1.44.1 +if [ -e /sucks/lib/libuv.so.1.0.0 ]; then + msg info "%s exists, skipping %s" /sucks/lib/libuv.so.1.0.0 ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} libuv-v1.44.1 ${pkg}.tar.gz ${pkg} + ( + cd_or_fail ${G_SRC}/${pkg} + + + apply_patch final-system -Np1 -i \ + ${G_PAT}/libuv-mlfs/autogen-hardcode.patch + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + + CFLAGS='-march=native -mtune=native -pipe ' + CFLAGS+='-O3 -ffat-lto-objects -flto=4 ' + LDFLAGS='-flto=4 -Wl,-O2 -Wl,--as-needed -pthread ' + DESTDIR=/build + export CFLAGS LDFLAGS DESTDIR + + NOCONFIGURE=1 ./autogen.sh || exit 1 + ./configure --prefix=/sucks \\ + --disable-static + + make ${JN} || exit 1 + make install +} +! + mkpk ${pkg} + unpack_pkg ${pkg} / + ) || exit 1 + remove_dir ${G_SRC}/${pkg} +fi +end_substep + +begin_substep cmake-3.23.2 +if [ -e /sucks/bin/cmake ]; then + msg info "%s exists, skipping %s" /sucks/bin/cmake ${pkg} +elif [ -e ${G_SPKG}/${pkg}.tar.xz ]; then + unpack_pkg ${pkg} / +else + extract_pkg ${G_SRC} ${pkg} ${pkg}.tar.gz + ( + cd_or_fail ${G_SRC}/${pkg} + + cat <<! >MKPK +mkpk_name() +{ + printf "%s" "${pkg}" +} + +mkpk_install() +{ + CFLAGS='-march=native -mtune=native -pipe ' + CFLAGS+='-O3 -ffat-lto-objects -flto=auto ' + CXXFLAGS=\${CFLAGS} + LDFLAGS='-flto=auto -Wl,-O2 -Wl,--as-needed ' + DESTDIR=/build + export CFLAGS CXXFLAGS LDFLAGS DESTDIR + + sed -i '/"lib64"/s,lib64,sucks/lib,' Modules/GNUInstallDirs.cmake + + ./bootstrap --prefix=/sucks \\ + --system-libs \\ + --mandir=/sucks/share/man \\ + --no-system-jsoncpp \\ + --no-system-librhash \\ + --no-system-curl \\ + --no-system-nghttp2 \\ + --no-system-libarchive \\ + --docdir=/share/doc/${pkg} + + make ${JN} || exit 1 + make DESTDIR=/build install } ! mkpk ${pkg} @@ -2321,15 +2740,12 @@ mkpk_install() 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} @@ -2341,29 +2757,18 @@ mkpk_name() mkpk_install() { + CFLAGS='-O3 -march=native -mtune=native -pipe -static --static -fcommon' + LDFLAGS='-static --static -fcommon' 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 + cmake --install-prefix / -B../build . || exit 1 + make -C ../build ${JN} || exit 1 + make -C ../build install } ! mkpk ${pkg} - #unpack_pkg ${pkg} / + unpack_pkg ${pkg} / ) || exit 1 #remove_dir ${G_SRC}/${pkg} fi @@ -2388,31 +2793,26 @@ mkpk_name() 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 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=/ +SBINDIR=/bin +MANDIR=/share/man +BINM_SOELIM=msoelim +MANM_ROFF=mandoc_roff CFLAGS='-O3 -march=native -mtune=native -pipe' LDFLAGS='-Wl,-z,relro' STATIC='-static --static -fcommon' BUILD_CATMAN=1 @ - ./configure + ./configure || exit 1 make ${JN} || exit 1 make install-strip @@ -2425,6 +2825,4 @@ BUILD_CATMAN=1 fi end_substep -# Move after autotools -fi end_step diff --git a/FAQ b/FAQ @@ -1,5 +1,5 @@ FAQ ---- +=== Q: What does "Galeb" mean? A: "Seagull". @@ -94,6 +94,13 @@ A: Galeb doesn't follow FHS. Instead, it builds on https://sta.li/filesystem/ * 9base is in /plan9. +Q: How do I install a package? +A: cd / && xz -dc /pkg/some_pkg.tar.xz | tar -xf - + +Q: How do I uninstall a package? +A: cd / && xz -dc /pkg/some_pkg.tar.xz | tar -tf - | xargs rm + Remove unwanted empty directories manually. + [1]: https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic [2]: https://www.gnu.org/licenses/license-list.html#Expat diff --git a/lib/fun.sh b/lib/fun.sh @@ -220,17 +220,19 @@ fetch_pkg() git_clone() { - local dir=$1 repo=${2##*/} delay=$3 + local dir=$1 url=$2 delay=$3 repo + + repo=${url##*/} if [ -d "${G_SRC}/${dir}" ]; then #msg info "Directory %s exists" "${dir}" return fi cd_or_fail ${G_SRC} - msg info "git clone %s" "${repo}" + msg info "git clone %s" "${url}" setup_fifo - if ! git clone ${repo} >${G_FIFO} 2>&1; then - msg err "git clone %s failed" "${repo}" + if ! git clone ${url} >${G_FIFO} 2>&1; then + msg err "git clone %s failed" "${url}" exit 1 fi mv_or_fail "${repo%%.git}" "${dir}" @@ -280,13 +282,14 @@ mkpk() fi cd .. - mkdir -p bin build dev etc include sucks tmp tools + mkdir -p bin build dev etc include share sucks tmp tools msg info "mkpk mounting..." mount -B /bin ./bin -o ro mount -B /dev ./dev mount -B /etc ./etc mount -B /include ./include -o ro mount -B /lib ./lib -o ro + mount -B /share ./share -o ro mount -B /sucks ./sucks -o ro mount -B /tmp ./tmp -o ro mount -B /tools ./tools -o ro @@ -333,6 +336,7 @@ mkpk() umount ../tools umount ../tmp umount ../sucks + umount ../share umount ../lib umount ../include umount ../etc @@ -356,6 +360,7 @@ mkpk() msg info "Cleaning up in %s" $(pwd) rm -fr build rm -fr sucks + rm -fr share rm usr rmdir bin dev etc include tmp tools exit ${fail} diff --git a/lib/gensums b/lib/gensums @@ -6,8 +6,12 @@ pkgdb=./lib/pkgs.tsv sed 1q "${pkgdb}" >newfile lineno=0 +totallines=$(wc -l ${pkgdb} | cut -d ' ' -f1) +totallines=$((totallines - 1)) while read -r record do + perc=$((lineno * 100 / totallines)) + printf "%3d%%\r" "${perc}" [ ${lineno} -eq 0 ] || \ ( IFS=$(printf '\t') @@ -33,5 +37,6 @@ do ) lineno=$((lineno+1)) done <${pkgdb} +echo mv newfile "${pkgdb}" diff --git a/lib/pkgs.tsv b/lib/pkgs.tsv @@ -1,4 +1,5 @@ URL Directory/Tarball MD5 Sum +git+https://git.adelielinux.org/adelie/musl-locales.git musl-locales-20220708 git+https://github.com/mirbsd/mksh mksh-20220709 git+https://github.com/onetrueawk/awk awk-20220709 git://git.suckless.org/9base 9base-20220706 @@ -6,9 +7,11 @@ git://git.suckless.org/sbase sbase-20220709 git://git.suckless.org/ubase ubase-20220709 git://repo.or.cz/tinycc.git tinycc-20220708 https://astron.com/pub/file/file-5.41.tar.gz 18233bb0a0089dfdc7dfbc93b96f231b +https://cmake.org/files/v3.23/cmake-3.23.2.tar.gz ab3c9ed9578cdb496a252c6733989d78 https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-2.46.tar.gz 80bb18a8e6240fcf7ec2f7b57601c170 https://dev.alpinelinux.org/archive/posixtz/posixtz-0.5.tar.xz 80f8ae1df19dd28e1c8b192c6ea7b836 https://dev.gentoo.org/~xen0n/distfiles/pax-utils-1.3.4.tar.xz b9cdbc70fdd4e377dcf17eeff28c5ade +https://dist.libuv.org/dist/v1.44.1/libuv-v1.44.1.tar.gz libuv-1.44.1.tar.gz c09e81ebac8c4cdb9ef3adada0257350 https://distfiles.dereferenced.org/pkgconf/pkgconf-1.8.0.tar.xz 823212dc241793df8ff1d097769a3473 https://download.savannah.gnu.org/releases/acl/acl-2.3.1.tar.xz 95ce715fe09acca7c12d3306d0f076b2 https://download.savannah.gnu.org/releases/attr/attr-2.5.1.tar.gz ac1c5a7a084f0f83b8cace34211f64d8 @@ -25,6 +28,7 @@ https://ftp.gnu.org/gnu/gdbm/gdbm-1.20.tar.gz 006c19b8b60828fd6916a16f3496bd3c https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz libgmp-6.2.1.tar.xz 0b82665c4a92fd2ade7440c13fcaa42b https://ftp.gnu.org/gnu/gperf/gperf-3.1.tar.gz 9e251c0a618ad0824b51117d5d9db87e https://ftp.gnu.org/gnu/grep/grep-3.7.tar.xz 7c9cca97fa18670a21e72638c3e1dabf +https://ftp.gnu.org/gnu/groff/groff-1.22.4.tar.gz 08fb04335e2f5e73f23ea4c3adbf0c5f https://ftp.gnu.org/gnu/gzip/gzip-1.12.tar.xz 9608e4ac5f061b2a6479dc44e917a5db https://ftp.gnu.org/gnu/help2man/help2man-1.49.2.tar.xz 0372898fbf054140d62385a79c5855f4 https://ftp.gnu.org/gnu/inetutils/inetutils-2.1.tar.xz 4e7676d1980e57c7df665e5c5c3c1047 @@ -45,7 +49,10 @@ https://github.com/Mic92/iana-etc/releases/download/20210611/iana-etc-20210611.t https://github.com/arsv/perl-cross/releases/download/1.4/perl-cross-1.4.tar.gz 73c246c20766d027c3dc9f606418c22c https://github.com/ericonr/argp-standalone/archive/refs/tags/1.4.1.tar.gz argp-standalone-1.4.1.tar.gz 7f391d52161e7fe8e8d3df4f850bc7ee https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz a6eb7fb1f2c21fa80030a47993853e92 +https://github.com/libcheck/check/releases/download/0.15.2/check-0.15.2.tar.gz 50fcafcecde5a380415b12e9c574e0b2 https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz 294b921e6cf9ab0fbaea4b639f8fdbe8 +https://github.com/mesonbuild/meson/releases/download/0.61.3/meson-0.61.3.tar.gz 8998d77313d753a0c474d9bdf1738b2e +https://github.com/michaelforney/samurai/releases/download/1.2/samurai-1.2.tar.gz 3ad6771de19a93660fdb36dc67687727 https://github.com/pullmoll/musl-fts/archive/v1.2.7.tar.gz musl-fts-1.2.7.tar.gz bce0b5de0cf2519a74fbfacead60369d https://github.com/pullmoll/musl-obstack/archive/v1.1.tar.gz musl-obstack-1.1.tar.gz 185975cc117dba8e6158cce847ba44d5 https://github.com/shadow-maint/shadow/releases/download/v4.11.1/shadow-4.11.1.tar.xz 5a95ec069aa91508167d02fecafaa912 @@ -59,6 +66,7 @@ https://mandoc.bsd.lv/snapshots/mdocml-1.14.1.tar.gz 07db67f437ee894e7e4b18b305 https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/man-pages-5.13.tar.xz 3ac24e8c6fae26b801cb87ceb63c0a30 https://musl.libc.org/releases/musl-1.2.3.tar.gz a507ae4f7f20bcfe566d8eb65c1af73e https://prdownloads.sourceforge.net/expat/expat-2.4.8.tar.xz 0584a7318a4c007f7ec94778799d72fe +https://sourceforge.net/projects/procps-ng/files/Production/procps-ng-3.3.17.tar.xz d60613e88c2f442ebd462b5a75313d56 https://sourceforge.net/projects/psmisc/files/psmisc/psmisc-23.4.tar.xz 8114cd4489b95308efe2509c3a406bbf https://sourceforge.net/projects/tcl/files/Tcl/8.6.12/tcl8.6.12-src.tar.gz 87ea890821d2221f2ab5157bc5eb885f https://sourceware.org/ftp/elfutils/0.186/elfutils-0.186.tar.bz2 libelf-0.186.tar.bz2 2c095e31e35d6be7b3718477b6d52702 diff --git a/pat-11.2.1/gettext-tiny-galeb/autopoint.patch b/pat-11.2.1/gettext-tiny-galeb/autopoint.patch @@ -0,0 +1,22 @@ +--- a/src/autopoint.in 2020-04-06 12:43:29.000000000 +0200 ++++ b/src/autopoint.in 2022-07-11 08:29:49.886251999 +0200 +@@ -7,16 +7,14 @@ + fi + + mkdir -p m4 intl po +-for i in $m4src/*.m4 ; do +- cp -f $i m4/ +-done ++find / -path "${m4src}/*.m4" -exec cp -f {} m4/ \; + + dirprefix="" + while read line + do + if [ "${line##*AC_CONFIG_AUX_DIR}" != "$line" ]; then +- dirprefix="${line##*([}" +- dirprefix="${dirprefix%%])*}" ++ dirprefix=$(echo line | sed -e 's,^.*(\[,,') ++ dirprefix=$(echo ${dirprefix} | sed -e 's,]).*$,,') + mkdir -p "${dirprefix}" + fi + diff --git a/pat-11.2.1/libuv-mlfs/autogen-hardcode.patch b/pat-11.2.1/libuv-mlfs/autogen-hardcode.patch @@ -0,0 +1,11 @@ +diff -uNr libuv-v1.41.0.orig/autogen.sh libuv-v1.41.0/autogen.sh +--- libuv-v1.41.0.orig/autogen.sh 2021-02-13 11:57:24.000000000 -0600 ++++ libuv-v1.41.0/autogen.sh 2021-06-21 10:48:58.247976405 -0500 +@@ -41,6 +41,6 @@ + + set -ex + "$LIBTOOLIZE" --copy +-"$ACLOCAL" -I m4 ++aclocal -I /share/aclocal -I m4 + "$AUTOCONF" + "$AUTOMAKE" --add-missing --copy