안드로이드

Termux mesa 24.2.6 빌드하기 (proot / msm, kgsl)

ㅋㅋ잠자 2024. 11. 7. 12:48
반응형

안녕하세요. 이전에 아래 글을 올려드린적이 있습니다.

최신 버전이 올라와서 한번 컴파일 해보려고합니다.

 

일반적으로는 컴파일 할 필요가 없는데 proot 환경에서 작업을 함으로 저희는 따로 컴파일이 필요합니다.

https://blog.djjproject.com/832

 

1. termux packages 소스 받기

root@localhost:~# git clone https://github.com/xMeM/termux-packages.git -b dev/mesa --single-branch

 

2. 패치 확인하기

root@localhost:~/termux-packages# cd packages/mesa
root@localhost:~/termux-packages/packages/mesa# ls
0000-disable-android-detection.patch
0001-disable-multithreading-for-llvmpipe.patch
0002-fix-for-getprogname.patch
0003-fix-for-anon-file.patch
0004-do-not-check-xlocale.patch
0005-virgl-socket-path.patch
0006-wsi-no-pthread_cancel.patch
0007-use-mtx_t-operations-in-turnip.patch
0008-workaround-fortify-check.patch
0009-disable-resource_create_front-for-vtest.patch
0010-fix-zink.patch
0011-freedreno-drm-kgsl-Add-KGSL-backend-for-freedreno.patch
0012-freedreno-drm-Add-more-APIs-to-per-backend-API.patch
0013-fix-bad-syscall.patch
0014-freedreno-HACK-GL_ARB_timer_query.patch
0015-termux-x11-kgsl.patch
build.sh
cmake-wrapper.in
mesa-dev.subpackage.sh
mesa-vulkan-icd-freedreno.subpackage.sh
mesa-vulkan-icd-swrast.subpackage.sh
osmesa.subpackage.sh
 

3. mesa 소스 받기

root@localhost:~# wget https://archive.mesa3d.org/mesa-24.2.6.tar.xz
root@localhost:~# tar xf mesa-24.2.6.tar.xz 
root@localhost:~# cd mesa-24.2.6/

 

4. 패치하기

root@localhost:~/mesa-24.2.6# vi patch.sh
#!/bin/bash

PATCH_DIR=/root/termux-packages/packages/mesa
PATCH_FILES=$(ls -1 $PATCH_DIR | grep .patch)

echo $PATCH_DIR

for PATCH in $PATCH_FILES
do
    echo "PATCH: $PATCH"
    if [[ $PATCH == "0008*" ]]; then
        echo "SKIP PATCH !!!: $PATCH"
        continue
    fi

    patch -p1 < $PATCH
done

root@localhost:~/mesa-24.2.6# rm /root/termux-packages/packages/mesa/0008-workaround-fortify-check.patch
root@localhost:~/mesa-24.2.6# chmod a+x ./patch.sh 
root@localhost:~/mesa-24.2.6# ./patch.sh 

 

5. 컴파일 및 설치
root@localhost:~/mesa-24.2.6# meson build -Dcpp_rtti=true -Dgbm=enabled -Dopengl=true -Degl=enabled -Degl-native-platform=x11 -Dgles1=disabled -Dgles2=enabled -Ddri3=enabled -Dglx=dri -Dllvm=enabled -Dshared-llvm=disabled -Dplatforms=x11,wayland -Dosmesa=true -Dglvnd=enabled -Dxmlconfig=disabled -Dgallium-drivers=swrast,virgl,zink,freedreno -Dvulkan-drivers=swrast,freedreno -Dfreedreno-kmds=msm,kgsl --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu --reconfigure
libarchive 3.7.2

    regex support: glibc

mesa 24.2.6

  Directories
    prefix                       : /usr
    libdir                       : lib/aarch64-linux-gnu
    includedir                   : include

  Common C and C++ arguments
    c_cpp_args                   : -mtls-dialect=desc

  OpenGL
    OpenGL                       : YES
    ES1                          : NO
    ES2                          : YES
    Shared glapi                 : YES
    GLVND                        : YES

  DRI
    Platform                     : drm
    Driver dir                   : /usr/lib/aarch64-linux-gnu/dri

  GLX
    Enabled                      : YES
    Provider                     : dri

  EGL
    Enabled                      : YES
    Drivers                      : builtin:egl_dri2 builtin:egl_dri3
    Platforms                    : x11 wayland surfaceless drm xcb

  GBM
    Enabled                      : YES
    Backends path                : /usr/lib/aarch64-linux-gnu/gbm

  Vulkan
    Drivers                      : swrast freedreno
    Platforms                    : x11 wayland surfaceless drm xcb
    ICD dir                      : share/vulkan/icd.d
    Intel Ray tracing            : NO

  Video
    Codecs                       : av1dec av1enc vp9dec
    APIs                         : vdpau va vulkan xa

  LLVM
    Enabled                      : YES
    Version                      : 15.0.6

  Gallium
    Enabled                      : YES
    Drivers                      : swrast virgl zink freedreno
    Platforms                    : x11 wayland surfaceless drm xcb
    Frontends                    : mesa xa vdpau va
    Off-screen rendering (OSMesa): libOSMesa
    HUD lm-sensors               : YES

  Perfetto
    Enabled                      : NO

  Teflon (TensorFlow Lite delegate)
    Enabled                      : NO

  Subprojects
    libarchive                   : YES
    lua                          : YES

  User defined options
    libdir                       : /usr/lib/aarch64-linux-gnu
    prefix                       : /usr
    cpp_rtti                     : true
    dri3                         : enabled
    egl                          : enabled
    egl-native-platform          : x11
    freedreno-kmds               : msm,kgsl
    gallium-drivers              : swrast,virgl,zink,freedreno
    gbm                          : enabled
    gles1                        : disabled
    gles2                        : enabled
    glvnd                        : enabled
    glx                          : dri
    llvm                         : enabled
    opengl                       : true
    osmesa                       : true
    platforms                    : x11,wayland
    shared-llvm                  : disabled
    vulkan-drivers               : swrast,freedreno
    xmlconfig                    : disabled

Found ninja-1.11.1 at /usr/bin/ninja
Cleaning... 0 files.
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
root@localhost:~/mesa-24.2.6# ninja -C build install
ninja: Entering directory `build'
[84/1872] Compiling C object src/util/libmesa_util.a.p/format_u_format_bptc.

 

6. 테스트

반응형