Build both stages of curl in sysc

The source tarball is provided as part of sysa distfiles and copied to sysc, which resolves the issue of finding a reliable plain HTTP mirror for curl.

Splitted from https://github.com/fosslinux/live-bootstrap/pull/253.
This commit is contained in:
Eduardo Sánchez Muñoz 2023-03-23 18:35:38 +01:00
parent bc4ecd9ed4
commit dcd43599a7
12 changed files with 23 additions and 96 deletions

34
sysc/curl-7.88.1/pass1.sh Executable file
View file

@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Regnerate src/tool_cb_prg.c
sed -i "55,76d" src/tool_cb_prg.c
sed -i "55 s/^/$(perl sinus.pl | sed "s/, $//")\n/" src/tool_cb_prg.c
rm src/tool_help.c src/tool_help.h src/tool_listhelp.c src/tool_hugehelp.c
# Rebuild libtool files
rm config.guess config.sub ltmain.sh
libtoolize
AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
}
src_configure() {
LDFLAGS="-static" ./configure \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--build=i386-unknown-linux-gnu \
--enable-ipv6 \
--without-ssl \
--disable-hsts
}
src_install() {
default
install -m 755 scripts/mk-ca-bundle.pl "${DESTDIR}/usr/bin/mk-ca-bundle"
}

View file

@ -22,8 +22,8 @@ src_configure() {
LDFLAGS="-static" ./configure \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--build=i386-unknown-linux-musl \
--enable-ipv6 \
--with-openssl \
--with-ca-bundle=/etc/ssl/certs.pem \
--build=i386-unknown-linux-musl
--with-ca-bundle=/etc/ssl/certs.pem
}

View file

@ -0,0 +1,56 @@
# SPDX-FileCopyrightText: 2023 Eduardo Sánchez Muñoz <eduardosm-dev@e64.io>
#
# SPDX-License-Identifier: curl
Disables checking current date in mk-ca-bundle script, so it produces
reproducible bundles.
diff -ru scripts/mk-ca-bundle.pl scripts/mk-ca-bundle.pl
--- scripts/mk-ca-bundle.pl
+++ scripts/mk-ca-bundle.pl
@@ -499,19 +499,7 @@
if($main_block) {
push @precert, $_ if not /^#$/;
if(/^# Not Valid After : (.*)/) {
- my $stamp = $1;
- use Time::Piece;
- # Not Valid After : Thu Sep 30 14:01:15 2021
- my $t = Time::Piece->strptime($stamp, "%a %b %d %H:%M:%S %Y");
- my $delta = ($t->epoch - time()); # negative means no longer valid
- if($delta < 0) {
- $skipnum++;
- report "Skipping: $main_block_name is not valid anymore" if ($opt_v);
- $valid = 0;
- }
- else {
- $valid = 1;
- }
+ $valid = 1;
}
}
next;
@@ -573,24 +561,6 @@
if($timestamp[12] ne "Z") {
report "distrust date stamp is not using UTC";
}
- # Example date: 200617000000Z
- # Means 2020-06-17 00:00:00 UTC
- my $distrustat =
- timegm($timestamp[10] . $timestamp[11], # second
- $timestamp[8] . $timestamp[9], # minute
- $timestamp[6] . $timestamp[7], # hour
- $timestamp[4] . $timestamp[5], # day
- ($timestamp[2] . $timestamp[3]) - 1, # month
- "20" . $timestamp[0] . $timestamp[1]); # year
- if(time >= $distrustat) {
- # not trusted anymore
- $skipnum++;
- report "Skipping: $main_block_name is not trusted anymore" if ($opt_v);
- $valid = 0;
- }
- else {
- # still trusted
- }
}
next;
}

View file

@ -1 +1 @@
http://curl.se/download/curl-7.88.1.tar.xz 1dae31b2a7c1fe269de99c0c31bb488346aab3459b5ffca909d6938249ae415f
https://curl.se/download/curl-7.88.1.tar.bz2 8224b45cce12abde039c12dc0711b7ea85b104b9ad534d6e4c5b4e188a61c907

View file

@ -43,7 +43,6 @@ install_tar binutils-2.30 0
install_tar bzip2-1.0.8 0
install_tar bison-3.4.1 2
install_tar coreutils-6.10 0
install_tar curl-7.88.1 0
install_tar dhcpcd-9.4.1 0
install_tar diffutils-2.7 0
install_tar findutils-4.2.33 0

View file

@ -36,6 +36,14 @@ create_fhs
populate_device_nodes
if [ -e "${SOURCES}/distfiles" ]; then
mv "${SOURCES}/distfiles" /
else
mkdir -p "${DISTFILES}"
fi
build curl-7.88.1 pass1.sh
# Obtain network connection
if [ "${CHROOT}" = "False" ]; then
dhcpcd --waitip=4
@ -52,12 +60,6 @@ if [ "${CHROOT}" = "False" ]; then
done
fi
if [ -e "${SOURCES}/distfiles" ]; then
mv "${SOURCES}/distfiles" /
else
mkdir -p "${DISTFILES}"
fi
build bash-5.2.15
exec env -i PATH="${PATH}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash run2.sh

View file

@ -58,7 +58,7 @@ build openssl-1.1.1l
build ca-certificates-3.88.1
build curl-7.88.1
build curl-7.88.1 pass2.sh
build zlib-1.2.13