Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # -*- coding: utf-8 -*- |
| 3 | # |
| 4 | # |
| 5 | # Loosely based on original bash-version by Sebastian Schlingmann (based, again, on a OSX application bundler |
| 6 | # by Thomas Keller). |
| 7 | # |
| 8 | |
| 9 | import sys, os, string, re, shutil, plistlib, tempfile, exceptions, datetime, tarfile |
| 10 | from subprocess import Popen, PIPE |
| 11 | from optparse import OptionParser |
| 12 | |
Alexander Afanasyev | 38d74ec | 2016-11-14 10:22:48 +0900 | [diff] [blame] | 13 | os.environ['PATH'] += ":/usr/local/opt/qt5/bin:/opt/qt5/5.8/clang_64/bin" |
| 14 | |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 15 | import platform |
| 16 | |
| 17 | if platform.system () != 'Darwin': |
| 18 | print "This script is indended to be run only on OSX platform" |
| 19 | exit (1) |
| 20 | |
Qi Zhao | 6d0399e | 2017-02-23 16:24:39 -0800 | [diff] [blame] | 21 | MIN_SUPPORTED_VERSION="10.12" |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 22 | |
| 23 | current_version = tuple(int(i) for i in platform.mac_ver()[0].split('.')[0:2]) |
| 24 | min_supported_version = tuple(int(i) for i in MIN_SUPPORTED_VERSION.split('.')[0:2]) |
| 25 | |
| 26 | if current_version < min_supported_version: |
| 27 | print "This script is indended to be run only on OSX >= %s platform" % MIN_SUPPORTED_VERSION |
| 28 | exit (1) |
| 29 | |
| 30 | options = None |
| 31 | |
| 32 | def gitrev(): |
| 33 | return os.popen('git describe').read()[:-1] |
| 34 | |
| 35 | def codesign(path): |
| 36 | '''Call the codesign executable.''' |
| 37 | |
| 38 | if hasattr(path, 'isalpha'): |
| 39 | path = (path,) |
| 40 | |
| 41 | for p in path: |
| 42 | p = Popen(('codesign', '-vvvv', '--deep', '--force', '--sign', options.codesign, p)) |
| 43 | retval = p.wait() |
| 44 | if retval != 0: |
| 45 | return retval |
| 46 | return 0 |
| 47 | |
| 48 | class AppBundle(object): |
| 49 | |
| 50 | def __init__(self, bundle, version, binary): |
| 51 | shutil.copytree (src = binary, dst = bundle, symlinks = True) |
| 52 | |
| 53 | self.framework_path = '' |
| 54 | self.handled_libs = {} |
| 55 | self.bundle = bundle |
| 56 | self.version = version |
| 57 | self.infopath = os.path.join(os.path.abspath(bundle), 'Contents', 'Info.plist') |
| 58 | self.infoplist = plistlib.readPlist(self.infopath) |
| 59 | self.binary = os.path.join(os.path.abspath(bundle), 'Contents', 'MacOS', self.infoplist['CFBundleExecutable']) |
| 60 | print ' * Preparing AppBundle' |
| 61 | |
| 62 | def is_system_lib(self, lib): |
| 63 | ''' |
| 64 | Is the library a system library, meaning that we should not include it in our bundle? |
| 65 | ''' |
| 66 | if lib.startswith('/System/Library/'): |
| 67 | return True |
| 68 | if lib.startswith('/usr/lib/'): |
| 69 | return True |
| 70 | |
| 71 | return False |
| 72 | |
| 73 | def is_dylib(self, lib): |
| 74 | ''' |
| 75 | Is the library a dylib? |
| 76 | ''' |
| 77 | return lib.endswith('.dylib') |
| 78 | |
| 79 | def get_framework_base(self, fw): |
| 80 | ''' |
| 81 | Extracts the base .framework bundle path from a library in an abitrary place in a framework. |
| 82 | ''' |
| 83 | paths = fw.split('/') |
| 84 | for i, str in enumerate(paths): |
| 85 | if str.endswith('.framework'): |
| 86 | return '/'.join(paths[:i+1]) |
| 87 | return None |
| 88 | |
| 89 | def is_framework(self, lib): |
| 90 | ''' |
| 91 | Is the library a framework? |
| 92 | ''' |
| 93 | return bool(self.get_framework_base(lib)) |
| 94 | |
| 95 | def get_binary_libs(self, path): |
| 96 | ''' |
| 97 | Get a list of libraries that we depend on. |
| 98 | ''' |
| 99 | m = re.compile('^\t(.*)\ \(.*$') |
| 100 | libs = Popen(['otool', '-L', path], stdout=PIPE).communicate()[0] |
| 101 | libs = string.split(libs, '\n') |
| 102 | ret = [] |
| 103 | bn = os.path.basename(path) |
| 104 | for line in libs: |
| 105 | g = m.match(line) |
| 106 | if g is not None: |
| 107 | lib = g.groups()[0] |
| 108 | if lib != bn: |
| 109 | ret.append(lib) |
| 110 | return ret |
| 111 | |
| 112 | def handle_libs(self): |
| 113 | ''' |
| 114 | Copy non-system libraries that we depend on into our bundle, and fix linker |
| 115 | paths so they are relative to our bundle. |
| 116 | ''' |
| 117 | print ' * Taking care of libraries' |
| 118 | |
| 119 | # Does our fwpath exist? |
| 120 | fwpath = os.path.join(os.path.abspath(self.bundle), 'Contents', 'Frameworks') |
| 121 | if not os.path.exists(fwpath): |
| 122 | os.mkdir(fwpath) |
| 123 | |
| 124 | self.handle_binary_libs() |
| 125 | |
| 126 | def handle_binary_libs(self, macho=None, loader_path=None): |
| 127 | ''' |
| 128 | Fix up dylib depends for a specific binary. |
| 129 | ''' |
| 130 | # Does our fwpath exist already? If not, create it. |
| 131 | if not self.framework_path: |
| 132 | self.framework_path = self.bundle + '/Contents/Frameworks' |
| 133 | if not os.path.exists(self.framework_path): |
| 134 | os.mkdir(self.framework_path) |
| 135 | else: |
| 136 | shutil.rmtree(self.framework_path) |
| 137 | os.mkdir(self.framework_path) |
| 138 | |
| 139 | # If we weren't explicitly told which binary to operate on, pick the |
| 140 | # bundle's default executable from its property list. |
| 141 | if macho is None: |
| 142 | macho = os.path.abspath(self.binary) |
| 143 | else: |
| 144 | macho = os.path.abspath(macho) |
| 145 | |
| 146 | print "Processing [%s]" % macho |
Qi Zhao | 0e043e5 | 2016-12-05 18:27:09 -0800 | [diff] [blame] | 147 | |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 148 | libs = self.get_binary_libs(macho) |
| 149 | |
| 150 | for lib in libs: |
| 151 | |
| 152 | # Skip system libraries |
| 153 | if self.is_system_lib(lib): |
| 154 | continue |
| 155 | |
| 156 | # Frameworks are 'special'. |
| 157 | if self.is_framework(lib): |
| 158 | fw_path = self.get_framework_base(lib) |
| 159 | basename = os.path.basename(fw_path) |
| 160 | name = basename.split('.framework')[0] |
| 161 | rel = basename + '/' + name |
| 162 | |
| 163 | abs = self.framework_path + '/' + rel |
| 164 | |
| 165 | if not basename in self.handled_libs: |
| 166 | dst = self.framework_path + '/' + basename |
| 167 | print "COPY ", fw_path, dst |
| 168 | shutil.copytree(fw_path, dst, symlinks=True) |
| 169 | if name.startswith('Qt'): |
| 170 | os.remove(dst + '/' + name + '.prl') |
| 171 | os.remove(dst + '/Headers') |
| 172 | shutil.rmtree(dst + '/Versions/Current/Headers') |
| 173 | |
| 174 | os.chmod(abs, 0755) |
| 175 | os.system('install_name_tool -id "@executable_path/../Frameworks/%s" "%s"' % (rel, abs)) |
| 176 | self.handled_libs[basename] = True |
| 177 | self.handle_binary_libs(abs) |
| 178 | |
| 179 | os.chmod(macho, 0755) |
Alexander Afanasyev | 2fda126 | 2016-03-20 23:26:23 -0700 | [diff] [blame] | 180 | # print 'install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho) |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 181 | os.system('install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho)) |
| 182 | |
| 183 | # Regular dylibs |
| 184 | else: |
| 185 | basename = os.path.basename(lib) |
| 186 | rel = basename |
| 187 | |
| 188 | if not basename in self.handled_libs: |
| 189 | if lib.startswith('@loader_path'): |
| 190 | copypath = lib.replace('@loader_path', loader_path) |
| 191 | else: |
| 192 | copypath = lib |
| 193 | |
| 194 | print "COPY ", copypath |
| 195 | shutil.copy(copypath, self.framework_path + '/' + basename) |
| 196 | |
| 197 | abs = self.framework_path + '/' + rel |
| 198 | os.chmod(abs, 0755) |
| 199 | os.system('install_name_tool -id "@executable_path/../Frameworks/%s" "%s"' % (rel, abs)) |
| 200 | self.handled_libs[basename] = True |
Qi Zhao | 0e043e5 | 2016-12-05 18:27:09 -0800 | [diff] [blame] | 201 | self.handle_binary_libs(abs, loader_path=os.path.dirname(lib)) |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 202 | |
Alexander Afanasyev | 2fda126 | 2016-03-20 23:26:23 -0700 | [diff] [blame] | 203 | # print 'install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho) |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 204 | os.chmod(macho, 0755) |
| 205 | os.system('install_name_tool -change "%s" "@executable_path/../Frameworks/%s" "%s"' % (lib, rel, macho)) |
| 206 | |
| 207 | def copy_resources(self, rsrcs): |
| 208 | ''' |
| 209 | Copy needed resources into our bundle. |
| 210 | ''' |
| 211 | print ' * Copying needed resources' |
| 212 | rsrcpath = os.path.join(self.bundle, 'Contents', 'Resources') |
| 213 | if not os.path.exists(rsrcpath): |
| 214 | os.mkdir(rsrcpath) |
| 215 | |
| 216 | # Copy resources already in the bundle |
| 217 | for rsrc in rsrcs: |
| 218 | b = os.path.basename(rsrc) |
| 219 | if os.path.isdir(rsrc): |
| 220 | shutil.copytree(rsrc, os.path.join(rsrcpath, b), symlinks=True) |
| 221 | elif os.path.isfile(rsrc): |
| 222 | shutil.copy(rsrc, os.path.join(rsrcpath, b)) |
| 223 | |
| 224 | return |
| 225 | |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 226 | def copy_etc(self, rsrcs): |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 227 | ''' |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 228 | Copy needed config files into our bundle. |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 229 | ''' |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 230 | print ' * Copying needed config files' |
Alexander Afanasyev | 964feb9 | 2016-03-22 13:03:11 -0700 | [diff] [blame] | 231 | rsrcpath = os.path.join(self.bundle, 'Contents', 'etc', 'ndn') |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 232 | if not os.path.exists(rsrcpath): |
Alexander Afanasyev | 964feb9 | 2016-03-22 13:03:11 -0700 | [diff] [blame] | 233 | os.makedirs(rsrcpath) |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 234 | |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 235 | # Copy resources already in the bundle |
| 236 | for rsrc in rsrcs: |
| 237 | b = os.path.basename(rsrc) |
| 238 | if os.path.isdir(rsrc): |
| 239 | shutil.copytree(rsrc, os.path.join(rsrcpath, b), symlinks=True) |
| 240 | elif os.path.isfile(rsrc): |
| 241 | shutil.copy(rsrc, os.path.join(rsrcpath, b)) |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 242 | |
Alexander Afanasyev | e1236c7 | 2016-03-21 15:52:09 -0700 | [diff] [blame] | 243 | return |
Qi Zhao | 0e043e5 | 2016-12-05 18:27:09 -0800 | [diff] [blame] | 244 | |
Alexander Afanasyev | e1236c7 | 2016-03-21 15:52:09 -0700 | [diff] [blame] | 245 | def copy_framework(self, framework): |
| 246 | ''' |
| 247 | Copy frameworks |
| 248 | ''' |
| 249 | print ' * Copying framework' |
| 250 | rsrcpath = os.path.join(self.bundle, 'Contents', 'Frameworks', os.path.basename(framework)) |
| 251 | |
| 252 | shutil.copytree(framework, rsrcpath, symlinks = True) |
| 253 | |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 254 | def macdeployqt(self): |
| 255 | Popen(['macdeployqt', self.bundle, '-qmldir=src', '-executable=%s' % self.binary]).communicate() |
Qi Zhao | 0e043e5 | 2016-12-05 18:27:09 -0800 | [diff] [blame] | 256 | |
Alexander Afanasyev | b2cf5c0 | 2016-03-21 11:04:28 -0700 | [diff] [blame] | 257 | def copy_ndn_deps(self, path): |
| 258 | ''' |
| 259 | Copy over NDN dependencies (NFD and related apps) |
| 260 | ''' |
| 261 | print ' * Copying NDN dependencies' |
| 262 | |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 263 | src = os.path.join(path, 'bin') |
Alexander Afanasyev | 9c45c64 | 2017-03-18 15:29:42 -0700 | [diff] [blame^] | 264 | dstBinary = os.path.join(self.bundle, 'Contents', 'Helpers') |
| 265 | dstResource = os.path.join(self.bundle, 'Contents', 'Resources', 'bin') |
| 266 | os.makedirs(dstBinary) |
| 267 | os.makedirs(dstResource) |
Alexander Afanasyev | b2cf5c0 | 2016-03-21 11:04:28 -0700 | [diff] [blame] | 268 | |
Alexander Afanasyev | 9c45c64 | 2017-03-18 15:29:42 -0700 | [diff] [blame^] | 269 | for file in os.listdir(src): |
| 270 | ftype = Popen(['/usr/bin/file', '-b', "%s/%s" % (src, file)], stdout=PIPE).communicate()[0] |
| 271 | if "Mach-O" in ftype: |
| 272 | shutil.copy("%s/%s" % (src, file), "%s/%s" % (dstBinary, file)) |
| 273 | else: |
| 274 | shutil.copy("%s/%s" % (src, file), "%s/%s" % (dstResource, file)) |
| 275 | Popen(['/usr/bin/sed', '-i', '', '-e', 's|`dirname "$0"`/|`dirname "$0"`/../../Helpers/|', "%s/%s" % (dstResource, file)]).communicate()[0] |
| 276 | |
| 277 | for subdir, dirs, files in os.walk(dstBinary): |
Alexander Afanasyev | b2cf5c0 | 2016-03-21 11:04:28 -0700 | [diff] [blame] | 278 | for file in files: |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 279 | abs = subdir + "/" + file |
| 280 | self.handle_binary_libs(abs) |
Alexander Afanasyev | b2cf5c0 | 2016-03-21 11:04:28 -0700 | [diff] [blame] | 281 | |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 282 | def set_min_macosx_version(self, version): |
| 283 | ''' |
| 284 | Set the minimum version of Mac OS X version that this App will run on. |
| 285 | ''' |
| 286 | print ' * Setting minimum Mac OS X version to: %s' % (version) |
| 287 | self.infoplist['LSMinimumSystemVersion'] = version |
| 288 | |
| 289 | def done(self): |
| 290 | plistlib.writePlist(self.infoplist, self.infopath) |
| 291 | print ' * Done!' |
| 292 | print '' |
| 293 | |
| 294 | class FolderObject(object): |
| 295 | class Exception(exceptions.Exception): |
| 296 | pass |
| 297 | |
| 298 | def __init__(self): |
| 299 | self.tmp = tempfile.mkdtemp() |
| 300 | |
| 301 | def copy(self, src, dst='/'): |
| 302 | ''' |
| 303 | Copy a file or directory into foler |
| 304 | ''' |
| 305 | asrc = os.path.abspath(src) |
| 306 | |
| 307 | if dst[0] != '/': |
| 308 | raise self.Exception |
| 309 | |
| 310 | # Determine destination |
| 311 | if dst[-1] == '/': |
| 312 | adst = os.path.abspath(self.tmp + '/' + dst + os.path.basename(src)) |
| 313 | else: |
| 314 | adst = os.path.abspath(self.tmp + '/' + dst) |
| 315 | |
| 316 | if os.path.isdir(asrc): |
| 317 | print ' * Copying directory: %s' % os.path.basename(asrc) |
| 318 | shutil.copytree(asrc, adst, symlinks=True) |
| 319 | elif os.path.isfile(asrc): |
| 320 | print ' * Copying file: %s' % os.path.basename(asrc) |
| 321 | shutil.copy(asrc, adst) |
| 322 | |
| 323 | def symlink(self, src, dst): |
| 324 | ''' |
| 325 | Create a symlink inside the folder |
| 326 | ''' |
| 327 | asrc = os.path.abspath(src) |
| 328 | adst = self.tmp + '/' + dst |
| 329 | print " * Creating symlink %s" % os.path.basename(asrc) |
| 330 | os.symlink(asrc, adst) |
| 331 | |
| 332 | def mkdir(self, name): |
| 333 | ''' |
| 334 | Create a directory inside the folder. |
| 335 | ''' |
| 336 | print ' * Creating directory %s' % os.path.basename(name) |
| 337 | adst = self.tmp + '/' + name |
| 338 | os.makedirs(adst) |
| 339 | |
| 340 | class DiskImage(FolderObject): |
| 341 | |
| 342 | def __init__(self, filename, volname): |
| 343 | FolderObject.__init__(self) |
| 344 | print ' * Preparing to create diskimage' |
| 345 | self.filename = filename |
| 346 | self.volname = volname |
| 347 | |
| 348 | def create(self): |
| 349 | ''' |
| 350 | Create the disk image |
| 351 | ''' |
| 352 | print ' * Creating disk image. Please wait...' |
| 353 | if os.path.exists(self.filename): |
Alexander Afanasyev | 2fda126 | 2016-03-20 23:26:23 -0700 | [diff] [blame] | 354 | os.remove(self.filename) |
| 355 | shutil.rmtree(self.filename, ignore_errors=True) |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 356 | p = Popen(['hdiutil', 'create', |
| 357 | '-srcfolder', self.tmp, |
| 358 | '-format', 'UDBZ', |
| 359 | '-volname', self.volname, |
| 360 | self.filename]) |
| 361 | |
| 362 | retval = p.wait() |
| 363 | print ' * Removing temporary directory.' |
| 364 | shutil.rmtree(self.tmp) |
| 365 | print ' * Done!' |
| 366 | |
| 367 | |
| 368 | if __name__ == '__main__': |
| 369 | parser = OptionParser() |
| 370 | parser.add_option('-r', '--release', dest='release', help='Build a release. This determines the version number of the release.') |
| 371 | parser.add_option('-s', '--snapshot', dest='snapshot', help='Build a snapshot release. This determines the \'snapshot version\'.') |
| 372 | parser.add_option('-g', '--git', dest='git', help='Build a snapshot release. Use the git revision number as the \'snapshot version\'.', action='store_true', default=False) |
| 373 | parser.add_option('--codesign', dest='codesign', help='Identity to use for code signing. (If not set, no code signing will occur)') |
| 374 | |
| 375 | options, args = parser.parse_args() |
| 376 | |
| 377 | # Release |
| 378 | if options.release: |
| 379 | ver = options.release |
| 380 | # Snapshot |
| 381 | elif options.snapshot or options.git: |
| 382 | if not options.git: |
| 383 | ver = options.snapshot |
| 384 | else: |
| 385 | ver = gitrev() |
| 386 | else: |
| 387 | print 'ERROR: Neither snapshot or release selected. Bailing.' |
| 388 | parser.print_help () |
| 389 | sys.exit(1) |
| 390 | |
| 391 | # Do the finishing touches to our Application bundle before release |
Qi Zhao | 6d0399e | 2017-02-23 16:24:39 -0800 | [diff] [blame] | 392 | shutil.rmtree('build/NDN.app', ignore_errors=True) |
| 393 | a = AppBundle('build/NDN.app', ver, 'build/NDN Control Center.app') |
Alexander Afanasyev | b2cf5c0 | 2016-03-21 11:04:28 -0700 | [diff] [blame] | 394 | a.copy_ndn_deps("build/deps") |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 395 | # a.copy_resources(['qt.conf']) |
| 396 | a.copy_etc(['nfd.conf']) |
Alexander Afanasyev | 11ae34d | 2016-03-21 11:55:16 -0700 | [diff] [blame] | 397 | a.set_min_macosx_version('%s.0' % MIN_SUPPORTED_VERSION) |
Alexander Afanasyev | 8e986f8 | 2016-03-21 14:19:15 -0700 | [diff] [blame] | 398 | a.macdeployqt() |
Alexander Afanasyev | fda42a8 | 2017-02-01 18:03:39 -0800 | [diff] [blame] | 399 | a.copy_framework("osx/Frameworks/Sparkle.framework") |
Alexander Afanasyev | 11ae34d | 2016-03-21 11:55:16 -0700 | [diff] [blame] | 400 | a.done() |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 401 | |
Alexander Afanasyev | 11ae34d | 2016-03-21 11:55:16 -0700 | [diff] [blame] | 402 | # Sign our binaries, etc. |
| 403 | if options.codesign: |
| 404 | print ' * Signing binaries with identity `%s\'' % options.codesign |
Alexander Afanasyev | fda42a8 | 2017-02-01 18:03:39 -0800 | [diff] [blame] | 405 | codesign(a.bundle) |
Alexander Afanasyev | 11ae34d | 2016-03-21 11:55:16 -0700 | [diff] [blame] | 406 | print '' |
Alexander Afanasyev | cf18c80 | 2016-03-20 22:48:15 -0700 | [diff] [blame] | 407 | |
Alexander Afanasyev | 11ae34d | 2016-03-21 11:55:16 -0700 | [diff] [blame] | 408 | # Create diskimage |
Qi Zhao | 6d0399e | 2017-02-23 16:24:39 -0800 | [diff] [blame] | 409 | title = "NDN-%s" % ver |
Alexander Afanasyev | 11ae34d | 2016-03-21 11:55:16 -0700 | [diff] [blame] | 410 | fn = "build/%s.dmg" % title |
| 411 | d = DiskImage(fn, title) |
| 412 | d.symlink('/Applications', '/Applications') |
Qi Zhao | 6d0399e | 2017-02-23 16:24:39 -0800 | [diff] [blame] | 413 | d.copy('build/NDN.app', '/NDN.app') |
Alexander Afanasyev | 11ae34d | 2016-03-21 11:55:16 -0700 | [diff] [blame] | 414 | d.create() |
Alexander Afanasyev | fda42a8 | 2017-02-01 18:03:39 -0800 | [diff] [blame] | 415 | |
| 416 | if options.codesign: |
| 417 | print ' * Signing .dmg with identity `%s\'' % options.codesign |
| 418 | codesign(fn) |
| 419 | print '' |
Alexander Afanasyev | 712dedc | 2017-02-09 16:31:41 -0800 | [diff] [blame] | 420 | |
| 421 | Popen('tail -n +3 RELEASE_NOTES.md | pandoc -f markdown -t html > build/release-notes-%s.html' % ver, shell=True).wait() |