Modified setup file
This commit is contained in:
parent
66f6f32916
commit
b4a0060756
106
src/setup.py
106
src/setup.py
@ -1,70 +1,46 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Setup file to create executables and distribute the source code of this application. Don't forget this file! """
|
import sys
|
||||||
############################################################
|
|
||||||
# Copyright (c) 2016 Manuel Eduardo Cortéz Vallejo <manuel@manuelcortez.net>
|
|
||||||
#
|
|
||||||
# This program 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 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
############################################################
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
import py2exe
|
|
||||||
import os
|
|
||||||
import platform
|
import platform
|
||||||
from glob import glob
|
import os
|
||||||
from requests import certs
|
|
||||||
|
|
||||||
def get_data():
|
|
||||||
return [
|
|
||||||
("", ["app-configuration.defaults", "libvlccore.dll", "libvlc.dll", "cacerts.txt"]),
|
|
||||||
("", [certs.where()]),
|
|
||||||
("plugins", glob("plugins/*/*.dll")),
|
|
||||||
]+get_locales()
|
|
||||||
|
|
||||||
def get_locales():
|
|
||||||
answer = []
|
|
||||||
for root, dirs, files in os.walk('locales'):
|
|
||||||
new = (root, glob(os.path.join(root, '*.mo')))
|
|
||||||
answer.append(new)
|
|
||||||
return answer
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
import i18n
|
import i18n
|
||||||
|
from cx_Freeze import setup, Executable
|
||||||
|
from babel.messages import frontend as babel
|
||||||
|
|
||||||
i18n.setup()
|
i18n.setup()
|
||||||
import application
|
import application
|
||||||
setup(
|
|
||||||
name = application.name,
|
def find_accessible_output2_datafiles():
|
||||||
author = application.author,
|
import accessible_output2
|
||||||
author_email = application.authorEmail,
|
path = os.path.join(accessible_output2.__path__[0], 'lib')
|
||||||
version = application.version,
|
dest_dir = os.path.join('accessible_output2', 'lib')
|
||||||
url = application.url,
|
return (path, dest_dir)
|
||||||
packages= find_packages(),
|
|
||||||
data_files = get_data(),
|
base = None
|
||||||
options = {
|
if sys.platform == 'win32':
|
||||||
'py2exe': {
|
base = 'Win32GUI'
|
||||||
'optimize':2,
|
|
||||||
'packages': ["pubsub", "pubsub.core", "pubsub.core.kwargs"],
|
build_exe_options = dict(
|
||||||
'dll_excludes': ["MPR.dll", "api-ms-win-core-apiquery-l1-1-0.dll", "api-ms-win-core-console-l1-1-0.dll", "api-ms-win-core-delayload-l1-1-1.dll", "api-ms-win-core-errorhandling-l1-1-1.dll", "api-ms-win-core-file-l1-2-0.dll", "api-ms-win-core-handle-l1-1-0.dll", "api-ms-win-core-heap-obsolete-l1-1-0.dll", "api-ms-win-core-libraryloader-l1-1-1.dll", "api-ms-win-core-localization-l1-2-0.dll", "api-ms-win-core-processenvironment-l1-2-0.dll", "api-ms-win-core-processthreads-l1-1-1.dll", "api-ms-win-core-profile-l1-1-0.dll", "api-ms-win-core-registry-l1-1-0.dll", "api-ms-win-core-synch-l1-2-0.dll", "api-ms-win-core-sysinfo-l1-2-0.dll", "api-ms-win-security-base-l1-2-0.dll", "api-ms-win-core-heap-l1-2-0.dll", "api-ms-win-core-interlocked-l1-2-0.dll", "api-ms-win-core-localization-obsolete-l1-1-0.dll", "api-ms-win-core-string-l1-1-0.dll", "api-ms-win-core-string-obsolete-l1-1-0.dll", "WLDAP32.dll", "MSVCP90.dll", "CRYPT32.dll"],
|
build_exe="dist",
|
||||||
# 'skip_archive': False
|
optimize=1,
|
||||||
},
|
include_msvcr=True,
|
||||||
},
|
zip_include_packages=["accessible_output2"],
|
||||||
windows = [
|
replace_paths = [("*", "")],
|
||||||
{
|
include_files=["app-configuration.defaults", "cacerts.txt", "locales", "plugins", "libvlc.dll", "libvlccore.dll", find_accessible_output2_datafiles()],
|
||||||
'script': 'main.py',
|
)
|
||||||
'dest_base': 'MusicDL',
|
|
||||||
}
|
executables = [
|
||||||
],
|
Executable('main.py', base=base, targetName="MusicDL")
|
||||||
install_requires = [
|
]
|
||||||
]
|
|
||||||
|
setup(name='musicDL',
|
||||||
|
version=application.version,
|
||||||
|
description=application.description,
|
||||||
|
# Register babel commands in setup file.
|
||||||
|
cmdclass = {'compile_catalog': babel.compile_catalog,
|
||||||
|
'extract_messages': babel.extract_messages,
|
||||||
|
'init_catalog': babel.init_catalog,
|
||||||
|
'update_catalog': babel.update_catalog},
|
||||||
|
message_extractors = {"musicdl": [('**.py', 'python', None)]},
|
||||||
|
options = {"build_exe": build_exe_options},
|
||||||
|
executables=executables
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user