Improve AppImages & Safer OpenAL
This commit is contained in:
parent
07baea7b5a
commit
0fd8ba7de9
@ -40,6 +40,7 @@ endif()
|
|||||||
# Specify Installation Paths
|
# Specify Installation Paths
|
||||||
set(MCPI_INSTALL_DIR "lib/${MCPI_VARIANT_NAME}")
|
set(MCPI_INSTALL_DIR "lib/${MCPI_VARIANT_NAME}")
|
||||||
set(MCPI_LIB_DIR "${MCPI_INSTALL_DIR}/lib")
|
set(MCPI_LIB_DIR "${MCPI_INSTALL_DIR}/lib")
|
||||||
|
set(MCPI_BIN_DIR "${MCPI_INSTALL_DIR}/bin")
|
||||||
set(MCPI_FALLBACK_LIB_DIR "${MCPI_INSTALL_DIR}/fallback-lib")
|
set(MCPI_FALLBACK_LIB_DIR "${MCPI_INSTALL_DIR}/fallback-lib")
|
||||||
|
|
||||||
# Build Mode
|
# Build Mode
|
||||||
|
4
dependencies/CMakeLists.txt
vendored
4
dependencies/CMakeLists.txt
vendored
@ -16,7 +16,7 @@ endif()
|
|||||||
if(BUILD_NATIVE_COMPONENTS AND NOT MCPI_HEADLESS_MODE)
|
if(BUILD_NATIVE_COMPONENTS AND NOT MCPI_HEADLESS_MODE)
|
||||||
add_subdirectory(glfw)
|
add_subdirectory(glfw)
|
||||||
endif()
|
endif()
|
||||||
# Zenity (Minimal AppImage Build)
|
# Zenity (Minimal Build)
|
||||||
if(BUILD_NATIVE_COMPONENTS AND NOT MCPI_HEADLESS_MODE AND MCPI_IS_APPIMAGE_BUILD)
|
if(BUILD_NATIVE_COMPONENTS AND NOT MCPI_HEADLESS_MODE)
|
||||||
add_subdirectory(zenity)
|
add_subdirectory(zenity)
|
||||||
endif()
|
endif()
|
||||||
|
2
dependencies/zenity/CMakeLists.txt
vendored
2
dependencies/zenity/CMakeLists.txt
vendored
@ -12,4 +12,4 @@ add_subdirectory(src EXCLUDE_FROM_ALL)
|
|||||||
add_custom_target(zenity-build ALL DEPENDS zenity)
|
add_custom_target(zenity-build ALL DEPENDS zenity)
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
install(TARGETS zenity DESTINATION "bin")
|
install(TARGETS zenity DESTINATION "${MCPI_BIN_DIR}")
|
||||||
|
2
dependencies/zenity/src
vendored
2
dependencies/zenity/src
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 6f08afb7989c420282654eee9dea9d5df01e914a
|
Subproject commit 4663a8656d8c12be00286ee10aae2ff55ff589af
|
@ -148,6 +148,29 @@ void pre_bootstrap() {
|
|||||||
ERR("AppImage: Unable To Fix Current Directory: %s", strerror(errno));
|
ERR("AppImage: Unable To Fix Current Directory: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Get Binary Directory
|
||||||
|
char *binary_directory = get_binary_directory();
|
||||||
|
|
||||||
|
// Configure PATH
|
||||||
|
{
|
||||||
|
// Add Library Directory
|
||||||
|
char *new_path;
|
||||||
|
safe_asprintf(&new_path, "%s/bin", binary_directory);
|
||||||
|
// Add Existing PATH
|
||||||
|
{
|
||||||
|
char *value = get_env_safe("PATH");
|
||||||
|
if (strlen(value) > 0) {
|
||||||
|
string_append(&new_path, ":%s", value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Set And Free
|
||||||
|
set_and_print_env("PATH", new_path);
|
||||||
|
free(new_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Free Binary Directory
|
||||||
|
free(binary_directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bootstrap
|
// Bootstrap
|
||||||
@ -158,14 +181,13 @@ void bootstrap(int argc, char *argv[]) {
|
|||||||
char *binary_directory = get_binary_directory();
|
char *binary_directory = get_binary_directory();
|
||||||
|
|
||||||
// Handle AppImage
|
// Handle AppImage
|
||||||
|
char *usr_prefix = NULL;
|
||||||
#ifdef MCPI_IS_APPIMAGE_BUILD
|
#ifdef MCPI_IS_APPIMAGE_BUILD
|
||||||
char *usr_prefix = getenv("APPDIR");
|
usr_prefix = getenv("APPDIR");
|
||||||
|
#endif
|
||||||
if (usr_prefix == NULL) {
|
if (usr_prefix == NULL) {
|
||||||
usr_prefix = "";
|
usr_prefix = "";
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
char *usr_prefix = "";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Configure LD_LIBRARY_PATH
|
// Configure LD_LIBRARY_PATH
|
||||||
{
|
{
|
||||||
@ -265,23 +287,6 @@ void bootstrap(int argc, char *argv[]) {
|
|||||||
free(new_ld_preload);
|
free(new_ld_preload);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure PATH
|
|
||||||
{
|
|
||||||
// Add Library Directory
|
|
||||||
char *new_path;
|
|
||||||
safe_asprintf(&new_path, "%s/lib", binary_directory);
|
|
||||||
// Add Existing PATH
|
|
||||||
{
|
|
||||||
char *value = get_env_safe("PATH");
|
|
||||||
if (strlen(value) > 0) {
|
|
||||||
string_append(&new_path, ":%s", value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Set And Free
|
|
||||||
set_and_print_env("PATH", new_path);
|
|
||||||
free(new_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resolve Binary Path & Set MCPI_DIRECTORY
|
// Resolve Binary Path & Set MCPI_DIRECTORY
|
||||||
{
|
{
|
||||||
// Resolve Full Binary Path
|
// Resolve Full Binary Path
|
||||||
|
@ -15,11 +15,12 @@ static std::vector<ALuint> &get_sources() {
|
|||||||
return sources;
|
return sources;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define AL_ERROR_CHECK() \
|
#define AL_ERROR_CHECK() AL_ERROR_CHECK_MANUAL(alGetError())
|
||||||
|
#define AL_ERROR_CHECK_MANUAL(val) \
|
||||||
{ \
|
{ \
|
||||||
ALenum err = alGetError(); \
|
ALenum __err = val; \
|
||||||
if (err != AL_NO_ERROR) { \
|
if (__err != AL_NO_ERROR) { \
|
||||||
ERR("OpenAL Error: %s", alGetString(err)); \
|
ERR("OpenAL Error: %s", alGetString(__err)); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +82,15 @@ void media_audio_play(const char *source, const char *name, float x, float y, fl
|
|||||||
// Create Source
|
// Create Source
|
||||||
ALuint al_source;
|
ALuint al_source;
|
||||||
alGenSources(1, &al_source);
|
alGenSources(1, &al_source);
|
||||||
AL_ERROR_CHECK();
|
// Special Out-Of-Memory Handling
|
||||||
|
{
|
||||||
|
ALenum err = alGetError();
|
||||||
|
if (err == AL_OUT_OF_MEMORY) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
AL_ERROR_CHECK_MANUAL(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set Properties
|
// Set Properties
|
||||||
alSourcef(al_source, AL_PITCH, pitch);
|
alSourcef(al_source, AL_PITCH, pitch);
|
||||||
|
@ -12,7 +12,7 @@ if(BUILD_NATIVE_COMPONENTS)
|
|||||||
target_link_libraries(media-layer-proxy-client media-layer-headers reborn-headers ${MEDIA_LAYER_PROXY_LIBS})
|
target_link_libraries(media-layer-proxy-client media-layer-headers reborn-headers ${MEDIA_LAYER_PROXY_LIBS})
|
||||||
target_compile_definitions(media-layer-proxy-client PRIVATE -DMEDIA_LAYER_PROXY_CLIENT)
|
target_compile_definitions(media-layer-proxy-client PRIVATE -DMEDIA_LAYER_PROXY_CLIENT)
|
||||||
# Install
|
# Install
|
||||||
install(TARGETS media-layer-proxy-client DESTINATION "${MCPI_LIB_DIR}")
|
install(TARGETS media-layer-proxy-client DESTINATION "${MCPI_BIN_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_ARM_COMPONENTS)
|
if(BUILD_ARM_COMPONENTS)
|
||||||
|
@ -32,7 +32,7 @@ if (mode === 'client') {
|
|||||||
'libgtk-3-0',
|
'libgtk-3-0',
|
||||||
'libglib2.0-0',
|
'libglib2.0-0',
|
||||||
'libgdk-pixbuf2.0-0',
|
'libgdk-pixbuf2.0-0',
|
||||||
'libcanberra-gtk3-module',
|
'shared-mime-info',
|
||||||
'libfreeimage3',
|
'libfreeimage3',
|
||||||
'libopenal1'
|
'libopenal1'
|
||||||
);
|
);
|
||||||
@ -52,6 +52,7 @@ const packageExclusions = [
|
|||||||
// Exclude Unneeded Packages
|
// Exclude Unneeded Packages
|
||||||
'humanity-icon-theme',
|
'humanity-icon-theme',
|
||||||
'adwaita-icon-theme',
|
'adwaita-icon-theme',
|
||||||
|
'libxml2',
|
||||||
'*systemd*',
|
'*systemd*',
|
||||||
'dconf-service',
|
'dconf-service',
|
||||||
'dconf-gsettings-backend',
|
'dconf-gsettings-backend',
|
||||||
@ -102,7 +103,8 @@ const files = {
|
|||||||
'usr/share/doc/*/TODO.*',
|
'usr/share/doc/*/TODO.*',
|
||||||
'usr/include',
|
'usr/include',
|
||||||
'usr/share/locale',
|
'usr/share/locale',
|
||||||
'usr/share/help'
|
'usr/share/help',
|
||||||
|
'usr/bin/update-mime-database'
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,7 +122,8 @@ const runtime = {
|
|||||||
GTK_PATH: `\${APPDIR}/usr/lib/${triplet}/gtk-3.0`,
|
GTK_PATH: `\${APPDIR}/usr/lib/${triplet}/gtk-3.0`,
|
||||||
GTK_DATA_PREFIX: '${APPDIR}',
|
GTK_DATA_PREFIX: '${APPDIR}',
|
||||||
GTK_THEME: 'Default',
|
GTK_THEME: 'Default',
|
||||||
APPDIR_LIBRARY_PATH: `\${APPDIR}/usr/lib/${triplet}:\${APPDIR}/lib/${triplet}:\${APPDIR}/usr/lib:\${APPDIR}/usr/lib/${triplet}/gdk-pixbuf-2.0/2.10.0/loaders`
|
XDG_DATA_DIRS: '${APPDIR}/share:${APPDIR}/usr/share',
|
||||||
|
APPDIR_LIBRARY_PATH: `\${APPDIR}/usr/lib/${triplet}:\${APPDIR}/usr/${triplet}/lib:\${APPDIR}/lib/${triplet}:\${APPDIR}/usr/lib:\${APPDIR}/usr/lib/${triplet}/gdk-pixbuf-2.0/2.10.0/loaders`
|
||||||
} : undefined,
|
} : undefined,
|
||||||
preserve: arch !== 'armhf' ? [
|
preserve: arch !== 'armhf' ? [
|
||||||
// On non-ARM32 systems, an ARM32 linker is embedded, this
|
// On non-ARM32 systems, an ARM32 linker is embedded, this
|
||||||
|
@ -95,6 +95,7 @@ queue_pkg \
|
|||||||
strace \
|
strace \
|
||||||
fuse \
|
fuse \
|
||||||
gtk-update-icon-cache \
|
gtk-update-icon-cache \
|
||||||
|
shared-mime-info \
|
||||||
sed
|
sed
|
||||||
|
|
||||||
# Install Queue
|
# Install Queue
|
||||||
@ -115,4 +116,4 @@ sudo rm -f /usr/local/bin/appimagetool
|
|||||||
sudo ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool
|
sudo ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool
|
||||||
|
|
||||||
# Install appimage-builder
|
# Install appimage-builder
|
||||||
sudo pip3 install 'git+https://github.com/TheBrokenRail/appimage-builder.git'
|
sudo pip3 install 'git+https://github.com/TheBrokenRail/appimage-builder.git@combined'
|
||||||
|
Loading…
Reference in New Issue
Block a user