source: launchers/macosx/dmgconfig.py @ 5ed701d

Last change on this file since 5ed701d was f76874a, checked in by meeh <meeh@…>, 2 years ago

Adding XCode workspace & Xcode project, and some files missing from last commit.

Please note that Xcode project embedds the packing script (meaning it runs "ant" - zip files, and moves it to bundle)

  • Property mode set to 100644
File size: 7.9 KB
Line 
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4import biplist
5import os.path
6
7#
8# Example settings file for dmgbuild
9#
10
11# Use like this: dmgbuild -s settings.py "Test Volume" test.dmg
12
13# You can actually use this file for your own application (not just TextEdit)
14# by doing e.g.
15#
16#   dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg
17
18# .. Useful stuff ..............................................................
19
20application = defines.get('app', 'I2PLauncher.app')
21appname = os.path.basename(application)
22
23def icon_from_app(app_path):
24    plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
25    plist = biplist.readPlist(plist_path)
26    icon_name = plist['CFBundleIconFile']
27    icon_root,icon_ext = os.path.splitext(icon_name)
28    if not icon_ext:
29        icon_ext = '.icns'
30    icon_name = icon_root + icon_ext
31    return os.path.join(app_path, 'Contents', 'Resources', icon_name)
32
33# .. Basics ....................................................................
34
35# Uncomment to override the output filename
36filename = 'i2p-for-osx.dmg'
37
38# Uncomment to override the output volume name
39volume_name = 'I2P'
40
41# Volume format (see hdiutil create -help)
42format = defines.get('format', 'UDBZ')
43
44# Volume size
45size = defines.get('size', None)
46
47# Files to include
48files = [ application ]
49
50# Symlinks to create
51symlinks = { 'Applications': '/Applications' }
52
53# Volume icon
54#
55# You can either define icon, in which case that icon file will be copied to the
56# image, *or* you can define badge_icon, in which case the icon file you specify
57# will be used to badge the system's Removable Disk icon
58#
59#icon = '/path/to/icon.icns'
60badge_icon = icon_from_app(application)
61
62# Where to put the icons
63icon_locations = {
64    appname:        (140, 120),
65    'Applications': (500, 120)
66    }
67
68# .. Window configuration ......................................................
69
70# Background
71#
72# This is a STRING containing any of the following:
73#
74#    #3344ff          - web-style RGB color
75#    #34f             - web-style RGB color, short form (#34f == #3344ff)
76#    rgb(1,0,0)       - RGB color, each value is between 0 and 1
77#    hsl(120,1,.5)    - HSL (hue saturation lightness) color
78#    hwb(300,0,0)     - HWB (hue whiteness blackness) color
79#    cmyk(0,1,0,0)    - CMYK color
80#    goldenrod        - X11/SVG named color
81#    builtin-arrow    - A simple built-in background with a blue arrow
82#    /foo/bar/baz.png - The path to an image file
83#
84# The hue component in hsl() and hwb() may include a unit; it defaults to
85# degrees ('deg'), but also supports radians ('rad') and gradians ('grad'
86# or 'gon').
87#
88# Other color components may be expressed either in the range 0 to 1, or
89# as percentages (e.g. 60% is equivalent to 0.6).
90background = 'builtin-arrow'
91
92show_status_bar = False
93show_tab_view = False
94show_toolbar = False
95show_pathbar = False
96show_sidebar = False
97sidebar_width = 180
98
99# Window position in ((x, y), (w, h)) format
100window_rect = ((100, 100), (640, 280))
101
102# Select the default view; must be one of
103#
104#    'icon-view'
105#    'list-view'
106#    'column-view'
107#    'coverflow'
108#
109default_view = 'icon-view'
110
111# General view configuration
112show_icon_preview = False
113
114# Set these to True to force inclusion of icon/list view settings (otherwise
115# we only include settings for the default view)
116include_icon_view_settings = 'auto'
117include_list_view_settings = 'auto'
118
119# .. Icon view configuration ...................................................
120
121arrange_by = None
122grid_offset = (0, 0)
123grid_spacing = 100
124scroll_position = (0, 0)
125label_pos = 'bottom' # or 'right'
126text_size = 16
127icon_size = 128
128
129# .. List view configuration ...................................................
130
131# Column names are as follows:
132#
133#   name
134#   date-modified
135#   date-created
136#   date-added
137#   date-last-opened
138#   size
139#   kind
140#   label
141#   version
142#   comments
143#
144list_icon_size = 16
145list_text_size = 12
146list_scroll_position = (0, 0)
147list_sort_by = 'name'
148list_use_relative_dates = True
149list_calculate_all_sizes = False,
150list_columns = ('name', 'date-modified', 'size', 'kind', 'date-added')
151list_column_widths = {
152    'name': 300,
153    'date-modified': 181,
154    'date-created': 181,
155    'date-added': 181,
156    'date-last-opened': 181,
157    'size': 97,
158    'kind': 115,
159    'label': 100,
160    'version': 75,
161    'comments': 300,
162    }
163list_column_sort_directions = {
164    'name': 'ascending',
165    'date-modified': 'descending',
166    'date-created': 'descending',
167    'date-added': 'descending',
168    'date-last-opened': 'descending',
169    'size': 'descending',
170    'kind': 'ascending',
171    'label': 'ascending',
172    'version': 'ascending',
173    'comments': 'ascending',
174    }
175
176# .. License configuration .....................................................
177
178# Text in the license configuration is stored in the resources, which means
179# it gets stored in a legacy Mac encoding according to the language.  dmgbuild
180# will *try* to convert Unicode strings to the appropriate encoding, *but*
181# you should be aware that Python doesn't support all of the necessary encodings;
182# in many cases you will need to encode the text yourself and use byte strings
183# instead here.
184
185# Recognized language names are:
186#
187#  af_ZA, ar, be_BY, bg_BG, bn, bo, br, ca_ES, cs_CZ, cy, da_DK, de_AT, de_CH,
188#  de_DE, dz_BT, el_CY, el_GR, en_AU, en_CA, en_GB, en_IE, en_SG, en_US, eo,
189#  es_419, es_ES, et_EE, fa_IR, fi_FI, fo_FO, fr_001, fr_BE, fr_CA, fr_CH,
190#  fr_FR, ga-Latg_IE, ga_IE, gd, grc, gu_IN, gv, he_IL, hi_IN, hr_HR, hu_HU,
191#  hy_AM, is_IS, it_CH, it_IT, iu_CA, ja_JP, ka_GE, kl, ko_KR, lt_LT, lv_LV,
192#  mk_MK, mr_IN, mt_MT, nb_NO, ne_NP, nl_BE, nl_NL, nn_NO, pa, pl_PL, pt_BR,
193#  pt_PT, ro_RO, ru_RU, se, sk_SK, sl_SI, sr_RS, sv_SE, th_TH, to_TO, tr_TR,
194#  uk_UA, ur_IN, ur_PK, uz_UZ, vi_VN, zh_CN, zh_TW
195
196# license = {
197#     'default-language': 'en_US',
198#     'licenses': {
199#         # For each language, the text of the license.  This can be plain text,
200#         # RTF (in which case it must start "{\rtf1"), or a path to a file
201#         # containing the license text.  If you're using RTF,
202#         # watch out for Python escaping (or read it from a file).
203#         'English': b'''{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf820
204# {\\fonttbl\\f0\\fnil\\fcharset0 Helvetica-Bold;\\f1\\fnil\\fcharset0 Helvetica;}
205# {\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue0;}
206# {\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c0;}
207# \\paperw11905\\paperh16837\\margl1133\\margr1133\\margb1133\\margt1133
208# \\deftab720
209# \\pard\\pardeftab720\\sa160\\partightenfactor0
210
211# \\f0\\b\\fs60 \\cf2 \\expnd0\\expndtw0\\kerning0
212# \\up0 \\nosupersub \\ulnone \\outl0\\strokewidth0 \\strokec2 Test License\\
213# \\pard\\pardeftab720\\sa160\\partightenfactor0
214
215# \\fs36 \\cf2 \\strokec2 What is this?\\
216# \\pard\\pardeftab720\\sa160\\partightenfactor0
217
218# \\f1\\b0\\fs22 \\cf2 \\strokec2 This is the English license. It says what you are allowed to do with this software.\\
219# \\
220# }''',
221#     },
222#     'buttons': {
223#         # For each language, text for the buttons on the licensing window.
224#         #
225#         # Default buttons and text are built-in for the following languages:
226#         #
227#         #   English (en_US), German (de_DE), Spanish (es_ES), French (fr_FR),
228#         #   Italian (it_IT), Japanese (ja_JP), Dutch (nl_NL), Swedish (sv_SE),
229#         #   Brazilian Portuguese (pt_BR), Simplified Chinese (zh_CN),
230#         #   Traditional Chinese (zh_TW), Danish (da_DK), Finnish (fi_FI),
231#         #   Korean (ko_KR), Norwegian (nb_NO)
232#         #
233#         # You don't need to specify them for those languages; if you fail to
234#         # specify them for some other language, English will be used instead.
235
236#         'en_US': (
237#             b'English',
238#             b'Agree',
239#             b'Disagree',
240#             b'Print',
241#             b'Save',
242#             b'If you agree with the terms of this license, press "Agree" to '
243#             b'install the software.  If you do not agree, press "Disagree".'
244#         ),
245#     },
246# }
Note: See TracBrowser for help on using the repository browser.