Make bin directory AppImage ready

This commit is contained in:
Jakob Bornecrantz 2021-04-06 17:21:16 +01:00 committed by Bjorn
parent d558996206
commit b02c30a0e4
4 changed files with 24 additions and 0 deletions

View File

@ -807,6 +807,14 @@ elseif(UNIX)
endif()
endif()
endfunction()
function(move_app_image_file)
set(SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/resources/${ARGV0}")
set(DST "${CMAKE_BINARY_DIR}/bin/${ARGV0}")
add_custom_command(TARGET lovr POST_BUILD
DEPENDS ${SRC}
COMMAND ${CMAKE_COMMAND} -E copy ${SRC} ${DST}
)
endfunction()
move_lib(${LOVR_GLFW})
move_lib(${LOVR_LUA})
move_lib(${LOVR_ODE})
@ -816,4 +824,9 @@ elseif(UNIX)
foreach(target ${ALL_PLUGIN_TARGETS})
move_lib(${target})
endforeach()
if(LOVR_BUILD_BUNDLE)
move_app_image_file("lovr.desktop")
move_app_image_file("AppRun")
move_app_image_file("logo.svg")
endif()
endif()

5
src/resources/AppRun Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
IMAGE_DIR="$(dirname "$(readlink -f "$0")")"
exec "$IMAGE_DIR/lovr" "$@"

1
src/resources/logo.svg Normal file
View File

@ -0,0 +1 @@
<svg viewBox="0 0 85 78" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><defs><linearGradient x1="50%" y1="10.433596%" x2="50%" y2="89.3888378%" id="g1"><stop stop-color="#18A9E3" offset="0%"></stop><stop stop-color="#E94699" offset="100%"></stop></linearGradient><path d="M36.0947816,24.4670322 C44.9603247,9.17704943 59.3351373,9.17826246 68.2002532,24.4670322 L90.4871564,62.9030025 C99.3529756,78.1929853 92.2066627,90.5879653 74.5447305,90.5879653 L29.7514983,90.5879653 C12.0809204,90.5879653 4.94373271,78.1917723 13.8085725,62.9030025 L36.0947816,24.4670322 Z" id="p2"></path><mask id="m3" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="84.2947002" height="77.5879653" fill="white"><use href="#p2"></use></mask></defs><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-10.000000, -13.000000)" stroke="url(#g1)" stroke-width="16" fill="rgba(255, 255, 255, .1)"><use mask="url(#m3)" href="#p2"></use></g></g></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,5 @@
[Desktop Entry]
Type=Application
Name=LÖVR
Icon=logo
Categories=