Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2@file
3@brief Various functions to install `MinGW <http://www.mingw.org/>`_.
4"""
5from __future__ import print_function
6import sys
7import os
9from .install_custom import download_from_sourceforge
12def install_mingw(dest_folder=".", fLOG=print, install=True, version=None):
13 """
14 install `MinGW <http://www.mingw.org/>`_ (only on Windows)
16 @param dest_folder where to download the setup
17 @param fLOG logging function
18 @param install install (otherwise only download)
19 @param version version to install (unused)
20 @return temporary file
22 Packages to install:
23 * gcc
24 * g77 3.4.5
25 * binutils
26 * mingw-runtime
27 * w32api
28 * gcc-core - C compiler
29 * gcc-g++ - C++ compiler
30 * gcc-objc - Objective C compiler
31 * gcc-gfortran - Fortran 90/95 compiler
32 * gcc-java - Java compiler
33 * gcc-ada - Ada compiler
34 * mingw-gdb - Windows native build of GNU debugger
35 * mingw32-make - Windows native build of GNU make
36 * mingw-utils - Miscellaneous utilities
38 ::
40 mingw-get install binutils gcc g++ mingw32 fortran gdb mingw32 mingw w32api g77==3.4.5
42 """
43 if version is not None:
44 raise ValueError("cannot specify a version")
45 if not sys.platform.startswith("win"):
46 raise NotImplementedError(
47 "MinGW can only be installed on Windows at the moment")
49 name = "mingw-get-setup.exe"
50 newurl = "http://sourceforge.net/projects/mingw/files/Installer/{0}/download?use_mirror=autoselect".format(
51 name)
52 outfile = os.path.join(dest_folder, name)
53 fLOG("[pymy] mingw, download from ", newurl)
54 file = download_from_sourceforge(
55 newurl,
56 outfile,
57 fLOG=fLOG,
58 temp_folder=dest_folder)
60 if install:
61 raise NotImplementedError()
62 return file