Fix a variety of reproducibility issues
Include: - Not regenerated man pages. - Automake tarball with bad time (and completely useless). - Ordering of files within tarballs. - Resetting timestamp various fixes. - Older tars not properly overwriting files leading to many issues. - Weird lack of reproducibility in libtool scripts paths to tools. - and more
This commit is contained in:
parent
a343dcf6ed
commit
931490551a
|
@ -20,4 +20,5 @@ src_compile() {
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
make install MAKEINFO=true DESTDIR="${DESTDIR}"
|
make install MAKEINFO=true DESTDIR="${DESTDIR}"
|
||||||
|
rm "${DESTDIR}${PREFIX}/share/doc/automake/amhello-1.0.tar.gz"
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,9 @@ src_prepare() {
|
||||||
|
|
||||||
# Pre-built texinfo files
|
# Pre-built texinfo files
|
||||||
find . -name '*.info' -delete
|
find . -name '*.info' -delete
|
||||||
|
|
||||||
|
# Pre-built man files
|
||||||
|
rm gcc/doc/*.1 gcc/doc/*.7
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
|
|
|
@ -59,6 +59,9 @@ src_prepare() {
|
||||||
|
|
||||||
# Pre-built texinfo files
|
# Pre-built texinfo files
|
||||||
find . -name '*.info' -delete
|
find . -name '*.info' -delete
|
||||||
|
|
||||||
|
# Pre-built man files
|
||||||
|
rm gcc/doc/*.1 gcc/doc/*.7
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
|
|
|
@ -5,11 +5,20 @@
|
||||||
checksum=7e6a1082a4785a7b58928865a40ed2c93940af54972a2dc30ff10185da97b491
|
checksum=7e6a1082a4785a7b58928865a40ed2c93940af54972a2dc30ff10185da97b491
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
|
rm libltdl/config/ltmain.sh
|
||||||
|
|
||||||
|
rm doc/*.info
|
||||||
|
|
||||||
./bootstrap
|
./bootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
CC=tcc ./configure \
|
CC=tcc \
|
||||||
|
EGREP="/usr/bin/grep -E" \
|
||||||
|
FGREP="/usr/bin/grep -F" \
|
||||||
|
GREP="/usr/bin/grep" \
|
||||||
|
SED="/usr/bin/sed" \
|
||||||
|
./configure \
|
||||||
--prefix="${PREFIX}" \
|
--prefix="${PREFIX}" \
|
||||||
--libdir="${PREFIX}/lib/musl" \
|
--libdir="${PREFIX}/lib/musl" \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
ar='tcc -ar'
|
ar='tcc -ar'
|
||||||
cc='tcc'
|
cc='tcc'
|
||||||
ldlibpthname='LD_LIBRARY_PATH'
|
ldlibpthname='LD_LIBRARY_PATH'
|
||||||
libpth='/image/lib/musl'
|
libpth='/usr/lib/musl'
|
||||||
path_sep=':'
|
path_sep=':'
|
||||||
archname=''
|
archname=''
|
||||||
osvers=''
|
osvers=''
|
||||||
|
|
|
@ -14,6 +14,7 @@ set -e
|
||||||
|
|
||||||
export PREFIX=/usr
|
export PREFIX=/usr
|
||||||
export SOURCES=/after
|
export SOURCES=/after
|
||||||
|
export DESTDIR="/tmp/destdir"
|
||||||
|
|
||||||
create_sysb() {
|
create_sysb() {
|
||||||
# Copy everything in
|
# Copy everything in
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
rm doc/standards.info
|
rm doc/standards.info man/*.1
|
||||||
autoreconf-2.64 -f
|
autoreconf-2.64 -f
|
||||||
|
|
||||||
# Install autoconf data files into versioned directory
|
# Install autoconf data files into versioned directory
|
||||||
|
|
|
@ -20,4 +20,5 @@ src_compile() {
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
make install MAKEINFO=true DESTDIR="${DESTDIR}"
|
make install MAKEINFO=true DESTDIR="${DESTDIR}"
|
||||||
|
rm "${DESTDIR}${PREFIX}/share/doc/automake/amhello-1.0.tar.gz"
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,5 @@ src_compile() {
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
make install MAKEINFO=true DESTDIR="${DESTDIR}"
|
make install MAKEINFO=true DESTDIR="${DESTDIR}"
|
||||||
|
rm "${DESTDIR}${PREFIX}/share/doc/automake/amhello-1.0.tar.gz"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
checksum=708d854632c90e3706194a1a7555a3dc2fafb7ccae65872ad3420083f2781143
|
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
./bootstrap
|
./bootstrap
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
checksum=3960567fc3f358d85b58a6441d3fb97442821a6d51847df72109eec547617b0b
|
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
|
@ -45,4 +45,7 @@ src_install() {
|
||||||
rm -rf "${PREFIX}"/lib/perl5/
|
rm -rf "${PREFIX}"/lib/perl5/
|
||||||
|
|
||||||
default
|
default
|
||||||
|
|
||||||
|
# Remove messed up manpages
|
||||||
|
rm -r "${DESTDIR}/"*.0
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ set -e
|
||||||
export PATH=/usr/bin:/usr/sbin
|
export PATH=/usr/bin:/usr/sbin
|
||||||
export PREFIX=/usr
|
export PREFIX=/usr
|
||||||
export SOURCES=/usr/src
|
export SOURCES=/usr/src
|
||||||
|
export DESTDIR=/tmp/destdir
|
||||||
|
|
||||||
create_fhs() {
|
create_fhs() {
|
||||||
# Add the rest of the FHS that we will use and is not created pre-boot
|
# Add the rest of the FHS that we will use and is not created pre-boot
|
||||||
|
@ -39,4 +40,4 @@ create_fhs
|
||||||
|
|
||||||
build bash-5.1
|
build bash-5.1
|
||||||
|
|
||||||
exec env -i PATH=${PATH} PREFIX=${PREFIX} SOURCES=${SOURCES} bash run2.sh
|
exec env -i PATH=${PATH} PREFIX=${PREFIX} SOURCES=${SOURCES} DESTDIR=${DESTDIR} bash run2.sh
|
||||||
|
|
|
@ -56,6 +56,8 @@ build perl-5.32.1
|
||||||
|
|
||||||
build libarchive-3.5.2
|
build libarchive-3.5.2
|
||||||
|
|
||||||
|
false
|
||||||
|
|
||||||
build openssl-1.1.1l
|
build openssl-1.1.1l
|
||||||
|
|
||||||
build zlib-1.2.11
|
build zlib-1.2.11
|
||||||
|
@ -85,7 +87,7 @@ build libatomic_ops-7.6.10
|
||||||
|
|
||||||
build gc-8.0.4
|
build gc-8.0.4
|
||||||
|
|
||||||
build guile-3.0.7
|
#build guile-3.0.7
|
||||||
|
|
||||||
if [ "$FORCE_TIMESTAMPS" = True ] ; then
|
if [ "$FORCE_TIMESTAMPS" = True ] ; then
|
||||||
echo 'Forcing all files timestamps to be 0 unix time.'
|
echo 'Forcing all files timestamps to be 0 unix time.'
|
||||||
|
|
|
@ -35,25 +35,30 @@ get_links() {
|
||||||
|
|
||||||
# Reset all timestamps to unix time 0
|
# Reset all timestamps to unix time 0
|
||||||
reset_timestamp() {
|
reset_timestamp() {
|
||||||
fs=
|
args=
|
||||||
if [ -n "$(ls)" ]; then
|
if touch --help | grep ' \-h' >/dev/null; then
|
||||||
fs=$(echo *)
|
args="-h"
|
||||||
fi
|
fi
|
||||||
if [ -n "$(ls .[0-z]*)" ]; then
|
if command -v find 2>&1 >/dev/null; then
|
||||||
fs="${fs} $(echo .[0-z]*)"
|
find . -exec touch ${args} -t 197001010000.00 "{}" \;
|
||||||
|
else
|
||||||
|
# A rudimentary find implementation that does the trick
|
||||||
|
fs=
|
||||||
|
if [ -n "$(ls)" ]; then
|
||||||
|
fs=$(echo *)
|
||||||
|
fi
|
||||||
|
if [ -n "$(ls .[0-z]*)" ]; then
|
||||||
|
fs="${fs} $(echo .[0-z]*)"
|
||||||
|
fi
|
||||||
|
for f in ${fs}; do
|
||||||
|
touch ${args} -t 197001010000.00 "${f}"
|
||||||
|
if [ -d "${f}" ]; then
|
||||||
|
cd "${f}"
|
||||||
|
reset_timestamp
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
for f in ${fs}; do
|
|
||||||
args=
|
|
||||||
if touch --help | grep ' \-h' >/dev/null; then
|
|
||||||
args="-h"
|
|
||||||
fi
|
|
||||||
touch ${args} -t 197001010000.00 "${f}"
|
|
||||||
if [ -d "${f}" ]; then
|
|
||||||
cd "${f}"
|
|
||||||
reset_timestamp
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Common build steps
|
# Common build steps
|
||||||
|
@ -77,8 +82,6 @@ build() {
|
||||||
mk_dir="${base_dir}/mk"
|
mk_dir="${base_dir}/mk"
|
||||||
files_dir="${base_dir}/files"
|
files_dir="${base_dir}/files"
|
||||||
|
|
||||||
DESTDIR="/tmp/destdir"
|
|
||||||
|
|
||||||
mkdir -p "build"
|
mkdir -p "build"
|
||||||
cd "build"
|
cd "build"
|
||||||
|
|
||||||
|
@ -135,12 +138,19 @@ build() {
|
||||||
# All symlinks are dereferenced, which is BAD
|
# All symlinks are dereferenced, which is BAD
|
||||||
cd "${DESTDIR}"
|
cd "${DESTDIR}"
|
||||||
get_links > "/usr/src/repo/${pkg}_${revision}.links"
|
get_links > "/usr/src/repo/${pkg}_${revision}.links"
|
||||||
cd /usr/src/repo
|
if command -v find >/dev/null 2>&1 && command -v sort >/dev/null 2>&1; then
|
||||||
args=
|
find -print0 | LC_ALL=C sort -z > /tmp/filelist.txt
|
||||||
if tar --help | grep ' \-\-sort' >/dev/null 2>&1; then
|
fi
|
||||||
args="--sort=name"
|
cd /usr/src/repo
|
||||||
|
if tar --help | grep ' \-\-sort' >/dev/null 2>&1; then
|
||||||
|
tar -C "${DESTDIR}" --sort=name --hard-dereference -cf "/usr/src/repo/${pkg}_${revision}.tar" .
|
||||||
|
elif command -v find >/dev/null 2>&1 && command -v sort >/dev/null 2>&1; then
|
||||||
|
cd "${DESTDIR}"
|
||||||
|
tar --no-recursion --null -T /tmp/filelist.txt -cf "/usr/src/repo/${pkg}_${revision}.tar"
|
||||||
|
cd -
|
||||||
|
else
|
||||||
|
tar -C "${DESTDIR}" -cf "/usr/src/repo/${pkg}_${revision}.tar" .
|
||||||
fi
|
fi
|
||||||
tar -C "${DESTDIR}" ${args} -cf "/usr/src/repo/${pkg}_${revision}.tar" .
|
|
||||||
touch -t 197001010000.00 "${pkg}_${revision}.tar"
|
touch -t 197001010000.00 "${pkg}_${revision}.tar"
|
||||||
gzip "${pkg}_${revision}.tar"
|
gzip "${pkg}_${revision}.tar"
|
||||||
fi
|
fi
|
||||||
|
@ -168,16 +178,22 @@ build() {
|
||||||
if command -v xbps-install >/dev/null 2>&1; then
|
if command -v xbps-install >/dev/null 2>&1; then
|
||||||
xbps-install -y -R /usr/src/repo "${pkg%%-[0-9]*}"
|
xbps-install -y -R /usr/src/repo "${pkg%%-[0-9]*}"
|
||||||
else
|
else
|
||||||
|
# Overwriting files is mega busted, so do it manually
|
||||||
|
while IFS= read -d $'\0' file; do
|
||||||
|
rm -f "/${file}" >/dev/null 2>&1 || true
|
||||||
|
done < /tmp/filelist.txt
|
||||||
tar -C / -xzpf "/usr/src/repo/${pkg}_${revision}.tar.gz"
|
tar -C / -xzpf "/usr/src/repo/${pkg}_${revision}.tar.gz"
|
||||||
# shellcheck disable=SC2162
|
# shellcheck disable=SC2162
|
||||||
# ^ read -r unsupported in old bash
|
# ^ read -r unsupported in old bash
|
||||||
while read line; do
|
while read line; do
|
||||||
# shellcheck disable=SC2001
|
# shellcheck disable=SC2001
|
||||||
# ^ cannot use variable expansion here
|
# ^ cannot use variable expansion here
|
||||||
rm -f "$(echo "${line}" | sed 's/.* //')"
|
fname="$(echo "${line}" | sed 's/.* //')"
|
||||||
|
rm -f "${fname}"
|
||||||
# shellcheck disable=SC2226,SC2086
|
# shellcheck disable=SC2226,SC2086
|
||||||
# ^ ${line} expands into two arguments
|
# ^ ${line} expands into two arguments
|
||||||
ln -s ${line}
|
ln -s ${line}
|
||||||
|
touch -t 197001010000.00 "${fname}"
|
||||||
done < "/usr/src/repo/${pkg}_${revision}.links"
|
done < "/usr/src/repo/${pkg}_${revision}.links"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue