updates
This commit is contained in:
parent
0bd27fb698
commit
f2fa4ce26b
2 changed files with 136 additions and 120 deletions
93
pybuild.py
93
pybuild.py
|
|
@ -53,8 +53,12 @@ def exec(cmd):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
# Utilities:
|
# Utilities:
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def execute_git_subs():
|
def execute_git_subs():
|
||||||
exec("git submodule update --recursive")
|
exec("git submodule update --recursive")
|
||||||
exec("git submodule foreach git pull origin master")
|
exec("git submodule foreach git pull origin master")
|
||||||
|
|
@ -102,10 +106,11 @@ def execute_mach_env():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
# Targets:
|
# Targets:
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
def execute_fetch():
|
def execute_fetch():
|
||||||
if options.src == 'release':
|
if options.src == 'release':
|
||||||
exec("rm -f firefox-{}.source.tar.xz".format(pkgver))
|
exec("rm -f firefox-{}.source.tar.xz".format(pkgver))
|
||||||
|
|
@ -129,26 +134,31 @@ def execute_extract():
|
||||||
exec("rm -rf firefox-{}".format(pkgver))
|
exec("rm -rf firefox-{}".format(pkgver))
|
||||||
exec("tar xf firefox-{}.source.tar.xz".format(pkgver))
|
exec("tar xf firefox-{}.source.tar.xz".format(pkgver))
|
||||||
|
|
||||||
def execute_lw_do_patches():
|
|
||||||
if options.no_librewolf:
|
|
||||||
return
|
|
||||||
print("[debug] doing target -> lw_do_patches")
|
|
||||||
|
|
||||||
def execute_build():
|
def execute_build():
|
||||||
enter_srcdir()
|
enter_srcdir()
|
||||||
exec("bash ./mach build")
|
exec("bash ./mach build")
|
||||||
leave_srcdir()
|
leave_srcdir()
|
||||||
|
|
||||||
def execute_lw_post_build():
|
|
||||||
if options.no_librewolf:
|
|
||||||
return
|
|
||||||
print("[debug] doing target -> lw_post_build")
|
|
||||||
|
|
||||||
def execute_package():
|
def execute_package():
|
||||||
enter_srcdir()
|
enter_srcdir()
|
||||||
exec("bash ./mach package")
|
exec("bash ./mach package")
|
||||||
leave_srcdir()
|
leave_srcdir()
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LibreWolf specific:
|
||||||
|
#
|
||||||
|
|
||||||
|
def execute_lw_do_patches():
|
||||||
|
if options.no_librewolf:
|
||||||
|
return
|
||||||
|
print("[debug] doing target -> lw_do_patches")
|
||||||
|
|
||||||
|
def execute_lw_post_build():
|
||||||
|
if options.no_librewolf:
|
||||||
|
return
|
||||||
|
print("[debug] doing target -> lw_post_build")
|
||||||
|
|
||||||
def execute_lw_artifacts():
|
def execute_lw_artifacts():
|
||||||
if options.no_librewolf:
|
if options.no_librewolf:
|
||||||
return
|
return
|
||||||
|
|
@ -162,7 +172,11 @@ def execute_lw_artifacts():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
# Main targets:
|
# Main targets:
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
def execute_all():
|
def execute_all():
|
||||||
execute_fetch()
|
execute_fetch()
|
||||||
execute_extract()
|
execute_extract()
|
||||||
|
|
@ -196,6 +210,7 @@ def execute_clean():
|
||||||
# main commandline interface
|
# main commandline interface
|
||||||
#
|
#
|
||||||
|
|
||||||
|
def main():
|
||||||
if options.src == 'tor-browser':
|
if options.src == 'tor-browser':
|
||||||
options.no_librewolf = True
|
options.no_librewolf = True
|
||||||
|
|
||||||
|
|
@ -256,7 +271,55 @@ if len(remainder) > 0:
|
||||||
beep()
|
beep()
|
||||||
else:
|
else:
|
||||||
# Print help message
|
# Print help message
|
||||||
print(pybuild_lw.help_message)
|
print(help_message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Large multiline strings
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
help_message = """# Use:
|
||||||
|
|
||||||
|
pybuild [<options>] clean | all | <targets> | <utilities>
|
||||||
|
|
||||||
|
# Options:
|
||||||
|
|
||||||
|
-n,--no-execute - print commands, don't execute them
|
||||||
|
-l,--no-librewolf - skip LibreWolf specific stages.
|
||||||
|
-x,--cross - crosscompile from linux, implies -t win
|
||||||
|
-s,--src <src> - release,nightly,tor-browser
|
||||||
|
(default=release)
|
||||||
|
-t,--distro <distro> - deb,rpm,win (default=win)
|
||||||
|
|
||||||
|
# Targets:
|
||||||
|
|
||||||
|
all - all steps from fetch to producing setup.exe
|
||||||
|
clean - clean everything, including extracted/fetched sources
|
||||||
|
|
||||||
|
fetch - wget or hg clone or git pull
|
||||||
|
extract - nop if not wget
|
||||||
|
lw_do_patches - [librewolf] patch the source
|
||||||
|
build - build the browser
|
||||||
|
lw_post_build - [librewolf] insert our settings
|
||||||
|
package - package the browser into zip/apk
|
||||||
|
lw_artifacts - [librewolf] build setup.exe
|
||||||
|
|
||||||
|
# Utilities:
|
||||||
|
|
||||||
|
git_subs - git update submodules
|
||||||
|
git_init - put the source folder in a .git repository
|
||||||
|
|
||||||
|
deps_deb - install dependencies with apt
|
||||||
|
deps_rpm - install dependencies with dnf
|
||||||
|
deps_pkg - install dependencies on freebsd
|
||||||
|
|
||||||
|
rustup - update rust
|
||||||
|
mach_env - create mach environment
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,2 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Large multiline strings
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
help_message = """# Use:
|
|
||||||
|
|
||||||
pybuild [<options>] clean | all | <targets> | <utilities>
|
|
||||||
|
|
||||||
# Options:
|
|
||||||
|
|
||||||
-n,--no-execute - print commands, don't execute them
|
|
||||||
-l,--no-librewolf - skip LibreWolf specific stages.
|
|
||||||
-x,--cross - crosscompile from linux, implies -t win
|
|
||||||
-s,--src <src> - release,nightly,tor-browser
|
|
||||||
(default=release)
|
|
||||||
-t,--distro <distro> - deb,rpm,win (default=win)
|
|
||||||
|
|
||||||
# Targets:
|
|
||||||
|
|
||||||
all - all steps from fetch to producing setup.exe
|
|
||||||
clean - clean everything, including extracted/fetched sources
|
|
||||||
|
|
||||||
fetch - wget or hg clone or git pull
|
|
||||||
extract - nop if not wget
|
|
||||||
lw_do_patches - [librewolf] patch the source
|
|
||||||
build - build the browser
|
|
||||||
lw_post_build - [librewolf] insert our settings
|
|
||||||
package - package the browser into zip/apk
|
|
||||||
lw_artifacts - [librewolf] build setup.exe
|
|
||||||
|
|
||||||
# Utilities:
|
|
||||||
|
|
||||||
git_subs - git update submodules
|
|
||||||
git_init - put the source folder in a .git repository
|
|
||||||
|
|
||||||
deps_deb - install dependencies with apt
|
|
||||||
deps_rpm - install dependencies with dnf
|
|
||||||
deps_pkg - install dependencies on freebsd
|
|
||||||
|
|
||||||
rustup - update rust
|
|
||||||
mach_env - create mach environment
|
|
||||||
"""
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue