diff --git a/config/config.rpath b/config/config.rpath new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/configure.ac b/configure.ac index f27177baf7f1d37f1534df9e5a35846f0b975eb3..8b8ec9c70c2353b9c1a4beb771955fa887d007ea 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,11 @@ AS_CASE([$host], AC_SUBST(build_darwin) AC_SUBST(build_linux) +if test "x$build_linux" = "xyes" +then + AC_DEFINE_UNQUOTED([AEGISUB_LINUX], 1, [Build Aegisub for Linux]) +fi + ######################## # Configurable variables ######################## @@ -88,7 +93,7 @@ AS_CASE([x$prefix], [xNONE | x], [prefix="$ac_default_prefix"], []) # Build with appimage support # Do this here because we will override the install path AC_ARG_ENABLE([appimage], - [AS_HELP_STRING([--enable-appimage], [Build Aegisub as an AppImage. Defaults to no])], + [AS_HELP_STRING([--enable-appimage], [Build Aegisub as an AppImage. [no]])], [AEGISUB_APPIMAGE_ENABLED=$enableval], [AEGISUB_APPIMAGE_ENABLED=no]) AS_IF([test "x$AEGISUB_APPIMAGE_ENABLED" = "xyes"], [ @@ -148,7 +153,6 @@ AS_IF([test x$use_build_credit = xyes], #################### # Check for programs #################### -CHECK_GNU_MAKE AC_PROG_CC AC_PROG_CXX AC_LANG(C++) @@ -565,9 +569,23 @@ AC_PCH_FLAG([-fpch-preprocess]) ############################## AM_GNU_GETTEXT([external]) -################ +############################################################################ # Update checker -################ +# * The $HOSTNAME/$URL should contains a file such as: +# 3.3.3 +# Changelog v3.3.3 +# +# * Added link to Joysound Exporter in the 'Help' menu +# * Fixed UTF-8 being read as ASCII leading to missing characters on Linux +# and crashes on Windows +# * Use system and user fonts on Windows +# +# Changelog v3.3.2-2 +# Added the Amaranth font installation to the Windows installer. +# * The content of the folder must be something like this: +# - latest +# - Aegisub-latest-x64 +############################################################################ AC_MSG_CHECKING([whether to enable the update checker]) AC_ARG_ENABLE(update-checker, AS_HELP_STRING([--disable-update-checker], [disable the update checker [no]])) @@ -581,15 +599,15 @@ AC_ARG_WITH(update-server, AS_HELP_STRING([--with-update-server=HOSTNAME], [Server to use for the update checker [mugen.karaokes.moe]])) -AC_MSG_RESULT(${with_update_server:=mugen.karaokes.moe}) +AC_MSG_RESULT(${with_update_server:=kurisu.iiens.net}) AC_DEFINE_UNQUOTED([UPDATE_CHECKER_SERVER], ["$with_update_server"], [Server for the update checker]) AC_MSG_CHECKING([for update checker base URL]) AC_ARG_WITH(update-url, AS_HELP_STRING([--with-update-url=HOSTNAME], - [Base path to use for the update checker [/downloads/aegisub-japan7]])) -AC_MSG_RESULT(${with_update_url:=/downloads/aegisub-japan7}) + [Base path to use for the update checker [/dist/aegisub]])) +AC_MSG_RESULT(${with_update_url:=/dist/aegisub}) AC_DEFINE_UNQUOTED([UPDATE_CHECKER_BASE_URL], ["$with_update_url"], [Base path for the update checker]) diff --git a/libaegisub/unix/path.cpp b/libaegisub/unix/path.cpp index dc080528c82c5f8e36b29f8892caf9f701b92bab..138d33273dc222f40669d307061f6efda708b109 100644 --- a/libaegisub/unix/path.cpp +++ b/libaegisub/unix/path.cpp @@ -14,6 +14,8 @@ // // Aegisub Project http://www.aegisub.org/ +#include "libaegisub/log.h" + #include <libaegisub/path.h> #include <libaegisub/exception.h> @@ -39,6 +41,8 @@ std::string home_dir() #endif } +#include <iostream> + namespace agi { void Path::FillPlatformSpecificPaths() { @@ -48,14 +52,25 @@ void Path::FillPlatformSpecificPaths() SetToken("?local", home / ".aegisub"); SetToken("?data", P_DATA); SetToken("?dictionary", "/usr/share/hunspell"); -#else +#else /* Now __APPLE__ is defined */ agi::fs::path app_support = agi::util::GetApplicationSupportDirectory(); SetToken("?user", app_support / "Aegisub"); SetToken("?local", app_support / "Aegisub"); SetToken("?data", agi::util::GetBundleSharedSupportDirectory()); SetToken("?dictionary", agi::util::GetBundleSharedSupportDirectory() + "/dictionaries"); -#endif +#endif /* __APPLE__ */ SetToken("?temp", boost::filesystem::temp_directory_path()); +#ifdef AEGISUB_LINUX + char *P_EXEC = getenv("P_EXEC"); + if (P_EXEC && P_EXEC[0] != '\0' && std::string(P_EXEC).rfind("/tmp/.mount_") == 0) { + /* Craft the P_DATA with the P_EXEC because we are in an AppImage The + * string should be /tmp/.mount_(.*)/usr/bin/aegisub and need to be + * transformed to /tmp/.mount_(.*)/usr/share/aegisub/ */ + agi::fs::path p_exec(P_EXEC); + std::string p_data = (p_exec.parent_path().parent_path() / "share/aegisub").string(); + SetToken("?data", p_data); + } +#endif /* AEGISUB_LINUX */ } } diff --git a/src/auto4_base.cpp b/src/auto4_base.cpp index 6c0c5056aba5cc41eee1e1d2812d9f89ecf2b4e8..2925192f6272a259ef5e490a6da302dc5780e03b 100644 --- a/src/auto4_base.cpp +++ b/src/auto4_base.cpp @@ -38,6 +38,7 @@ #include "string_codec.h" #include "subs_controller.h" +#include <libaegisub/log.h> #include <libaegisub/dispatch.h> #include <libaegisub/format.h> #include <libaegisub/fs.h> @@ -327,6 +328,7 @@ void AutoloadScriptManager::Reload() for (auto tok : agi::Split(path, '|')) { auto dirname = config::path->Decode(agi::str(tok)); + LOG_D("agi/script/reload") << "Using folder " << dirname << " to reload scripts"; if (!agi::fs::DirectoryExists(dirname)) continue; for (auto filename : agi::fs::DirectoryIterator(dirname, "*.*")) diff --git a/src/main.cpp b/src/main.cpp index 228410a250eddfaa91060a804205f0ada822bb99..cc992820c5f49182208154ee517f5be1140e8a09 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -72,6 +72,7 @@ #include <wx/msgdlg.h> #include <wx/stackwalk.h> #include <wx/utils.h> +#include <wx/stdpaths.h> namespace config { agi::Options *opt = nullptr; @@ -166,6 +167,16 @@ bool AegisubApp::OnInit() } }); +#ifdef AEGISUB_LINUX + { + // Set the P_EXEC if we are on Linux. This variable will be needed if + // we are inside an AppImage when creating the config::path. + wxString appPath(wxStandardPaths::Get().GetExecutablePath()); + const char *appPathCStr = appPath.ToUTF8().data(); + setenv("P_EXEC", appPathCStr, 1); + } +#endif + config::path = new agi::Path; crash_writer::Initialize(config::path->Decode("?user"));