diff --git a/x11-packages/the-powder-toy/00-SConscript.patch b/x11-packages/the-powder-toy/00-SConscript.patch index 51bb7dabf..90e3a1a71 100644 --- a/x11-packages/the-powder-toy/00-SConscript.patch +++ b/x11-packages/the-powder-toy/00-SConscript.patch @@ -1,7 +1,7 @@ -diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript ---- The-Powder-Toy-94.1/SConscript 2019-02-21 07:23:45.000000000 +0200 -+++ The-Powder-Toy-94.1.mod/SConscript 2019-05-19 18:34:00.558771379 +0300 -@@ -138,7 +138,7 @@ +diff -uNr The-Powder-Toy-95.0/SConscript The-Powder-Toy-95.0.mod/SConscript +--- The-Powder-Toy-95.0/SConscript 2020-02-27 05:38:53.000000000 +0200 ++++ The-Powder-Toy-95.0.mod/SConscript 2020-03-08 20:42:15.679348686 +0200 +@@ -134,7 +134,7 @@ for var in ["CC","CXX","LD","LIBPATH","STRIP"]: if var in os.environ: env[var] = os.environ[var] @@ -10,7 +10,7 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript # variables containing several space separated things for var in ["CFLAGS","CCFLAGS","CXXFLAGS","LINKFLAGS","CPPDEFINES","CPPPATH"]: if var in os.environ: -@@ -146,7 +146,7 @@ +@@ -142,7 +142,7 @@ env[var] += SCons.Util.CLVar(os.environ[var]) else: env[var] = SCons.Util.CLVar(os.environ[var]) @@ -19,7 +19,7 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript #Used for intro text / executable name, actual bit flags are only set if the --64bit/--32bit command line args are given def add32bitflags(env): -@@ -159,12 +159,8 @@ +@@ -155,12 +155,8 @@ env["BIT"] = 64 #add 32/64 bit defines before configuration if GetOption('64bit'): @@ -32,11 +32,11 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript add32bitflags(env) if GetOption('universal'): -@@ -246,16 +242,14 @@ +@@ -242,16 +238,14 @@ runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD" - #if platform == "Darwin" and conf.CheckFramework("SDL"): - # runSdlConfig = False -- if not conf.CheckLib("SDL2"): + if platform == "Darwin" and conf.CheckFramework("SDL2"): + runSdlConfig = False +- elif not conf.CheckLib("SDL2"): - FatalError("SDL2 development library not found or not installed") if runSdlConfig: @@ -52,9 +52,20 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript except: pass -@@ -332,10 +326,6 @@ - if not conf.CheckLib(['z', 'zlib']): - FatalError("libz not found or not installed") +@@ -335,19 +329,15 @@ + + if useCurl and (platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"): + if GetOption('static'): +- env.ParseConfig("curl-config --static-libs") ++ env.ParseConfig("bash @TERMUX_PREFIX@/bin/curl-config --static-libs") + else: +- env.ParseConfig("curl-config --libs") ++ env.ParseConfig("bash @TERMUX_PREFIX@/bin/curl-config --libs") + + # Needed for ssl. Scons seems incapable of parsing this out of curl-config + if platform == "Darwin": + if not conf.CheckFramework('Security'): + FatalError("Could not find Security.Framework") - #Look for pthreads - if not conf.CheckLib(['pthread', 'pthreadVC2']): @@ -63,7 +74,7 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript if msvc: if not conf.CheckHeader('dirent.h') or not conf.CheckHeader('fftw3.h') or not conf.CheckHeader('pthread.h') or not conf.CheckHeader('zlib.h'): FatalError("Required headers not found") -@@ -366,9 +356,6 @@ +@@ -378,9 +368,6 @@ if platform == "Linux" or platform == "FreeBSD": if not conf.CheckLib('X11'): FatalError("X11 development library not found or not installed") @@ -73,7 +84,7 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript elif platform == "Windows": #These need to go last if not conf.CheckLib('gdi32') or not conf.CheckLib('winmm') or (not msvc and not conf.CheckLib('dxguid')): -@@ -428,8 +415,6 @@ +@@ -436,8 +423,6 @@ #Add architecture flags and defines @@ -82,7 +93,7 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript if not GetOption('no-sse'): if GetOption('sse'): if msvc: -@@ -474,7 +459,7 @@ +@@ -482,7 +467,7 @@ else: env.Append(CCFLAGS=['/MD']) else: @@ -91,7 +102,7 @@ diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript if platform != "Darwin": env.Append(CCFLAGS=['-funsafe-loop-optimizations']) -@@ -546,8 +531,8 @@ +@@ -559,8 +544,8 @@ if platform == "Windows": sources += env.RES('resources/powder-res.rc') if not msvc: diff --git a/x11-packages/the-powder-toy/01-SConstruct.patch b/x11-packages/the-powder-toy/01-SConstruct.patch deleted file mode 100644 index 807412cd0..000000000 --- a/x11-packages/the-powder-toy/01-SConstruct.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr The-Powder-Toy-93.3/SConstruct The-Powder-Toy-93.3.mod/SConstruct ---- The-Powder-Toy-93.3/SConstruct 2018-04-02 00:19:03.000000000 +0300 -+++ The-Powder-Toy-93.3.mod/SConstruct 2018-06-15 13:55:36.199587222 +0300 -@@ -2,7 +2,7 @@ - #run generator.py - if not GetOption('clean'): - if sys.version_info[0] < 3: -- execfile("generator.py") -+ exec(compile(open("generator.py").read(), "generator.py", 'exec')) - else: - with open("generator.py") as f: - code = compile(f.read(), "generator.py", 'exec') diff --git a/x11-packages/the-powder-toy/03-saves-dir-path.patch b/x11-packages/the-powder-toy/03-saves-dir-path.patch index 47cd2a3cb..0aebe83b1 100644 --- a/x11-packages/the-powder-toy/03-saves-dir-path.patch +++ b/x11-packages/the-powder-toy/03-saves-dir-path.patch @@ -1,7 +1,7 @@ -diff -uNr The-Powder-Toy-94.1/src/client/Client.cpp The-Powder-Toy-94.1.mod/src/client/Client.cpp ---- The-Powder-Toy-94.1/src/client/Client.cpp 2019-02-21 07:23:45.000000000 +0200 -+++ The-Powder-Toy-94.1.mod/src/client/Client.cpp 2019-05-19 20:47:52.166319755 +0300 -@@ -71,7 +71,8 @@ +diff -uNr The-Powder-Toy-95.0/src/client/Client.cpp The-Powder-Toy-95.0.mod/src/client/Client.cpp +--- The-Powder-Toy-95.0/src/client/Client.cpp 2020-02-27 05:38:53.000000000 +0200 ++++ The-Powder-Toy-95.0.mod/src/client/Client.cpp 2020-03-08 20:36:18.935572466 +0200 +@@ -67,7 +67,8 @@ { //Read config std::ifstream configFile; @@ -11,7 +11,7 @@ diff -uNr The-Powder-Toy-94.1/src/client/Client.cpp The-Powder-Toy-94.1.mod/src/ if (configFile) { try -@@ -909,7 +910,8 @@ +@@ -888,7 +889,8 @@ void Client::WritePrefs() { std::ofstream configFile; @@ -21,7 +21,7 @@ diff -uNr The-Powder-Toy-94.1/src/client/Client.cpp The-Powder-Toy-94.1.mod/src/ if (configFile) { -@@ -1102,6 +1104,7 @@ +@@ -1066,6 +1068,7 @@ ByteString saveID = ByteString::Build(Format::Hex(Format::Width(lastStampTime, 8)), Format::Hex(Format::Width(lastStampName, 2))); ByteString filename = STAMPS_DIR PATH_SEP + saveID + ".stm"; @@ -29,7 +29,7 @@ diff -uNr The-Powder-Toy-94.1/src/client/Client.cpp The-Powder-Toy-94.1.mod/src/ MakeDirectory(STAMPS_DIR); Json::Value stampInfo; -@@ -1137,6 +1140,7 @@ +@@ -1101,6 +1104,7 @@ void Client::updateStamps() { @@ -37,36 +37,9 @@ diff -uNr The-Powder-Toy-94.1/src/client/Client.cpp The-Powder-Toy-94.1.mod/src/ MakeDirectory(STAMPS_DIR); std::ofstream stampsStream; -@@ -1527,7 +1531,7 @@ - if(authUser.UserID) - { - ByteString userID = ByteString::Build(authUser.UserID); -- -+ - data = http_auth_get(url.c_str(), userID.c_str(), NULL, authUser.SessionID.c_str(), &dataStatus, &dataLength); - } - else -@@ -1549,7 +1553,7 @@ - if (authUser.UserID) - { - ByteString userID = ByteString::Build(authUser.UserID); -- -+ - const char *const postNames[] = { "ActionPublish", NULL }; - const char *const postDatas[] = { "" }; - size_t postLengths[] = { 1 }; -@@ -1578,7 +1582,7 @@ - if(authUser.UserID) - { - ByteString userID = ByteString::Build(authUser.UserID); -- -+ - data = http_auth_get(urlStream.Build().c_str(), userID.c_str(), NULL, authUser.SessionID.c_str(), &dataStatus, &dataLength); - } - else -diff -uNr The-Powder-Toy-94.1/src/Config.h The-Powder-Toy-94.1.mod/src/Config.h ---- The-Powder-Toy-94.1/src/Config.h 2019-02-21 07:23:45.000000000 +0200 -+++ The-Powder-Toy-94.1.mod/src/Config.h 2019-05-19 20:40:10.040532978 +0300 +diff -uNr The-Powder-Toy-95.0/src/Config.h The-Powder-Toy-95.0.mod/src/Config.h +--- The-Powder-Toy-95.0/src/Config.h 2020-02-27 05:38:53.000000000 +0200 ++++ The-Powder-Toy-95.0.mod/src/Config.h 2020-03-08 20:36:18.935572466 +0200 @@ -61,11 +61,7 @@ #define IDENT_PLATFORM "WIN32" #endif @@ -80,9 +53,9 @@ diff -uNr The-Powder-Toy-94.1/src/Config.h The-Powder-Toy-94.1.mod/src/Config.h #elif defined(MACOSX) #define IDENT_PLATFORM "MACOSX" #else -@@ -88,11 +84,11 @@ - #define SERVER "powdertoy.co.uk" +@@ -91,11 +87,11 @@ #define STATICSERVER "static.powdertoy.co.uk" + #define ENFORCE_HTTPS -#define LOCAL_SAVE_DIR "Saves" +#define LOCAL_SAVE_DIR "@TERMUX_HOME@/.powdertoy/saves" @@ -93,12 +66,12 @@ diff -uNr The-Powder-Toy-94.1/src/Config.h The-Powder-Toy-94.1.mod/src/Config.h -#define BRUSH_DIR "Brushes" +#define BRUSH_DIR "@TERMUX_HOME@/.powdertoy/brushes" - //Number of unique thumbnails to have in cache at one time - #define THUMB_CACHE_SIZE 256 -diff -uNr The-Powder-Toy-94.1/src/gui/game/GameController.cpp The-Powder-Toy-94.1.mod/src/gui/game/GameController.cpp ---- The-Powder-Toy-94.1/src/gui/game/GameController.cpp 2019-02-21 07:23:45.000000000 +0200 -+++ The-Powder-Toy-94.1.mod/src/gui/game/GameController.cpp 2019-05-19 20:40:39.801711358 +0300 -@@ -850,7 +850,7 @@ + #ifndef M_GRAV + #define M_GRAV 6.67300e-1 +diff -uNr The-Powder-Toy-95.0/src/gui/game/GameController.cpp The-Powder-Toy-95.0.mod/src/gui/game/GameController.cpp +--- The-Powder-Toy-95.0/src/gui/game/GameController.cpp 2020-02-27 05:38:53.000000000 +0200 ++++ The-Powder-Toy-95.0.mod/src/gui/game/GameController.cpp 2020-03-08 20:37:59.986378271 +0200 +@@ -774,7 +774,7 @@ #if !defined(MACOSX) && !defined(NO_INSTALL_CHECK) if (Client::Ref().IsFirstRun()) { @@ -107,18 +80,18 @@ diff -uNr The-Powder-Toy-94.1/src/gui/game/GameController.cpp The-Powder-Toy-94. } #endif firstTick = false; -@@ -1265,6 +1265,7 @@ +@@ -1210,6 +1210,7 @@ gameSave->authors = localSaveInfo; - gameModel->SetSaveFile(&tempSave); + gameModel->SetSaveFile(&tempSave, gameView->ShiftBehaviour()); + Client::Ref().MakeDirectory("@TERMUX_HOME@/.powdertoy"); Client::Ref().MakeDirectory(LOCAL_SAVE_DIR); std::vector saveData = gameSave->Serialise(); if (saveData.size() == 0) -diff -uNr The-Powder-Toy-94.1/src/gui/game/GameModel.cpp The-Powder-Toy-94.1.mod/src/gui/game/GameModel.cpp ---- The-Powder-Toy-94.1/src/gui/game/GameModel.cpp 2019-02-21 07:23:45.000000000 +0200 -+++ The-Powder-Toy-94.1.mod/src/gui/game/GameModel.cpp 2019-05-19 20:49:54.675892548 +0300 -@@ -105,6 +105,7 @@ +diff -uNr The-Powder-Toy-95.0/src/gui/game/GameModel.cpp The-Powder-Toy-95.0.mod/src/gui/game/GameModel.cpp +--- The-Powder-Toy-95.0/src/gui/game/GameModel.cpp 2020-02-27 05:38:53.000000000 +0200 ++++ The-Powder-Toy-95.0.mod/src/gui/game/GameModel.cpp 2020-03-08 20:36:18.936572474 +0200 +@@ -423,6 +423,7 @@ brushList.push_back(new TriangleBrush(ui::Point(4, 4))); //Load more from brushes folder @@ -126,22 +99,22 @@ diff -uNr The-Powder-Toy-94.1/src/gui/game/GameModel.cpp The-Powder-Toy-94.1.mod std::vector brushFiles = Client::Ref().DirectorySearch(BRUSH_DIR, "", ".ptb"); for (size_t i = 0; i < brushFiles.size(); i++) { -diff -uNr The-Powder-Toy-94.1/src/gui/options/OptionsView.cpp The-Powder-Toy-94.1.mod/src/gui/options/OptionsView.cpp ---- The-Powder-Toy-94.1/src/gui/options/OptionsView.cpp 2019-02-21 07:23:45.000000000 +0200 -+++ The-Powder-Toy-94.1.mod/src/gui/options/OptionsView.cpp 2019-05-19 20:41:09.689890689 +0300 -@@ -292,7 +292,7 @@ - const char* openCommand = "xdg-open "; +diff -uNr The-Powder-Toy-95.0/src/gui/options/OptionsView.cpp The-Powder-Toy-95.0.mod/src/gui/options/OptionsView.cpp +--- The-Powder-Toy-95.0/src/gui/options/OptionsView.cpp 2020-02-27 05:38:53.000000000 +0200 ++++ The-Powder-Toy-95.0.mod/src/gui/options/OptionsView.cpp 2020-03-08 20:38:45.213738818 +0200 +@@ -300,7 +300,7 @@ + const char* openCommand = "xdg-open "; #endif - char* workingDirectory = new char[FILENAME_MAX+strlen(openCommand)]; -- sprintf(workingDirectory, "%s\"%s\"", openCommand, getcwd(NULL, 0)); -+ sprintf(workingDirectory, "%s\"%s\"", openCommand, "@TERMUX_HOME@/.powdertoy"); - system(workingDirectory); - delete[] workingDirectory; - } -diff -uNr The-Powder-Toy-94.1/src/gui/save/LocalSaveActivity.cpp The-Powder-Toy-94.1.mod/src/gui/save/LocalSaveActivity.cpp ---- The-Powder-Toy-94.1/src/gui/save/LocalSaveActivity.cpp 2019-02-21 07:23:45.000000000 +0200 -+++ The-Powder-Toy-94.1.mod/src/gui/save/LocalSaveActivity.cpp 2019-05-19 20:41:28.202001848 +0300 -@@ -116,6 +116,7 @@ + char* workingDirectory = new char[FILENAME_MAX+strlen(openCommand)]; +- sprintf(workingDirectory, "%s\"%s\"", openCommand, getcwd(NULL, 0)); ++ sprintf(workingDirectory, "%s\"%s\"", openCommand, "@TERMUX_HOME@/.powdertoy"); + system(workingDirectory); + delete[] workingDirectory; + } }); +diff -uNr The-Powder-Toy-95.0/src/gui/save/LocalSaveActivity.cpp The-Powder-Toy-95.0.mod/src/gui/save/LocalSaveActivity.cpp +--- The-Powder-Toy-95.0/src/gui/save/LocalSaveActivity.cpp 2020-02-27 05:38:53.000000000 +0200 ++++ The-Powder-Toy-95.0.mod/src/gui/save/LocalSaveActivity.cpp 2020-03-08 20:36:18.937572482 +0200 +@@ -104,6 +104,7 @@ void LocalSaveActivity::saveWrite(ByteString finalFilename) { diff --git a/x11-packages/the-powder-toy/build.sh b/x11-packages/the-powder-toy/build.sh index 96655849c..dc7256da6 100644 --- a/x11-packages/the-powder-toy/build.sh +++ b/x11-packages/the-powder-toy/build.sh @@ -5,7 +5,7 @@ TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=95.0 TERMUX_PKG_SRCURL=https://github.com/ThePowderToy/The-Powder-Toy/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=f60c3dc93e4ceddeda92b768e75a2d218f8df3da4a569b7d7cb57fff5515e15b -TERMUX_PKG_DEPENDS="fftw, libbz2, libc++, liblua52, sdl2, libx11, zlib" +TERMUX_PKG_DEPENDS="fftw, libbz2, libc++, libcurl, liblua52, sdl2, libx11, zlib" TERMUX_PKG_FOLDERNAME=The-Powder-Toy-${TERMUX_PKG_VERSION} TERMUX_PKG_BUILD_IN_SRC=true