mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-04-29 19:44:49 +02:00
Add AppImage stuff
This commit is contained in:
parent
1e63c65c73
commit
0dbc2b1a21
13 changed files with 77 additions and 17 deletions
|
@ -21,7 +21,8 @@ RB_METHOD(DiscordConnected)
|
|||
{
|
||||
RB_UNUSED_PARAM;
|
||||
|
||||
return rb_bool_new(shState->discord().isConnected());
|
||||
// Checking to make sure callbacks have actually fired
|
||||
return rb_bool_new(shState->discord().userId());
|
||||
}
|
||||
|
||||
RB_METHOD(DiscordGetUsername)
|
||||
|
|
15
linux/AppRun
Executable file
15
linux/AppRun
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
SELF_DIR="$(dirname "$(readlink -f "$0")")"
|
||||
LIBS_PATH="$SELF_DIR/usr/lib"
|
||||
|
||||
if [ -z "$LD_LIBRARY_PATH" ]; then
|
||||
LD_LIBRARY_PATH="$LIBS_PATH"
|
||||
else
|
||||
LD_LIBRARY_PATH="$LIBS_PATH:$LD_LIBRARY_PATH"
|
||||
fi
|
||||
|
||||
export LD_LIBRARY_PATH
|
||||
export SRCDIR=$PWD
|
||||
|
||||
exec "$SELF_DIR/usr/bin/mkxp-z"
|
36
linux/copy_dependencies.sh
Normal file
36
linux/copy_dependencies.sh
Normal file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
# Author : Hemanth.HM
|
||||
# Email : hemanth[dot]hm[at]gmail[dot]com
|
||||
# License : GNU GPLv3
|
||||
#
|
||||
|
||||
function useage()
|
||||
{
|
||||
cat << EOU
|
||||
Useage: bash $0 <path to the binary> <path to copy the dependencies>
|
||||
EOU
|
||||
exit 1
|
||||
}
|
||||
|
||||
#Validate the inputs
|
||||
[[ $# < 2 ]] && useage
|
||||
|
||||
#Check if the paths are vaild
|
||||
[[ ! -e $1 ]] && echo "Not a vaild input $1" && exit 1
|
||||
[[ -d $2 ]] || echo "No such directory $2 creating..."&& mkdir -p "$2"
|
||||
|
||||
#Get the library dependencies
|
||||
echo "Collecting the shared library dependencies for $1..."
|
||||
deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1\
|
||||
~/^\//{print $1}$3~/^\//{print $3}'\
|
||||
| sed 's/,$/\n/')
|
||||
echo "Copying the dependencies to $2"
|
||||
|
||||
#Copy the deps
|
||||
for dep in $deps
|
||||
do
|
||||
echo "Copying $dep to $2"
|
||||
cp "$dep" "$2"
|
||||
done
|
||||
|
||||
echo "Done!"
|
5
linux/make_appimg.sh
Normal file
5
linux/make_appimg.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
BINNAME=$1
|
||||
APPIMGKIT=$2
|
||||
|
||||
exec("./copy_dependencies.sh $BINNAME ${MESON_INSTALL_PREFIX}/lib")
|
||||
$APPIMGKIT ${MESON_INSTALL_PREFIX} ${MESON_BUILD_ROOT}
|
4
linux/meson.build
Normal file
4
linux/meson.build
Normal file
|
@ -0,0 +1,4 @@
|
|||
install_data('AppRun')
|
||||
install_data('mkxp-z.png')
|
||||
install_data('mkxp-z.desktop')
|
||||
meson.add_install_script('make_appimg.sh', 'mkxp-z', get_option('appimagekit_path'))
|
6
linux/mkxp-z.desktop
Normal file
6
linux/mkxp-z.desktop
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Name=mkxp-z
|
||||
Exec=mkxp-z
|
||||
Icon=mkxp-z
|
||||
Type=Application
|
||||
Categories=X-Utilities;
|
BIN
linux/mkxp-z.png
Normal file
BIN
linux/mkxp-z.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
@ -1,9 +1,3 @@
|
|||
if get_option('mk') == false
|
||||
install_data('icon.icns', install_dir: 'Contents/Resources')
|
||||
else
|
||||
install_data('icon_mk.icns', install_dir: 'Contents/Resources', rename: 'icon.icns')
|
||||
endif
|
||||
|
||||
install_data('icon.icns', install_dir: 'Contents/Resources')
|
||||
install_data('Info.plist', install_dir: 'Contents')
|
||||
|
||||
meson.add_install_script('macpack.sh')
|
||||
|
|
|
@ -79,6 +79,8 @@ elif host_system == 'darwin'
|
|||
add_project_arguments('-mmacosx-version-min='+minimum_macos_version, language: 'c')
|
||||
add_project_link_arguments('-mmacosx-version-min='+minimum_macos_version, language: 'cpp')
|
||||
endif
|
||||
else
|
||||
subdir('linux')
|
||||
endif
|
||||
|
||||
executable(meson.project_name(),
|
||||
|
@ -86,5 +88,5 @@ executable(meson.project_name(),
|
|||
dependencies: [main_dependencies, binding_dependencies, ext_dependencies],
|
||||
include_directories: include_dirs,
|
||||
gui_app: (get_option('console') == false),
|
||||
install: (host_system == 'darwin')
|
||||
install: (host_system != 'windows')
|
||||
)
|
||||
|
|
|
@ -10,6 +10,7 @@ option('use_fakeapi', type: 'boolean', value: false, description: 'Attempt to re
|
|||
option('default_framerate', type: 'boolean', value: false, description: 'Disable syncToRefreshrate and fixedFramerate configuration options')
|
||||
option('no_preload_scripts', type: 'boolean', value: false, description: 'Disable the preloadScript configuration option')
|
||||
option('workdir_current', type: 'boolean', value: false, description: 'Keep current directory on startup')
|
||||
option('independent_appimage', type: 'boolean', value: true, description: 'Set current directory to the original location of the AppImage when contained within one')
|
||||
|
||||
option('discord_sdk_path', type: 'string', value: '', description: 'Path to Discord GameSDK')
|
||||
option('independent_appimage', type: 'boolean', value: true, description: 'Set current directory to the original location of the AppImage when contained within one')
|
||||
option('discord_sdk_path', type: 'string', value: '', description: 'Path to Discord GameSDK')
|
||||
option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages')
|
|
@ -201,7 +201,7 @@ int DiscordState::update()
|
|||
|
||||
bool DiscordState::isConnected()
|
||||
{
|
||||
return p->connected;
|
||||
return (p->connected && p->userPresent);
|
||||
}
|
||||
|
||||
std::string DiscordState::userName()
|
||||
|
|
|
@ -73,8 +73,6 @@ printGLInfo()
|
|||
int rgssThreadFun(void *userdata)
|
||||
{
|
||||
RGSSThreadData *threadData = static_cast<RGSSThreadData*>(userdata);
|
||||
const Config &conf = threadData->config;
|
||||
SDL_Window *win = threadData->window;
|
||||
|
||||
/* Setup AL context */
|
||||
ALCcontext *alcCtx = alcCreateContext(threadData->alcDev, 0);
|
||||
|
@ -187,12 +185,10 @@ int main(int argc, char *argv[])
|
|||
char dataDir[512]{};
|
||||
char *tmp{};
|
||||
#if defined(__linux__) && defined(INDEPENDENT_APPIMAGE)
|
||||
tmp = getenv("APPIMAGE");
|
||||
tmp = getenv("SRCDIR");
|
||||
if (tmp)
|
||||
{
|
||||
strncpy(dataDir, tmp, sizeof(dataDir));
|
||||
int spos = strrchr(dataDir, '/');
|
||||
dataDir[spos] = 0;
|
||||
}
|
||||
#endif
|
||||
if (!dataDir[0])
|
||||
|
|
Loading…
Add table
Reference in a new issue