From 05581d5e237477aac51b3dbf8e4c03714a36e276 Mon Sep 17 00:00:00 2001 From: 0x221e Date: Mon, 22 Jun 2026 13:23:39 +0300 Subject: ibps-src: make template functions optional, replace sudo with doas sync: sync all templates (not v0 yet, therefore it is acceptable) --- ibps-src | 84 +++++++++++++++++++++++++++-------------------- templates/ninja/template | 2 ++ templates/python/template | 2 ++ 3 files changed, 53 insertions(+), 35 deletions(-) diff --git a/ibps-src b/ibps-src index c2d4b2d..c7e38a8 100755 --- a/ibps-src +++ b/ibps-src @@ -50,10 +50,18 @@ fi function bootstrap-rootfs { pkg "perl" "true" pkg "libxcrypt" "true" - pkg "openssl" "true" + pkg "openssl3" "true" + pkg "python" "true" + pkg "pip" "true" pkg "bison" "true" + pkg "libidn2" "true" pkg "cmake" "true" - pkg "ninja" "true" + pkg "ninja" "true" + pkg "meson" "true" + pkg "gmp" "true" + pkg "mpc" "true" + pkg "mpfr" "true" + pkg "gcc" "true" } function msg_err { @@ -65,42 +73,42 @@ function msg_err { function env_run { command="$1" - sudo mount --bind /dev "${MASTERDIR}/dev" - sudo mount --make-rslave "${MASTERDIR}/dev" - sudo mount --bind /dev/pts "${MASTERDIR}/dev/pts" - sudo mount --bind /proc "${MASTERDIR}/proc" - sudo mount --bind /sys "${MASTERDIR}/sys" - sudo mount --bind /tmp "${MASTERDIR}/tmp" - sudo mount --bind "$(pwd)/compiled" "${MASTERDIR}/compiled" + doas mount --bind /dev "${MASTERDIR}/dev" + doas mount --make-rslave "${MASTERDIR}/dev" + doas mount --bind /dev/pts "${MASTERDIR}/dev/pts" + doas mount --bind /proc "${MASTERDIR}/proc" + doas mount --bind /sys "${MASTERDIR}/sys" + doas mount --bind /tmp "${MASTERDIR}/tmp" + doas mount --bind "$(pwd)/compiled" "${MASTERDIR}/compiled" unshare --pid -r --fork --user --mount chroot ${MASTERDIR} /bin/bash -c "${command}" - sudo umount "${MASTERDIR}/compiled" - sudo umount "${MASTERDIR}/tmp" - sudo umount "${MASTERDIR}/sys" - sudo umount "${MASTERDIR}/proc" - sudo umount "${MASTERDIR}/dev/pts" - sudo umount "${MASTERDIR}/dev" + doas umount "${MASTERDIR}/compiled" + doas umount "${MASTERDIR}/tmp" + doas umount "${MASTERDIR}/sys" + doas umount "${MASTERDIR}/proc" + doas umount "${MASTERDIR}/dev/pts" + doas umount "${MASTERDIR}/dev" } function chroot { - sudo mount --bind /dev "${MASTERDIR}/dev" - sudo mount --make-rslave "${MASTERDIR}/dev" - sudo mount --bind /dev/pts "${MASTERDIR}/dev/pts" - sudo mount --bind /proc "${MASTERDIR}/proc" - sudo mount --bind /sys "${MASTERDIR}/sys" - sudo mount --bind /tmp "${MASTERDIR}/tmp" - sudo mount --bind "$(pwd)/compiled" "${MASTERDIR}/compiled" + doas mount --bind /dev "${MASTERDIR}/dev" + doas mount --make-rslave "${MASTERDIR}/dev" + doas mount --bind /dev/pts "${MASTERDIR}/dev/pts" + doas mount --bind /proc "${MASTERDIR}/proc" + doas mount --bind /sys "${MASTERDIR}/sys" + doas mount --bind /tmp "${MASTERDIR}/tmp" + doas mount --bind "$(pwd)/compiled" "${MASTERDIR}/compiled" unshare --pid -r --fork --user --mount chroot ${MASTERDIR} /bin/bash - sudo umount "${MASTERDIR}/compiled" - sudo umount "${MASTERDIR}/tmp" - sudo umount "${MASTERDIR}/sys" - sudo umount "${MASTERDIR}/proc" - sudo umount "${MASTERDIR}/dev/pts" - sudo umount "${MASTERDIR}/dev" + doas umount "${MASTERDIR}/compiled" + doas umount "${MASTERDIR}/tmp" + doas umount "${MASTERDIR}/sys" + doas umount "${MASTERDIR}/proc" + doas umount "${MASTERDIR}/dev/pts" + doas umount "${MASTERDIR}/dev" } function download_if_uncached { @@ -251,13 +259,19 @@ function pkg { cp "${template_loc}" "${MASTERDIR}/build/template" apply_patches - cp "stubs/configure" "${MASTERDIR}/build/" - env_run "DISTRO_TC=${DISTRO_TC} ./build/configure" - - cp "stubs/build" "${MASTERDIR}/build/buildstub" - env_run "DISTRO_TC=${DISTRO_TC} ./build/buildstub" - - cp "stubs/install" "${MASTERDIR}/build/install" + if [[ "$(type -t 'do_configure')" == "function" ]]; then + cp "stubs/configure" "${MASTERDIR}/build/" + env_run "DISTRO_TC=${DISTRO_TC} ./build/configure" + fi + + if [[ "$(type -t 'do_build')" == "function" ]]; then + cp "stubs/build" "${MASTERDIR}/build/buildstub" + env_run "DISTRO_TC=${DISTRO_TC} ./build/buildstub" + fi + + if [[ "$(type -t 'do_install')" == "function" ]]; then + cp "stubs/install" "${MASTERDIR}/build/install" + fi if [[ "${install_sys}" == "true" ]] then diff --git a/templates/ninja/template b/templates/ninja/template index f5033aa..30e84da 100644 --- a/templates/ninja/template +++ b/templates/ninja/template @@ -3,6 +3,8 @@ version=1.13.2 build_no=1 upstream="https://github.com/ninja-build/ninja/archive/refs/tags/v${version}.tar.gz" +makedepends=(libidn2 cmake) + function do_configure { cmake -Bbuild-cmake -DBUILD_TESTING=OFF } diff --git a/templates/python/template b/templates/python/template index f698bc6..62207e2 100644 --- a/templates/python/template +++ b/templates/python/template @@ -5,6 +5,8 @@ upstream="https://github.com/python/cpython/archive/refs/tags/v${version}.tar.gz cddir="cpython-${version}" +makedepends=(openssl3 make autoconf) + function do_configure { mkdir build/ cd build/ -- cgit v1.2.3