summaryrefslogtreecommitdiff
path: root/homebrew/einstein/patches.sh
diff options
context:
space:
mode:
authorMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-20 20:49:46 -0500
committerMCApollo <34170230+MCApollo@users.noreply.github.com>2019-04-23 20:18:47 -0500
commit12335518ab39608d58370c85ff9f5384ad2aa5f7 (patch)
tree352d81f2a2de3f1252af732080ec0fde38c13b4d /homebrew/einstein/patches.sh
parenta2b26ad12d4fa12f0273645caf4be6d0b8b71e7c (diff)
Ported in the homebrew-marauder for a hacky update/import system.
TODO: Maybe add a license & fix up messy code.
Diffstat (limited to 'homebrew/einstein/patches.sh')
-rwxr-xr-xhomebrew/einstein/patches.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/homebrew/einstein/patches.sh b/homebrew/einstein/patches.sh
new file mode 100755
index 000000000..7b1728003
--- /dev/null
+++ b/homebrew/einstein/patches.sh
@@ -0,0 +1,39 @@
+echo 'Creating brew-patch.diff'
+cat << EOF >> brew-patch.diff
+--- formatter.cpp
++++ formatter.cpp
+@@ -58,7 +58,7 @@ Formatter::Formatter(unsigned char *data, int offset)
+ if ((c.type == INT_ARG) || (c.type == STRING_ARG) ||
+ (c.type == FLOAT_ARG) || (c.type == DOUBLE_ARG))
+ {
+- int no = (int)c.data;
++ int no = *((int*)(&c.data));
+ args[no - 1] = c.type;
+ }
+ }
+@@ -135,7 +135,7 @@ std::wstring Formatter::format(std::vector<ArgValue*> &argValues) const
+
+ case STRING_ARG:
+ case INT_ARG:
+- no = (int)cmd->data - 1;
++ no = *((int*)(&cmd->data)) - 1;
+ if (no < (int)argValues.size())
+ s += argValues[no]->format(cmd);
+ break;
+--- main.cpp
++++ main.cpp
+@@ -61,13 +61,9 @@ static void loadResources(const std::wstring &selfPath)
+ #ifdef WIN32
+ dirs.push_back(getStorage()->get(L"path", L"") + L"\\res");
+ #else
+-#ifdef __APPLE__
+- dirs.push_back(getResourcesPath(selfPath));
+-#else
+ dirs.push_back(PREFIX L"/share/einstein/res");
+ dirs.push_back(fromMbcs(getenv("HOME")) + L"/.einstein/res");
+ #endif
+-#endif
+ dirs.push_back(L"res");
+ dirs.push_back(L".");
+ resources = new ResourcesCollection(dirs);
+EOF