blob: 0044ecf6818ca09fa0cd7b9f49288e282aa7e1da [file] [log] [blame]
chrome-bot91e5ba92019-02-04 22:56:48 -08001# Copyright 1999-2017 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI="6"
5
chromeos-ci-prod30ea59f2021-06-22 08:36:59 -07006CROS_WORKON_COMMIT="7b5dd3eb47b82db16d8ab51a03b6cda8625fa8e9"
7CROS_WORKON_TREE="f4b861dfec2f86b6b3c33034d7af41e0a08a86e6"
chrome-bot91e5ba92019-02-04 22:56:48 -08008CROS_WORKON_PROJECT="chromiumos/third_party/virglrenderer"
chromeos-ci-prod4618fea2021-03-05 08:46:28 -08009CROS_WORKON_EGIT_BRANCH="master"
chrome-bot91e5ba92019-02-04 22:56:48 -080010
David Riley58c21732019-12-18 14:47:55 -080011# Prevent automatic uprevs of this package since upstream is out of our control.
Mike Frysinger46a4ee72020-11-10 01:11:36 -050012CROS_WORKON_MANUAL_UPREV="1"
Gurchetan Singhe599bec2019-08-08 10:59:59 -070013
chromeos-ci-prod6952bcc2020-06-12 08:11:32 -070014inherit cros-fuzzer cros-sanitizers eutils flag-o-matic meson cros-workon
chrome-bot91e5ba92019-02-04 22:56:48 -080015
16DESCRIPTION="library used implement a virtual 3D GPU used by qemu"
17HOMEPAGE="https://virgil3d.github.io/"
18
19LICENSE="MIT"
20SLOT="0"
21KEYWORDS="*"
chromeos-ci-prode617f552021-04-21 08:43:45 -070022IUSE="debug fuzzer profiling test vulkan"
chrome-bot91e5ba92019-02-04 22:56:48 -080023
24RDEPEND="
25 >=x11-libs/libdrm-2.4.50
chrome-bot91e5ba92019-02-04 22:56:48 -080026 media-libs/libepoxy
chromeos-ci-prodc4d92f22019-07-29 21:32:57 -070027 media-libs/minigbm
chrome-bot91e5ba92019-02-04 22:56:48 -080028 fuzzer? (
Manoj Gupta51808be2020-02-02 16:37:22 -080029 virtual/opengles
chrome-bot91e5ba92019-02-04 22:56:48 -080030 )
chromeos-ci-prode617f552021-04-21 08:43:45 -070031 vulkan? ( media-libs/vulkan-loader )
chrome-bot91e5ba92019-02-04 22:56:48 -080032"
33# We need autoconf-archive for @CODE_COVERAGE_RULES@. #568624
34DEPEND="${RDEPEND}
chromeos-ci-prod4618fea2021-03-05 08:46:28 -080035 chromeos-base/percetto
chrome-bot91e5ba92019-02-04 22:56:48 -080036 sys-devel/autoconf-archive
David Riley152f5e52020-01-03 18:07:53 -080037 fuzzer? ( >=dev-libs/check-0.9.4 )
chromeos-ci-prode617f552021-04-21 08:43:45 -070038 test? ( >=dev-libs/check-0.9.4 )
39 vulkan? ( dev-util/vulkan-headers )
40"
chrome-bot91e5ba92019-02-04 22:56:48 -080041
chrome-bot91e5ba92019-02-04 22:56:48 -080042src_prepare() {
43 default
chrome-bot91e5ba92019-02-04 22:56:48 -080044}
45
46src_configure() {
47 sanitizers-setup-env
48
49 if use profiling; then
50 append-flags -fprofile-instr-generate -fcoverage-mapping
51 append-ldflags -fprofile-instr-generate -fcoverage-mapping
52 fi
David Riley58c21732019-12-18 14:47:55 -080053
54 emesonargs+=(
chromeos-ci-prod4618fea2021-03-05 08:46:28 -080055 -Dtracing=percetto
Lepton Wuf29ce9a2020-04-04 22:26:41 -070056 -Dminigbm_allocation="true"
David Riley58c21732019-12-18 14:47:55 -080057 -Dplatforms="egl"
David Riley58c21732019-12-18 14:47:55 -080058 $(meson_use fuzzer)
chromeos-ci-prode617f552021-04-21 08:43:45 -070059 $(meson_use vulkan venus-experimental)
David Riley58c21732019-12-18 14:47:55 -080060 --buildtype $(usex debug debug release)
61 )
62
David Riley152f5e52020-01-03 18:07:53 -080063 # virgl_fuzzer is only built with tests.
64 if use test || use fuzzer; then
65 emesonargs+=( -Dtests="true" )
66 fi
67
David Riley58c21732019-12-18 14:47:55 -080068 meson_src_configure
chrome-bot91e5ba92019-02-04 22:56:48 -080069}
70
71src_install() {
David Riley58c21732019-12-18 14:47:55 -080072 meson_src_install
chrome-bot91e5ba92019-02-04 22:56:48 -080073
David Riley152f5e52020-01-03 18:07:53 -080074 fuzzer_install "${FILESDIR}/fuzzer-OWNERS" \
75 "${WORKDIR}/${P}-build"/tests/fuzzer/virgl_fuzzer \
76 --options "${FILESDIR}/virgl_fuzzer.options"
77 fuzzer_install "${FILESDIR}/fuzzer-OWNERS" \
78 "${WORKDIR}/${P}-build"/vtest/vtest_fuzzer \
chrome-bot143e2ff2019-06-22 06:28:00 -070079 --options "${FILESDIR}/vtest_fuzzer.options"
chrome-bot91e5ba92019-02-04 22:56:48 -080080
81 find "${ED}"/usr -name 'lib*.la' -delete
82}