dev-python/pytest: arm64 stable (bug #723996)
[gentoo.git] / media-gfx / libimagequant / libimagequant-2.12.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit toolchain-funcs
7
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"
11
12 LICENSE="GPL-3"
13 SLOT="0/0"
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"
16
17 DEPEND=""
18 RDEPEND="${DEPEND}"
19
20 PATCHES=(
21         "${FILESDIR}"/libimagequant-2.12.2-respect-CFLAGS.patch
22         "${FILESDIR}"/libimagequant-2.12.2-fix-pkgconfig.patch
23 )
24
25 pkg_pretend() {
26         [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
27 }
28
29 src_configure() {
30         tc-export AR CC
31         # Hand rolled configure script, so not all flags are supported.
32         ./configure \
33                 --prefix="${EPREFIX}/usr" \
34                 --libdir="${EPREFIX}/usr/$(get_libdir)" \
35                 $(use debug && echo --enable-debug) \
36                 $(use_enable cpu_flags_x86_sse2 sse) \
37                 $(use_with openmp) \
38                 CFLAGS="${CFLAGS} ${CPPFLAGS}" \
39                 LDFLAGS="${LDFLAGS}"
40 }
41
42 src_compile() {
43         emake shared imagequant.pc
44         use static-libs && emake static
45 }
46
47 src_install() {
48         dolib.so libimagequant.so
49         dolib.so libimagequant.so.*
50         use static-libs && dolib.a libimagequant.a
51         doheader libimagequant.h
52         einstalldocs
53         insinto /usr/$(get_libdir)/pkgconfig
54         doins imagequant.pc
55 }