Added pybuild_lw.py

This commit is contained in:
Bert van der Weerd 2021-06-10 00:14:09 +02:00
parent 147e5f7be8
commit 0bd27fb698
No known key found for this signature in database
GPG key ID: 4CFABB96ADE0F5B1
3 changed files with 53 additions and 48 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@
/tmp.nsi
/tmp-permissive.nsi
/tmp-strict.nsi
/__pycache__

View file

@ -10,6 +10,8 @@ import optparse
import sys
import os
import pybuild_lw
parser = optparse.OptionParser()
parser.add_option('-x', '--cross', dest='cross_compile', default=False, action="store_true")
@ -21,20 +23,10 @@ parser.add_option('-t', '--distro', dest='distro', default='win')
options, remainder = parser.parse_args()
#print("[debug] ----------")
#print("[debug] --cross = ", options.cross_compile)
#print("[debug] --no-execute = ", options.no_execute)
#print("[debug] --src = ", options.src)
#print("[debug] --distro = ", options.distro)
#print("[debug] ----------")
def beep():
print('\a')
def enter_srcdir():
dir = "firefox-{}".format(pkgver)
if options.src == 'nightly':
@ -264,44 +256,7 @@ if len(remainder) > 0:
beep()
else:
# Print help message
print("""# Use:
pybuild [<options>] clean | all | <targets>
# 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
""")
print(pybuild_lw.help_message)

49
pybuild_lw.py Normal file
View file

@ -0,0 +1,49 @@
#
# 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
"""