aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2021-02-26 11:44:51 +0100
committerRobby Workman <rworkman@slackbuilds.org>2021-04-17 22:49:11 -0500
commit018ccee47bd146e9615a1b02ec70f9540854e233 (patch)
treee6cca89cbcf9fdd0544a730db87cc221e08abe31
parentf2c7a6761baaac4e0420472a527021891e4c0fc1 (diff)
games/0ad: Updated for version 0.0.24b.
patch for the newer rust, add the dep fmt Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--games/0ad/0ad.SlackBuild26
-rw-r--r--games/0ad/0ad.info8
-rw-r--r--games/0ad/D1852.diff213
-rw-r--r--games/0ad/rust-1.50.0.patch40
4 files changed, 61 insertions, 226 deletions
diff --git a/games/0ad/0ad.SlackBuild b/games/0ad/0ad.SlackBuild
index 514f61c116a1..d8ff784b1bc6 100644
--- a/games/0ad/0ad.SlackBuild
+++ b/games/0ad/0ad.SlackBuild
@@ -25,7 +25,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=0ad
-VERSION=${VERSION:-0.0.23b}
+VERSION=${VERSION:-0.0.24b}
RELEASE=${RELEASE:-alpha}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
@@ -72,30 +72,38 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+unset CPPFLAGS
+
export CFLAGS="$SLKCFLAGS"
-export CXXFLAGS="$SLKCFLAGS -fpermissive"
-# and yes, it's really necessary to set CPPFLAGS like this :(
-export CPPFLAGS="$SLKCFLAGS -fpermissive"
+export CXXFLAGS="$SLKCFLAGS -DU_USING_ICU_NAMESPACE=1"
export LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}"
+export SDL2_CONFIG="/usr/bin/sdl2-config"
-# Fix boost names
-sed -i 's/-mt//g' build/premake/extern_libs4.lua
+# Fix boost names, include paths and remove isystem
+sed -i 's|-mt||g' build/premake/extern_libs5.lua || exit 1
+sed -i 's|/usr/local/include|/usr/include|' build/premake/{extern_libs5.lua,premake5.lua} || exit 1
+sed -i 's|-isystem |-I|' build/premake/premake5/{src/tools/gcc.lua,tests/tools/test_gcc.lua} || exit 1
+
+sed -i '/third_party/a #include <deque>' source/ps/CLogger.h || exit 1
+sed -i '/ps\/Profiler2/a #include <stack>' source/ps/Profiler2GPU.cpp || exit 1
#allow for ATLAS to be yes.
[ "x$ATLAS" = "xyes" ]&& ATLAS="enable"
# build/workspaces/update-workspaces.sh
# have a root check, let's disable it.
patch -p1 < $CWD/disable-root-check.patch
-#apply a segfault fixing patch
-#sourced from https://code.wildfiregames.com/file/data/nryu3qhun4v6uroyiqoc/PHID-FILE-osgvknec7zmfuja5xqq4/D1852.diff
-patch -p2 < $CWD/D1852.diff
+
+echo "patch -p1 < $CWD/rust-1.50.0.patch" >> libraries/source/spidermonkey/patch.sh
build/workspaces/update-workspaces.sh \
+ --without-pch \
--bindir=/usr/games \
--datadir=/usr/share/games/0ad \
--libdir=/usr/lib${LIBDIRSUFFIX}/0ad \
--${ATLAS:-disable}-atlas
+sed -i 's|-isystem |-I|g' build/workspaces/gcc/*.make || exit 1
+
make CONFIG=Release -C build/workspaces/gcc
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/0ad
diff --git a/games/0ad/0ad.info b/games/0ad/0ad.info
index 848b05848e6b..ec46e6bed064 100644
--- a/games/0ad/0ad.info
+++ b/games/0ad/0ad.info
@@ -1,10 +1,10 @@
PRGNAM="0ad"
-VERSION="0.0.23b"
+VERSION="0.0.24b"
HOMEPAGE="https://play0ad.com/"
-DOWNLOAD="http://releases.wildfiregames.com/0ad-0.0.23b-alpha-unix-build.tar.xz"
-MD5SUM="4fa111410ea55de7a013406ac1013668"
+DOWNLOAD="http://releases.wildfiregames.com/0ad-0.0.24b-alpha-unix-build.tar.xz"
+MD5SUM="c9d34029fe95d515a5284508cc1d646c"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="0ad-data OpenAL enet gloox miniupnpc SDL2 libsodium"
+REQUIRES="0ad-data enet fmt gloox miniupnpc"
MAINTAINER="Tim Dickson"
EMAIL="dickson.tim@googlemail.com"
diff --git a/games/0ad/D1852.diff b/games/0ad/D1852.diff
deleted file mode 100644
index 131c8210a0a2..000000000000
--- a/games/0ad/D1852.diff
+++ /dev/null
@@ -1,213 +0,0 @@
-Index: ps/trunk/source/ps/Replay.cpp
-===================================================================
---- ps/trunk/source/ps/Replay.cpp
-+++ ps/trunk/source/ps/Replay.cpp
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2018 Wildfire Games.
-+/* Copyright (C) 2019 Wildfire Games.
- * This file is part of 0 A.D.
- *
- * 0 A.D. is free software: you can redistribute it and/or modify
-@@ -72,7 +72,7 @@
- JS::RootedValue mods(cx, Mod::GetLoadedModsWithVersions(m_ScriptInterface));
- m_ScriptInterface.SetProperty(attribs, "mods", mods);
-
-- m_Directory = createDateIndexSubdirectory(VisualReplay::GetDirectoryName());
-+ m_Directory = createDateIndexSubdirectory(VisualReplay::GetDirectoryPath());
- debug_printf("Writing replay to %s\n", m_Directory.string8().c_str());
-
- m_Stream = new std::ofstream(OsString(m_Directory / L"commands.txt").c_str(), std::ofstream::out | std::ofstream::trunc);
-Index: ps/trunk/source/ps/VisualReplay.h
-===================================================================
---- ps/trunk/source/ps/VisualReplay.h
-+++ ps/trunk/source/ps/VisualReplay.h
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2017 Wildfire Games.
-+/* Copyright (C) 2019 Wildfire Games.
- * This file is part of 0 A.D.
- *
- * 0 A.D. is free software: you can redistribute it and/or modify
-@@ -29,12 +29,20 @@
- {
-
- /**
-- * Returns the path to the sim-log directory (that contains the directories with the replay files.
-- *
-- * @param scriptInterface - the ScriptInterface in which to create the return data.
-- * @return OsPath the absolute file path
-+ * Returns the absolute path to the sim-log directory (that contains the directories with the replay files.
-+ */
-+OsPath GetDirectoryPath();
-+
-+/**
-+ * Returns the absolute path to the replay cache file.
-+ */
-+OsPath GetCacheFilePath();
-+
-+/**
-+ * Returns the absolute path to the temporary replay cache file used to
-+ * always have a valid cache file in place even if bad things happen.
- */
--OsPath GetDirectoryName();
-+OsPath GetTempCacheFilePath();
-
- /**
- * Replays the commands.txt file in the given subdirectory visually.
-Index: ps/trunk/source/ps/VisualReplay.cpp
-===================================================================
---- ps/trunk/source/ps/VisualReplay.cpp
-+++ ps/trunk/source/ps/VisualReplay.cpp
-@@ -40,13 +40,19 @@
- */
- const u8 minimumReplayDuration = 3;
-
--static const OsPath tempCacheFileName = VisualReplay::GetDirectoryName() / L"replayCache_temp.json";
--static const OsPath cacheFileName = VisualReplay::GetDirectoryName() / L"replayCache.json";
-+OsPath VisualReplay::GetDirectoryPath()
-+{
-+ return Paths(g_args).UserData() / "replays" / engine_version;
-+}
-+
-+OsPath VisualReplay::GetCacheFilePath()
-+{
-+ return GetDirectoryPath() / L"replayCache.json";
-+}
-
--OsPath VisualReplay::GetDirectoryName()
-+OsPath VisualReplay::GetTempCacheFilePath()
- {
-- const Paths paths(g_args);
-- return OsPath(paths.UserData() / "replays" / engine_version);
-+ return GetDirectoryPath() / L"replayCache_temp.json";
- }
-
- bool VisualReplay::StartVisualReplay(const OsPath& directory)
-@@ -55,7 +61,7 @@
- ENSURE(!g_NetClient);
- ENSURE(!g_Game);
-
-- const OsPath replayFile = VisualReplay::GetDirectoryName() / directory / L"commands.txt";
-+ const OsPath replayFile = VisualReplay::GetDirectoryPath() / directory / L"commands.txt";
-
- if (!FileExists(replayFile))
- return false;
-@@ -69,10 +75,10 @@
- JSContext* cx = scriptInterface.GetContext();
- JSAutoRequest rq(cx);
-
-- if (!FileExists(cacheFileName))
-+ if (!FileExists(GetCacheFilePath()))
- return false;
-
-- std::ifstream cacheStream(OsString(cacheFileName).c_str());
-+ std::ifstream cacheStream(OsString(GetCacheFilePath()).c_str());
- CStr cacheStr((std::istreambuf_iterator<char>(cacheStream)), std::istreambuf_iterator<char>());
- cacheStream.close();
-
-@@ -85,7 +91,7 @@
- }
-
- LOGWARNING("The replay cache file is corrupted, it will be deleted");
-- wunlink(cacheFileName);
-+ wunlink(GetCacheFilePath());
- return false;
- }
-
-@@ -95,12 +101,12 @@
- JSAutoRequest rq(cx);
-
- JS::RootedValue replaysRooted(cx, JS::ObjectValue(*replays));
-- std::ofstream cacheStream(OsString(tempCacheFileName).c_str(), std::ofstream::out | std::ofstream::trunc);
-+ std::ofstream cacheStream(OsString(GetTempCacheFilePath()).c_str(), std::ofstream::out | std::ofstream::trunc);
- cacheStream << scriptInterface.StringifyJSON(&replaysRooted);
- cacheStream.close();
-
-- wunlink(cacheFileName);
-- if (wrename(tempCacheFileName, cacheFileName))
-+ wunlink(GetCacheFilePath());
-+ if (wrename(GetTempCacheFilePath(), GetCacheFilePath()))
- LOGERROR("Could not store the replay cache");
- }
-
-@@ -139,7 +145,7 @@
- JS::RootedObject replays(cx, JS_NewArrayObject(cx, 0));
- DirectoryNames directories;
-
-- if (GetDirectoryEntries(GetDirectoryName(), nullptr, &directories) != INFO::OK)
-+ if (GetDirectoryEntries(GetDirectoryPath(), nullptr, &directories) != INFO::OK)
- return replays;
-
- bool newReplays = false;
-@@ -155,7 +161,7 @@
- // Don't return, because we want to save our progress
- break;
-
-- const OsPath replayFile = GetDirectoryName() / directory / L"commands.txt";
-+ const OsPath replayFile = GetDirectoryPath() / directory / L"commands.txt";
-
- bool isNew = true;
- replayCacheMap::iterator it = fileList.find(directory);
-@@ -325,7 +331,7 @@
- JS::Value VisualReplay::LoadReplayData(const ScriptInterface& scriptInterface, const OsPath& directory)
- {
- // The directory argument must not be constant, otherwise concatenating will fail
-- const OsPath replayFile = GetDirectoryName() / directory / L"commands.txt";
-+ const OsPath replayFile = GetDirectoryPath() / directory / L"commands.txt";
-
- if (!FileExists(replayFile))
- return JS::NullValue();
-@@ -407,7 +413,7 @@
- if (replayDirectory.empty())
- return false;
-
-- const OsPath directory = GetDirectoryName() / replayDirectory;
-+ const OsPath directory = GetDirectoryPath() / replayDirectory;
- return DirectoryExists(directory) && DeleteDirectory(directory) == INFO::OK;
- }
-
-@@ -420,7 +426,7 @@
- pCxPrivate->pScriptInterface->Eval("({})", &attribs);
-
- // Return empty object if file doesn't exist
-- const OsPath replayFile = GetDirectoryName() / directoryName / L"commands.txt";
-+ const OsPath replayFile = GetDirectoryPath() / directoryName / L"commands.txt";
- if (!FileExists(replayFile))
- return attribs;
-
-@@ -483,7 +489,7 @@
-
- bool VisualReplay::HasReplayMetadata(const OsPath& directoryName)
- {
-- const OsPath filePath(GetDirectoryName() / directoryName / L"metadata.json");
-+ const OsPath filePath(GetDirectoryPath() / directoryName / L"metadata.json");
-
- if (!FileExists(filePath))
- return false;
-@@ -503,7 +509,7 @@
- JSAutoRequest rq(cx);
- JS::RootedValue metadata(cx);
-
-- std::ifstream* stream = new std::ifstream(OsString(GetDirectoryName() / directoryName / L"metadata.json").c_str());
-+ std::ifstream* stream = new std::ifstream(OsString(GetDirectoryPath() / directoryName / L"metadata.json").c_str());
- ENSURE(stream->good());
- CStr line;
- std::getline(*stream, line);
-Index: ps/trunk/source/ps/scripting/JSInterface_VisualReplay.cpp
-===================================================================
---- ps/trunk/source/ps/scripting/JSInterface_VisualReplay.cpp
-+++ ps/trunk/source/ps/scripting/JSInterface_VisualReplay.cpp
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2018 Wildfire Games.
-+/* Copyright (C) 2019 Wildfire Games.
- * This file is part of 0 A.D.
- *
- * 0 A.D. is free software: you can redistribute it and/or modify
-@@ -61,7 +61,7 @@
-
- CStrW JSI_VisualReplay::GetReplayDirectoryName(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const CStrW& directoryName)
- {
-- return wstring_from_utf8(OsPath(VisualReplay::GetDirectoryName() / directoryName).string8());
-+ return wstring_from_utf8(OsPath(VisualReplay::GetDirectoryPath() / directoryName).string8());
- }
-
- void JSI_VisualReplay::RegisterScriptFunctions(const ScriptInterface& scriptInterface)
diff --git a/games/0ad/rust-1.50.0.patch b/games/0ad/rust-1.50.0.patch
new file mode 100644
index 000000000000..165288406557
--- /dev/null
+++ b/games/0ad/rust-1.50.0.patch
@@ -0,0 +1,40 @@
+diff -Naur mozjs-78.6.0.orig/.cargo/config.in mozjs-78.6.0/.cargo/config.in
+--- mozjs-78.6.0.orig/.cargo/config.in 2020-11-28 17:33:01.000000000 +0100
++++ mozjs-78.6.0/.cargo/config.in 2021-02-26 08:45:50.995837000 +0100
+@@ -3,9 +3,9 @@
+ # Please do not edit.
+
+ [source."https://github.com/shravanrn/nix/"]
+-branch = "r0.13.1"
+ git = "https://github.com/shravanrn/nix/"
+ replace-with = "vendored-sources"
++rev = "4af6c367603869a30fddb5ffb0aba2b9477ba92e"
+
+ [source."https://github.com/mozilla/rkv"]
+ git = "https://github.com/mozilla/rkv"
+diff -Naur mozjs-78.6.0.orig/Cargo.lock mozjs-78.6.0/Cargo.lock
+--- mozjs-78.6.0.orig/Cargo.lock 2020-11-28 17:33:01.000000000 +0100
++++ mozjs-78.6.0/Cargo.lock 2021-02-26 08:47:06.265837000 +0100
+@@ -3200,7 +3200,7 @@
+ [[package]]
+ name = "nix"
+ version = "0.13.1"
+-source = "git+https://github.com/shravanrn/nix/?branch=r0.13.1#4af6c367603869a30fddb5ffb0aba2b9477ba92e"
++source = "git+https://github.com/shravanrn/nix/?rev=4af6c367603869a30fddb5ffb0aba2b9477ba92e#4af6c367603869a30fddb5ffb0aba2b9477ba92e"
+ dependencies = [
+ "bitflags",
+ "cc",
+diff -Naur mozjs-78.6.0.orig/Cargo.toml mozjs-78.6.0/Cargo.toml
+--- mozjs-78.6.0.orig/Cargo.toml 2020-11-28 17:34:26.000000000 +0100
++++ mozjs-78.6.0/Cargo.toml 2021-02-26 08:48:06.663837000 +0100
+@@ -60,8 +60,8 @@
+ [patch.crates-io]
+ packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="3541e3818fdc7c2a24f87e3459151a4ce955a67a" }
+ rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="d510da5999a744c563b0acd18056069d1698273f" }
+-nix = { git = "https://github.com/shravanrn/nix/", branch = "r0.13.1", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" }
+-spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3", rev = "20191ad2f370afd6d247edcb9ff9da32d3bedb9c" }
++nix = { git = "https://github.com/shravanrn/nix/", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" }
++spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu4" }
+ # failure's backtrace feature might break our builds, see bug 1608157.
+ failure = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" }
+ failure_derive = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" }