1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs
8 DESCRIPTION="Palette quantization library that powers pngquant and other PNG optimizers"
9 HOMEPAGE="https://pngquant.org/lib/"
10 SRC_URI="https://github.com/ImageOptim/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
15 IUSE="cpu_flags_x86_sse2 debug openmp static-libs"
21 "${FILESDIR}"/libimagequant-2.12.2-respect-CFLAGS.patch
22 "${FILESDIR}"/libimagequant-2.12.2-fix-pkgconfig.patch
26 [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
31 # Hand rolled configure script, so not all flags are supported.
33 --prefix="${EPREFIX}/usr" \
34 --libdir="${EPREFIX}/usr/$(get_libdir)" \
35 $(use debug && echo --enable-debug) \
36 $(use_enable cpu_flags_x86_sse2 sse) \
38 CFLAGS="${CFLAGS} ${CPPFLAGS}" \
43 emake shared imagequant.pc
44 use static-libs && emake static
48 dolib.so libimagequant.so
49 dolib.so libimagequant.so.*
50 use static-libs && dolib.a libimagequant.a
51 doheader libimagequant.h
53 insinto /usr/$(get_libdir)/pkgconfig