forked from videomorph-dev/videomorph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
144 lines (123 loc) · 4.95 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File _name: setup.py
#
# VideoMorph - A PyQt5 frontend to ffmpeg.
# Copyright 2016-2017 VideoMorph Development Team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""This module defines the installation script for VideoMorph."""
from sys import platform
try:
from setuptools import setup
USE_DISTUTILS = False
except ImportError:
from distutils.core import setup
USE_DISTUTILS = True
from videomorph.converter import VERSION
from videomorph.converter import APP_NAME
from videomorph.converter import VM_PATHS
from videomorph.converter import SYS_PATHS
LONG_DESCRIPTION = """Video Converter based on ffmpeg, Python 3 and PyQt5.
Unlike other video converters, VideoMorph focuses on a single goal:
make video conversion simple, with an easy to use GUI and allowing
the user to convert to the currently most popular video formats.
.
VideoMorph GUI is simple and clean, focused on usability, eliminating
annoying options rarely used.
VideoMorph is a video converter, just that. If you want a video editor,
VideoMorph isn't for you."""
COMMONS = dict(name=APP_NAME.lower(),
version=VERSION,
description='Video Converter based on ffmpeg, '
'Python 3 and Qt5, focused on usability.',
long_description=LONG_DESCRIPTION,
author='Ozkar L. Garcell',
author_email='[email protected]',
maintainer='Leodanis Pozo Ramos',
maintainer_email='[email protected]',
url='https://github.com/videomorph-dev/videomorph',
license='Apache License, Version 2.0',
packages=['videomorph',
'videomorph.converter',
'videomorph.forms'],
platforms=['linux', 'win32'],
keywords='multimedia, video conversion, common video formats')
COMMONS_SETUPTOOLS = dict(
entry_points={'gui_scripts': ['videomorph = videomorph.main:main']})
LINUX_DATA_FILES = dict(
data_files=[ # Desktop entry
(SYS_PATHS.apps,
[VM_PATHS.apps + '/videomorph.desktop']),
# App icon
(SYS_PATHS.icons,
[VM_PATHS.icons + '/videomorph.png']),
# App translation file
(SYS_PATHS.i18n,
[VM_PATHS.i18n + '/videomorph_es.qm']),
# Default conversion profiles
(SYS_PATHS.profiles,
[VM_PATHS.profiles + '/default.xml',
VM_PATHS.profiles + '/customized.xml']),
# Documentation files
(SYS_PATHS.doc,
['README.md', 'LICENSE', 'AUTHORS', 'INSTALL', 'VERSION',
'copyright', 'changelog.gz', 'TODO', 'screenshot.png']),
# User's manual
(SYS_PATHS.help,
[VM_PATHS.help + '/manual_es.pdf',
VM_PATHS.help + '/manual_en.pdf']),
# Man page
(SYS_PATHS.man,
[VM_PATHS.man + '/videomorph.1.gz'])])
LINUX_DISTUTILS = dict(scripts=[VM_PATHS.bin + '/videomorph'])
WIN32_DATA_FILES = dict(
data_files=[ # App icon
(SYS_PATHS.icons,
[VM_PATHS.icons + '/videomorph.ico']),
# App translation file
(SYS_PATHS.i18n,
[VM_PATHS.i18n + '/videomorph_es.qm']),
# Default conversion profiles
(SYS_PATHS.profiles,
[VM_PATHS.profiles + '/default.xml',
VM_PATHS.profiles + '/customized.xml']),
# Documentation files
(SYS_PATHS.doc,
['README.md', 'LICENSE', 'AUTHORS', 'INSTALL', 'VERSION',
'copyright', 'changelog.gz', 'TODO', 'screenshot.png']),
# User's manual
(SYS_PATHS.help,
[VM_PATHS.help + '/manual_es.pdf',
VM_PATHS.help + '/manual_en.pdf'])])
SETUP_PARAMS = COMMONS
if platform == 'linux':
SETUP_PARAMS.update(LINUX_DATA_FILES)
if USE_DISTUTILS:
SETUP_PARAMS.update(LINUX_DISTUTILS)
else:
SETUP_PARAMS.update(COMMONS_SETUPTOOLS)
elif platform == 'win32':
SETUP_PARAMS.update(WIN32_DATA_FILES)
if not USE_DISTUTILS:
SETUP_PARAMS.update(COMMONS_SETUPTOOLS)
if __name__ == '__main__':
setup(**SETUP_PARAMS)
# if platform == 'win32':
# import os
# from sys import prefix
# from os.path import exists
# from os.path import expandvars
# from os.path import join as join_path
#
# exe_path = join_path(prefix, 'Scripts', APP_NAME.lower() + '.exe')
# if exists(exe_path):
# os.link(source=exe_path, link_name=APP_NAME + VERSION)