Add flag to enable ffmpeg support

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/15/head
trivernis 3 years ago
parent 36d5e92b98
commit 64aeeb669b
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -73,14 +73,16 @@ After all required dependencies are installed and tools are accessible in the `P
All Componens: All Componens:
```sh ```sh
$ ./build.py build $ ./build.py build --ffmpeg
``` ```
Daemon only: Daemon only:
```sh ```sh
$ ./build.py build --daemon $ ./build.py build --daemon --ffmpeg
``` ```
If you don't want to build with ffmpeg support omit the `--ffmpeg` flag.
UI only: UI only:
```sh ```sh
$ ./build.py build --ui $ ./build.py build --ui

@ -6,6 +6,7 @@ import subprocess
tauri_cli_version = '1.0.0-rc.5' tauri_cli_version = '1.0.0-rc.5'
build_output = 'out' build_output = 'out'
verbose = False verbose = False
ffmpeg = False
windows = os.name == 'nt' windows = os.name == 'nt'
@ -71,7 +72,11 @@ def yarn(cmd: str, dir: str = None):
def build_daemon(): def build_daemon():
'''Builds daemon''' '''Builds daemon'''
cargo('fetch', 'mediarepo-daemon') cargo('fetch', 'mediarepo-daemon')
cargo('build --release --frozen', 'mediarepo-daemon')
if not ffmpeg:
cargo('build --release --frozen --no-default-features', 'mediarepo-daemon')
else:
cargo('build --release --frozen', 'mediarepo-daemon')
if windows: if windows:
store_artifact('mediarepo-daemon/target/release/mediarepo-daemon.exe') store_artifact('mediarepo-daemon/target/release/mediarepo-daemon.exe')
@ -102,11 +107,14 @@ def check_daemon():
def check_ui(): def check_ui():
'''Checks dependencies for UI''' '''Checks dependencies for UI'''
if not windows:
check_exec('wget')
check_exec('curl')
check_exec('file')
check_exec('clang') check_exec('clang')
check_exec('cargo') check_exec('cargo')
check_exec('wget')
check_exec('curl')
check_exec('file')
check_exec('node') check_exec('node')
check_exec('npm') check_exec('npm')
check_yarn() check_yarn()
@ -165,6 +173,8 @@ def parse_args():
'--verbose', action='store_true', help='Verbose build') '--verbose', action='store_true', help='Verbose build')
build_parser.add_argument( build_parser.add_argument(
'--output', action='store', help='Build output directory') '--output', action='store', help='Build output directory')
build_parser.add_argument(
'--ffmpeg', action='store_true', help='Build with ffmpeg')
subparsers.add_parser('clean') subparsers.add_parser('clean')
args = parser.parse_args() args = parser.parse_args()
@ -181,6 +191,9 @@ def main():
global verbose global verbose
verbose = opts.verbose verbose = opts.verbose
global ffmpeg
ffmpeg = opts.ffmpeg
if opts.daemon: if opts.daemon:
build(True, False) build(True, False)
elif opts.ui: elif opts.ui:

Loading…
Cancel
Save