Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions variants/brush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,42 @@ shvr_build_brush ()
tar --extract \
--file="${build_srcdir}.tar.gz" \
--strip-components=1 \
--directory="${build_srcdir}"
--directory="${build_srcdir}" \
--owner=0 \
--group=0 \
--mode=go-w \
--touch

cd "${build_srcdir}"

RUSTFLAGS="-A unused_imports" cargo build --release
# Build with reproducible flags
# Use fixed source date epoch and disable compiler timestamp features
export SOURCE_DATE_EPOCH=1
export TZ=UTC
export RUSTFLAGS="-A unused_imports -C target-feature=-crt-static"

cargo build --release

unset SOURCE_DATE_EPOCH TZ RUSTFLAGS

mkdir -p "${SHVR_DIR_OUT}/brush_${version}/bin"
cp "./target/release/brush" "${SHVR_DIR_OUT}/brush_$version/bin"

# Strip binary to ensure reproducible output
strip --strip-all "${SHVR_DIR_OUT}/brush_${version}/bin/brush"

# Ensure consistent permissions and timestamps
touch -d "@1" "${SHVR_DIR_OUT}/brush_${version}/bin/brush"
chmod 755 "${SHVR_DIR_OUT}/brush_${version}/bin/brush"

"${SHVR_DIR_OUT}/brush_${version}/bin/brush" -c "echo brush version $version"
}

shvr_deps_brush ()
{
shvr_versioninfo_brush "$1"
apt-get -y install \
curl wget gcc
curl wget gcc binutils

if ! test -f "$HOME/.cargo/env"
then
Expand Down
23 changes: 21 additions & 2 deletions variants/yashrs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,42 @@ shvr_build_yashrs ()
tar --extract \
--file="${build_srcdir}.tar.gz" \
--strip-components=1 \
--directory="${build_srcdir}"
--directory="${build_srcdir}" \
--owner=0 \
--group=0 \
--mode=go-w \
--touch

cd "${build_srcdir}"

# Build with reproducible flags
# Use fixed source date epoch and disable compiler timestamp features
export SOURCE_DATE_EPOCH=1
export TZ=UTC
export RUSTFLAGS="-C target-feature=-crt-static"

cargo build --release

unset SOURCE_DATE_EPOCH TZ RUSTFLAGS

mkdir -p "${SHVR_DIR_OUT}/yashrs_${version}/bin"
cp "./target/release/yash3" "${SHVR_DIR_OUT}/yashrs_$version/bin"

# Strip binary to ensure reproducible output
strip --strip-all "${SHVR_DIR_OUT}/yashrs_${version}/bin/yash3"

# Ensure consistent permissions and timestamps
touch -d "@1" "${SHVR_DIR_OUT}/yashrs_${version}/bin/yash3"
chmod 755 "${SHVR_DIR_OUT}/yashrs_${version}/bin/yash3"

"${SHVR_DIR_OUT}/yashrs_${version}/bin/yash3" -c "echo yashrs version $version"
}

shvr_deps_yashrs ()
{
shvr_versioninfo_yashrs "$1"
apt-get -y install \
curl wget gcc
curl wget gcc binutils

if ! test -f "$HOME/.cargo/env"
then
Expand Down