parser = argparse.ArgumentParser(description=HELP) if IS_LINUX: parser.add_argument('build_dir') return parser.parse_args() args = parse_args() DIR = os.path.dirname(os.path.abspath(__file__)) INSTALLERS_DIR = os.path.join(DIR, 'installers') REQUIREMENTS = os.path.join(DIR, 'requirements.txt') DRIVE_C = 'C:\\' SITE_PACKAGES = os.path.join(DRIVE_C, 'Python27', 'Lib', 'site-packages') SEVEN_ZIP = os.path.join(DRIVE_C, 'Program Files (x86)', '7-Zip', '7z.exe') if IS_LINUX: BUILD_DIR = args.build_dir utils.confirm_overwrite(BUILD_DIR) os.environ['WINEPREFIX'] = BUILD_DIR DRIVE_C_REAL = os.path.join(BUILD_DIR, 'drive_c') PYTHON = ['wine', os.path.join(DRIVE_C_REAL, 'Python27', 'python.exe')] else: DRIVE_C_REAL = DRIVE_C PYTHON = [os.path.join(DRIVE_C,'Python27', 'python.exe')] INSTALLERS = [ ('http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920.exe?r=&ts=1384687929&use_mirror=netcologne', '7z920.exe'), ('https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi', 'python-2.7.12.msi'), ('http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-all-in-one-2.24.2.win32-py2.7.msi', 'pygtk-all-in-one-2.24.2.win32-py2.7.msi'),
DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(DIR) DIST_DIR = os.path.abspath(args.dist_dir) DRIVE_C = os.path.join(DIST_DIR, 'drive_c') BUILD_DIR = os.path.abspath(args.build_dir) assert os.path.exists(BUILD_DIR), BUILD_DIR WINE_RN_DIR = os.path.join(DRIVE_C, 'rednotebook') SPEC = os.path.join(BASE_DIR, 'win', 'rednotebook.spec') WINE_BUILD = os.path.join(DRIVE_C, 'build') WINE_DIST = os.path.join(DRIVE_C, 'dist') LOCALE_DIR = os.path.join(WINE_DIST, 'share', 'locale') WINE_RN_EXE = os.path.join(WINE_DIST, 'rednotebook.exe') WINE_PYTHON = os.path.join(DRIVE_C, 'Python34', 'python.exe') utils.confirm_overwrite(DIST_DIR) os.environ['WINEPREFIX'] = DIST_DIR utils.ensure_path(os.path.dirname(DIST_DIR)) print('Start copying {} to {}'.format(BUILD_DIR, DIST_DIR)) utils.fast_copytree(BUILD_DIR, DIST_DIR) print('Finished copying') archive = '/tmp/rednotebook-archive.tar' stash_name = utils.get_output(['git', 'stash', 'create'], cwd=BASE_DIR) stash_name = stash_name or 'HEAD' run(['git', 'archive', stash_name, '-o', archive], cwd=BASE_DIR) utils.ensure_path(WINE_RN_DIR) run(['tar', '-xf', archive], cwd=WINE_RN_DIR) os.mkdir(os.path.join(DRIVE_C, 'Python34/share')) shutil.copytree(
parser.add_argument('build_dir') return parser.parse_args() args = parse_args() DIR = os.path.dirname(os.path.abspath(__file__)) INSTALLERS_DIR = os.path.join(DIR, 'installers') REQUIREMENTS = os.path.join(DIR, 'requirements.txt') DRIVE_C = 'C:\\' PYTHON_DIR = 'Python34' SITE_PACKAGES = os.path.join(DRIVE_C, PYTHON_DIR, 'Lib', 'site-packages') SEVEN_ZIP = os.path.join(DRIVE_C, 'Program Files (x86)', '7-Zip', '7z.exe') if USE_WINE: BUILD_DIR = args.build_dir utils.confirm_overwrite(BUILD_DIR) os.environ['WINEPREFIX'] = BUILD_DIR DRIVE_C_REAL = os.path.join(BUILD_DIR, 'drive_c') PYTHON = ['wine', os.path.join(DRIVE_C_REAL, PYTHON_DIR, 'python.exe')] else: DRIVE_C_REAL = DRIVE_C PYTHON = [os.path.join(DRIVE_C, PYTHON_DIR, 'python.exe')] INSTALLERS = [ #('http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920.exe?r=&ts=1384687929&use_mirror=netcologne', # '7z920.exe'), # Python 3.5 and 3.6 not supported by PyGObject AIO package. Also, # Python 3.5 needs wine-staging >= 2.8 and Python 3.6 fails for wine-staging 2.8. # Python 3.4.4 is the last version of 3.4 with an installer. # Python 3.4.4 works with wine-staging 2.14. # Windows 7 makes distributing Python >= 3.5 easier (https://pyinstaller.readthedocs.io/en/stable/usage.html#platform-specific-notes-windows)
DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(DIR) DIST_DIR = os.path.abspath(args.dist_dir) DRIVE_C = os.path.join(DIST_DIR, 'drive_c') BUILD_DIR = os.path.abspath(args.build_dir) assert os.path.exists(BUILD_DIR), BUILD_DIR WINE_RN_DIR = os.path.join(DRIVE_C, 'rednotebook') SPEC = os.path.join(BASE_DIR, 'win', 'rednotebook.spec') WINE_BUILD = os.path.join(DRIVE_C, 'build') WINE_DIST = os.path.join(DRIVE_C, 'dist') LOCALE_DIR = os.path.join(WINE_DIST, 'share', 'locale') WINE_RN_EXE = os.path.join(WINE_DIST, 'rednotebook.exe') WINE_PYTHON = os.path.join(DRIVE_C, 'Python34', 'python.exe') utils.confirm_overwrite(DIST_DIR) os.environ['WINEPREFIX'] = DIST_DIR utils.ensure_path(os.path.dirname(DIST_DIR)) print('Start copying {} to {}'.format(BUILD_DIR, DIST_DIR)) utils.fast_copytree(BUILD_DIR, DIST_DIR) print('Finished copying') archive = '/tmp/rednotebook-archive.tar' stash_name = utils.get_output(['git', 'stash', 'create'], cwd=BASE_DIR) stash_name = stash_name or 'HEAD' run(['git', 'archive', stash_name, '-o', archive], cwd=BASE_DIR) utils.ensure_path(WINE_RN_DIR) run(['tar', '-xf', archive], cwd=WINE_RN_DIR) os.mkdir(os.path.join(DRIVE_C, 'Python34/share')) shutil.copytree(os.path.join(DRIVE_C, 'Python34/Lib/site-packages/gnome/share/gir-1.0/'), os.path.join(DRIVE_C, 'Python34/share/gir-1.0/'))