From ecfcb6a461f5aa72090a33a55b183e4f1ad3965b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 11 Dec 2024 16:45:23 -0500 Subject: [PATCH] Unbundle zopfli - We now have libzopfli/zopfli-devel in EPEL9 --- advancecomp.spec | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/advancecomp.spec b/advancecomp.spec index b9606ef..b8e7d1c 100644 --- a/advancecomp.spec +++ b/advancecomp.spec @@ -39,13 +39,7 @@ BuildRequires: zlib-devel # Unbundled downstream BuildRequires: pkgconfig(libdeflate) - -# No libzopfli/zopfli-devel in EPEL9. -# -# Version number based on HISTORY, which mentions that upstream commit -# 6818a0859063b946094fb6f94732836404a0d89a was used from -# https://github.com/google/zopfli/. -Provides: bundled(zopfli) = 1.0.2^20160527git6818a08 +BuildRequires: zopfli-devel # From 7z/README: # @@ -95,6 +89,19 @@ find . -type f -exec gawk \ '{}' '+' | xargs -r -t sed -r -i 's@^([[:blank:]]*#include.*)libdeflate/@\1@' +# Patch out bundled zopfli +rm -rv zopfli +sed -r -i \ + -e '/zopfli[\/_]/d' \ + -e 's/((\(7z_SOURCES\)|WindowOut\.h).*)[[:blank:]]*\\/\1/' \ + Makefile.am +# Fix up #include paths. The find-then-modify pattern keeps us from discarding +# mtimes on any sources that do not need modification. +find . -type f -exec gawk \ + '/^[[:blank:]]*#include.*zopfli/ { print FILENAME; nextfile }' \ + '{}' '+' | + xargs -r -t sed -r -i -e 's@^([[:blank:]]*#include.*)zopfli/@\1@' + %build %set_build_flags @@ -105,6 +112,9 @@ export CFLAGS="$(pkgconf --cflags libdeflate) ${CFLAGS-}" export CXXFLAGS="$(pkgconf --cflags libdeflate) ${CXXFLAGS-}" export LDFLAGS="$(pkgconf --libs libdeflate) ${LDFLAGS-}" +# Link against system zopfli +export LDFLAGS="-lzopfli ${LDFLAGS-}" + %configure %make_build