forked from zserge/webview-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
75 lines (65 loc) · 2.07 KB
/
setup.py
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
69
70
71
72
73
74
75
import platform
import subprocess
from setuptools import Extension, setup
OSNAME = platform.system()
if OSNAME == 'Linux':
def pkgconfig(flags):
return subprocess.check_output(
'pkg-config {} gtk+-3.0 webkit2gtk-4.0'.format(flags),
shell=True,
stderr=subprocess.STDOUT).decode()
define_macros = [("WEBVIEW_GTK", '1')]
extra_cflags = pkgconfig("--cflags").split()
extra_ldflags = pkgconfig("--libs").split()
elif OSNAME == 'Darwin':
define_macros = [('WEBVIEW_COCOA', '1')]
extra_cflags = ['-std=c++11']
extra_ldflags = ['-framework', 'WebKit']
elif OSNAME == 'Windows':
define_macros = [('WEBVIEW_WINAPI', '1')]
extra_cflags = ['/std:c++17', '/Iwebview', '/Iwebview\\script']
extra_ldflags = [R'webview\script\microsoft.web.webview2.1.0.664.37\build\native\x64\WebView2Loader.dll.lib']
webview = Extension(
'webview',
sources=['webview.cpp'],
define_macros=define_macros,
extra_compile_args=extra_cflags,
extra_link_args=extra_ldflags,
)
setup(
name='webview',
version='0.1.5',
description='Python WebView bindings',
author='Serge Zaitsev',
author_email='zaitsev.serge@gmail.com',
url='https://github.com/zserge/webview',
keywords=[],
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python',
'Topic :: Desktop Environment',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: User Interfaces',
],
ext_modules=[webview],
py_modules=['pywebview'],
entry_points=dict(
gui_scripts=[
'pywv = pywebview:main',
],
),
extras_require=dict(
dev=[
'pip',
'setuptools',
'wheel',
],
),
)