From b9e352a13cf891d021c0abd687de5b0d4d88288a Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:14:24 -0500 Subject: [PATCH 01/15] Attempt at fixing MacOS executable not starting --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e624327b..1aa11077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: pip install pyinstaller cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup mv ./target/release/libtt_damage_calculator.dylib ./src/tt_damage_calculator/tt_damage_calculator.so - pyinstaller "Toontown Damage Calculator.spec" + pyinstaller "Toontown Damage Calculator.spec" --windowed cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable From f60cba7f1c5f6d128fa57d078489a2261d3a37e4 Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:17:44 -0500 Subject: [PATCH 02/15] CI Changes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1aa11077..7e2de190 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: pip install pyinstaller cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup mv ./target/release/libtt_damage_calculator.dylib ./src/tt_damage_calculator/tt_damage_calculator.so - pyinstaller "Toontown Damage Calculator.spec" --windowed + pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable From 7b0286d1354dcd82af9d96e0660b35be080f0ae0 Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:20:51 -0500 Subject: [PATCH 03/15] CI Changes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e2de190..2580bfe3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: pip install pyinstaller cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup mv ./target/release/libtt_damage_calculator.dylib ./src/tt_damage_calculator/tt_damage_calculator.so - pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed + pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed --onefile'src/tt_damage_calculator/assets/img/whole-cream-pie.ico' cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable From 67ced3406d9ba2c09597eda51bebeac65b6bb96f Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:23:19 -0500 Subject: [PATCH 04/15] CI Changes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2580bfe3..fb586119 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: pip install pyinstaller cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup mv ./target/release/libtt_damage_calculator.dylib ./src/tt_damage_calculator/tt_damage_calculator.so - pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed --onefile'src/tt_damage_calculator/assets/img/whole-cream-pie.ico' + pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed --onefile --icon='src/tt_damage_calculator/assets/img/whole-cream-pie.ico' cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable From 12cb014969590c069fe0812b8e90e4cdbaa6a4d8 Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:26:32 -0500 Subject: [PATCH 05/15] CI Changes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb586119..9620e790 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: pip install pyinstaller cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup mv ./target/release/libtt_damage_calculator.dylib ./src/tt_damage_calculator/tt_damage_calculator.so - pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed --onefile --icon='src/tt_damage_calculator/assets/img/whole-cream-pie.ico' + pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed --onefile cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable From fe0fba9a1c81ca60e93923cb2730bbb953b497be Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:48:19 -0500 Subject: [PATCH 06/15] CI Changes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9620e790..47a719b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,7 @@ jobs: macos-exe: - runs-on: macos-latest + runs-on: macos-12 strategy: fail-fast: false matrix: From b2efde382e4a1c317ec892d89d08277da98e9fa5 Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:55:11 -0500 Subject: [PATCH 07/15] CI Changes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47a719b3..d004ef60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable - uses: actions/upload-artifact@v4 + uses: alehechka/upload-tartifact@v2 with: name: executable-macos-x86_64 path: dist From f59c47d519ba2ed57483989c2e25d8d24273f06c Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 19:57:58 -0500 Subject: [PATCH 08/15] Revert previous commit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d004ef60..47a719b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable - uses: alehechka/upload-tartifact@v2 + uses: actions/upload-artifact@v4 with: name: executable-macos-x86_64 path: dist From d4741a879fd63bc380c97e49714e70a8dbaa35af Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 20:28:52 -0500 Subject: [PATCH 09/15] Changing asset path stuff --- .github/workflows/ci.yml | 2 +- src/tt_damage_calculator/widgets.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47a719b3..18d42771 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: pip install pyinstaller cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup mv ./target/release/libtt_damage_calculator.dylib ./src/tt_damage_calculator/tt_damage_calculator.so - pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --windowed --onefile + pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --onefile cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable diff --git a/src/tt_damage_calculator/widgets.py b/src/tt_damage_calculator/widgets.py index 91d71634..3c290345 100644 --- a/src/tt_damage_calculator/widgets.py +++ b/src/tt_damage_calculator/widgets.py @@ -369,8 +369,8 @@ def get_asset_path(self): """Gets the asset path for the program.""" self.asset_path = str(pathlib.Path(__file__).parent.resolve()) - if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): - self.asset_path = os.getcwd() + if getattr(sys, 'frozen', False): + self.asset_path = "./" def reset_tracks(self): """Empties the track lists and sets nogroup to 0 for the next calculation.""" From c0447923204a19ab6e19aa77fd5c32ba1c0a9634 Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 20:44:10 -0500 Subject: [PATCH 10/15] Changing asset path stuff --- src/tt_damage_calculator/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tt_damage_calculator/widgets.py b/src/tt_damage_calculator/widgets.py index 3c290345..9c0d0f3c 100644 --- a/src/tt_damage_calculator/widgets.py +++ b/src/tt_damage_calculator/widgets.py @@ -370,7 +370,7 @@ def get_asset_path(self): self.asset_path = str(pathlib.Path(__file__).parent.resolve()) if getattr(sys, 'frozen', False): - self.asset_path = "./" + self.asset_path = Patch("./").parent.resolve() def reset_tracks(self): """Empties the track lists and sets nogroup to 0 for the next calculation.""" From 64dab748bf7b812033662414beaf8a47670672a1 Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Sun, 2 Jun 2024 20:51:45 -0500 Subject: [PATCH 11/15] More path stuff --- src/tt_damage_calculator/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tt_damage_calculator/widgets.py b/src/tt_damage_calculator/widgets.py index 9c0d0f3c..71d07412 100644 --- a/src/tt_damage_calculator/widgets.py +++ b/src/tt_damage_calculator/widgets.py @@ -370,7 +370,7 @@ def get_asset_path(self): self.asset_path = str(pathlib.Path(__file__).parent.resolve()) if getattr(sys, 'frozen', False): - self.asset_path = Patch("./").parent.resolve() + self.asset_path = str(pathlib.Path("./").parent.resolve()) def reset_tracks(self): """Empties the track lists and sets nogroup to 0 for the next calculation.""" From 1f01685e6de9be18c57837d106acb276feff219f Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Wed, 7 Aug 2024 11:00:20 -0500 Subject: [PATCH 12/15] Update ci.yml another commit in my quest to get the macos executable working --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18d42771..81820d03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,7 +145,7 @@ jobs: pip install pyinstaller cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup mv ./target/release/libtt_damage_calculator.dylib ./src/tt_damage_calculator/tt_damage_calculator.so - pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --onefile + pyinstaller "src/tt_damage_calculator/Toontown Damage Calculator.py" --onefile --windowed cp -R ./src/tt_damage_calculator/assets ./dist/assets cp -R ./LICENSE ./dist - name: Upload executable @@ -159,7 +159,7 @@ jobs: strategy: matrix: platform: - - runner: macos-latest + - runner: macos-12 target: x86_64 - runner: macos-14 target: aarch64 From d8474239c739beb451a306f3a49cc8586ed37d1a Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Wed, 7 Aug 2024 11:23:13 -0500 Subject: [PATCH 13/15] Updating path for Darwin taken from a stackoverflow question, hopefully this works --- src/tt_damage_calculator/widgets.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tt_damage_calculator/widgets.py b/src/tt_damage_calculator/widgets.py index 71d07412..0a425a65 100644 --- a/src/tt_damage_calculator/widgets.py +++ b/src/tt_damage_calculator/widgets.py @@ -369,6 +369,9 @@ def get_asset_path(self): """Gets the asset path for the program.""" self.asset_path = str(pathlib.Path(__file__).parent.resolve()) + if platform.system() == "Darwin": + self.asset_path = pathlib.Path(os.path.dirname(os.path.abspath(__file__))) + if getattr(sys, 'frozen', False): self.asset_path = str(pathlib.Path("./").parent.resolve()) From a1069764f43ad62d8467c15ef0a754633db49110 Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Wed, 7 Aug 2024 11:26:06 -0500 Subject: [PATCH 14/15] Version bump bumping version in hopes this fixes the macos issues --- change.log | 4 ++++ src/tt_damage_calculator/assets/version.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/change.log b/change.log index 146b4778..0e2e870e 100644 --- a/change.log +++ b/change.log @@ -91,3 +91,7 @@ - Executable files for Linux are now also supplied in releases. These should work for any Linux distribution that uses glibc, but Ubuntu is the distribution that is specifcally targeted. - Keybinds now have a hardcoded default, if an error happens when setting a keybind it will fall back on this default. - Removed the menu bar's update checker, this change is tentative and there may be a new iteration of the update checker in the future. + +--V4.3.1-- +- Changes to how the MacOS executable finds resources. This hopefully allows it to actually run. +- Compatibility has been moved from macos-latest to macos-12. diff --git a/src/tt_damage_calculator/assets/version.txt b/src/tt_damage_calculator/assets/version.txt index 81911389..f77856a6 100644 --- a/src/tt_damage_calculator/assets/version.txt +++ b/src/tt_damage_calculator/assets/version.txt @@ -1 +1 @@ -4.3.0 \ No newline at end of file +4.3.1 From 8ac342140b6847a5785e0bf95cd5750567d2b70a Mon Sep 17 00:00:00 2001 From: Vhou-Atroph Date: Wed, 7 Aug 2024 11:46:32 -0500 Subject: [PATCH 15/15] oops skull emoji sorry python fans i have failed you again --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 17fcec72..fc268f37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ strip = true [project] name = "tt_damage_calculator" -version = "4.3.0" +version = "4.3.1" authors = [ { name="Vhou-Atroph", email="vhouatroph@proton.me" }, ]