|
| 1 | +# SPDX-FileCopyrightText: 2021 Andrius Štikonas <[email protected]> |
| 2 | +# SPDX-FileCopyrightText: 2025 fosslinux <[email protected]> |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: GPL-3.0-or-later |
| 5 | + |
| 6 | +# sources note: Unfortunately, xz's xz tarballs use SHA-256 checksum, which |
| 7 | +# is not widely supported (including by xz), so we use bz2 tarball instead. |
| 8 | + |
| 9 | +src_prepare() { |
| 10 | + # Delete translation catalogs |
| 11 | + rm po/*.gmo |
| 12 | + |
| 13 | + # Delete generated documentation |
| 14 | + rm -rf po4a/man |
| 15 | + |
| 16 | + # Would have detected the xz backdoor |
| 17 | + rm tests/files/*.{x,l}z |
| 18 | + |
| 19 | + # Regenerate these c files/headers |
| 20 | + rm src/liblzma/rangecoder/price_table.c src/liblzma/lzma/fastpos_table.c \ |
| 21 | + src/liblzma/lz/lz_encoder_hash_table.h \ |
| 22 | + src/liblzma/check/crc{32,64}_table_*.h |
| 23 | + |
| 24 | + pushd src/liblzma/rangecoder |
| 25 | + gcc -std=c99 -o price_tablegen price_tablegen.c |
| 26 | + ./price_tablegen > price_table.c |
| 27 | + popd |
| 28 | + |
| 29 | + pushd src/liblzma/lzma |
| 30 | + gcc -std=c99 -o fastpos_tablegen fastpos_tablegen.c |
| 31 | + ./fastpos_tablegen > fastpos_table.c |
| 32 | + popd |
| 33 | + |
| 34 | + pushd src/liblzma/check |
| 35 | + gcc -std=c99 -o crc32_tablegen_le crc32_tablegen.c |
| 36 | + ./crc32_tablegen_le > crc32_table_le.h |
| 37 | + gcc -std=c99 -DWORDS_BIGENDIAN -o crc32_tablegen_be crc32_tablegen.c |
| 38 | + ./crc32_tablegen_be > crc32_table_be.h |
| 39 | + gcc -std=c99 -DLZ_HASH_TABLE -o crc32_tablegen_hashtable crc32_tablegen.c |
| 40 | + ./crc32_tablegen_hashtable > ../lz/lz_encoder_hash_table.h |
| 41 | + |
| 42 | + gcc -std=c99 -o crc64_tablegen_le crc64_tablegen.c |
| 43 | + ./crc64_tablegen_le > crc64_table_le.h |
| 44 | + gcc -std=c99 -DWORDS_BIGENDIAN -o crc64_tablegen_be crc64_tablegen.c |
| 45 | + ./crc64_tablegen_be > crc64_table_be.h |
| 46 | + popd |
| 47 | + |
| 48 | + AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 AUTOCONF=autoconf-2.69 AUTOM4TE=autom4te-2.69 autoreconf-2.69 -f |
| 49 | +} |
| 50 | + |
| 51 | +src_configure() { |
| 52 | + ./configure \ |
| 53 | + --prefix="${PREFIX}" \ |
| 54 | + --disable-shared \ |
| 55 | + --disable-nls \ |
| 56 | + --build=i386-unknown-linux-musl \ |
| 57 | + --libdir="${LIBDIR}" |
| 58 | +} |
0 commit comments