[Scummvm-git-logs] scummvm master -> 1efc058667938c3b414974a25c5a8a11381645d6
criezy
noreply at scummvm.org
Mon Sep 15 19:28:29 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
1efc058667 MACOS: Bundle license files in subdirectory and only keep renamed files
Commit: 1efc058667938c3b414974a25c5a8a11381645d6
https://github.com/scummvm/scummvm/commit/1efc058667938c3b414974a25c5a8a11381645d6
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2025-09-15T20:28:18+01:00
Commit Message:
MACOS: Bundle license files in subdirectory and only keep renamed files
We had two versions of each license files in the app bundle, one with
the original name (e.g. COPYING.MPL) and one renamed as the extension
could confuse the system when trying to open it (e.g. COPYING-MPL).
Now only the later is kept. Also they have been moved to a subdirectory
under the bundle Resources folder.
This should fix an issue with the mtropolis engine detecting COPYING.MPL
as a game data file.
Changed paths:
backends/platform/sdl/macosx/appmenu_osx.mm
ports.mk
diff --git a/backends/platform/sdl/macosx/appmenu_osx.mm b/backends/platform/sdl/macosx/appmenu_osx.mm
index fa046b2029b..9e4d02c46c9 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -74,29 +74,29 @@ enum {
// In SnowLeopard, this workaround is unnecessary and should not be used. Under SnowLeopard, the first menu
// is always identified as the application menu.
-static void openFromBundle(NSString *file) {
- NSString *path = [[NSBundle mainBundle] pathForResource:file ofType:@"rtf"];
- if (!path) {
- path = [[NSBundle mainBundle] pathForResource:file ofType:@"html"];
- if (!path) {
- path = [[NSBundle mainBundle] pathForResource:file ofType:@""];
- if (!path)
- path = [[NSBundle mainBundle] pathForResource:file ofType:@"md"];
- }
+static void openFromBundle(NSString *file, NSString *subdir = nil) {
+ NSString *path = nil;
+ for (NSString *type in @[@"rtf", @"html", @"txt", @"", @"md"]) {
+ if (subdir)
+ path = [[NSBundle mainBundle] pathForResource:file ofType:type inDirectory:subdir];
+ else
+ path = [[NSBundle mainBundle] pathForResource:file ofType:type];
+ if (path)
+ break;
}
- // RTF and HTML files are widely recognized and we can rely on the default
+ // RTF, TXT, and HTML files are widely recognized and we can rely on the default
// file association working for those. For the other ones this might not be
// the case so we explicitly indicate they should be open with TextEdit.
if (path) {
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
- if ([path hasSuffix:@".html"] || [path hasSuffix:@".rtf"])
+ if ([path hasSuffix:@".html"] || [path hasSuffix:@".rtf"] || [path hasSuffix:@".txt"])
[[NSWorkspace sharedWorkspace] openFile:path];
else
[[NSWorkspace sharedWorkspace] openFile:path withApplication:@"TextEdit"];
#else
NSURL *pathUrl = [NSURL fileURLWithPath:path isDirectory:NO];
- if ([path hasSuffix:@".html"] || [path hasSuffix:@".rtf"]) {
+ if ([path hasSuffix:@".html"] || [path hasSuffix:@".rtf"] || [path hasSuffix:@".txt"]) {
[[NSWorkspace sharedWorkspace] openURL:pathUrl];
} else {
[[NSWorkspace sharedWorkspace] openURLs:[NSArray arrayWithObjects:pathUrl, nil]
@@ -137,59 +137,59 @@ static void openFromBundle(NSString *file) {
}
- (void)openLicenseGPL {
- openFromBundle(@"COPYING");
+ openFromBundle(@"COPYING", @"licenses");
}
- (void)openLicenseApache {
- openFromBundle(@"COPYING-Apache");
+ openFromBundle(@"COPYING-Apache", @"licenses");
}
- (void)openLicenseBSD {
- openFromBundle(@"COPYING-BSD");
+ openFromBundle(@"COPYING-BSD", @"licenses");
}
- (void)openLicenseBSL {
- openFromBundle(@"COPYING-BSL");
+ openFromBundle(@"COPYING-BSL", @"licenses");
}
- (void)openLicenseGLAD {
- openFromBundle(@"COPYING-GLAD");
+ openFromBundle(@"COPYING-GLAD", @"licenses");
}
- (void)openLicenseISC {
- openFromBundle(@"COPYING-ISC");
+ openFromBundle(@"COPYING-ISC", @"licenses");
}
- (void)openLicenseLGPL {
- openFromBundle(@"COPYING-LGPL");
+ openFromBundle(@"COPYING-LGPL", @"licenses");
}
- (void)openLicenseLUA {
- openFromBundle(@"COPYING-LUA");
+ openFromBundle(@"COPYING-LUA", @"licenses");
}
- (void)openLicenseMIT {
- openFromBundle(@"COPYING-MIT");
+ openFromBundle(@"COPYING-MIT", @"licenses");
}
- (void)openLicenseMKV {
- openFromBundle(@"COPYING-MKV");
+ openFromBundle(@"COPYING-MKV", @"licenses");
}
- (void)openLicenseMPL {
- openFromBundle(@"COPYING-MPL");
+ openFromBundle(@"COPYING-MPL", @"licenses");
}
- (void)openLicenseOFL {
- openFromBundle(@"COPYING-OFL");
+ openFromBundle(@"COPYING-OFL", @"licenses");
}
- (void)openLicenseTinyGL {
- openFromBundle(@"COPYING-TINYGL");
+ openFromBundle(@"COPYING-TINYGL", @"licenses");
}
- (void)openLicenseCatharon {
- openFromBundle(@"CatharonLicense-txt");
+ openFromBundle(@"CatharonLicense", @"licenses");
}
- (void)openNews {
diff --git a/ports.mk b/ports.mk
index 86d5267915c..f72b2134569 100644
--- a/ports.mk
+++ b/ports.mk
@@ -182,24 +182,27 @@ ifdef USE_PANDOC
@sed -i'.sed-orig' -e "s|href=\"AUTHORS\"|href=\"https://www.scummvm.org/credits/\"|g" $(bundle_name)/Contents/Resources/README$(PANDOCEXT)
endif
@rm $(bundle_name)/Contents/Resources/*.sed-orig
- cp $(bundle_name)/Contents/Resources/COPYING.Apache $(bundle_name)/Contents/Resources/COPYING-Apache
- cp $(bundle_name)/Contents/Resources/COPYING.BSD $(bundle_name)/Contents/Resources/COPYING-BSD
- cp $(bundle_name)/Contents/Resources/COPYING.BSL $(bundle_name)/Contents/Resources/COPYING-BSL
- cp $(bundle_name)/Contents/Resources/COPYING.GLAD $(bundle_name)/Contents/Resources/COPYING-GLAD
- cp $(bundle_name)/Contents/Resources/COPYING.ISC $(bundle_name)/Contents/Resources/COPYING-ISC
- cp $(bundle_name)/Contents/Resources/COPYING.LGPL $(bundle_name)/Contents/Resources/COPYING-LGPL
- cp $(bundle_name)/Contents/Resources/COPYING.LUA $(bundle_name)/Contents/Resources/COPYING-LUA
- cp $(bundle_name)/Contents/Resources/COPYING.MIT $(bundle_name)/Contents/Resources/COPYING-MIT
- cp $(bundle_name)/Contents/Resources/COPYING.MKV $(bundle_name)/Contents/Resources/COPYING-MKV
- cp $(bundle_name)/Contents/Resources/COPYING.MPL $(bundle_name)/Contents/Resources/COPYING-MPL
- cp $(bundle_name)/Contents/Resources/COPYING.OFL $(bundle_name)/Contents/Resources/COPYING-OFL
- cp $(bundle_name)/Contents/Resources/COPYING.TINYGL $(bundle_name)/Contents/Resources/COPYING-TINYGL
- cp $(bundle_name)/Contents/Resources/CatharonLicense.txt $(bundle_name)/Contents/Resources/CatharonLicense-txt
+ mkdir -p $(bundle_name)/Contents/Resources/licenses
+ mv $(bundle_name)/Contents/Resources/COPYING $(bundle_name)/Contents/Resources/licenses/COPYING
+ mv $(bundle_name)/Contents/Resources/COPYING.Apache $(bundle_name)/Contents/Resources/licenses/COPYING-Apache
+ mv $(bundle_name)/Contents/Resources/COPYING.BSD $(bundle_name)/Contents/Resources/licenses/COPYING-BSD
+ mv $(bundle_name)/Contents/Resources/COPYING.BSL $(bundle_name)/Contents/Resources/licenses/COPYING-BSL
+ mv $(bundle_name)/Contents/Resources/COPYING.GLAD $(bundle_name)/Contents/Resources/licenses/COPYING-GLAD
+ mv $(bundle_name)/Contents/Resources/COPYING.ISC $(bundle_name)/Contents/Resources/licenses/COPYING-ISC
+ mv $(bundle_name)/Contents/Resources/COPYING.LGPL $(bundle_name)/Contents/Resources/licenses/COPYING-LGPL
+ mv $(bundle_name)/Contents/Resources/COPYING.LUA $(bundle_name)/Contents/Resources/licenses/COPYING-LUA
+ mv $(bundle_name)/Contents/Resources/COPYING.MIT $(bundle_name)/Contents/Resources/licenses/COPYING-MIT
+ mv $(bundle_name)/Contents/Resources/COPYING.MKV $(bundle_name)/Contents/Resources/licenses/COPYING-MKV
+ mv $(bundle_name)/Contents/Resources/COPYING.MPL $(bundle_name)/Contents/Resources/licenses/COPYING-MPL
+ mv $(bundle_name)/Contents/Resources/COPYING.OFL $(bundle_name)/Contents/Resources/licenses/COPYING-OFL
+ mv $(bundle_name)/Contents/Resources/COPYING.TINYGL $(bundle_name)/Contents/Resources/licenses/COPYING-TINYGL
+ mv $(bundle_name)/Contents/Resources/CatharonLicense.txt $(bundle_name)/Contents/Resources/licenses/CatharonLicense.txt
ifdef DYNAMIC_MODULES
cp $(PLUGINS) $(bundle_name)/Contents/Resources/
endif
chmod 644 $(bundle_name)/Contents/Resources/*
+ chmod 755 $(bundle_name)/Contents/Resources/licenses
ifneq ($(DIST_FILES_SHADERS),)
chmod 755 $(bundle_name)/Contents/Resources/shaders
endif
More information about the Scummvm-git-logs
mailing list