AOSC-Archive / autobuild3

AOSC OS package maintenance toolkit (version 3)
https://aosc.io
GNU General Public License v2.0
24 stars 17 forks source link

Shall we add intermediate steps between configure, compile and install? #36

Closed Artoria2e5 closed 9 years ago

Artoria2e5 commented 9 years ago

With this we can get a lot of build removed from our current abbs repo.

Btw, maybe we should add some automated support for make with menuconfig and regular make.

# build/13-plainmake.sh
build_plainmake_probe(){
    arch_findfile make_dotconfig &>/dev/null ||
    [ -e Makefile ]
}

build_plainmake_build(){
    # no conf step.
    build_ready
    make "$ABMK" || return $?
    build_final
    make install || return $?
}

ABBUILD+=' plainmake'
# proc/50-build.sh
build_start
build_${ABTYPE}_build
# ...
# proc/20-build_funcs.sh
_mk_stub build{start,ready,final}
for i in $AB/build/*.sh
do
        . "$i"
done
# proc/10-defines.sh
# ..............
arch_loadfile functions
# So we move the really programmable part of defines here.
# lib/base.sh
_mk_stub(){ local i; for i; do _whichcmd "$i" &>/dev/null || eval "$i(){ ${STUBSTR:-:;} }"; done; }
# abbs::apt/functions
# mask make install
make(){
    if [ "$1" != install ]; then
        env make "$@"
    else
        abinfo "Masking command: $(argprint make "$@")"
    fi
}
# really do the install job
build_final(){
    _apt_in(){ local target args=("$@"); target="${args[-1]}"; unset args[-1]; cp --reflink -al "${args[@]}" "$PKGDIR/$target"; }
    make -C po
    mkdir -p "$PKGDIR"/usr/{{s,}bin,share,lib/{apt,dpkg/methods/apt}}
    _apt_in bin/apt /usr/sbin/
    _apt_in bin/apt-* /usr/bin/
    _apt_in bin/methods /usr/lib/apt/
    _apt_in scripts/dselect/* /usr/lib/dpkg/methods/apt/
    _apt_in locale /usr/share/
    _apt_in bin/lib* /usr/lib/
    _apt_in include/ /usr/include/
    unset -f _apt_in
}
Artoria2e5 commented 9 years ago

Status: impl pending

Artoria2e5 commented 9 years ago

Status: discussion needed: how shall we handle python?

Current:

build_python_build(){
    for PYTHON in "$(bool NOPYTHON2 || which python2 || which python || echo)" \
    "$(bool NOPYTHON3 || which python3 || echo)"; do
        if bool $USE_PYTHON_BUILD_FIRST; then
            build_ready
            "$PYTHON" build || return $?
        fi
        build_final
        "$PYTHON" setup.py install $MAKE_AFTER --prefix=/usr --root="$PKGDIR" --optimize=1 || return $?
        bool $NOPYTHONCLEAN || "$PYTHON" setup.py clean || true
    done
}
Artoria2e5 commented 9 years ago

build_start is actually prepare. Working on the rest.

Artoria2e5 commented 9 years ago

Still need build_start for autotools after reconf.

Artoria2e5 commented 9 years ago

Impl-ed.