Variety of improvements

- Rename sources to distfiles for clarity.
- Per sys(a/c) distfiles to reduce rootfs.py processing and reduce RAM
  usage in sysa.
- Canonicalise early kaem mes/tcc files to kaem script conventions.
- Cleanup unused setup in python.
This commit is contained in:
fosslinux 2022-04-24 13:59:17 +10:00
parent acf713595c
commit f1600467a7
48 changed files with 130 additions and 138 deletions

View file

@ -118,7 +118,7 @@ build() {
echo "${pkg}: unpacking source."
build_stage=src_unpack
call $build_stage
unset EXTRA_SRCS
unset EXTRA_DISTFILES
cd "${dirname}" || (echo "Cannot cd into build/${dirname}!"; kill $$)
@ -153,8 +153,6 @@ build() {
echo "${pkg}: creating package."
cd "${DESTDIR}"
src_pkg
# Various shenanigans must be implemented for repoducibility
# as a result of timestamps
src_checksum
@ -171,36 +169,31 @@ build() {
cd "${SOURCES}"
unset -f src_unpack src_prepare src_configure src_compile src_install
unset checksum
}
# Default unpacking function that unpacks all source tarballs.
default_src_unpack() {
SRCS=$EXTRA_SRCS
for f in "/sources/${pkg}."*; do
SRCS="$(basename "$f") ${SRCS}"
distfiles=${EXTRA_DISTFILES}
# shellcheck disable=SC2153
for f in "${DISTFILES}/${pkg}."*; do
distfiles="$(basename "$f") ${distfiles}"
done
# Check for new tar
# shellcheck disable=SC2153
if test -e "${PREFIX}/libexec/rmt"; then
for i in $SRCS; do
tar --no-same-owner -xf "/sources/${i}"
for i in ${distfiles}; do
tar --no-same-owner -xf "${DISTFILES}/${i}"
done
else
for i in $SRCS; do
for i in ${distfiles}; do
case "$i" in
*.tar.gz)
tar -xzf "/sources/${i}"
;;
*.tar.gz) tar -xzf "${DISTFILES}/${i}" ;;
*.tar.bz2)
# Initial bzip2 built against meslibc has broken pipes
bzip2 --decompress --keep "/sources/${i}"
tar -xf "/sources/${i%.bz2}"
rm "/sources/${i%.bz2}"
;;
bzip2 -dc "${DISTFILES}/${i}" | tar -xf - ;;
*.tar.xz)
tar -xf "/sources/${i}" --use-compress-program=xz
;;
tar -xf "${DISTFILES}/${i}" --use-compress-program=xz ;;
esac
done
fi
@ -297,9 +290,8 @@ src_apply() {
rm -f "/${file}" >/dev/null 2>&1 || true
done < /tmp/filelist.txt
fi
bzip2 --decompress --keep "/usr/src/repo/${pkg}_${revision}.tar.bz2"
tar -C / -xpf "/usr/src/repo/${pkg}_${revision}.tar"
rm "/usr/src/repo/${pkg}_${revision}.tar"
bzip2 -dc "/usr/src/repo/${pkg}_${revision}.tar.bz2" | \
tar -C / -xpf -
# shellcheck disable=SC2162
# ^ read -r unsupported in old bash
while read line; do