From b5f22e1874786bf0641bc0cfe1f6c2eedf0ff649 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 21 Jun 2019 04:37:37 +0200 Subject: pkgs/games: Add Warcraft II BNE This is supported by the Stratagus/Wargus engine and it's using the data files from the GOG version. I had this laying in the repository for a while but didn't commit and push it yet, so let's call it done by now :-) Signed-off-by: aszlig --- pkgs/games/gog/warcraft2/xdg.patch | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 pkgs/games/gog/warcraft2/xdg.patch (limited to 'pkgs/games/gog/warcraft2/xdg.patch') diff --git a/pkgs/games/gog/warcraft2/xdg.patch b/pkgs/games/gog/warcraft2/xdg.patch new file mode 100644 index 00000000..979a86e3 --- /dev/null +++ b/pkgs/games/gog/warcraft2/xdg.patch @@ -0,0 +1,37 @@ +diff --git a/src/stratagus/parameters.cpp b/src/stratagus/parameters.cpp +index a705ba21d..8585856b0 100644 +--- a/src/stratagus/parameters.cpp ++++ b/src/stratagus/parameters.cpp +@@ -48,26 +48,13 @@ void Parameters::SetDefaultValues() + + void Parameters::SetDefaultUserDirectory() + { +-#ifdef USE_GAME_DIR +- userDirectory = StratagusLibPath; +-#elif USE_WIN32 +- userDirectory = getenv("APPDATA"); +-#else +- userDirectory = getenv("HOME"); +-#endif +- +- if (!userDirectory.empty()) { +- userDirectory += "/"; ++ const char *xdg_data_home = getenv("XDG_DATA_HOME"); ++ if (xdg_data_home == NULL) { ++ userDirectory = getenv("HOME"); ++ userDirectory += "/.local/share"; ++ } else { ++ userDirectory = xdg_data_home; + } +- +-#ifdef USE_GAME_DIR +-#elif USE_WIN32 +- userDirectory += "Stratagus"; +-#elif defined(USE_MAC) +- userDirectory += "Library/Stratagus"; +-#else +- userDirectory += ".stratagus"; +-#endif + } + + static std::string GetLocalPlayerNameFromEnv() -- cgit 1.4.1