xquartz: Move default applications list outside of the main executable
This will allow side-wide customization.
Fixes: https://github.com/XQuartz/XQuartz/issues/274
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit e654de80ed)
			
			
This commit is contained in:
		
							parent
							
								
									5d302c378d
								
							
						
					
					
						commit
						3dee0aac2c
					
				| 
						 | 
					@ -2,6 +2,7 @@ noinst_LTLIBRARIES = libXquartz.la
 | 
				
			||||||
AM_CFLAGS = $(DIX_CFLAGS)
 | 
					AM_CFLAGS = $(DIX_CFLAGS)
 | 
				
			||||||
AM_OBJCFLAGS = $(DIX_CFLAGS)
 | 
					AM_OBJCFLAGS = $(DIX_CFLAGS)
 | 
				
			||||||
AM_CPPFLAGS = \
 | 
					AM_CPPFLAGS = \
 | 
				
			||||||
 | 
						-DXQUARTZ_DATA_DIR=\"$(datadir)/X11/XQuartz\" \
 | 
				
			||||||
	-DXSERVER_VERSION=\"$(VERSION)\" \
 | 
						-DXSERVER_VERSION=\"$(VERSION)\" \
 | 
				
			||||||
	-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" \
 | 
						-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" \
 | 
				
			||||||
	-DUSE_NEW_CLUT \
 | 
						-DUSE_NEW_CLUT \
 | 
				
			||||||
| 
						 | 
					@ -44,6 +45,7 @@ EXTRA_DIST = \
 | 
				
			||||||
	darwin.h \
 | 
						darwin.h \
 | 
				
			||||||
	darwinfb.h \
 | 
						darwinfb.h \
 | 
				
			||||||
	darwinEvents.h \
 | 
						darwinEvents.h \
 | 
				
			||||||
 | 
						defaults.plist \
 | 
				
			||||||
	keysym2ucs.h \
 | 
						keysym2ucs.h \
 | 
				
			||||||
	quartz.h \
 | 
						quartz.h \
 | 
				
			||||||
	quartzKeyboard.h \
 | 
						quartzKeyboard.h \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -96,10 +96,6 @@ NSString * const XQuartzPrefKeySyncPrimaryOnSelect = @"sync_primary_on_select";
 | 
				
			||||||
            defaults = [[[NSUserDefaults alloc] initWithSuiteName:defaultsDomain] retain];
 | 
					            defaults = [[[NSUserDefaults alloc] initWithSuiteName:defaultsDomain] retain];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        NSArray * const defaultAppsMenu = @[
 | 
					 | 
				
			||||||
            @[NSLocalizedString(@"Terminal", @"Terminal"), @"xterm", @"n"],
 | 
					 | 
				
			||||||
        ];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        NSString *defaultWindowItemModifiers = @"command";
 | 
					        NSString *defaultWindowItemModifiers = @"command";
 | 
				
			||||||
        NSString * const defaultWindowItemModifiersLocalized = NSLocalizedString(@"window item modifiers", @"window item modifiers");
 | 
					        NSString * const defaultWindowItemModifiersLocalized = NSLocalizedString(@"window item modifiers", @"window item modifiers");
 | 
				
			||||||
        if (![defaultWindowItemModifiersLocalized isEqualToString:@"window item modifiers"]) {
 | 
					        if (![defaultWindowItemModifiersLocalized isEqualToString:@"window item modifiers"]) {
 | 
				
			||||||
| 
						 | 
					@ -107,7 +103,6 @@ NSString * const XQuartzPrefKeySyncPrimaryOnSelect = @"sync_primary_on_select";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        NSDictionary<NSString *, id> * const defaultDefaultsDict = @{
 | 
					        NSDictionary<NSString *, id> * const defaultDefaultsDict = @{
 | 
				
			||||||
            XQuartzPrefKeyAppsMenu : defaultAppsMenu,
 | 
					 | 
				
			||||||
            XQuartzPrefKeyFakeButtons : @(NO),
 | 
					            XQuartzPrefKeyFakeButtons : @(NO),
 | 
				
			||||||
            // XQuartzPrefKeyFakeButton2 nil default
 | 
					            // XQuartzPrefKeyFakeButton2 nil default
 | 
				
			||||||
            // XQuartzPrefKeyFakeButton3 nil default
 | 
					            // XQuartzPrefKeyFakeButton3 nil default
 | 
				
			||||||
| 
						 | 
					@ -141,6 +136,10 @@ NSString * const XQuartzPrefKeySyncPrimaryOnSelect = @"sync_primary_on_select";
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [defaults registerDefaults:defaultDefaultsDict];
 | 
					        [defaults registerDefaults:defaultDefaultsDict];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        NSString * const systemDefaultsPlistPath = [@(XQUARTZ_DATA_DIR) stringByAppendingPathComponent:@"defaults.plist"];
 | 
				
			||||||
 | 
					        NSDictionary <NSString *, id> * const systemDefaultsDict = [NSDictionary dictionaryWithContentsOfFile:systemDefaultsPlistPath];
 | 
				
			||||||
 | 
					        [defaults registerDefaults:systemDefaultsDict];
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return defaults;
 | 
					    return defaults;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,17 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- This file contains system-wide defaults for XQuartz -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<plist version="1.0">
 | 
				
			||||||
 | 
					<dict>
 | 
				
			||||||
 | 
						<key>apps_menu</key>
 | 
				
			||||||
 | 
						<array>
 | 
				
			||||||
 | 
							<array>
 | 
				
			||||||
 | 
								<string>Terminal</string>
 | 
				
			||||||
 | 
								<string>xterm</string>
 | 
				
			||||||
 | 
								<string>n</string>
 | 
				
			||||||
 | 
							</array>
 | 
				
			||||||
 | 
						</array>
 | 
				
			||||||
 | 
					</dict>
 | 
				
			||||||
 | 
					</plist>
 | 
				
			||||||
| 
						 | 
					@ -23,6 +23,7 @@ endif
 | 
				
			||||||
bundle_id_def = '-DBUNDLE_ID_PREFIX="@0@"'.format(bundle_id_prefix)
 | 
					bundle_id_def = '-DBUNDLE_ID_PREFIX="@0@"'.format(bundle_id_prefix)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bundle_root = join_paths(apple_applications_dir, apple_application_name + '.app')
 | 
					bundle_root = join_paths(apple_applications_dir, apple_application_name + '.app')
 | 
				
			||||||
 | 
					xquartz_data_dir = join_paths(get_option('prefix'), get_option('datadir'),'X11', 'XQuartz')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# using sparkle update framework?
 | 
					# using sparkle update framework?
 | 
				
			||||||
build_sparkle = xquartz_sparkle_feed_url != '' and xquartz_sparkle_public_edkey != ''
 | 
					build_sparkle = xquartz_sparkle_feed_url != '' and xquartz_sparkle_public_edkey != ''
 | 
				
			||||||
| 
						 | 
					@ -60,6 +61,7 @@ libxquartz_defs = [
 | 
				
			||||||
    '-DUSE_NEW_CLUT',
 | 
					    '-DUSE_NEW_CLUT',
 | 
				
			||||||
    '-DXFree86Server',
 | 
					    '-DXFree86Server',
 | 
				
			||||||
    '-DXQUARTZ',
 | 
					    '-DXQUARTZ',
 | 
				
			||||||
 | 
					    '-DXQUARTZ_DATA_DIR="@0@"'.format(xquartz_data_dir),
 | 
				
			||||||
    '-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
 | 
					    '-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
 | 
				
			||||||
    bundle_id_def,
 | 
					    bundle_id_def,
 | 
				
			||||||
    sparkle_defs,
 | 
					    sparkle_defs,
 | 
				
			||||||
| 
						 | 
					@ -93,3 +95,7 @@ xquartz_man = configure_file(
 | 
				
			||||||
    configuration: manpage_config,
 | 
					    configuration: manpage_config,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
install_man(xquartz_man)
 | 
					install_man(xquartz_man)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					install_data('defaults.plist',
 | 
				
			||||||
 | 
					    install_dir: xquartz_data_dir,
 | 
				
			||||||
 | 
					    install_mode: 'rw-r--r--')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
AM_CPPFLAGS=-I..
 | 
					AM_CPPFLAGS=-I.. -DXQUARTZ_DATA_DIR=\"$(datadir)/X11/XQuartz\"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AM_CFLAGS=$(XPBPROXY_CFLAGS)
 | 
					AM_CFLAGS=$(XPBPROXY_CFLAGS)
 | 
				
			||||||
AM_OBJCFLAGS=$(XPBPROXY_CFLAGS)
 | 
					AM_OBJCFLAGS=$(XPBPROXY_CFLAGS)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,9 @@
 | 
				
			||||||
build_standalone_pbproxy = get_option('xpbproxy')
 | 
					build_standalone_pbproxy = get_option('xpbproxy')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pbproxy_defs = [bundle_id_def]
 | 
					pbproxy_defs = [
 | 
				
			||||||
 | 
					    '-DXQUARTZ_DATA_DIR="@0@"'.format(xquartz_data_dir),
 | 
				
			||||||
 | 
					    bundle_id_def
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
if build_standalone_pbproxy
 | 
					if build_standalone_pbproxy
 | 
				
			||||||
    pbproxy_defs += ['-DSTANDALONE_XPBPROXY']
 | 
					    pbproxy_defs += ['-DSTANDALONE_XPBPROXY']
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue