From 4226f5e870320d38a7ab4823394f2d15990eacc0 Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Mon, 5 May 2025 21:55:45 +0100 Subject: [PATCH 1/6] Update Package.py Remove mingw mentions --- Scripts/Package.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Scripts/Package.py b/Scripts/Package.py index a52cbf092..a87a72fda 100644 --- a/Scripts/Package.py +++ b/Scripts/Package.py @@ -34,8 +34,6 @@ def mkdir_p(path): parser.add_argument('--os', choices=['windows','linux','mac'], required=True, help='Operating System (windows or linux or mac)') parser.add_argument('--build', default='full', help='Define what contents to package (full, core, engine, layout, none') parser.add_argument('--clean', action='store_true', help='Clean the output directory') -parser.add_argument('--compiler', help='Compiler to use (vs, mingw, gcc') - args = parser.parse_args() ##################################################################### @@ -108,12 +106,8 @@ def mkdir_p(path): ##################################################################### if args.os == 'windows': if args.build == 'full' or args.build == 'core' or args.build == 'engine': - # copy retrofe.exe to core folder - if(hasattr(args, 'compiler') and args.compiler == 'mingw'): - src_exe = os.path.join(base_path, 'RetroFE', 'Build', 'retrofe.exe') - else: - src_exe = os.path.join(base_path, 'RetroFE', 'Build', 'Release', 'retrofe.exe') - + # copy retrofe.exe to folder + src_exe = os.path.join(base_path, 'RetroFE', 'Build', 'Release', 'retrofe.exe') core_path = os.path.join(output_path, 'retrofe') # create the core folder From 6aa06457482299472832db25bac885fc45e97cfa Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Mon, 5 May 2025 21:55:57 +0100 Subject: [PATCH 2/6] Update Package.py Remove core folder reference --- Scripts/Package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Package.py b/Scripts/Package.py index a87a72fda..577055eb3 100644 --- a/Scripts/Package.py +++ b/Scripts/Package.py @@ -110,7 +110,7 @@ def mkdir_p(path): src_exe = os.path.join(base_path, 'RetroFE', 'Build', 'Release', 'retrofe.exe') core_path = os.path.join(output_path, 'retrofe') - # create the core folder + # create the retrofe folder if not os.path.exists(core_path): os.makedirs(core_path) From 5070adeb5bdddf7652bc34ad7424c97e3e4fee76 Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Mon, 5 May 2025 22:14:34 +0100 Subject: [PATCH 3/6] Update Package.py Amend macOS path in test environment packager --- Scripts/Package.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Scripts/Package.py b/Scripts/Package.py index 577055eb3..fa93e7375 100644 --- a/Scripts/Package.py +++ b/Scripts/Package.py @@ -124,13 +124,17 @@ def mkdir_p(path): shutil.copy(src_exe, output_path) elif args.os == 'mac': - if args.build == 'full' or args.build == 'core' or args.build == 'engine': - src_exe = os.path.join(base_path, 'RetroFE', 'Build', 'retrofe') - shutil.copy(src_exe, output_path) - app_path = os.path.join(output_path, 'RetroFE.app') - if not os.path.exists(app_path): - copytree(os_path, output_path) - shutil.copy(src_exe, output_path + '/RetroFE.app/Contents/MacOS/') - - - + if args.build == 'full' or args.build == 'core' or args.build == 'engine': + release_dir = os.path.join(base_path, 'RetroFE', 'Build', 'Release') + src_app = os.path.join(release_dir, 'RetroFE.app') + src_exe = os.path.join(release_dir, 'retrofe') + dest_app = os.path.join(output_path, 'RetroFE.app') + + if os.path.exists(src_app): + if os.path.exists(dest_app): + shutil.rmtree(dest_app) # Clean the Artifacts folder + shutil.copytree(src_app, dest_app, symlinks=True, ignore_dangling_symlinks=True) # Copy RetroFE.app + elif os.path.exists(src_exe): + shutil.copy(src_exe, output_path) # Copy RetroFE executable, typically built statically by CMake + else: + print("Error: Neither RetroFE.app nor retrofe binary found in Release folder.") From 13fbb10e103a8941aed12e846a519b903ac0b06b Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Mon, 5 May 2025 22:14:50 +0100 Subject: [PATCH 4/6] Update Package.py Formatting --- Scripts/Package.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Scripts/Package.py b/Scripts/Package.py index fa93e7375..143c9e1a4 100644 --- a/Scripts/Package.py +++ b/Scripts/Package.py @@ -74,18 +74,18 @@ def mkdir_p(path): dirs = [d for d in os.listdir(collection_path) if os.path.isdir(os.path.join(collection_path, d))] for collection in dirs: if not collection.startswith('_'): - mkdir_p(os.path.join(output_path, 'collections', collection, 'roms')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'artwork_front')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'artwork_back')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'medium_back')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'medium_front')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'bezel')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'logo')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'screenshot')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'screentitle')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'video')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'system_artwork')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'roms')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'artwork_front')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'artwork_back')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'medium_back')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'medium_front')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'bezel')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'logo')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'screenshot')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'screentitle')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'video')) + mkdir_p(os.path.join(output_path, 'collections', collection, 'system_artwork')) elif args.build == 'layout': layout_dest_path = os.path.join(output_path, 'layouts') @@ -117,7 +117,7 @@ def mkdir_p(path): # copy retrofe.exe shutil.copy(src_exe, core_path) # third_party_path = os.path.join(base_path, 'RetroFE', 'ThirdParty') - + elif args.os == 'linux': if args.build == 'full' or args.build == 'core' or args.build == 'engine': src_exe = os.path.join(base_path, 'RetroFE', 'Build', 'retrofe') From e68c6dd9457f66afa5a4d267cc48ad2a232b379a Mon Sep 17 00:00:00 2001 From: aidenjbass Date: Mon, 5 May 2025 22:18:31 +0100 Subject: [PATCH 5/6] Update Package.py Refactor --- Scripts/Package.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/Scripts/Package.py b/Scripts/Package.py index 143c9e1a4..a694190b0 100644 --- a/Scripts/Package.py +++ b/Scripts/Package.py @@ -74,19 +74,28 @@ def mkdir_p(path): dirs = [d for d in os.listdir(collection_path) if os.path.isdir(os.path.join(collection_path, d))] for collection in dirs: if not collection.startswith('_'): - mkdir_p(os.path.join(output_path, 'collections', collection, 'roms')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'artwork_front')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'artwork_back')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'medium_back')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'medium_front')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'bezel')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'logo')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'screenshot')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'screentitle')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'medium_artwork', 'video')) - mkdir_p(os.path.join(output_path, 'collections', collection, 'system_artwork')) - + collection_base = os.path.join(output_path, 'collections', collection) + + # List of subdirectories to create for each collection + dirs_to_create = [ + 'roms', + 'medium_artwork', + 'medium_artwork/artwork_front', + 'medium_artwork/artwork_back', + 'medium_artwork/medium_back', + 'medium_artwork/medium_front', + 'medium_artwork/bezel', + 'medium_artwork/logo', + 'medium_artwork/screenshot', + 'medium_artwork/screentitle', + 'medium_artwork/video', + 'system_artwork', + ] + + # Create the directories + for subdir in dirs_to_create: + mkdir_p(os.path.join(collection_base, subdir)) + elif args.build == 'layout': layout_dest_path = os.path.join(output_path, 'layouts') layout_common_path = os.path.join(common_path, 'layouts') From cd3727c6ab03f525890f8fbfb68637759c650ab2 Mon Sep 17 00:00:00 2001 From: aidenjbass <72824515+aidenjbass@users.noreply.github.com> Date: Tue, 6 May 2025 17:44:08 +0100 Subject: [PATCH 6/6] Update Package.py --- Scripts/Package.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Scripts/Package.py b/Scripts/Package.py index a694190b0..cda2d391f 100644 --- a/Scripts/Package.py +++ b/Scripts/Package.py @@ -80,14 +80,7 @@ def mkdir_p(path): dirs_to_create = [ 'roms', 'medium_artwork', - 'medium_artwork/artwork_front', - 'medium_artwork/artwork_back', - 'medium_artwork/medium_back', - 'medium_artwork/medium_front', - 'medium_artwork/bezel', 'medium_artwork/logo', - 'medium_artwork/screenshot', - 'medium_artwork/screentitle', 'medium_artwork/video', 'system_artwork', ]