Skip to content

Commit

Permalink
Build DirectFB2
Browse files Browse the repository at this point in the history
  • Loading branch information
shengwen-tw committed Jun 18, 2024
1 parent a5de9f7 commit 03f5acb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
12 changes: 12 additions & 0 deletions patches/riscv-directfb2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/lib/direct/os/linux/system.c b/lib/direct/os/linux/system.c
index fffc495b2..9d871da74 100644
--- a/lib/direct/os/linux/system.c
+++ b/lib/direct/os/linux/system.c
@@ -1,3 +1,6 @@
+#ifndef __NR_futex
+#define __NR_futex __NR_futex_time64
+#endif
/*
This file is part of DirectFB.


33 changes: 33 additions & 0 deletions scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,49 @@ function do_buildroot
function do_linux
{
ASSERT git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git -b linux-6.1.y --depth=1
mkdir -p linux/out
cp -f configs/linux.config linux/.config
export PATH="$PWD/buildroot/output/host/bin:$PATH"
export CROSS_COMPILE=riscv32-buildroot-linux-gnu-
export ARCH=riscv
export INSTALL_MOD_PATH="out"
pushd linux
ASSERT make olddefconfig
ASSERT make $PARALLEL
ASSERT make modules_install
cp -f arch/riscv/boot/Image ../Image
popd
}

function do_directfb
{
mkdir -p directfb
ASSERT git clone https://github.com/directfb2/DirectFB2.git
export PATH=$PATH:$PWD/buildroot/output/host/bin
export BUILDROOT_OUT=$PWD/buildroot/output/
pushd DirectFB2
git apply ../patches/riscv-directfb2.patch
ASSERT wget https://gist.githubusercontent.com/shengwen-tw/098da8c41ba7fbb9162ddaa4ff62b29e/raw/5ab962990d19a8bd1a8f378ef9b0b0ef1c5fb36a/riscv-cross-file
ASSERT meson --cross-file riscv-cross-file build/riscv
ASSERT meson compile -C build/riscv
DESTDIR=$BUILDROOT_OUT/host/riscv32-buildroot-linux-gnu/sysroot meson install -C build/riscv
DESTDIR=../../../directfb meson install -C build/riscv
popd
}

function do_directfb_examples
{
ASSERT git clone https://github.com/directfb2/DirectFB-examples.git
export PATH=$PATH:$PWD/buildroot/output/host/bin
pushd DirectFB-examples/
ASSERT wget https://gist.githubusercontent.com/shengwen-tw/098da8c41ba7fbb9162ddaa4ff62b29e/raw/5ab962990d19a8bd1a8f378ef9b0b0ef1c5fb36a/riscv-cross-file
ASSERT meson --cross-file riscv-cross-file build/riscv
ASSERT meson compile -C build/riscv
DESTDIR=../../../directfb meson install -C build/riscv
popd
}

do_buildroot && OK
do_linux && OK
do_directfb && OK
do_directfb_examples && OK

0 comments on commit 03f5acb

Please sign in to comment.