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
|
// Configure LD_LIBRARY_PATH
|
||||||
{
|
{
|
||||||
// Log
|
// Log
|
||||||
|
@ -8,12 +8,26 @@
|
|||||||
#include "patchelf.h"
|
#include "patchelf.h"
|
||||||
|
|
||||||
// Duplicate MCPI Executable Into /tmp
|
// Duplicate MCPI Executable Into /tmp
|
||||||
|
#define TMP_DIR "/tmp/.minecraft-pi-tmp"
|
||||||
static void duplicate_mcpi_executable() {
|
static void duplicate_mcpi_executable() {
|
||||||
// Get Original Path
|
// Get Original Path
|
||||||
const char *original_path = getenv("MCPI_EXECUTABLE_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
|
// Generate New File
|
||||||
char new_path[] = "/tmp/.minecraft-pi-XXXXXX";
|
char new_path[] = TMP_DIR "/XXXXXX";
|
||||||
int new_file_fd = mkstemp(new_path);
|
int new_file_fd = mkstemp(new_path);
|
||||||
if (new_file_fd == -1) {
|
if (new_file_fd == -1) {
|
||||||
ERR("Unable To Create Temporary File: %s", strerror(errno));
|
ERR("Unable To Create Temporary File: %s", strerror(errno));
|
||||||
|
@ -122,7 +122,8 @@ const runtime = {
|
|||||||
GTK_DATA_PREFIX: '${APPDIR}',
|
GTK_DATA_PREFIX: '${APPDIR}',
|
||||||
GTK_THEME: 'Default',
|
GTK_THEME: 'Default',
|
||||||
XDG_DATA_DIRS: '${APPDIR}/share:${APPDIR}/usr/share',
|
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,
|
} : 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
|
||||||
|
Loading…
Reference in New Issue
Block a user