From 3f16e757fba9121f1eda0a37debc353e60bcaa25 Mon Sep 17 00:00:00 2001 From: juvinious <581120+juvinious@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:05:02 -0500 Subject: [PATCH] Remove sanitize-address, as libasan is not available. Move to building SDL2_gfx since it's not part of sniper runtime. --- docker/Dockerfile.steam | 37 +++++++++++++++++++++---------------- misc/steam/steam.txt | 25 +++++++++---------------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/docker/Dockerfile.steam b/docker/Dockerfile.steam index 0b7ae942b..c3cbb83b9 100644 --- a/docker/Dockerfile.steam +++ b/docker/Dockerfile.steam @@ -4,7 +4,7 @@ FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest RUN apt update && \ - apt install -y sudo wget git ninja-build make python3-pip libsdl2-gfx-dev && \ + apt install -y sudo wget git ninja-build make python3-pip && \ apt remove -y meson # Get latest meson @@ -16,6 +16,10 @@ RUN mkdir -p /build/cross/include/SDL2 COPY src /build/src COPY meson.build /build +RUN sed -i 's/is_static = true/is_static=false/' /build/meson.build && \ + sed -i '24 s/-fsanitize=address/-I\.\.\/cross\/include/' /build/meson.build && \ + sed -i '33 s/^/#/' /build/meson.build && \ + sed -i '25 s/fsanitize=address/lpthread/' /build/meson.build COPY misc/steam/steam.txt /build/steam.txt COPY meson.options /build COPY Makefile /build/Makefile @@ -38,21 +42,22 @@ clean:\n\ RUN mkdir -p /build/.tmp # SDL_gfx is not installed by default, we may need to statically link it if it doesn't work on steam deck or with steam natively -#RUN git clone https://github.com/ferzkopp/SDL2_gfx.git -- /build/.tmp/SDL_gfx -#RUN echo "sources = [\n\ -# 'SDL2_framerate.c',\n\ -# 'SDL2_gfxPrimitives.c',\n\ -# 'SDL2_imageFilter.c',\n\ -# 'SDL2_rotozoom.c',\n\ -#]\n\ -#\n\ -#includes = include_directories('.')\n\ -#\n\ -#sdl_graphics_library = static_library('SDL2_gfx', sources,\n\ -# include_directories: [includes],\n\ -# dependencies: [sdl_dependency, zlib_dependency],\n\ -#)\n" > /build/.tmp/SDL_gfx/meson.build -#RUN cp /build/.tmp/SDL_gfx/*.h /build/cross/include/SDL2 +RUN git clone https://github.com/ferzkopp/SDL2_gfx.git -- /build/.tmp/SDL_gfx +RUN echo "sources = [\n\ + 'SDL2_framerate.c',\n\ + 'SDL2_gfxPrimitives.c',\n\ + 'SDL2_imageFilter.c',\n\ + 'SDL2_rotozoom.c',\n\ +]\n\ +\n\ +includes = include_directories('.', '../../src')\n\ +\n\ +sdl_graphics_library = static_library('SDL2_gfx', sources,\n\ + include_directories: [includes],\n\ + dependencies: [sdl_dependency, zlib_dependency],\n\ +)\n" > /build/.tmp/SDL_gfx/meson.build +RUN cp /build/.tmp/SDL_gfx/*.h /build/cross/include/SDL2 && \ + sed -i "109i subdir('.tmp\/SDL_gfx')" /build/meson.build RUN cd /build && make diff --git a/misc/steam/steam.txt b/misc/steam/steam.txt index a9db5dac5..614261b0d 100644 --- a/misc/steam/steam.txt +++ b/misc/steam/steam.txt @@ -4,7 +4,6 @@ common_args = ['-I..' / cross_root / 'include', '-DDATA_PATH="data"', '-DSTEAM' ] -#common_link_args = ['-L/usr/x86_64-w64-mingw32/lib', '-lz'] [binaries] c = 'clang' @@ -17,7 +16,6 @@ sdl2-config = 'sdl2-config' cmake = 'cmake' [properties] -#pkg_config_libdir = ['/usr/x86_64-w64-mingw32/lib/pkgconfig', cross_root / 'lib/pkgconfig'] pkg_config_libdir = [] [host_machine] @@ -27,37 +25,32 @@ cpu = 'x86_64' endian = 'little' [built-in options] -#pkg_config_path = cross_root / 'lib/pkg-config' -#c_include_path = cross_root / 'include' -#cpp_include_path = cross_root / 'include' c_args = common_args cpp_args = common_args -c_link_args = ['-static', '-lsfml-window-s', '-lsfml-system-s',] -cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++',] -#includedir = cross_root / 'include' -#libdir = cross_root / 'lib' -default_library='static' +c_link_args = ['-lsfml-window-s', '-lsfml-system-s',] +#cpp_link_args = ['-static-libgcc', '-static-libstdc++',] +#default_library='static' [sdl2:built-in options] -default_library = 'static' +#default_library = 'static' werror = false [SDL2_image:built-in options] -default_library = 'static' +#default_library = 'static' werror = false [SDL2_ttf:built-in options] -default_library = 'static' +#default_library = 'static' werror = false [SDL2_mixer:built-in options] -default_library = 'static' +#default_library = 'static' werror = false [zlib:built-in options] -default_library = 'static' +#default_library = 'static' werror = false [yaml-cpp:built-in options] -default_library = 'static' +#default_library = 'static' werror = false \ No newline at end of file