commit:     7d91cd4932a8c3ebe09dc097808c0e6046b4ff6c
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Sun Sep 17 13:48:53 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Sep 17 13:48:53 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d91cd49

media-gfx/apngopt: EAPI8 bump, fix #724818

Closes: https://bugs.gentoo.org/724818
Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 media-gfx/apngopt/apngopt-1.4-r1.ebuild            | 38 +++++++++++++++++++
 .../apngopt/files/apngopt-1.4-r1-makefile.patch    | 43 ++++++++++++++++++++++
 2 files changed, 81 insertions(+)

diff --git a/media-gfx/apngopt/apngopt-1.4-r1.ebuild 
b/media-gfx/apngopt/apngopt-1.4-r1.ebuild
new file mode 100644
index 000000000000..9a1255fc6ef8
--- /dev/null
+++ b/media-gfx/apngopt/apngopt-1.4-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Optimize APNG images"
+HOMEPAGE="https://sourceforge.net/projects/apng/";
+SRC_URI="mirror://sourceforge/apng/${P}-src.zip"
+S="${WORKDIR}"
+
+LICENSE="LGPL-2.1 ZLIB"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+       app-arch/zopfli:=
+       media-libs/libpng:=
+       sys-libs/zlib"
+DEPEND="${RDEPEND}"
+BDEPEND="app-arch/unzip"
+
+PATCHES=( "${FILESDIR}"/${PF}-makefile.patch )
+
+src_prepare() {
+       default
+       rm -rf libpng zlib zopfli || die
+}
+
+src_configure() {
+       tc-export CXX
+}
+
+src_install() {
+       dobin apngopt
+       dodoc readme.txt
+}

diff --git a/media-gfx/apngopt/files/apngopt-1.4-r1-makefile.patch 
b/media-gfx/apngopt/files/apngopt-1.4-r1-makefile.patch
new file mode 100644
index 000000000000..0726f81db4a2
--- /dev/null
+++ b/media-gfx/apngopt/files/apngopt-1.4-r1-makefile.patch
@@ -0,0 +1,43 @@
+Use system zopfli library and respect CFLAGS.
+
+--- a/Makefile
++++ b/Makefile
+@@ -1,10 +1,9 @@
+ PACKAGE    = apngopt
+-CC         = gcc
+-SRC_DIRS   = . 7z zopfli
+-CFLAGS     = -Wall -pedantic
+-CFLAGS_OPT = -O2
+-CFLAGS_7Z  = -Wno-sign-compare -Wno-reorder -Wno-maybe-uninitialized 
-Wno-parentheses
+-LIBS       = -lstdc++ -lm -lpng -lz
++
++SRC_DIRS   = . 7z
++CXXFLAGS   += -Wall -pedantic
++CXXFLAGS_7Z = -Wno-sign-compare -Wno-reorder -Wno-maybe-uninitialized 
-Wno-parentheses
++LIBS       += -lm -lpng -lz -lzopfli
+ 
+ INCUDE_DIRS := $(addprefix -I./, $(SRC_DIRS))
+ OBJ_DIRS := $(addprefix obj/, $(SRC_DIRS))
+@@ -16,19 +15,16 @@
+ all : $(PACKAGE)
+ 
+ $(PACKAGE) : objdirs $(OBJECTS)
+-      $(CC) -o $@ $(OBJECTS) -s $(LIBS)
++      $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
+ 
+ objdirs :
+       mkdir -p $(OBJ_DIRS)
+ 
+ obj/%.o : %.cpp
+-      $(CC) -o $@ -c $< $(INCUDE_DIRS) $(CFLAGS) $(CFLAGS_OPT)
+-
+-obj/%.o : %.c
+-      $(CC) -o $@ -c $< $(INCUDE_DIRS) $(CFLAGS) $(CFLAGS_OPT)
++      $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $< $(INCUDE_DIRS)
+ 
+ obj/%.o : %.cc
+-      $(CC) -o $@ -c $< $(INCUDE_DIRS) $(CFLAGS) $(CFLAGS_OPT) $(CFLAGS_7Z)
++      $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $< $(INCUDE_DIRS) $(CXXFLAGS_7Z)
+ 
+ .PHONY : clean
+ 

Reply via email to