blob: 2a5b8c91ada61e5296643d438ea88565487d3bcd [file] [log] [blame]
Kristian H. Kristensen49a007d2021-09-02 09:18:38 +00001# Copyright 1999-2010 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI=7
5
6CROS_WORKON_PROJECT="chromiumos/platform/croscomp"
7CROS_WORKON_LOCALNAME="platform/croscomp"
8CROS_WORKON_INCREMENTAL_BUILD=1
9
10KEYWORDS="~*"
11
12inherit base meson cros-rust flag-o-matic cros-workon
13
14DESCRIPTION="ChromeOS System Compositor"
15
16LICENSE="MIT SGI-B-2.0"
17
18IUSE="debug vulkan"
19
20COMMON_DEPEND="
21 x11-libs/cairo:=
22 sys-libs/mtdev:=
23 x11-libs/libxkbcommon:=
Kristian H. Kristensen49a007d2021-09-02 09:18:38 +000024 x11-libs/pixman:=
25 x11-libs/pango:=
26 dev-libs/wayland:=
27 dev-libs/expat:=
Kristian H. Kristensen49a007d2021-09-02 09:18:38 +000028 media-libs/lcms:=
29 >=x11-libs/libdrm-2.4.94:=
30"
31
32RDEPEND="${COMMON_DEPEND}
33"
34
35DEPEND="${COMMON_DEPEND}
Kristian H. Kristensendb3a4c72021-09-08 11:42:45 +000036 virtual/bindgen:=
Kristian H. Kristensen49a007d2021-09-02 09:18:38 +000037 >=dev-rust/libc-0.2.44:= <dev-rust/libc-0.3.0
38 =dev-rust/cfg-if-1.0.0:=
39 >=dev-rust/parking_lot-0.7.1:=
40 >=dev-rust/scoped-tls-0.1.0:=
41"
42
43BDEPEND="
44 virtual/pkgconfig
Kristian H. Kristensendb3a4c72021-09-08 11:42:45 +000045 dev-libs/wayland-protocols:=
Kristian H. Kristensen49a007d2021-09-02 09:18:38 +000046"
47
48src_unpack() {
49 # Unpack both the project and dependency source code
50 cros-workon_src_unpack
51 cros-rust_src_unpack
52}
53
54src_prepare() {
55 cros-rust_src_prepare
56 default
57}
58
59src_configure() {
60 export MESON_BUILD_DIR="${WORKDIR}/${P}-build"
61 meson_src_configure
62 cros-rust_src_configure
63}
64
65src_compile() {
66 export MESON_BUILD_DIR="${WORKDIR}/${P}-build"
67 meson_src_compile
68 env | grep build
69 ecargo_build -v \
70 -p croscomp \
71 || die "cargo build failed"
72}
73
74src_install() {
Kristian H. Kristensen65bb0122021-09-08 11:42:56 +000075 # cargo doesn't know how to install cross-compiled binaries. It will
76 # always install native binaries for the host system. Manually install
77 # crosvm instead.
78 local build_dir="$(cros-rust_get_build_dir)"
79 dobin "${build_dir}/croscomp"
80
Kristian H. Kristensen49a007d2021-09-02 09:18:38 +000081 meson_src_install
82}