Skip to content
Extraits de code Groupes Projets
Vérifiée Valider ef4f0413 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Fix AppImage env checks, should works

parent 93e8ee12
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!8Create an AppImage
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <pwd.h> #include <pwd.h>
#include <iostream>
namespace { namespace {
#ifndef __APPLE__ #ifndef __APPLE__
std::string home_dir() { std::string home_dir() {
...@@ -44,17 +46,14 @@ void Path::FillPlatformSpecificPaths() { ...@@ -44,17 +46,14 @@ void Path::FillPlatformSpecificPaths() {
agi::fs::path home = home_dir(); agi::fs::path home = home_dir();
SetToken("?user", home/".aegisub"); SetToken("?user", home/".aegisub");
SetToken("?local", home/".aegisub"); SetToken("?local", home/".aegisub");
#ifdef __linux__
/* AppImage case */
if (const char *ptr_root = getenv("APPDIR"); ptr_root != nullptr) { if (const char *ptr_root = getenv("APPDIR"); ptr_root != nullptr) {
/* AppImage case */
agi::fs::path root = ptr_root; agi::fs::path root = ptr_root;
SetToken("?data", root/P_DATA); SetToken("?data", root/"usr/share/aegisub/");
} else { } else {
/* No AppImage */
SetToken("?data", P_DATA); SetToken("?data", P_DATA);
} }
#else
SetToken("?data", P_DATA);
#endif
SetToken("?dictionary", "/usr/share/hunspell"); SetToken("?dictionary", "/usr/share/hunspell");
#else #else
agi::fs::path app_support = agi::util::GetApplicationSupportDirectory(); agi::fs::path app_support = agi::util::GetApplicationSupportDirectory();
......
...@@ -33,9 +33,12 @@ chmod +x "$APPIMAGETOOL" "$LINUXDEPLOY" ...@@ -33,9 +33,12 @@ chmod +x "$APPIMAGETOOL" "$LINUXDEPLOY"
cp packages/desktop/aegisub.desktop.template.in AppImage/aegisub.desktop || exit 1; cp packages/desktop/aegisub.desktop.template.in AppImage/aegisub.desktop || exit 1;
cp packages/desktop/64x64.png AppImage/aegisub.png || exit 1; cp packages/desktop/64x64.png AppImage/aegisub.png || exit 1;
sed -i -e 's/@AEGISUB_COMMAND@/aegisub/g' AppImage/aegisub.desktop || exit 1; sed -i -e 's/@AEGISUB_COMMAND@/aegisub/g' AppImage/aegisub.desktop || exit 1;
rm AppImage/Aegisub/usr/bin/aegisub
$LINUXDEPLOY \ $LINUXDEPLOY \
--appdir AppImage/Aegisub \ --appdir AppImage/Aegisub \
--icon-file AppImage/aegisub.png \ --icon-file AppImage/aegisub.png \
--desktop-file AppImage/aegisub.desktop \ --desktop-file AppImage/aegisub.desktop \
--executable "$AEGISUB" || exit 1; --executable "$AEGISUB" || exit 1;
mkdir -p AppImage/Aegisub/usr/share/aegisub/automation || exit 1;
cp -rv automation/* AppImage/Aegisub/usr/share/aegisub/automation/
$APPIMAGETOOL AppImage/Aegisub $APPIMAGETOOL AppImage/Aegisub
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter