[20] | 1 | # -*- coding: iso-8859-2 -*-
|
---|
| 2 |
|
---|
| 3 | import sys
|
---|
| 4 | import os
|
---|
| 5 | from glob import glob
|
---|
| 6 | from distutils.core import setup
|
---|
| 7 |
|
---|
[37] | 8 | scriptdir=os.path.dirname(sys.argv[0])
|
---|
| 9 | sys.path.insert(0, os.path.join(scriptdir, "src"))
|
---|
[20] | 10 |
|
---|
[27] | 11 | import mlx.const
|
---|
[37] | 12 | import mlx.update
|
---|
[20] | 13 |
|
---|
[137] | 14 | data_files = [("sounds", glob(os.path.join("sounds", "*.*")))]
|
---|
[287] | 15 | for language in ["en", "hu"]:
|
---|
| 16 | data_files.append((os.path.join("doc", "manual", language),
|
---|
| 17 | glob(os.path.join("doc", "manual", language, "*.*"))))
|
---|
| 18 | data_files.append((os.path.join("locale", language, "LC_MESSAGES"),
|
---|
| 19 | [os.path.join("locale", language, "LC_MESSAGES",
|
---|
| 20 | "mlx.mo")]))
|
---|
[281] | 21 | data_files.append(("", ["logo.png",
|
---|
| 22 | "conn_grey.png", "conn_red.png", "conn_green.png"]))
|
---|
[20] | 23 | if os.name=="nt":
|
---|
| 24 | import py2exe
|
---|
| 25 |
|
---|
[28] | 26 | data_files.append(("", ["logo.ico"]))
|
---|
[27] | 27 |
|
---|
[20] | 28 | msvcrDir = os.environ["MSVCRDIR"] if "MSVCRDIR" in os.environ else None
|
---|
| 29 | if msvcrDir:
|
---|
[653] | 30 | data_files.append(("Microsoft.VC90.CRT", glob(os.path.join(msvcrDir, "*.*"))))
|
---|
| 31 | os.environ["PATH"] = os.environ["PATH"] + ";" + glob(os.path.join(msvcrDir))[0]
|
---|
[20] | 32 |
|
---|
| 33 | gtkRuntimeDir = os.environ["GTKRTDIR"] if "GTKRTDIR" in os.environ else None
|
---|
| 34 | if gtkRuntimeDir:
|
---|
| 35 | path = os.path.join("lib", "gtk-2.0", "2.10.0", "engines")
|
---|
[37] | 36 | data_files.append((os.path.join("library", path),
|
---|
| 37 | [os.path.join(gtkRuntimeDir, path, "libwimp.dll")]))
|
---|
[20] | 38 |
|
---|
| 39 | path = os.path.join("share", "themes", "MS-Windows", "gtk-2.0")
|
---|
[37] | 40 | data_files.append((os.path.join("library", path),
|
---|
| 41 | glob(os.path.join(gtkRuntimeDir, path, "*"))))
|
---|
[373] | 42 |
|
---|
[159] | 43 | path = os.path.join("share", "locale", "hu", "LC_MESSAGES")
|
---|
| 44 | data_files.append((os.path.join("library", path),
|
---|
| 45 | glob(os.path.join(gtkRuntimeDir, path, "*"))))
|
---|
| 46 | path = os.path.join("share", "icons", "hicolor")
|
---|
| 47 | data_files.append((os.path.join("library", path),
|
---|
| 48 | glob(os.path.join(gtkRuntimeDir, path, "*"))))
|
---|
[373] | 49 |
|
---|
[653] | 50 | cefDir = os.environ.get("CEFDIR")
|
---|
| 51 | if cefDir:
|
---|
| 52 | for fileName in ["icudt.dll", "subprocess.exe"]:
|
---|
| 53 | data_files.append(("", [os.path.join(cefDir, fileName)]))
|
---|
| 54 |
|
---|
| 55 | data_files.append(("locales",
|
---|
| 56 | glob(os.path.join(cefDir, "locales", "*"))))
|
---|
| 57 |
|
---|
| 58 | print data_files
|
---|
| 59 |
|
---|
[20] | 60 | with open("mlx-common.nsh", "wt") as f:
|
---|
[27] | 61 | print >>f, '!define MLX_VERSION "%s"' % (mlx.const.VERSION)
|
---|
[20] | 62 | f.close()
|
---|
| 63 |
|
---|
| 64 | long_description="""MAVA Logger X
|
---|
| 65 |
|
---|
| 66 | This is a program to log and evaluate the actions
|
---|
| 67 | of a pilot flying a virtual Malév flight operated
|
---|
| 68 | by MAVA."""
|
---|
| 69 |
|
---|
| 70 | setup(name = "mlx",
|
---|
[27] | 71 | version = mlx.const.VERSION,
|
---|
[20] | 72 | description = "MAVA Logger X",
|
---|
| 73 | long_description = long_description,
|
---|
| 74 | author = "István Váradi",
|
---|
| 75 | author_email = "ivaradi@gmail.com",
|
---|
| 76 | url = "http://mlx.varadiistvan.hu",
|
---|
| 77 | package_dir = { "" : "src" },
|
---|
[28] | 78 | packages = ["mlx", "mlx.gui"],
|
---|
[497] | 79 | requires = ["pyuipc", "xplra"],
|
---|
[27] | 80 | windows = [{ "script" : "runmlx.py",
|
---|
[36] | 81 | "icon_resources" : [(1, "logo.ico")]},
|
---|
| 82 | { "script" : "mlxupdate.py",
|
---|
| 83 | "uac_info" : "requireAdministrator"}],
|
---|
[37] | 84 | options = { "py2exe" : { "includes": "gio, pango, atk, pangocairo",
|
---|
| 85 | "skip_archive": True} },
|
---|
| 86 | zipfile = "library/.",
|
---|
[20] | 87 | data_files = data_files,
|
---|
| 88 | platforms = ["Win32", "Linux"],
|
---|
| 89 | license = "Public Domain"
|
---|
| 90 | )
|
---|
[37] | 91 |
|
---|
| 92 | if os.name=="nt":
|
---|
[654] | 93 | os.rename(os.path.join(scriptdir, "dist", "library", "libcef.dll"),
|
---|
| 94 | os.path.join(scriptdir, "dist", "libcef.dll"))
|
---|
[37] | 95 | mlx.update.buildManifest(os.path.join(scriptdir, "dist"))
|
---|
[378] | 96 | with open(os.path.join(scriptdir, "dist", "Uninstall.conf"), "wt") as f:
|
---|
| 97 | print >> f, "StartMenuFolder=MAVA Logger X"
|
---|
| 98 | print >> f, "LinkName=MAVA Logger X"
|
---|