diff --git a/linux/make_appimg.sh b/linux/make_appimg.sh index 92fd91cb..6601f40b 100755 --- a/linux/make_appimg.sh +++ b/linux/make_appimg.sh @@ -33,6 +33,11 @@ get_dep libbsd get_dep tinfo get_dep readline +if [ -n "$3" ]; then + echo "Copying steam_api..." + cp "$3/libsteam_api.so" "${MESON_INSTALL_PREFIX}/usr/lib" +fi + cp ${MESON_INSTALL_PREFIX}/share/mkxp-z/* ${MESON_INSTALL_PREFIX} rm -rf ${MESON_INSTALL_PREFIX}/share $2 ${MESON_INSTALL_PREFIX} diff --git a/linux/meson.build b/linux/meson.build index 8a7cc90a..868e9a62 100644 --- a/linux/meson.build +++ b/linux/meson.build @@ -1,4 +1,9 @@ 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')) + +swarg = '' +if steamworks == true + swarg = steam_libpath +endif +meson.add_install_script('make_appimg.sh', meson.project_name(), get_option('appimagekit_path'), swarg) diff --git a/macos/macpack.sh b/macos/macpack.sh index 42d5f912..af875475 100755 --- a/macos/macpack.sh +++ b/macos/macpack.sh @@ -3,4 +3,10 @@ EXE=${MESON_INSTALL_PREFIX}/Contents/MacOS/mkxp-z install_name_tool -add_rpath "@executable_path/../libs" $EXE -macpack -v $EXE +macpack $EXE + +if [ -n "$1" ]; then + echo "Setting up steam_api manually..." + cp "$1/libsteam_api.dylib" "${MESON_INSTALL_PREFIX}/Contents/libs" + install_name_tool -change "@loader_path/libsteam_api.dylib" "@executable_path/../libs/libsteam_api.dylib" $EXE +fi diff --git a/macos/meson.build b/macos/meson.build index 626154cc..0dd4a657 100644 --- a/macos/meson.build +++ b/macos/meson.build @@ -1,3 +1,9 @@ install_data('icon.icns', install_dir: 'Contents/Resources') install_data('Info.plist', install_dir: 'Contents') -meson.add_install_script('macpack.sh') + +swarg = '' +if steamworks == true + swarg = steam_libpath +endif + +meson.add_install_script('macpack.sh', swarg) diff --git a/meson_options.txt b/meson_options.txt index 355f814c..2797338a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -19,4 +19,5 @@ option('workdir_current', type: 'boolean', value: false, description: 'Keep curr option('static_executable', type: 'boolean', value: false, description: 'Build a static executable (Windows-only)') option('independent_appimage', type: 'boolean', value: true, description: 'Set current directory to the original location of the AppImage when contained within one') option('steamworks_path', type: 'string', value: '', description: 'Path to Steamshim') +option('steam_appid', type: 'string', value: '', description: 'Steam AppID. Set this to use SteamAPI_RestartAppIfNecessary') option('appimagekit_path', type: 'string', value: '', description: 'Path to AppImageKit, used for building AppImages')