#!/bin/sh # SPDX-FileCopyrightText: 2021 Andrius Štikonas # SPDX-FileCopyrightText: 2021-22 fosslinux # SPDX-FileCopyrightText: 2024 Gábor Stefanik # # 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}.tgz ../src/${pkg}.tar.gz gunzip -f ../src/${pkg}.tar.gz tar xf ../src/${pkg}.tar rm -r ../src/ cd ${pkg} # Prepare cp ../../files/Makefile . # meslibc has no fgetpos/fsetpos - emulate using fseek/ftell sed -i -e "s/fpos_t/long/" -e "s/fgetpos(f, &save_area.line_fpos) != 0/(save_area.line_fpos = ftell(f)) == -1/" \ -e "s/fsetpos(input_file, &save_area.line_fpos)/fseek(input_file, save_area.line_fpos, SEEK_SET)/" reader.c # likewise, meslibc has no tmpfile() sed -i -e "s/tmpfile()/fopen(label, \"w+\")/" main.c # Build yacc make CC=tcc AR=tcc\ -ar CFLAGS=-DMAXPATHLEN=100\ -DEILSEQ=84\ -DMB_LEN_MAX=100 LDFLAGS=-lgetopt\ -static RANLIB=true # Install yacc install yacc ${BINDIR} cd ../.. # Checksums if match x${UPDATE_CHECKSUMS} xTrue; then sha256sum -o ${pkg}.checksums \ /usr/bin/yacc install ${pkg}.checksums ${SRCDIR} else sha256sum -c ${pkg}.checksums fi