-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
executable file
·115 lines (97 loc) · 3.16 KB
/
Copy pathJustfile
File metadata and controls
executable file
·115 lines (97 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# SPDX-FileCopyrightText: mpvQC developers
#
# SPDX-License-Identifier: MIT
APP_ID := 'io.github.mpvqc.mpvQC'
MANIFEST_FILE := 'io.github.mpvqc.mpvQC.yml'
MANIFEST_PYPI_FILE := 'io.github.mpvqc.mpvQC.pypi.yml'
APPSTREAM_FILE := 'io.github.mpvqc.mpvQC.metainfo.xml'
DESKTOP_FILE := 'io.github.mpvqc.mpvQC.desktop'
BUILD_DIR := 'build-dir'
alias fmt := format
@_default:
just --list --unsorted
# Initialize repository
init:
uvx prek install
# Format code
format:
uvx prek --config=.config/prek.toml run --all-files
# Update git hook dependencies
update-git-hook-dependencies:
uvx prek --config=.config/prek.toml auto-update
# Regenerate Python dependency file
[group('support')]
generate-flatpak-dependencies:
#!/usr/bin/env nu
let cleanup = (open "{{ MANIFEST_PYPI_FILE }}" | get cleanup?)
let reqs = [
"inject==5.3.0"
"PySide6-Essentials==6.11.1"
"shiboken6==6.11.1"
"MarkupSafe==3.0.3"
"Jinja2==3.1.6"
"mpv==1.0.8"
]
let generated = (^uvx --with pyyaml req2flatpak --target-platforms 313-x86_64 --requirements ...$reqs --yaml | from yaml)
let out = if ($cleanup | is-empty) { $generated } else { $generated | merge { cleanup: ($cleanup | sort --ignore-case) } }
$out | to yaml | save --force "{{ MANIFEST_PYPI_FILE }}"
# Lint flatpak appstream file
[group('flatpak-lint')]
@lint-flatpak-appstream:
flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream {{ APPSTREAM_FILE }}
# Lint flatpak manifest file
[group('flatpak-lint')]
@lint-flatpak-manifest:
flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest {{ MANIFEST_FILE }}
# Lint flatpak builddir directory
[group('flatpak-lint')]
@lint-flatpak-builddir:
flatpak run --command=flatpak-builder-lint org.flatpak.Builder builddir {{ BUILD_DIR }}
# Lint flatpak repo
[group('flatpak-lint')]
@lint-flatpak-repo:
flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo
# Check for dependency updates (read-only)
[group('flatpak-update')]
@run-x-checker-check:
docker run --rm \
-v $PWD:/run/app \
ghcr.io/flathub/flatpak-external-data-checker:latest \
/run/app/{{ MANIFEST_FILE }}
# Sync dependency updates (update manifest file)
[group('flatpak-update')]
@run-x-checker-update:
docker run --rm \
-v $PWD:/run/app \
ghcr.io/flathub/flatpak-external-data-checker:latest \
--update --edit-only \
/run/app/{{ MANIFEST_FILE }}
# Force clean environment
[group('flatpak')]
clean-flatpak-resources:
rm -rf {{ BUILD_DIR }}
rm -rf .flatpak-builder
rm -rf repo
# (1) Build flatpak
[group('flatpak')]
build-flatpak:
flatpak-builder \
--force-clean {{ BUILD_DIR }} {{ MANIFEST_FILE }}
# (2) Install flatpak
[group('flatpak')]
install-flatpak:
flatpak-builder \
--force-clean \
--user \
--install-deps-from=flathub \
--disable-download \
--repo=repo \
--install {{ BUILD_DIR }} {{ MANIFEST_FILE }}
# (3) Run flatpak
[group('flatpak')]
run-flatpak:
flatpak run {{ APP_ID }}
# (4) Uninstall flatpak
[group('flatpak')]
uninstall-flatpak:
flatpak uninstall --user {{ APP_ID }} -y