Skip to content

Commit 7620fdf

Browse files
committed
Build virglrenderer and DirectFB2
1 parent 89d4743 commit 7620fdf

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

configs/riscv-cross-file

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[binaries]
2+
c = 'riscv32-buildroot-linux-gnu-gcc'
3+
strip = 'riscv32-buildroot-linux-gnu-strip'
4+
pkgconfig = 'pkg-config'
5+
python = '/usr/bin/python3'
6+
7+
[properties]
8+
pkg_config_libdir = ['@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot/usr/local/lib/pkgconfig',
9+
'@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot/usr/share/pkgconfig/',
10+
'@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot/usr/lib/pkgconfig/'
11+
]
12+
sys_root = '@GLOBAL_SOURCE_ROOT@' / '../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot'
13+
14+
[host_machine]
15+
system = 'linux'
16+
cpu_family = 'riscv'
17+
cpu = 'riscv32-ima'
18+
endian = 'little'

scripts/build-image.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,71 @@ function do_buildroot
3838
function do_linux
3939
{
4040
ASSERT git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git -b linux-6.1.y --depth=1
41+
mkdir -p linux/out
4142
cp -f configs/linux.config linux/.config
4243
export PATH="$PWD/buildroot/output/host/bin:$PATH"
4344
export CROSS_COMPILE=riscv32-buildroot-linux-gnu-
4445
export ARCH=riscv
46+
export INSTALL_MOD_PATH="out"
4547
pushd linux
4648
ASSERT make olddefconfig
4749
ASSERT make $PARALLEL
50+
ASSERT make modules_install
4851
cp -f arch/riscv/boot/Image ../Image
4952
popd
5053
}
5154

55+
function do_libepoxy
56+
{
57+
ASSERT git clone https://github.com/anholt/libepoxy.git
58+
pushd libepoxy
59+
cp ../configs/riscv-cross-file .
60+
ASSERT meson --cross-file riscv-cross-file build/riscv
61+
ASSERT meson compile -C build/riscv
62+
DESTDIR=../../../libepoxy_out meson install -C build/riscv
63+
DESTDIR=../../../buildroot/output/host/riscv32-buildroot-linux-gnu/sysroot meson install -C build/riscv
64+
popd
65+
}
66+
67+
function do_virglrenderer
68+
{
69+
ASSERT git clone https://gitlab.freedesktop.org/virgl/virglrenderer.git
70+
pushd virglrenderer
71+
cp ../configs/riscv-cross-file .
72+
ASSERT meson --cross-file riscv-cross-file build/riscv
73+
ASSERT meson compile -C build/riscv
74+
DESTDIR=../../../virglrenderer_out meson install -C build/riscv
75+
popd
76+
}
77+
78+
function do_directfb
79+
{
80+
export PATH=$PATH:$PWD/buildroot/output/host/bin
81+
export BUILDROOT_OUT=$PWD/buildroot/output/
82+
mkdir -p directfb
83+
84+
# Build DirectFB2
85+
ASSERT git clone https://github.com/directfb2/DirectFB2.git
86+
pushd DirectFB2
87+
cp ../configs/riscv-cross-file .
88+
ASSERT meson -Ddrmkms=true --cross-file riscv-cross-file build/riscv
89+
ASSERT meson compile -C build/riscv
90+
DESTDIR=$BUILDROOT_OUT/host/riscv32-buildroot-linux-gnu/sysroot meson install -C build/riscv
91+
DESTDIR=../../../directfb meson install -C build/riscv
92+
popd
93+
94+
# Build DirectFB2 examples
95+
ASSERT git clone https://github.com/directfb2/DirectFB-examples.git
96+
pushd DirectFB-examples/
97+
cp ../configs/riscv-cross-file .
98+
ASSERT meson --cross-file riscv-cross-file build/riscv
99+
ASSERT meson compile -C build/riscv
100+
DESTDIR=../../../directfb meson install -C build/riscv
101+
popd
102+
}
103+
52104
do_buildroot && OK
53105
do_linux && OK
106+
do_libepoxy && OK
107+
do_virglrenderer && OK
108+
do_directfb && OK

0 commit comments

Comments
 (0)