diff --git a/scripts/freeze.py b/scripts/freeze.py new file mode 100644 index 000000000..96350e804 --- /dev/null +++ b/scripts/freeze.py @@ -0,0 +1,56 @@ +#!/usr/bin/python +# Copyright 2014 Florian Bruhin (The Compiler) +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +"""cx_Freeze script for qutebrowser. + +Builds a standalone executable. +""" + + +import platform + +from cx_Freeze import setup, Executable + +from scripts.setupdata import setupdata + + +def get_egl_path(): + """Get the path for PyQt5's libEGL.dll.""" + bits = platform.architecture()[0] + if bits == '32bit': + return r'C:\Python33_x32\Lib\site-packages\PyQt5\libEGL.dll' + elif bits == '64bit': + return r'C:\Python33\Lib\site-packages\PyQt5\libEGL.dll' + else: + raise ValueError("Unknown architecture") + + +setup( + executables = [Executable('qutebrowser/__main__.py', base='Win32GUI', + targetName='qutebrowser.exe')], + options = { + 'build_exe': { + 'include_files': [ + (get_egl_path(), 'libEGL.dll'), + ('qutebrowser/html', 'html'), + ], + 'include_msvcr': True, + } + }, + **setupdata +) diff --git a/scripts/setupdata.py b/scripts/setupdata.py new file mode 100644 index 000000000..20e0b1dc9 --- /dev/null +++ b/scripts/setupdata.py @@ -0,0 +1,59 @@ +# Copyright 2014 Florian Bruhin (The Compiler) +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + + +"""Data used by setup.py and scripts/freeze.py""" + +import qutebrowser + + +def read_file(name): + with open(name, encoding='utf-8') as f: + return f.read() + + +setupdata = { + 'name': 'qutebrowser', + 'version': qutebrowser.__version__, + 'description': ("A keyboard-driven, vim-like browser based on PyQt5 and " + "QtWebKit."), + 'long_description': read_file('README'), + 'url': 'http://www.qutebrowser.org/', + 'author': "Florian Bruhin", + 'author_email': 'me@qutebrowser.org', + 'license': 'GPL', + 'classifiers': [ + 'Development Status :: 3 - Alpha', + 'Environment :: X11 Applications :: Qt', + 'Intended Audience :: End Users/Desktop', + 'License :: OSI Approved :: GNU General Public License v3 or later ' + '(GPLv3+)', + 'Natural Language :: English', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: Microsoft :: Windows :: Windows XP', + 'Operating System :: Microsoft :: Windows :: Windows 7', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Topic :: Internet', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Internet :: WWW/HTTP :: Browsers', + ], + 'keywords': 'pyqt browser web qt webkit', +} diff --git a/setup.py b/setup.py index 67982c15d..e1c855053 100644 --- a/setup.py +++ b/setup.py @@ -1,49 +1,37 @@ #!/usr/bin/python +# Copyright 2014 Florian Bruhin (The Compiler) +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +"""setuptools installer script for qutebrowser""" + + +from scripts.setupdata import setupdata from scripts.ez_setup import use_setuptools use_setuptools() - from setuptools import setup, find_packages -import qutebrowser -def read_file(name): - with open(name, encoding='utf-8') as f: - return f.read() setup( - name='qutebrowser', - version=qutebrowser.__version__, - description="A keyboard-driven, vim-like browser based on PyQt5 and " - "QtWebKit.", - long_description=read_file('README'), - url='http://www.qutebrowser.org/', - author="Florian Bruhin", - author_email='me@qutebrowser.org', - license='GPL', - classifiers = [ - 'Development Status :: 3 - Alpha', - 'Environment :: X11 Applications :: Qt', - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: GNU General Public License v3 or later ' - '(GPLv3+)', - 'Natural Language :: English', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: Microsoft :: Windows :: Windows XP', - 'Operating System :: Microsoft :: Windows :: Windows 7', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Topic :: Internet', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: Browsers', - ], - keywords='pyqt browser web qt webkit', packages=find_packages(exclude=['qutebrowser.test']), include_package_data=True, package_data={'qutebrowser': ['html/*']}, entry_points={'gui_scripts': ['qutebrowser = qutebrowser.__main__:main']}, test_suite='qutebrowser.test', zip_safe=True, + **setupdata )