upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/make_game.py
diff options
context:
space:
mode:
Diffstat (limited to 'make_game.py')
-rw-r--r--make_game.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/make_game.py b/make_game.py
index 397fad2cf..cff1068e1 100644
--- a/make_game.py
+++ b/make_game.py
@@ -334,7 +334,19 @@ def choose_game() -> str:
334 print(" That folder isn't a supported version of the game. Try again.") 334 print(" That folder isn't a supported version of the game. Try again.")
335 335
336 336
337def icloud_documents() -> bool:
338 """macOS: whether iCloud Drive holds Desktop & Documents. With that sync on, ~/Documents lives in iCloud Drive,
339 which uploads what goes in it and may evict files from the disk ("Optimize Mac Storage"). The folder can stay in
340 iCloud Drive after the sync is turned off; leaving Documents alone then costs nothing."""
341 return sys.platform == "darwin" and os.path.isdir(
342 os.path.join(os.path.expanduser("~"), "Library", "Mobile Documents", "com~apple~CloudDocs", "Documents"))
343
344
337def default_out() -> str: 345def default_out() -> str:
346 """Documents/Leonida, except on a Mac whose Documents iCloud syncs: the port and its work folder (hundreds of
347 GB made from the game) must stay on this computer, so they go to ~/Leonida there."""
348 if icloud_documents():
349 return os.path.join(os.path.expanduser("~"), "Leonida")
338 return os.path.join(os.path.expanduser("~"), "Documents", "Leonida") 350 return os.path.join(os.path.expanduser("~"), "Documents", "Leonida")
339 351
340 352
@@ -1235,7 +1247,8 @@ def main() -> int:
1235 ap = argparse.ArgumentParser(description="Build the PC port from your own copy of the game.") 1247 ap = argparse.ArgumentParser(description="Build the PC port from your own copy of the game.")
1236 ap.add_argument("--game", help="your package folder (found automatically if left out)") 1248 ap.add_argument("--game", help="your package folder (found automatically if left out)")
1237 ap.add_argument("--pick", action="store_true", help="choose your package folder in a folder dialog") 1249 ap.add_argument("--pick", action="store_true", help="choose your package folder in a folder dialog")
1238 ap.add_argument("--out", help="folder for the finished port (default Documents/Leonida)") 1250 ap.add_argument("--out", help="folder for the finished port (default Documents/Leonida; ~/Leonida on a Mac "
1251 "whose Documents iCloud syncs)")
1239 ap.add_argument("--work", help="folder for intermediate files (hundreds of GB; default <out>/work)") 1252 ap.add_argument("--work", help="folder for intermediate files (hundreds of GB; default <out>/work)")
1240 ap.add_argument("--stages", help="comma list from: " + ",".join(STAGES)) 1253 ap.add_argument("--stages", help="comma list from: " + ",".join(STAGES))
1241 ap.add_argument("--check", action="store_true", help="only check the game files") 1254 ap.add_argument("--check", action="store_true", help="only check the game files")
@@ -1336,6 +1349,8 @@ def main() -> int:
1336 fallbacks = fallback_flags(a) if "shaders" in stages else () 1349 fallbacks = fallback_flags(a) if "shaders" in stages else ()
1337 preflight(stages, work, a.wav, runtime_build, emulate=emulate, keep_emulated=keep_emulated, 1350 preflight(stages, work, a.wav, runtime_build, emulate=emulate, keep_emulated=keep_emulated,
1338 fallbacks=fallbacks, jobs=a.jobs) 1351 fallbacks=fallbacks, jobs=a.jobs)
1352 if not a.out and icloud_documents():
1353 log("iCloud syncs Documents on this Mac: building into ~/Leonida instead, so the game's files stay off iCloud")
1339 log(f"building into {out} (work files in {work})") 1354 log(f"building into {out} (work files in {work})")
1340 t0 = time.time() 1355 t0 = time.time()
1341 if "shaders" in stages: 1356 if "shaders" in stages: