66 lines
1.4 KiB
Bash
Executable File
66 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
|
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
|
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
set -ex
|
|
|
|
# Check tarball checksums
|
|
checksum-transcriber sources
|
|
sha256sum -c sources.SHA256SUM
|
|
|
|
mkdir build src
|
|
cd build
|
|
|
|
# Extract
|
|
cp ${distfiles}/${pkg}.tar.gz ../src/
|
|
gzip -d -f ../src/${pkg}.tar.gz
|
|
tar xf ../src/${pkg}.tar
|
|
rm -r ../src/
|
|
cd ${pkg}
|
|
cp ../../mk/main.mk Makefile
|
|
cp ../../mk/builtins.mk builtins/Makefile
|
|
cp ../../mk/common.mk common.mk
|
|
|
|
# Create various .h files
|
|
touch config.h
|
|
touch include/version.h
|
|
touch include/pipesize.h
|
|
rm y.tab.c y.tab.h
|
|
|
|
# Patch
|
|
patch -Np0 -i ../../patches/mes-libc.patch
|
|
patch -Np0 -i ../../patches/tinycc.patch
|
|
patch -Np0 -i ../../patches/missing-defines.patch
|
|
patch -Np0 -i ../../patches/locale.patch
|
|
patch -Np0 -i ../../patches/dev-tty.patch
|
|
|
|
# Compile
|
|
make mkbuiltins
|
|
cd builtins
|
|
make libbuiltins.a
|
|
cd ..
|
|
make
|
|
|
|
# Install
|
|
install bash ${prefix}/bin/
|
|
mkdir /bin/
|
|
ln -s ${prefix}/bin/bash /bin/bash
|
|
ln -s ${prefix}/bin/bash /bin/sh
|
|
ln -s ${prefix}/bin/bash ${prefix}/bin/sh
|
|
|
|
cd ../..
|
|
|
|
# Checksums
|
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
|
sha256sum -o ${pkg}.checksums \
|
|
/usr/bin/bash
|
|
|
|
install ${pkg}.checksums ${srcdir}
|
|
else
|
|
sha256sum -c ${pkg}.checksums
|
|
fi
|