live-bootstrap/sysa/heirloom-devtools-070527/heirloom-devtools-070527.kaem

46 lines
958 B
Bash
Executable File

#!/bin/sh
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -ex
mkdir build
cd build
lexdir=/lex
# Extract
bunzip2 ../src/${pkg}.tar.bz2
tar xf ../src/${pkg}.tar ${pkg}/yacc ${pkg}/lex
cd ${pkg}
# Prepare and patch
patch -Np0 -i ../../patches/yacc_remove_wchar.patch
patch -Np0 -i ../../patches/lex_remove_wchar.patch
# Build yacc
cd yacc
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DMAXPATHLEN=100\ -DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt RANLIB=true
# Install yacc
install yacc ${bindir}
install -m 644 yaccpar /
# Build lex
cd ../lex
make -f Makefile.mk CC=tcc AR=tcc\ -ar CFLAGS=-DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt RANLIB=true
# Install lex
mkdir ${lexdir}
install lex ${bindir}
install libl.a ${libdir}
install -m 644 ncform ${lexdir}
cd ../../..
# Checksums
sha256sum -c checksums