|
| 1 | +# Copyright 1999-2025 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=8 |
| 5 | + |
| 6 | +EGIT_REPO_URI="https://gitlab.freedesktop.org/pixman/pixman.git" |
| 7 | + |
| 8 | +if [[ ${PV} = 9999* ]]; then |
| 9 | + GIT_ECLASS="git-r3" |
| 10 | +fi |
| 11 | + |
| 12 | +inherit flag-o-matic ${GIT_ECLASS} meson-multilib multiprocessing toolchain-funcs |
| 13 | + |
| 14 | +DESCRIPTION="Low-level pixel manipulation routines" |
| 15 | +HOMEPAGE="http://www.pixman.org/ https://gitlab.freedesktop.org/pixman/pixman/" |
| 16 | +if [[ ${PV} != 9999* ]]; then |
| 17 | + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" |
| 18 | + SRC_URI="https://www.x.org/releases/individual/lib/${P}.tar.xz" |
| 19 | +fi |
| 20 | + |
| 21 | +LICENSE="MIT" |
| 22 | +SLOT="0" |
| 23 | +IUSE="cpu_flags_ppc_altivec cpu_flags_arm_neon loongson2f cpu_flags_x86_mmxext cpu_flags_x86_sse2 cpu_flags_x86_ssse3 static-libs test" |
| 24 | +RESTRICT="!test? ( test )" |
| 25 | + |
| 26 | +pkg_pretend() { |
| 27 | + [[ ${MERGE_TYPE} != binary ]] && use test && tc-check-openmp |
| 28 | +} |
| 29 | + |
| 30 | +pkg_setup() { |
| 31 | + [[ ${MERGE_TYPE} != binary ]] && use test && tc-check-openmp |
| 32 | +} |
| 33 | + |
| 34 | +multilib_src_configure() { |
| 35 | + # Temporary workaround for a build failure (known gcc issue): |
| 36 | + # |
| 37 | + # * https://bugs.gentoo.org/956715 |
| 38 | + # * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110812 |
| 39 | + # |
| 40 | + use riscv && filter-lto |
| 41 | + |
| 42 | + local emesonargs=( |
| 43 | + $(meson_feature cpu_flags_x86_mmxext mmx) |
| 44 | + $(meson_feature cpu_flags_x86_sse2 sse2) |
| 45 | + $(meson_feature cpu_flags_x86_ssse3 ssse3) |
| 46 | + $(meson_feature cpu_flags_ppc_altivec vmx) |
| 47 | + $(meson_feature loongson2f loongson-mmi) |
| 48 | + $(meson_feature test openmp) # only used in unit tests |
| 49 | + $(meson_feature test tests) |
| 50 | + -Ddefault_library=$(usex static-libs both shared) |
| 51 | + -Ddemos=disabled |
| 52 | + -Dgtk=disabled |
| 53 | + -Dlibpng=disabled |
| 54 | + ) |
| 55 | + |
| 56 | + if [[ ${ABI} == arm64 ]]; then |
| 57 | + emesonargs+=($(meson_feature cpu_flags_arm_neon a64-neon)) |
| 58 | + elif [[ ${ABI} == arm ]]; then |
| 59 | + emesonargs+=($(meson_feature cpu_flags_arm_neon neon)) |
| 60 | + fi |
| 61 | + |
| 62 | + meson_src_configure |
| 63 | +} |
| 64 | + |
| 65 | +multilib_src_test() { |
| 66 | + export OMP_NUM_THREADS=$(makeopts_jobs) |
| 67 | + meson_src_test -t 100 |
| 68 | +} |
0 commit comments