Add file downloading logic

Add urls to sysc, and modify some tarballs to http (non s) before ssl
This commit is contained in:
fosslinux 2022-05-12 19:50:28 +10:00
parent 39541e30f5
commit 8008de8e73
42 changed files with 110 additions and 152 deletions

View File

@ -21,6 +21,7 @@ src_prepare() {
src_configure() {
LDFLAGS="-static" ./configure \
--prefix="${PREFIX}" \
--build=i386-unknown-linux-gnu \
--without-ssl \
--disable-hsts
}

View File

@ -147,6 +147,10 @@ build() {
. "${build_script}"
fi
echo "${pkg}: getting sources."
build_stage=src_get
call $build_stage
echo "${pkg}: unpacking source."
build_stage=src_unpack
call $build_stage
@ -192,13 +196,28 @@ build() {
unset -f src_unpack src_prepare src_configure src_compile src_install
}
# Default get function that downloads source tarballs.
default_src_get() {
if ! [ -z "${urls}" ] && command -v curl >/dev/null 2>&1; then
for i in ${urls}; do
curl -L "${i}" --output "${DISTFILES}/$(basename "${i}")"
done
fi
}
# Default unpacking function that unpacks all source tarballs.
default_src_unpack() {
distfiles=${EXTRA_DISTFILES}
# shellcheck disable=SC2153
for f in "${DISTFILES}/${pkg}."*; do
distfiles="$(basename "$f") ${distfiles}"
done
distfiles="${EXTRA_DISTFILES}"
if [ -z "${urls}" ]; then
# shellcheck disable=SC2153
for f in "${DISTFILES}/${pkg}."*; do
distfiles="$(basename "$f") ${distfiles}"
done
else
for i in ${urls}; do
distfiles="$(basename "${i}") ${distfiles}"
done
fi
# Check for new tar
# shellcheck disable=SC2153

125
sysc.py
View File

@ -65,133 +65,8 @@ class SysC(SysGeneral):
else:
rootfs_dir = self.tmp_dir
self.get_packages()
copytree(self.sys_dir, rootfs_dir, ignore=shutil.ignore_patterns("tmp"))
# Unmount tmp/mnt if it was mounted
if create_disk_image:
umount(rootfs_dir)
# pylint: disable=line-too-long,too-many-statements
def get_packages(self):
"""Prepare remaining sources"""
# bash 5.1
self.get_file("https://mirrors.kernel.org/gnu/bash/bash-5.1.tar.gz")
# xz 5.0.5
self.get_file("https://tukaani.org/xz/xz-5.0.5.tar.bz2")
# automake 1.11.2
self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.11.2.tar.bz2")
# autoconf 2.69
self.get_file("https://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.xz")
# automake 1.15.1
self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.15.1.tar.xz")
# tar 1.34
self.get_file(["https://mirrors.kernel.org/gnu/tar/tar-1.34.tar.xz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-30820c.tar.gz"])
# coreutils 8.32
self.get_file(["https://git.savannah.gnu.org/cgit/coreutils.git/snapshot/coreutils-8.32.tar.gz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-d279bc.tar.gz"])
# pkg-config 0.29.2
self.get_file("https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz")
# make 4.2.1
self.get_file("https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz")
# gmp 6.2.1
self.get_file("https://mirrors.kernel.org/gnu/gmp/gmp-6.2.1.tar.xz")
# autoconf archive 2021.02.19
self.get_file("https://mirrors.kernel.org/gnu/autoconf-archive/autoconf-archive-2021.02.19.tar.xz")
# mpfr 4.1.0
self.get_file("https://mirrors.kernel.org/gnu/mpfr/mpfr-4.1.0.tar.xz")
# mpc 1.2.1
self.get_file("https://mirrors.kernel.org/gnu/mpc/mpc-1.2.1.tar.gz")
# flex 2.5.33
self.get_file("http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.33.tar.gz")
# bison 2.3
self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz"])
# bison 3.4.2
self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-3.4.2.tar.xz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-672663a.tar.gz"])
# perl 5.10.5
self.get_file("https://www.cpan.org/src/5.0/perl-5.10.1.tar.bz2")
# dist 3.5-236
# Debian's version is used because upstream is not to be found (dead?)
self.get_file("https://salsa.debian.org/perl-team/interpreter/dist/-/archive/d1de81f/dist-d1de81f.tar.gz",
output="dist-3.5-236.tar.gz")
# perl 5.32.1
self.get_file(["https://www.cpan.org/src/5.0/perl-5.32.1.tar.xz",
"https://salsa.debian.org/perl-team/interpreter/perl/-/archive/5f2dc80/perl-5f2dc80.tar.bz2"])
# libarchive-3.5.2
self.get_file("https://libarchive.org/downloads/libarchive-3.5.2.tar.xz")
# openssl-1.1.1l
self.get_file("https://www.openssl.org/source/openssl-1.1.1l.tar.gz")
# xbps 0.59.1
self.get_file("https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz",
output="xbps-0.59.1.tar.gz")
# autoconf 2.71
self.get_file("https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.xz")
# automake 1.16.3
self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.16.3.tar.xz")
# patch 2.7.6
self.get_file(["https://mirrors.kernel.org/gnu/patch/patch-2.7.6.tar.xz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-e017871.tar.gz"])
# gettext 0.21
self.get_file(["https://mirrors.kernel.org/gnu/gettext/gettext-0.21.tar.xz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-7daa86f.tar.gz"])
# texinfo 6.7
self.get_file(["https://mirrors.kernel.org/gnu/texinfo/texinfo-6.7.tar.xz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b81ec69.tar.gz"])
# zlib 1.2.12
self.get_file("https://www.zlib.net/zlib-1.2.12.tar.xz")
# gcc 4.7.4
self.get_file("https://mirrors.kernel.org/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2")
# gperf 3.1
self.get_file("https://mirrors.kernel.org/gnu/gperf/gperf-3.1.tar.gz")
# libunistring 0.9.10
self.get_file(["https://mirrors.kernel.org/gnu/libunistring/libunistring-0.9.10.tar.xz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-52a06cb3.tar.gz"])
# libffi 3.3
self.get_file("https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz")
# libatomic_ops 7.6.10
self.get_file("https://github.com/ivmai/libatomic_ops/releases/download/v7.6.10/libatomic_ops-7.6.10.tar.gz")
# boehm-gc 8.0.4
self.get_file("https://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz")
# guile 3.0.7
self.get_file(["https://mirrors.kernel.org/gnu/guile/guile-3.0.7.tar.xz",
"https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-901694b9.tar.gz",
"https://github.com/schierlm/guile-psyntax-bootstrapping/archive/refs/tags/guile-3.0.7.tar.gz"],
output=["guile-3.0.7.tar.xz", "gnulib-901694b9.tar.gz", "guile-psyntax-bootstrapping.tar.gz"])

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.xz"
src_prepare() {
rm doc/standards.info man/*.1
autoreconf-2.64 -f

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.xz"
src_prepare() {
rm doc/standards.info
autoreconf-2.69 -fi

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/autoconf-archive/autoconf-archive-2021.02.19.tar.xz"
src_prepare() {
autoreconf-2.69 -fi
}

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/automake/automake-1.11.2.tar.bz2"
src_prepare() {
default

View File

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/automake/automake-1.15.1.tar.xz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://mirrors.kernel.org/gnu/automake/automake-1.16.3.tar.xz"
src_prepare() {
./bootstrap

View File

@ -5,6 +5,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/bash/bash-5.1.tar.gz"
src_prepare() {
# Remove bison generated files
rm y.tab.c y.tab.h

View File

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-b28236b.tar.gz"
urls="http://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2
http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz"
src_prepare() {
default

View File

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-672663a.tar.gz"
urls="http://mirrors.kernel.org/gnu/bison/bison-3.4.2.tar.xz
http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-672663a.tar.gz"
src_prepare() {
default

View File

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-d279bc.tar.gz"
urls="http://git.savannah.gnu.org/cgit/coreutils.git/snapshot/coreutils-8.32.tar.gz
http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-d279bc.tar.gz"
regenerate_files() {
build-aux/gen-lists-of-programs.sh --autoconf > m4/cu-progs.m4

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://deb.debian.org/debian/pool/main/d/dist/dist_3.5-236.orig.tar.gz"
# We manually compile here because ./Configure uses metaconfig itself
# *sigh*

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.33.tar.gz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz"
src_prepare() {
autoreconf-2.71 -fi
}

View File

@ -4,6 +4,8 @@
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://mirrors.kernel.org/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2"
src_prepare() {
default

View File

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-7daa86f.tar.gz"
urls="https://mirrors.kernel.org/gnu/gettext/gettext-0.21.tar.xz
https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-7daa86f.tar.gz"
src_prepare() {
find . -name '*.info*' -delete

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/gmp/gmp-6.2.1.tar.xz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://mirrors.kernel.org/gnu/gperf/gperf-3.1.tar.gz"
src_prepare() {
find . -name '*.info*' -delete

View File

@ -4,7 +4,9 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-901694b9.tar.gz guile-psyntax-bootstrapping.tar.gz"
urls="https://mirrors.kernel.org/gnu/guile/guile-3.0.7.tar.xz
https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-901694b9.tar.gz
https://github.com/schierlm/guile-psyntax-bootstrapping/archive/refs/tags/guile-3.0.7.tar.gz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://libarchive.org/downloads/libarchive-3.5.2.tar.xz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://github.com/ivmai/libatomic_ops/releases/download/v7.6.10/libatomic_ops-7.6.10.tar.gz"
src_prepare() {
autoreconf-2.71 -fi
}

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz"
src_prepare() {
find . -name '*.info*' -delete

View File

@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-52a06cb3.tar.gz"
urls="https://mirrors.kernel.org/gnu/libunistring/libunistring-0.9.10.tar.xz
https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-52a06cb3.tar.gz"
src_prepare() {
find . -name '*.info*' -delete

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/mpc/mpc-1.2.1.tar.gz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://mirrors.kernel.org/gnu/mpfr/mpfr-4.1.0.tar.xz"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://artfiles.org/openssl.org/source/old/1.1.1/openssl-1.1.1l.tar.gz"
src_prepare() {
default

View File

@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-e017871.tar.gz"
urls="https://mirrors.kernel.org/gnu/patch/patch-2.7.6.tar.xz
https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-e017871.tar.gz"
src_prepare() {
../../import-gnulib.sh

View File

@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="perl-5.10.1.tar.bz2"
urls="http://www.cpan.org/src/5.0/perl-5.10.1.tar.bz2"
src_prepare() {
default_src_prepare

View File

@ -7,8 +7,8 @@ generate with correct values for live-bootstrap.
NOTE: this patch CANNOT be applied to a non-live-bootstrap environment.
--- ../perl-5f2dc80/regen-configure/U/threads/archname.U 2022-02-27 21:30:03.155396204 +1100
+++ ../perl-5f2dc80/regen-configure/U/threads/archname.U 2022-02-27 21:30:49.392396204 +1100
--- ../metaconfig-5.32.1~rc1/U/threads/archname.U 2022-02-27 21:30:03.155396204 +1100
+++ ../metaconfig-5.32.1~rc1/U/threads/archname.U 2022-02-27 21:30:49.392396204 +1100
@@ -79,7 +79,7 @@
?X: Very GCCian.
*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
@ -18,8 +18,8 @@ NOTE: this patch CANNOT be applied to a non-live-bootstrap environment.
case "$archname" in
'') dflt="$tarch";;
*) dflt="$archname";;
--- ../perl-5f2dc80/regen-configure/U/modified/Oldconfig.U 2022-02-27 21:31:26.911396204 +1100
+++ ../perl-5f2dc80/regen-configure/U/modified/Oldconfig.U 2022-02-27 21:32:31.846396204 +1100
--- ../metaconfig-5.32.1~rc1/U/modified/Oldconfig.U 2022-02-27 21:31:26.911396204 +1100
+++ ../metaconfig-5.32.1~rc1/U/modified/Oldconfig.U 2022-02-27 21:32:31.846396204 +1100
@@ -117,16 +117,13 @@
?X: on some machines to avoid the error message when uname is not found; e.g.
?X: old SUN-OS 3.2 would not execute hostname in (uname -a || hostname). Sigh!

View File

@ -7,8 +7,8 @@ generate with correct values for live-bootstrap.
NOTE: this patch CANNOT be applied to a non-live-bootstrap environment.
--- ../perl-5f2dc80/regen-configure/dist/U/archname.U 2022-02-26 10:51:45.343097807 +1100
+++ ../perl-5f2dc80/regen-configure/dist/U/archname.U 2022-02-26 10:51:51.742527859 +1100
--- ../metaconfig-5.32.1~rc1/dist/U/archname.U 2022-02-26 10:51:45.343097807 +1100
+++ ../metaconfig-5.32.1~rc1/dist/U/archname.U 2022-02-26 10:51:51.742527859 +1100
@@ -72,5 +72,5 @@
rp='What is your architecture name'
. ./myread
@ -16,8 +16,8 @@ NOTE: this patch CANNOT be applied to a non-live-bootstrap environment.
-myarchname="$tarch"
+myarchname="i386"
--- ../perl-5f2dc80/regen-configure/dist/U/Oldconfig.U 2022-02-27 10:55:04.890396204 +1100
+++ ../perl-5f2dc80/regen-configure/dist/U/Oldconfig.U 2022-02-27 11:00:31.324396204 +1100
--- ../metaconfig-5.32.1~rc1/dist/U/Oldconfig.U 2022-02-27 10:55:04.890396204 +1100
+++ ../metaconfig-5.32.1~rc1/dist/U/Oldconfig.U 2022-02-27 11:00:31.324396204 +1100
@@ -109,16 +109,13 @@
?LINT:extern hostarch libswanted libs
?LINT:change hostarch libswanted libs

View File

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="perl-5f2dc80.tar.bz2"
urls="http://www.cpan.org/src/5.0/perl-5.32.1.tar.xz
http://deb.debian.org/debian/pool/main/p/perl/perl_5.32.1.orig-regen-configure.tar.gz"
src_prepare() {
default
@ -26,8 +27,8 @@ src_prepare() {
# Regenerate configure + config_h.SH
rm -f Configure config_h.SH
ln -s ../perl-5f2dc80/regen-configure/.package .
ln -s ../perl-5f2dc80/regen-configure/U .
ln -s ../metaconfig-5.32.1\~rc1/.package .
ln -s ../metaconfig-5.32.1\~rc1/U .
metaconfig -m
}

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://gentoo.osuosl.org/distfiles/pkg-config-0.29.2.tar.gz"
src_prepare() {
autoreconf -fi
}

View File

@ -23,12 +23,16 @@ create_fhs() {
test -d /sys || (mkdir /sys && mount -t sysfs sysfs /sys)
# Make /tmp a ramdisk (speeds up configure etc significantly)
test -d /tmp || (mkdir /tmp && mount -t tmpfs tmpfs /tmp)
# Add /etc/resolv.conf
echo 'nameserver 1.1.1.1' > /etc/resolv.conf
}
populate_device_nodes ""
create_fhs
mkdir -p "${DISTFILES}"
build bash-5.1
exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" SRCDIR="${SRCDIR}" bash run2.sh

View File

@ -51,7 +51,7 @@ build bison-3.4.2
build perl-5.10.1
build dist-3.5-236 '' '' dist-d1de81f
build dist-3.5-236
build perl-5.32.1

View File

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-30820c.tar.gz"
urls="http://mirrors.kernel.org/gnu/tar/tar-1.34.tar.xz
http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-30820c.tar.gz"
src_prepare() {
default

View File

@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="gnulib-b81ec69.tar.gz"
urls="https://mirrors.kernel.org/gnu/texinfo/texinfo-6.7.tar.xz
https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b81ec69.tar.gz"
src_prepare() {
find . -name '*.mo' -delete

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz"
src_configure() {
PKG_CONFIG_PATH="${PREFIX}/lib/musl/pkgconfig" \
./configure --prefix="${PREFIX}" \

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="http://ixpeering.dl.sourceforge.net/project/lzmautils/xz-5.0.5.tar.bz2"
src_prepare() {
default

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://www.zlib.net/zlib-1.2.12.tar.xz"
src_configure() {
./configure --prefix="${PREFIX}" --libdir="${PREFIX}/lib/musl" --static
}