Simplify
This commit is contained in:
parent
3ebdffd396
commit
e18fc9fc63
@ -254,12 +254,6 @@ void bootstrap(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
// AppImage
|
||||
#ifdef MCPI_IS_APPIMAGE_BUILD
|
||||
// Mark Patched MCPI As Part Of AppImage
|
||||
set_and_print_env("APPDIR_MODULE_DIR", getenv("MCPI_EXECUTABLE_PATH"));
|
||||
#endif
|
||||
|
||||
// Configure LD_LIBRARY_PATH
|
||||
{
|
||||
// Log
|
||||
|
@ -8,12 +8,26 @@
|
||||
#include "patchelf.h"
|
||||
|
||||
// Duplicate MCPI Executable Into /tmp
|
||||
#define TMP_DIR "/tmp/.minecraft-pi-tmp"
|
||||
static void duplicate_mcpi_executable() {
|
||||
// Get Original Path
|
||||
const char *original_path = getenv("MCPI_EXECUTABLE_PATH");
|
||||
|
||||
// Ensure Temporary Directory
|
||||
{
|
||||
// Check If It Exists
|
||||
struct stat tmp_stat;
|
||||
int exists = stat(TMP_DIR, &tmp_stat) != 0 ? 0 : S_ISDIR(tmp_stat.st_mode);
|
||||
if (!exists) {
|
||||
// Doesn't Exist
|
||||
if (mkdir(TMP_DIR, S_IRUSR | S_IWUSR | S_IXUSR) != 0) {
|
||||
ERR("Unable To Create Temporary Folder: %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate New File
|
||||
char new_path[] = "/tmp/.minecraft-pi-XXXXXX";
|
||||
char new_path[] = TMP_DIR "/XXXXXX";
|
||||
int new_file_fd = mkstemp(new_path);
|
||||
if (new_file_fd == -1) {
|
||||
ERR("Unable To Create Temporary File: %s", strerror(errno));
|
||||
|
@ -122,7 +122,8 @@ const runtime = {
|
||||
GTK_DATA_PREFIX: '${APPDIR}',
|
||||
GTK_THEME: 'Default',
|
||||
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`
|
||||
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`,
|
||||
APPDIR_MODULE_DIR: '/tmp/.minecraft-pi-tmp'
|
||||
} : undefined,
|
||||
preserve: arch !== 'armhf' ? [
|
||||
// On non-ARM32 systems, an ARM32 linker is embedded, this
|
||||
|
Loading…
Reference in New Issue
Block a user