Files
darkforge/toolchain/scripts/166-patch.sh
2026-03-20 15:09:30 +01:00

36 lines
980 B
Bash
Executable File

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 3, Chapter 8: patch
# ============================================================================
# Purpose: Build GNU patch (applies patches to files).
# Essential for applying LFS and DarkForge patches to source code.
# Inputs: /sources/patch-2.7.6.tar.xz
# Outputs: patch binary in /usr/bin/
# Assumes: Running inside chroot
# Ref: LFS 13.0 §8.72
# ============================================================================
set -euo pipefail
source /sources/toolchain-scripts/100-chroot-env.sh
PACKAGE="patch"
VERSION="2.7.6"
echo "=== Building ${PACKAGE}-${VERSION} ==="
cd /sources
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
cd "${PACKAGE}-${VERSION}"
./configure --prefix=/usr
make
# Optional: run tests
# make check || true
make install
cd /sources
rm -rf "${PACKAGE}-${VERSION}"
echo "=== ${PACKAGE}-${VERSION} complete ==="