Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved Mac OS X Application Packaging.
1. Set python dependency paths in Application Bundle adhering the Homebrew convention of installing them in prefix/libexec 2. Add appdmg configuration to produce an os x disk image for FreeCAD application distribution 3. Added a Tools convenience script to produce an archive name from a serialized Version.h file using the convention FreeCAD_{Major Version Number}.{Minor Version Number}-{Git Revision Count}.{Git Short SHA}-{OS}-{Arch}
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
|
||
"title": "FreeCAD", | ||
|
||
"icon": "../FreeCAD.app/Contents/Resources/freecad.icns", | ||
|
||
"icon-size": 80, | ||
|
||
"background": "background.png", | ||
|
||
"contents": [ | ||
|
||
{ "x": 250, "y": 150, "type": "file", "path": "/usr/local/FreeCAD.app" }, | ||
{ "x": 475, "y": 150, "type": "link", "path": "/Applications" } | ||
|
||
], | ||
|
||
"format": "UDZO" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#! python | ||
### | ||
# A convenience script to generate a deployment archive name of the form | ||
# FreeCAD_{Major Version Number}.{Minor Version Number}-{Git Revision Count}.{Git Short SHA}-{OS}-{Arch} | ||
# | ||
import sys,string,getopt,platform | ||
|
||
def deserializeVersionHeader(path): | ||
version = {} | ||
try: | ||
dat = open(path, 'r').readlines() | ||
except IOError: | ||
print 'Unable to open ', path | ||
raise | ||
|
||
for l in dat: | ||
tokens = l.split() | ||
if len(tokens) > 1 and tokens[0].lower() == '#define': | ||
version[tokens[1]] = tokens[2].replace('"',"") | ||
|
||
return version | ||
|
||
def main(): | ||
OSAbbrev = {'Windows' : 'WIN', 'Darwin' : 'OSX'} | ||
SHA = None | ||
|
||
if(len(sys.argv) < 2): | ||
sys.stderr.write("Usage: archiveNameFromVersion <path to Version.h> [--git-SHA=]\n") | ||
|
||
try: | ||
opts, args = getopt.getopt(sys.argv[2:], "g:", ["git-SHA="]) | ||
except getopt.GetoptError: | ||
pass | ||
|
||
for o, a in opts: | ||
if o in ("-g", "--git-SHA"): | ||
SHA = a | ||
|
||
version = deserializeVersionHeader(sys.argv[1]) | ||
if SHA: | ||
version['FCRepositoryHash'] = SHA | ||
|
||
print 'FreeCAD_{Major}.{Minor}-{RevCount}.{GitShortSHA}-{OS}-{Arch}'.format( | ||
Major=version['FCVersionMajor'], | ||
Minor=version['FCVersionMinor'], | ||
RevCount=version['FCRevision'], | ||
GitShortSHA=version['FCRepositoryHash'][0:7], | ||
OS=OSAbbrev.get(platform.system(), 'LIN'), | ||
Arch=platform.machine()) | ||
|
||
if __name__ == "__main__": | ||
main() | ||
|