Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
178
Issues
178
List
Boards
Labels
Milestones
Merge Requests
49
Merge Requests
49
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
485e8526
Commit
485e8526
authored
Dec 24, 2018
by
Laurent Bachelier
🐧
Committed by
Romain Bignon
Dec 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup: Building Qt applications is now in a command
parent
ee68ad24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
32 deletions
+50
-32
setup.py
setup.py
+50
-32
No files found.
setup.py
View file @
485e8526
...
...
@@ -24,39 +24,52 @@ import glob
import
os
import
subprocess
import
sys
from
distutils.cmd
import
Command
from
distutils.log
import
WARN
from
setuptools
import
find_packages
,
setup
def
find_executable
(
name
,
names
):
envname
=
'
%
s_EXECUTABLE'
%
name
.
upper
()
if
os
.
getenv
(
envname
):
return
os
.
getenv
(
envname
)
paths
=
os
.
getenv
(
'PATH'
,
os
.
defpath
)
.
split
(
os
.
pathsep
)
exts
=
os
.
getenv
(
'PATHEXT'
,
os
.
pathsep
)
.
split
(
os
.
pathsep
)
for
name
in
names
:
for
path
in
paths
:
for
ext
in
exts
:
fpath
=
os
.
path
.
join
(
path
,
name
)
+
ext
if
os
.
path
.
exists
(
fpath
)
and
os
.
access
(
fpath
,
os
.
X_OK
):
return
fpath
print
(
'Could not find executable:
%
s'
%
name
,
file
=
sys
.
stderr
)
def
build_qt
():
print
(
'Building Qt applications...'
,
file
=
sys
.
stderr
)
make
=
find_executable
(
'make'
,
(
'gmake'
,
'make'
))
pyuic5
=
find_executable
(
'pyuic5'
,
(
'python2-pyuic5'
,
'pyuic5-python2.7'
,
'pyuic5'
))
if
not
pyuic5
or
not
make
:
print
(
'Install missing component(s) (see above) or disable Qt applications (with --no-qt).'
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
subprocess
.
check_call
(
[
make
,
'-f'
,
'build.mk'
,
'-s'
,
'-j2'
,
'all'
,
'PYUIC=
%
s
%
s'
%
(
pyuic5
,
' WIN32=1'
if
sys
.
platform
==
'win32'
else
''
)])
class
BuildQt
(
Command
):
description
=
'build Qt applications'
user_options
=
[]
def
initialize_options
(
self
):
pass
def
finalize_options
(
self
):
pass
def
run
(
self
):
self
.
announce
(
'Building Qt applications...'
,
WARN
)
make
=
self
.
find_executable
(
'make'
,
(
'gmake'
,
'make'
))
pyuic5
=
self
.
find_executable
(
'pyuic5'
,
(
'python2-pyuic5'
,
'pyuic5-python2.7'
,
'pyuic5'
))
if
not
pyuic5
or
not
make
:
print
(
'Install missing component(s) (see above) or disable Qt applications (with --no-qt).'
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
subprocess
.
check_call
(
[
make
,
'-f'
,
'build.mk'
,
'-s'
,
'-j2'
,
'all'
,
'PYUIC=
%
s
%
s'
%
(
pyuic5
,
' WIN32=1'
if
sys
.
platform
==
'win32'
else
''
)])
@
staticmethod
def
find_executable
(
name
,
names
):
envname
=
'
%
s_EXECUTABLE'
%
name
.
upper
()
if
os
.
getenv
(
envname
):
return
os
.
getenv
(
envname
)
paths
=
os
.
getenv
(
'PATH'
,
os
.
defpath
)
.
split
(
os
.
pathsep
)
exts
=
os
.
getenv
(
'PATHEXT'
,
os
.
pathsep
)
.
split
(
os
.
pathsep
)
for
name
in
names
:
for
path
in
paths
:
for
ext
in
exts
:
fpath
=
os
.
path
.
join
(
path
,
name
)
+
ext
if
os
.
path
.
exists
(
fpath
)
and
os
.
access
(
fpath
,
os
.
X_OK
):
return
fpath
print
(
'Could not find executable:
%
s'
%
name
,
file
=
sys
.
stderr
)
def
install_weboob
():
...
...
@@ -75,9 +88,7 @@ def install_weboob():
'qbooblyrics'
,
'qhandjoob'
))
if
options
.
qt
:
build_qt
()
else
:
if
not
options
.
qt
:
scripts
=
scripts
-
qt_scripts
qt_packages
=
set
((
...
...
@@ -172,6 +183,9 @@ def install_weboob():
'xunitparser'
,
'coverage'
,
],
cmdclass
=
{
'build_qt'
:
BuildQt
,
},
)
...
...
@@ -208,6 +222,10 @@ elif '--no-xdg' in args:
args
.
remove
(
'--no-xdg'
)
if
options
.
qt
:
args
.
insert
(
0
,
'build_qt'
)
sys
.
argv
=
[
sys
.
argv
[
0
]]
+
args
install_weboob
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment