-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_app.spec
68 lines (61 loc) · 2.5 KB
/
run_app.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- mode: python -*-
import os
from openal.al_lib import lib
import platform
from ctypes.util import find_library
from ctypes import CDLL, c_void_p, c_int, c_char_p, byref, cast, POINTER, Structure
import PyInstaller.depend.bindepend as bd
block_cipher = None
# Assumes that the libraries under Linux are a system-wide installed ones residing in the system-wide library directory
if platform.system() == "Linux" and platform.architecture()[0] == "64bit":
class LINKMAP(Structure):
_fields_ = [
("l_addr", c_void_p),
("l_name", c_char_p)
]
libdl = CDLL(find_library('dl'))
dlinfo = libdl.dlinfo
dlinfo.argtypes = c_void_p, c_int, c_void_p
dlinfo.restype = c_int
def get_full_path(lib_name):
if lib_name.endswith(".so"):
lib = CDLL(lib_name)
else:
lib = CDLL(find_library(lib_name))
lmptr = c_void_p()
#2 equals RTLD_DI_LINKMAP, pass pointer by reference
dlinfo(lib._handle, 2, byref(lmptr))
return cast(lmptr, POINTER(LINKMAP)).contents.l_name.decode("utf-8")
additional_libs = (get_full_path("openal"), get_full_path("mod_spatialite.so"), get_full_path("vorbisfile"))
elif platform.system() == "Windows":
additional_libs = (lib._name, find_library("mod_spatialite"), find_library("libvorbisfile"), find_library("libvorbis"), find_library("libogg"))
toc = [(os.path.basename(name), name, "BINARY") for name in additional_libs]
binaries = [(path, ".") for local_name, path, typ in toc]
a = Analysis(['run_app.py'],
pathex=['C:\\Users\\lukas\\projekty\\feel the streets', r'c:\python3\lib\site-packages\pygeodesy'],
binaries=binaries,
datas=[("app/sounds", "sounds"), ("locale", "locale"), ("*.yml", ".")],
hiddenimports=["pkg_resources.py2_warn"],
hookspath=["hooks"],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='fts',
debug=False,
strip=False,
upx=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name='fts')