diff --git a/media-gfx/metapixel/files/metapixel-1.0.2-getopt.patch b/media-gfx/metapixel/files/metapixel-1.0.2-getopt.patch new file mode 100644 index 000000000000..6707421e77de --- /dev/null +++ b/media-gfx/metapixel/files/metapixel-1.0.2-getopt.patch @@ -0,0 +1,16 @@ +Use system getopt instead of custom one +https://bugs.gentoo.org/944937 + +--- a/Makefile ++++ b/Makefile +@@ -24,8 +24,8 @@ CC = gcc + export CCOPTS CC FORMATDEFS + + LISPREADER_OBJS = lispreader.o pools.o allocator.o +-OBJS = metapixel.o vector.o zoom.o $(LISPREADER_OBJS) getopt.o getopt1.o +-CONVERT_OBJS = convert.o $(LISPREADER_OBJS) getopt.o getopt1.o ++OBJS = metapixel.o vector.o zoom.o $(LISPREADER_OBJS) ++CONVERT_OBJS = convert.o $(LISPREADER_OBJS) + IMAGESIZE_OBJS = imagesize.o + + all : metapixel metapixel.1 convert metapixel-imagesize diff --git a/media-gfx/metapixel/metapixel-1.0.2-r3.ebuild b/media-gfx/metapixel/metapixel-1.0.2-r3.ebuild new file mode 100644 index 000000000000..34eb664d8696 --- /dev/null +++ b/media-gfx/metapixel/metapixel-1.0.2-r3.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit toolchain-funcs + +DESCRIPTION="a program for generating photomosaics" +HOMEPAGE="https://www.complang.tuwien.ac.at/schani/metapixel/" +SRC_URI="https://www.complang.tuwien.ac.at/schani/${PN}/files/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + dev-lang/perl + >=media-libs/giflib-5:0= + >=media-libs/libpng-1.4:0= + media-libs/libjpeg-turbo:= +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-libpng15.patch + "${FILESDIR}"/${P}-giflib5.patch + "${FILESDIR}"/${P}-clang16-build-fix.patch + "${FILESDIR}"/${P}-getopt.patch +) + +src_prepare() { + default + + sed -i -e 's:/usr/X11R6:/usr:g' Makefile || die + sed -i -e 's:ar:$(AR):' rwimg/Makefile || die + rm getopt* || die +} + +src_compile() { + emake AR="$(tc-getAR)" CC="$(tc-getCC)" OPTIMIZE="${CFLAGS}" LDOPTS="${LDFLAGS}" +} + +src_install() { + dobin ${PN}{,-prepare,-imagesize,-sizesort} + doman ${PN}.1 + dodoc NEWS README +}