Skip to content

Commit

Permalink
libmali: update to 28f97bf
Browse files Browse the repository at this point in the history
Adds support for multiple so-files
  • Loading branch information
Kwiboo committed Apr 28, 2019
1 parent d22b3d3 commit 5aa3ff8
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 6 deletions.
22 changes: 16 additions & 6 deletions packages/graphics/libmali/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="libmali"
PKG_VERSION="ad56ed30985471c0950a654cc9db1e86310650d5"
PKG_SHA256="72438ea73cf6c2e8e770545872386b66ccad200c568261e5304845547099c9ed"
PKG_VERSION="28f97bf45f5e71cf760b6d8a7abba231998c68c1"
PKG_SHA256="bf4de370efb2ead9153594a617430611af5b6801a93f6825b9ede2b7f5692cd6"
PKG_ARCH="arm aarch64"
PKG_LICENSE="nonfree"
PKG_SITE="https://github.com/LibreELEC/libmali"
PKG_URL="https://github.com/LibreELEC/libmali/archive/$PKG_VERSION.tar.gz"
PKG_LONGDESC="OpenGL ES user-space binary for the ARM Mali GPU family"
PKG_STAMP="$MALI_FAMILY"

PKG_DEPENDS_TARGET="libdrm"

Expand All @@ -18,10 +19,19 @@ fi

PKG_CMAKE_OPTS_TARGET="-DMALI_VARIANT=$MALI_FAMILY"

if [ -n "$MALI_REVISION" ]; then
PKG_CMAKE_OPTS_TARGET+=" -DMALI_REVISION=$MALI_REVISION"
fi

if [ "$TARGET_ARCH" = "aarch64" ]; then
PKG_CMAKE_OPTS_TARGET+=" -DMALI_ARCH=aarch64-linux-gnu"
fi

post_makeinstall_target() {
mkdir -p $INSTALL/usr/bin
cp -v $PKG_DIR/scripts/libmali-setup $INSTALL/usr/bin

if [ $(ls -1q $INSTALL/usr/lib/libmali-*.so | wc -l) -gt 1 ]; then
ln -sfv /var/lib/libmali/libmali.so $INSTALL/usr/lib/libmali.so
fi
}

post_install() {
enable_service libmali-setup.service
}
44 changes: 44 additions & 0 deletions packages/graphics/libmali/scripts/libmali-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)

GPUINFO=/sys/kernel/debug/mali/version
[ ! -f "$GPUINFO" ] && GPUINFO=$(find /sys/devices/platform -name gpuinfo)

echo "GPUINFO: $GPUINFO"
[ ! -f "$GPUINFO" ] && exit

GPU=$(cat $GPUINFO)
echo "GPU: $GPU"

case $GPU in
Mali-400*) LIB="libmali-utgard-400-*.so" ;;
Mali-450*) LIB="libmali-utgard-450-*.so" ;;
Mali-T60x*) LIB="libmali-midgard-t60x-*.so" ;;
Mali-T62x*) LIB="libmali-midgard-t620-*.so" ;;
Mali-T72x*) LIB="libmali-midgard-t720-*.so" ;;
Mali-T76x*r0p0*) LIB="libmali-midgard-t76x-*-r0p0-*.so" ;;
Mali-T76x*r1p0*) LIB="libmali-midgard-t76x-*-r1p0-*.so" ;;
Mali-T82x*) LIB="libmali-midgard-t82x-*.so" ;;
Mali-T83x*) LIB="libmali-midgard-t83x-*.so" ;;
Mali-T86x*) LIB="libmali-midgard-t86x-*.so" ;;
Mali-T88x*) LIB="libmali-midgard-t88x-*.so" ;;
Mali-G31*) LIB="libmali-bifrost-g31-*.so" ;;
Mali-G51*) LIB="libmali-bifrost-g51-*.so" ;;
Mali-G52*) LIB="libmali-bifrost-g52-*.so" ;;
Mali-G71*) LIB="libmali-bifrost-g71-*.so" ;;
Mali-G72*) LIB="libmali-bifrost-g72-*.so" ;;
Mali-G76*) LIB="libmali-bifrost-g76-*.so" ;;
esac

echo "LIB: $LIB"
[ -z "$LIB" ] && exit

LIBMALI=$(find /usr/lib -name $LIB)

echo "LIBMALI: $LIBMALI"
[ ! -f "$LIBMALI" ] && exit

mkdir -p /var/lib/libmali
ln -sf $LIBMALI /var/lib/libmali/libmali.so
12 changes: 12 additions & 0 deletions packages/graphics/libmali/system.d/libmali-setup.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Setup symlink for ARM Mali library
Before=graphical.target
After=multi-user.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/libmali-setup

[Install]
WantedBy=multi-user.target

0 comments on commit 5aa3ff8

Please sign in to comment.