-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathsetup.py
210 lines (186 loc) · 6 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File _name: setup.py
#
# VideoMorph - A PyQt6 frontend to ffmpeg.
# Copyright 2016-2022 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 pathlib import Path
from sys import platform
from videomorph.converter import (
APP_NAME,
CODENAME,
SYS_PATHS,
VERSION,
VM_PATHS,
)
try:
from setuptools import setup
USE_DISTUTILS = False
except ImportError:
from distutils.core import setup
USE_DISTUTILS = True
LONG_DESCRIPTION = """Video Converter based on ffmpeg, Python 3 and PyQt6.
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 + "-" + CODENAME.lower(),
description="Video Converter based on ffmpeg, "
"Python 3 and Qt6, 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", "darwin", "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"].__str__(),
[Path(VM_PATHS["apps"], "videomorph.desktop").__str__()],
),
# App icon
(
SYS_PATHS["icons"].__str__(),
[Path(VM_PATHS["icons"], "videomorph.png").__str__()],
),
# App sounds
(
SYS_PATHS["sounds"].__str__(),
[Path(VM_PATHS["sounds"], "successful.wav").__str__()],
),
# App translation file
(
SYS_PATHS["i18n"].__str__(),
[Path(VM_PATHS["i18n"], "videomorph_es.qm").__str__()],
),
# Default conversion profiles
(
SYS_PATHS["profiles"].__str__(),
[
Path(VM_PATHS["profiles"], "default.xml").__str__(),
Path(VM_PATHS["profiles"], "customized.xml").__str__(),
],
),
# Documentation files
(
SYS_PATHS["doc"].__str__(),
[
"README.md",
"LICENSE",
"requirements.txt",
"copyright",
"changelog.gz",
"TODO",
"screenshot.png",
],
),
# User's manual
(
SYS_PATHS["help"].__str__(),
[
Path(VM_PATHS["help"], "manual_es.pdf").__str__(),
Path(VM_PATHS["help"], "manual_en.pdf").__str__(),
],
),
# Man page
(
SYS_PATHS["man"].__str__(),
[Path(VM_PATHS["man"], "videomorph.1.gz").__str__()],
),
]
)
LINUX_DISTUTILS = dict(scripts=[Path(VM_PATHS["bin"], "videomorph").__str__()])
DARWIN_DATA_FILES = LINUX_DATA_FILES
DARWIN_DISTUTILS = LINUX_DISTUTILS
WIN32_DATA_FILES = dict(
data_files=[ # App icon
(
SYS_PATHS["icons"].__str__(),
[Path(VM_PATHS["icons"], "videomorph.ico").__str__()],
),
# App sounds
(
SYS_PATHS["sounds"].__str__(),
[Path(VM_PATHS["sounds"], "successful.wav").__str__()],
),
# App translation file
(
SYS_PATHS["i18n"].__str__(),
[Path(VM_PATHS["i18n"], "videomorph_es.qm").__str__()],
),
# Default conversion profiles
(
SYS_PATHS["profiles"].__str__(),
[
Path(VM_PATHS["profiles"], "default.xml").__str__(),
Path(VM_PATHS["profiles"], "customized.xml").__str__(),
],
),
# Documentation files
(
SYS_PATHS["doc"].__str__(),
[
"README.md",
"LICENSE",
"requirements.txt",
"copyright",
"changelog.gz",
"TODO",
"screenshot.png",
],
),
# User's manual
(
SYS_PATHS["help"].__str__(),
[
Path(VM_PATHS["help"], "manual_es.pdf").__str__(),
Path(VM_PATHS["help"], "manual_en.pdf").__str__(),
],
),
]
)
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 == "darwin":
SETUP_PARAMS.update(DARWIN_DATA_FILES)
if USE_DISTUTILS:
SETUP_PARAMS.update(DARWIN_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)