Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7a08ce7e
Commit
7a08ce7e
authored
Nov 21, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{android,win32}/build.py: move class Project to build/project.py
parent
86486336
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
106 deletions
+62
-106
build.py
android/build.py
+1
-53
project.py
python/build/project.py
+60
-0
build.py
win32/build.py
+1
-53
No files found.
android/build.py
View file @
7a08ce7e
...
...
@@ -110,59 +110,7 @@ class AndroidNdkToolchain:
# default one on the build host
self
.
env
[
'PKG_CONFIG_LIBDIR'
]
=
os
.
path
.
join
(
install_prefix
,
'lib/pkgconfig'
)
from
build.download
import
download_and_verify
from
build.tar
import
untar
class
Project
:
def
__init__
(
self
,
url
,
md5
,
installed
,
name
=
None
,
version
=
None
,
base
=
None
,
use_cxx
=
False
,
use_clang
=
False
):
if
base
is
None
:
basename
=
os
.
path
.
basename
(
url
)
m
=
re
.
match
(
r'^(.+)\.(tar(\.(gz|bz2|xz|lzma))?|zip)$'
,
basename
)
if
not
m
:
raise
self
.
base
=
m
.
group
(
1
)
else
:
self
.
base
=
base
if
name
is
None
or
version
is
None
:
m
=
re
.
match
(
r'^([-\w]+)-(\d[\d.]*[a-z]?)$'
,
self
.
base
)
if
name
is
None
:
name
=
m
.
group
(
1
)
if
version
is
None
:
version
=
m
.
group
(
2
)
self
.
name
=
name
self
.
version
=
version
self
.
url
=
url
self
.
md5
=
md5
self
.
installed
=
installed
self
.
use_cxx
=
use_cxx
self
.
use_clang
=
use_clang
def
download
(
self
,
toolchain
):
return
download_and_verify
(
self
.
url
,
self
.
md5
,
toolchain
.
tarball_path
)
def
is_installed
(
self
,
toolchain
):
tarball
=
self
.
download
(
toolchain
)
installed
=
os
.
path
.
join
(
toolchain
.
install_prefix
,
self
.
installed
)
tarball_mtime
=
os
.
path
.
getmtime
(
tarball
)
try
:
return
os
.
path
.
getmtime
(
installed
)
>=
tarball_mtime
except
FileNotFoundError
:
return
False
def
unpack
(
self
,
toolchain
):
return
untar
(
self
.
download
(
toolchain
),
toolchain
.
src_path
,
self
.
base
)
def
make_build_path
(
self
,
toolchain
):
path
=
os
.
path
.
join
(
toolchain
.
build_path
,
self
.
base
)
try
:
shutil
.
rmtree
(
path
)
except
FileNotFoundError
:
pass
os
.
makedirs
(
path
,
exist_ok
=
True
)
return
path
from
build.project
import
Project
class
AutotoolsProject
(
Project
):
def
__init__
(
self
,
url
,
md5
,
installed
,
configure_args
=
[],
...
...
python/build/project.py
0 → 100644
View file @
7a08ce7e
import
os
,
shutil
import
re
from
build.download
import
download_and_verify
from
build.tar
import
untar
class
Project
:
def
__init__
(
self
,
url
,
md5
,
installed
,
name
=
None
,
version
=
None
,
base
=
None
,
use_cxx
=
False
,
use_clang
=
False
):
if
base
is
None
:
basename
=
os
.
path
.
basename
(
url
)
m
=
re
.
match
(
r'^(.+)\.(tar(\.(gz|bz2|xz|lzma))?|zip)$'
,
basename
)
if
not
m
:
raise
self
.
base
=
m
.
group
(
1
)
else
:
self
.
base
=
base
if
name
is
None
or
version
is
None
:
m
=
re
.
match
(
r'^([-\w]+)-(\d[\d.]*[a-z]?)$'
,
self
.
base
)
if
name
is
None
:
name
=
m
.
group
(
1
)
if
version
is
None
:
version
=
m
.
group
(
2
)
self
.
name
=
name
self
.
version
=
version
self
.
url
=
url
self
.
md5
=
md5
self
.
installed
=
installed
self
.
use_cxx
=
use_cxx
self
.
use_clang
=
use_clang
def
download
(
self
,
toolchain
):
return
download_and_verify
(
self
.
url
,
self
.
md5
,
toolchain
.
tarball_path
)
def
is_installed
(
self
,
toolchain
):
tarball
=
self
.
download
(
toolchain
)
installed
=
os
.
path
.
join
(
toolchain
.
install_prefix
,
self
.
installed
)
tarball_mtime
=
os
.
path
.
getmtime
(
tarball
)
try
:
return
os
.
path
.
getmtime
(
installed
)
>=
tarball_mtime
except
FileNotFoundError
:
return
False
def
unpack
(
self
,
toolchain
,
out_of_tree
=
True
):
if
out_of_tree
:
parent_path
=
toolchain
.
src_path
else
:
parent_path
=
toolchain
.
build_path
return
untar
(
self
.
download
(
toolchain
),
parent_path
,
self
.
base
)
def
make_build_path
(
self
,
toolchain
):
path
=
os
.
path
.
join
(
toolchain
.
build_path
,
self
.
base
)
try
:
shutil
.
rmtree
(
path
)
except
FileNotFoundError
:
pass
os
.
makedirs
(
path
,
exist_ok
=
True
)
return
path
win32/build.py
View file @
7a08ce7e
...
...
@@ -58,59 +58,7 @@ class CrossGccToolchain:
# default one on the build host
self
.
env
[
'PKG_CONFIG_LIBDIR'
]
=
os
.
path
.
join
(
install_prefix
,
'lib/pkgconfig'
)
from
build.download
import
download_and_verify
from
build.tar
import
untar
class
Project
:
def
__init__
(
self
,
url
,
md5
,
installed
,
name
=
None
,
version
=
None
,
base
=
None
):
if
base
is
None
:
basename
=
os
.
path
.
basename
(
url
)
m
=
re
.
match
(
r'^(.+)\.(tar(\.(gz|bz2|xz|lzma))?|zip)$'
,
basename
)
if
not
m
:
raise
self
.
base
=
m
.
group
(
1
)
else
:
self
.
base
=
base
if
name
is
None
or
version
is
None
:
m
=
re
.
match
(
r'^([-\w]+)-(\d[\d.]*[a-z]?)$'
,
self
.
base
)
if
name
is
None
:
name
=
m
.
group
(
1
)
if
version
is
None
:
version
=
m
.
group
(
2
)
self
.
name
=
name
self
.
version
=
version
self
.
url
=
url
self
.
md5
=
md5
self
.
installed
=
installed
def
download
(
self
,
toolchain
):
return
download_and_verify
(
self
.
url
,
self
.
md5
,
toolchain
.
tarball_path
)
def
is_installed
(
self
,
toolchain
):
tarball
=
self
.
download
(
toolchain
)
installed
=
os
.
path
.
join
(
toolchain
.
install_prefix
,
self
.
installed
)
tarball_mtime
=
os
.
path
.
getmtime
(
tarball
)
try
:
return
os
.
path
.
getmtime
(
installed
)
>=
tarball_mtime
except
FileNotFoundError
:
return
False
def
unpack
(
self
,
toolchain
,
out_of_tree
=
True
):
if
out_of_tree
:
parent_path
=
toolchain
.
src_path
else
:
parent_path
=
toolchain
.
build_path
return
untar
(
self
.
download
(
toolchain
),
parent_path
,
self
.
base
)
def
make_build_path
(
self
,
toolchain
):
path
=
os
.
path
.
join
(
toolchain
.
build_path
,
self
.
base
)
try
:
shutil
.
rmtree
(
path
)
except
FileNotFoundError
:
pass
os
.
makedirs
(
path
,
exist_ok
=
True
)
return
path
from
build.project
import
Project
class
AutotoolsProject
(
Project
):
def
__init__
(
self
,
url
,
md5
,
installed
,
configure_args
=
[],
...
...
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