Skip to content

Commit 0cce8ca

Browse files
authored
Merge pull request #67 from PropGit/demo
Update Mac Build and Package System
2 parents 7e16e6e + f2a5348 commit 0cce8ca

File tree

8 files changed

+74
-52
lines changed

8 files changed

+74
-52
lines changed

BlocklyPropClient.icns

54.6 KB
Binary file not shown.

BlocklyPropClient.macos.spec

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,50 @@
11
# -*- mode: python -*-
2-
a = Analysis(['BlocklyPropClient.py'],
32

3+
block_cipher = None
4+
5+
6+
a = Analysis(['BlocklyPropClient.py'],
7+
binaries=None,
8+
datas=None,
49
hiddenimports=[],
5-
hookspath=None,
6-
runtime_hooks=None)
7-
pyz = PYZ(a.pure)
10+
hookspath=[],
11+
runtime_hooks=[],
12+
excludes=[],
13+
win_no_prefer_redirects=False,
14+
win_private_assemblies=False,
15+
cipher=block_cipher)
16+
17+
pyz = PYZ(a.pure, a.zipped_data,
18+
cipher=block_cipher)
19+
820
exe = EXE(pyz,
921
a.scripts,
1022
exclude_binaries=True,
1123
name='BlocklyPropClient',
1224
debug=False,
13-
strip=None,
25+
strip=False,
1426
upx=False,
15-
console=False,
16-
windowed=True
17-
)
18-
# icon='blocklyprop.ico'
27+
console=False , icon='BlocklyPropClient.icns')
28+
29+
# Propeller Tools
1930
propeller_libs_and_tools = Tree('propeller-tools', prefix='propeller-tools', excludes=['*.pdf', 'windows', 'linux'])
2031
propeller_libs_and_tools += [('about.txt', 'about.txt', 'About file')]
32+
33+
# Collection (edited to include Propeller Tools)
2134
coll = COLLECT(exe,
2235
a.binaries,
2336
a.zipfiles,
2437
a.datas,
2538
propeller_libs_and_tools,
26-
strip=None,
39+
strip=False,
2740
upx=False,
28-
name='BlocklyPropClient.app',
29-
icon=None,
30-
bundle_identifier=None)
41+
name='BlocklyPropClient')
42+
43+
app = BUNDLE(coll,
44+
name='BlocklyPropClient.app',
45+
icon='BlocklyPropClient.icns',
46+
bundle_identifier='com.ParallaxInc.BlocklyPropClient',
47+
info_plist={'CFBundleShortVersionString': '0.5.3'})
3148

32-
# Analysis
33-
# pathex=['D:\\Development\\python\\BlocklyPropClient'],
49+
# From Analysis
50+
# pathex=['/Users/<username>/PythonProjects/BlocklyPropClient'],

BlocklyPropClient.spec

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,54 @@ These steps need be performed frequently, as needed, after System Configuration
146146
* Build BlocklyPropClient
147147
* (VPython)$ PyInstaller BlocklyPropClient.macos.spec
148148
* This builds and stores the application bundle in the ./dist subfolder as BlocklyPropClient.app
149+
* See BlocklyPropClient.macos.spec Details (below) for more information
149150
* Sign and Package BlocklyPropClient (requires signing certificate in Mac's KeyChain)
150151
* Navigate to the package folder
151152
* cd package
152153
* Run the mac_sign_and_package script giving the proper version number and deploy option
153154
* To include the FTDI USB Drivers inside the installer:
154-
* ./mac_app_sign_and_package.sh -a "BlocklyPropClient" -v 0.5.1 -r -f -d
155+
* _$ ./mac_app_sign_and_package.sh -a "BlocklyPropClient" -v 0.5.1 -r -f -d_
155156
* To exclude the FTDI USB Drivers from the installer:
156-
* ./mac_app_sign_and_package.sh -a "BlocklyPropClient" -v 0.5.1 -d
157+
* _$ ./mac_app_sign_and_package.sh -a "BlocklyPropClient" -v 0.5.1 -d_
157158
* The installer package will be written to the ../dist subfolder as BlocklyPropClient-0.5.1-setup-MacOS.pkg
158159
* Deactivate the Virtual Environment...
159-
* (VPython)$ deactivate
160+
* _(VPython)$ deactivate_
160161
* The "(VPython)" prefix will now disappear from your command-line
161162

163+
#### BlocklyPropClient.macos.spec Details
164+
165+
The BlocklyPropClient.macos.spec is the build specification file for Mac OS. This file contains Python executable source generated automatically by the pyi-makespec command and also later amended to include features not expressible via the pyi-makespec command-line.
166+
167+
To regenerate a specification file for Mac OS:
168+
* Navigate to the project
169+
* _$ cd ~/PythonProjects/BlocklyPropClient_
170+
* Activate the _Virtual Python_ environment for BlocklyPropClient
171+
* _$ source VPython/bin/activate_
172+
* Generate a new BlocklyPropClient.spec file
173+
* _(VPython)$ pyi-makespec --windowed --icon BlocklyPropClient.icns --osx-bundle-identifier com.ParallaxInc.BlocklyPropClient --noupx BlocklyPropClient.py_
174+
* Update the BlocklyPropClient.spec file to include propeller-tools content
175+
* Below the "exe" block, add the following three lines
176+
177+
```
178+
#Propeller Tools
179+
propeller_libs_and_tools = Tree('propeller-tools', prefix='propeller-tools', excludes=['*.pdf', 'windows', 'linux'])
180+
propeller_libs_and_tools += [('about.txt', 'about.txt', 'About file')]
181+
```
182+
183+
* Above the "coll" block, indicates it is modified
184+
```
185+
#Collection (edited to include Propeller Tools)
186+
```
187+
188+
* Below the "coll" block's "a.datas," line, insert the following line
189+
```
190+
propeller_libs_and_tools,
191+
```
192+
193+
* At the end of the "app" block, change that last element to the following lines (where x.x.x is the version number):
194+
```
195+
bundle_identifier='com.ParallaxInc.BlocklyPropClient',
196+
info_plist={'CFBundleShortVersionString': 'x.x.x'})
197+
```
198+
199+
* Save the file and rename to __BlocklyPropClient.macos.spec__

drivers/FTDIUSBSerialDriver.kext/Contents/Info.plist

100755100644
File mode changed.

package/mac_app_sign_and_package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ then
265265
#
266266
# Found bundle
267267
#
268-
if [[ -e ${DISTRIBUTION}${APP_BUNDLE}/_CodeSignature/CodeResources ]]
268+
if [[ -e ${DISTRIBUTION}${APP_BUNDLE}/Contents/_CodeSignature/CodeResources ]]
269269
then
270270
#
271271
# Found code signature, now we'll check validity

0 commit comments

Comments
 (0)