source: setup.py@ 720:09e2087e55b5

cef
Last change on this file since 720:09e2087e55b5 was 720:09e2087e55b5, checked in by István Váradi <ivaradi@…>, 8 years ago

Added some missing files to the distribution (re #279).

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