| 1 |
VERSION=`grep "__version__" lutris/__init__.py | cut -d" " -f 3 | sed 's|"\(.*\)"|\1|'` |
| 2 |
GITBRANCH ?= master |
| 3 |
# Default GPG key ID to use for package signing. |
| 4 |
PPA_GPG_KEY_ID ?= 82D96E430A1F1C0F0502747E37B90EDD4E3EFAE4 |
| 5 |
PYTHON:=$(shell which python3) |
| 6 |
PIP:=$(PYTHON) -m pip |
| 7 |
|
| 8 |
all: |
| 9 |
export GITBRANCH=master |
| 10 |
debuild |
| 11 |
debclean |
| 12 |
|
| 13 |
|
| 14 |
unsigned: |
| 15 |
export GITBRANCH=master |
| 16 |
debuild -i -us -uc -b |
| 17 |
debclean |
| 18 |
|
| 19 |
|
| 20 |
# Build process for GitHub runners. |
| 21 |
# Requires two environment variables related to package signing. |
| 22 |
# PPA_GPG_KEY_ID |
| 23 |
# Key ID used to sign the .deb package files. |
| 24 |
# PPA_GPG_PASSPHRASE |
| 25 |
# Decrypts the private key associated with GPG_KEY_ID. |
| 26 |
# |
| 27 |
# When running from a GitHub workflow. The above environment variables |
| 28 |
# are passed in from .github/scripts/build-ubuntu.sh and that script |
| 29 |
# receives those variables from the .github/workflows/publish-lutris-ppa.yml |
| 30 |
# which receives them from the repository secrets. |
| 31 |
github-ppa: |
| 32 |
export GITBRANCH=master |
| 33 |
# Automating builds for different Ubuntu codenames manipulates the |
| 34 |
# version string, and so that lintian check is suppressed. Also note |
| 35 |
# that all parameters after "--lintian-opts" are passed to lintian |
| 36 |
# so that _must_ be the last parameter. |
| 37 |
echo "y" | debuild -S \ |
| 38 |
-k"${PPA_GPG_KEY_ID}" \ |
| 39 |
-p"gpg --batch --passphrase ${PPA_GPG_PASSPHRASE} --pinentry-mode loopback" \ |
| 40 |
--lintian-opts --suppress-tags malformed-debian-changelog-version |
| 41 |
|
| 42 |
build-deps-ubuntu: |
| 43 |
sudo apt install devscripts debhelper dh-python meson |
| 44 |
|
| 45 |
build: |
| 46 |
gbp buildpackage --git-debian-branch=${GITBRANCH} |
| 47 |
|
| 48 |
clean: |
| 49 |
debclean |
| 50 |
|
| 51 |
build-source: clean |
| 52 |
gbp buildpackage -S --git-debian-branch=${GITBRANCH} |
| 53 |
mkdir build |
| 54 |
mv ../lutris_${VERSION}* build |
| 55 |
|
| 56 |
release: build-source upload upload-ppa |
| 57 |
|
| 58 |
test: |
| 59 |
rm tests/fixtures/pga.db -f |
| 60 |
nose2 |
| 61 |
|
| 62 |
|
| 63 |
cover: |
| 64 |
rm tests/fixtures/pga.db -f |
| 65 |
rm tests/coverage/ -rf |
| 66 |
nose2 --with-coverage --cover-package=lutris --cover-html --cover-html-dir=tests/coverage |
| 67 |
|
| 68 |
|
| 69 |
pgp-renew: |
| 70 |
osc signkey --extend home:strycore |
| 71 |
osc rebuildpac home:strycore --all |
| 72 |
|
| 73 |
changelog-add: |
| 74 |
EDITOR=vim dch -i |
| 75 |
|
| 76 |
changelog-edit: |
| 77 |
EDITOR=vim dch -e |
| 78 |
|
| 79 |
upload: |
| 80 |
scp build/lutris_${VERSION}.tar.xz anaheim:~/volumes/releases/ |
| 81 |
|
| 82 |
upload-ppa: |
| 83 |
dput ppa:lutris-team/lutris build/lutris_${VERSION}*_source.changes |
| 84 |
|
| 85 |
upload-staging: |
| 86 |
dput --force ppa:lutris-team/lutris-staging build/lutris_${VERSION}*_source.changes |
| 87 |
|
| 88 |
snap: |
| 89 |
snapcraft clean lutris -s pull |
| 90 |
snapcraft |
| 91 |
|
| 92 |
req-python: |
| 93 |
pip3 install PyYAML lxml requests Pillow setproctitle python-magic distro dbus-python types-requests \ |
| 94 |
types-PyYAML evdev PyGObject pypresence protobuf moddb |
| 95 |
|
| 96 |
dev: |
| 97 |
pip3 install ruff==0.12.1 mypy==1.16.1 mypy-baseline nose2 |
| 98 |
pip3 install pygobject-stubs --no-cache-dir --config-settings=config=Gtk3,Gdk3,Soup2 |
| 99 |
|
| 100 |
# ============ |
| 101 |
# Style checks |
| 102 |
# ============ |
| 103 |
|
| 104 |
style: |
| 105 |
ruff format . --check |
| 106 |
|
| 107 |
format: |
| 108 |
ruff check --select I --fix |
| 109 |
ruff format . |
| 110 |
|
| 111 |
# =============== |
| 112 |
# Static analysis |
| 113 |
# =============== |
| 114 |
|
| 115 |
check: ruff_lint mypy syntax-compat po-check |
| 116 |
|
| 117 |
ruff_lint: |
| 118 |
ruff check . |
| 119 |
|
| 120 |
syntax-compat: |
| 121 |
python3 -m compileall -q lutris/ |
| 122 |
|
| 123 |
po-check: |
| 124 |
@for f in po/*.po; do msgfmt --check "$$f" -o /dev/null; done |
| 125 |
|
| 126 |
mypy: |
| 127 |
mypy . --python-version 3.10 --install-types --non-interactive 2>&1 | mypy-baseline filter |
| 128 |
|
| 129 |
mypy-reset-baseline: # Add new typing errors to mypy. Use sparingly. |
| 130 |
mypy . --python-version 3.10--install-types --non-interactive 2>&1 | mypy-baseline sync |
| 131 |
|
| 132 |
# ============= |
| 133 |
# Abbreviations |
| 134 |
# ============= |
| 135 |
|
| 136 |
sc: style check |
| 137 |
styles: style |
| 138 |
checks: check |