Lines Matching +full:- +full:- +full:workdir
6 - support Intel 64-bit-only () and 32-bit-only installer builds
7 - build and use internal Tcl/Tk 8.6 for 10.6+ builds
8 - deprecate use of explicit SDK (--sdk-path=) since all but the oldest
13 supported with build-installer.
14 - use generic "gcc" as compiler (CC env var) rather than "gcc-4.2"
17 - support SDKROOT and DEVELOPER_DIR xcrun env variables
18 - test with 10.5 and 10.4 and determine support status
25 Sphinx, build-installer.py should also be converted to use python3!
28 build-installer builds and links with its own copy of Tcl/Tk 8.6.
29 Otherwise, it requires an installed third-party version of
78 QUOTED_VALUE='quotes' -> str('quotes')
79 UNQUOTED_VALUE=noquotes -> str('noquotes')
86 raise RuntimeError("Cannot find variable %s" % variable[:-1])
109 _cache_getFullVersion = ln.split()[-1][1:-1]
114 FW_VERSION_PREFIX = "--undefined--" # initialized in parseOptions
115 FW_SSL_DIRECTORY = "--undefined--" # initialized in parseOptions
118 WORKDIR = "/tmp/_py" variable
120 # The directory we'll use to store third-party sources. Set this to something
121 # else if you don't want to re-fetch required libraries every time.
122 DEPSRC = os.path.join(WORKDIR, 'third-party')
123 DEPSRC = os.path.expanduser('~/Universal/other-sources')
125 universal_opts_map = { '32-bit': ('i386', 'ppc',),
126 '64-bit': ('x86_64', 'ppc64',),
128 'intel-32': ('i386',),
129 'intel-64': ('x86_64',),
130 '3-way': ('ppc', 'i386', 'x86_64'),
133 '64-bit': '10.5',
134 '3-way': '10.5',
136 'intel-32': '10.4',
137 'intel-64': '10.5',
143 UNIVERSALARCHS = '32-bit'
154 # $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
162 '10.4': ('gcc-4.0', 'g++-4.0'),
176 -? or -h: Show this message
177 -b DIR
178 --build-dir=DIR: Create build here (default: %(WORKDIR)r)
179 --third-party=DIR: Store third-party sources here (default: %(DEPSRC)r)
180 --sdk-path=DIR: Location of the SDK (deprecated, use SDKROOT env variable)
181 --src-dir=DIR: Location of the Python sources (default: %(SRCDIR)r)
182 --dep-target=10.n macOS deployment target (default: %(DEPTARGET)r)
183 …--universal-archs=x universal architectures (options: %(UNIVERSALOPTS)r, default: %(UNIVERSALARCH…
219 url="https://www.openssl.org/source/openssl-1.1.0j.tar.gz",
231 url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tcl8.6.8-src.tar.gz",
235 '--enable-shared',
236 '--enable-threads',
237 '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),),
241 "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
247 url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk8.6.8-src.tar.gz",
254 '--enable-aqua',
255 '--enable-shared',
256 '--enable-threads',
257 '--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib'%(getVersion(),),
261 "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
272 url="http://tukaani.org/xz/xz-5.2.3.tar.gz",
275 '--disable-dependency-tracking',
283 url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz",
286 "--enable-widec",
287 "--without-cxx",
288 "--without-cxx-binding",
289 "--without-ada",
290 "--without-curses-h",
291 "--enable-shared",
292 "--with-shared",
293 "--without-debug",
294 "--without-normal",
295 "--without-tests",
296 "--without-manpages",
297 "--datadir=/usr/share",
298 "--sysconfdir=/etc",
299 "--sharedstatedir=/usr/com",
300 "--with-terminfo-dirs=/usr/share/terminfo",
301 "--with-default-terminfo-dir=/usr/share/terminfo",
302 "--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib"%(getVersion(),),
305 ("ftp://invisible-island.net/ncurses//5.9/ncurses-5.9-20120616-patch.sh.bz2",
309 …install='make && make install DESTDIR=%s && cd %s/usr/local/lib && ln -fs ../../../Library/Framewo…
310 shellQuote(os.path.join(WORKDIR, 'libraries')),
311 shellQuote(os.path.join(WORKDIR, 'libraries')),
317 url="https://www.sqlite.org/2018/sqlite-autoconf-3220000.tar.gz",
319 extra_cflags=('-Os '
320 '-DSQLITE_ENABLE_FTS5 '
321 '-DSQLITE_ENABLE_FTS4 '
322 '-DSQLITE_ENABLE_FTS3_PARENTHESIS '
323 '-DSQLITE_ENABLE_JSON1 '
324 '-DSQLITE_ENABLE_RTREE '
325 '-DSQLITE_TCL=0 '
326 '%s' % ('','-DSQLITE_WITHOUT_ZONEMALLOC ')[LT_10_5]),
328 '--enable-threadsafe',
329 '--enable-shared=no',
330 '--enable-static=yes',
331 '--disable-readline',
332 '--disable-dependency-tracking',
341 url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz",
344 install='make install CC=%s CXX=%s, PREFIX=%s/usr/local/ CFLAGS="-arch %s"'%(
346 shellQuote(os.path.join(WORKDIR, 'libraries')),
347 ' -arch '.join(ARCHLIST),
352 url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
355 install='make install CC=%s CXX=%s, prefix=%s/usr/local/ CFLAGS="-arch %s"'%(
357 shellQuote(os.path.join(WORKDIR, 'libraries')),
358 ' -arch '.join(ARCHLIST),
364 url="http://ftp.gnu.org/pub/gnu/readline/readline-6.1.tar.gz" ,
370 ('http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-001',
372 ('http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-002',
382 url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz",
387 '--includedir=/usr/local/include/db4',
426 long_name="UNIX command-line tools",
461 postflight="scripts/postflight.patch-profile",
463 source="/empty-dir",
476 source="/empty-dir",
558 # 1. there is a user-installed framework (usually ActiveTcl) in (or linked
560 # enforce that the version of the user-installed framework also
561 # exists in the system-supplied Tcl/Tk frameworks. Time to support
581 print(" -- Building with external Tcl/Tk %s frameworks"
592 print(" -- Building private copy of Tcl/Tk")
615 # Ensure we have access to sphinx-build.
617 runCommand('sphinx-build --version')
623 global WORKDIR, DEPSRC, SRCDIR, DEPTARGET
633 [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=',
634 'dep-target=', 'universal-archs=', 'help' ])
645 if k in ('-h', '-?', '--help'):
649 elif k in ('-d', '--build-dir'):
650 WORKDIR=v
652 elif k in ('--third-party',):
655 elif k in ('--sdk-path',):
656 print(" WARNING: --sdk-path is no longer supported")
658 elif k in ('--src-dir',):
661 elif k in ('--dep-target', ):
665 elif k in ('--universal-archs', ):
680 WORKDIR=os.path.abspath(WORKDIR)
688 print("-- Settings:")
690 print(" * Build directory: %s" % WORKDIR)
691 print(" * Third-party source: %s" % DEPSRC)
697 print(" -- Building a Python %s framework at patch level %s"
710 the archive ends with "-src" but the uncompressed directory does not.
717 retval = os.path.basename(archiveName[:-7])
719 and retval.endswith('-src')):
720 retval = retval[:-4]
726 retval = os.path.basename(archiveName[:-8])
732 retval = os.path.basename(archiveName[:-4])
738 retval = os.path.basename(archiveName[:-4])
808 "i386": ["darwin-i386-cc"],
809 "x86_64": ["darwin64-x86_64-cc", "enable-ec_nistp_64_gcc_128"],
810 "ppc": ["darwin-ppc-cc"],
811 "ppc64": ["darwin64-ppc-cc"],
814 "no-idea",
815 "no-mdc2",
816 "no-rc5",
817 "no-zlib",
818 "no-ssl3",
819 # "enable-unit-test",
821 "--prefix=%s"%os.path.join("/", *FW_VERSION_PREFIX),
822 "--openssldir=%s"%os.path.join("/", *FW_SSL_DIRECTORY),
825 configure_opts.append("no-asm")
836 os.path.basename(srcdir) + "-universal")
858 # copy arch-independent files from last build into the basedir framework
867 # e.g. -> "1.0.0"
870 # e.g. -> "libcrypto.1.0.0.dylib"
873 # e.g. -> "libssl.1.0.0.dylib"
880 # merge the individual arch-dependent shared libs into a fat shared lib
886 runCommand("lipo -create -output " +
895 # and the versioned links so that the setup.py post-build import test
916 to customize this process, basically a poor-mans DarwinPorts.
928 archiveName = os.path.split(url)[-1]
936 buildDir=os.path.join(WORKDIR, '_bld')
940 workDir = extractArchive(buildDir, sourceArchive)
941 os.chdir(workDir)
951 runCommand('patch -p%s < %s'%(recipe.get('patchlevel', 1),
963 runCommand('bunzip2 -fk %s' % shellQuote(fn))
964 fn = fn[:-4]
973 "--prefix=/usr/local",
974 "--enable-static",
975 "--disable-shared",
976 #"CPP=gcc -arch %s -E"%(' -arch '.join(archList,),),
981 if '--disable-static' in args:
982 configure_args.remove('--enable-static')
983 if '--enable-shared' in args:
984 configure_args.remove('--disable-shared')
989 "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
990 "-I%s/usr/local/include"%(
993 ' -arch '.join(archList),
994 shellQuote(basedir)[1:-1],),
995 "LDFLAGS=-mmacosx-version-min=%s -L%s/usr/local/lib -arch %s"%(
997 shellQuote(basedir)[1:-1],
998 ' -arch '.join(archList)),
1002 "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
1003 "-I%s/usr/local/include"%(
1006 ' -arch '.join(archList),
1007 shellQuote(basedir)[1:-1],),
1020 # call special-case build recipe, e.g. for openssl
1034 Build our dependencies into $WORKDIR/libraries/usr/local
1039 universal = os.path.join(WORKDIR, 'libraries')
1053 rootDir = os.path.join(WORKDIR, '_root')
1071 buildDir = os.path.join(WORKDIR, '_bld', 'python')
1072 rootDir = os.path.join(WORKDIR, '_root')
1080 os.makedirs(os.path.join(rootDir, 'empty-dir'))
1091 os.environ['DYLD_LIBRARY_PATH'] = os.path.join(WORKDIR,
1094 runCommand("%s -C --enable-framework --enable-universalsdk=/ "
1095 "--with-universal-archs=%s "
1100 "LDFLAGS='-g -L%s/libraries/usr/local/lib' "
1101 "CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"%(
1104 (' ', '--with-computed-gotos ')[PYTHON_3],
1105 (' ', '--without-ensurepip ')[PYTHON_3],
1106 (' ', "--with-tcltk-includes='-I%s/libraries/usr/local/include'"%(
1107 shellQuote(WORKDIR)[1:-1],))[internalTk()],
1108 (' ', "--with-tcltk-libs='-L%s/libraries/usr/local/lib -ltcl8.6 -ltk8.6'"%(
1109 shellQuote(WORKDIR)[1:-1],))[internalTk()],
1110 shellQuote(WORKDIR)[1:-1],
1111 shellQuote(WORKDIR)[1:-1]))
1143 if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')):
1145 WORKDIR, 'libraries', 'Library', 'Frameworks',
1148 WORKDIR, '_root', 'Library', 'Frameworks',
1155 runCommand("rm -r %s/pkgconfig"%(
1175 os.chown(os.path.join(dirpath, dn), -1, gid)
1185 os.chown(p, -1, gid)
1190 data = captureCommand("otool -L %s" % shellQuote(p))
1217 config_suffix = '-' + LDVERSION
1219 config_suffix = config_suffix + '-darwin'
1225 # the end-users system. Also remove the directories from _sysconfigdata.py
1228 include_path = '-I%s/libraries/usr/local/include' % (WORKDIR,)
1229 lib_path = '-L%s/libraries/usr/local/lib' % (WORKDIR,)
1260 # XXX this is extra-fragile
1338 pkgname = '%s-%s'%(recipe['name'], getVersion())
1345 print("- building package %s"%(pkgname,))
1360 srcdir = os.path.join(WORKDIR, '_root', srcdir[1:])
1371 … runCommand("pax -wf %s . 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
1372 … runCommand("gzip -9 %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
1439 IFPkgFlagPackageLocation='%s-%s.pkg'%(item['name'], getVersion()),
1456 for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')):
1461 outdir = os.path.join(WORKDIR, 'installer')
1500 data = captureCommand("du -ks %s"%(
1501 shellQuote(os.path.join(WORKDIR, '_root'))))
1510 outdir = os.path.join(WORKDIR, 'diskimage')
1515 'python-%s-macosx%s'%(getFullVersion(),DEPTARGET))
1517 imagepath = imagepath + '-%04d-%02d-%02d'%(time.localtime()[:3])
1527 cmd = ("hdiutil create -format UDRW -volname %s -srcfolder %s -size 100m %s"%(
1529 shellQuote(os.path.join(WORKDIR, 'installer')),
1538 print(" -- retrying hdiutil create")
1543 if not os.path.exists(os.path.join(WORKDIR, "mnt")):
1544 os.mkdir(os.path.join(WORKDIR, "mnt"))
1545 runCommand("hdiutil attach %s -mountroot %s"%(
1546 shellQuote(imagepath + ".tmp.dmg"), shellQuote(os.path.join(WORKDIR, "mnt"))))
1550 os.path.join(WORKDIR, "mnt", volname, ".VolumeIcon.icns"))
1551 runCommand("SetFile -a C %s/"%(
1552 shellQuote(os.path.join(WORKDIR, "mnt", volname)),))
1554 runCommand("hdiutil detach %s"%(shellQuote(os.path.join(WORKDIR, "mnt", volname))))
1557 runCommand("hdiutil convert %s -format UDZO -o %s"%(
1579 runCommand("cc -o %s %s/seticon.m -framework Cocoa"%(
1594 if os.path.exists(WORKDIR):
1595 shutil.rmtree(WORKDIR)
1596 os.mkdir(WORKDIR)
1600 # Then build third-party libraries such as sleepycat DB4.
1611 # be (re-)installed.
1617 folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(
1624 patchScript("scripts/postflight.patch-profile", fn)
1635 os.path.join(WORKDIR, 'installer', 'ReadMe.rtf'))
1639 os.path.join(WORKDIR, 'installer', 'License.rtf'))
1641 fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w')