chore(build): switch from pyproject to meson build system

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2026-01-16 18:18:50 +05:00
parent ae0b3a0f1a
commit 2ffd545a89
12 changed files with 174 additions and 66 deletions

View File

@@ -55,9 +55,8 @@ jobs:
steps:
- name: Install build dependencies
run: |
dnf install -y git rpmdevtools python3-devel python3-wheel python3-pip \
python3-build pyproject-rpm-macros systemd-rpm-macros python3-setuptools \
redhat-rpm-config nodejs npm
dnf install -y git rpmdevtools meson ninja-build python3-devel \
systemd-rpm-macros redhat-rpm-config nodejs npm
- name: Setup rpmbuild environment
run: |

View File

@@ -109,9 +109,8 @@ jobs:
steps:
- name: Install build dependencies
run: |
dnf install -y git rpmdevtools python3-devel python3-wheel python3-pip \
python3-build pyproject-rpm-macros systemd-rpm-macros python3-setuptools \
redhat-rpm-config nodejs npm
dnf install -y git rpmdevtools meson ninja-build python3-devel \
systemd-rpm-macros redhat-rpm-config nodejs npm
- name: Setup rpmbuild environment
run: |

View File

@@ -108,9 +108,8 @@ jobs:
steps:
- name: Install build dependencies
run: |
dnf install -y git rpmdevtools python3-devel python3-wheel python3-pip \
python3-build pyproject-rpm-macros python3-setuptools \
redhat-rpm-config nodejs npm
dnf install -y git rpmdevtools meson ninja-build python3-devel \
systemd-rpm-macros redhat-rpm-config nodejs npm
- name: Setup rpmbuild environment
run: |

View File

@@ -7,18 +7,15 @@ url="https://git.linux-gaming.ru/Boria138/PortProtonQt"
license=('GPL-3.0')
depends=('python-requests' 'python-babel' 'python-evdev' 'python-pyudev' 'python-orjson'
'python-psutil' 'python-tqdm' 'python-vdf' 'python-libarchive-c' 'pyside6' 'python-rapidfuzz' 'icoextract' 'python-pillow' 'perl-image-exiftool' 'xdg-utils' 'python-beautifulsoup4' 'python-websocket-client' 'cabextract' 'unzip' 'curl' 'unrar' 'qt6-svg')
makedepends=('python-'{'build','installer','setuptools','wheel'})
makedepends=('meson' 'ninja')
source=("git+https://git.linux-gaming.ru/Boria138/PortProtonQt#tag=v$pkgver")
sha256sums=('SKIP')
build() {
cd "$srcdir/PortProtonQt"
python -m build --wheel --no-isolation
arch-meson PortProtonQt build
meson compile -C build
}
package() {
cd "$srcdir/PortProtonQt"
python -m installer --destdir="$pkgdir" dist/*.whl
cp -r build-aux/share "$pkgdir/usr/"
cp -r build-aux/lib "$pkgdir/usr/"
meson install -C build --destdir "$pkgdir"
}

View File

@@ -7,7 +7,7 @@ url="https://git.linux-gaming.ru/Boria138/PortProtonQt"
license=('GPL-3.0')
depends=('python-requests' 'python-babel' 'python-evdev' 'python-pyudev' 'python-orjson'
'python-psutil' 'python-tqdm' 'python-vdf' 'python-libarchive-c' 'pyside6' 'icoextract' 'python-pillow' 'python-rapidfuzz' 'perl-image-exiftool' 'xdg-utils' 'python-beautifulsoup4' 'python-websocket-client' 'cabextract' 'unzip' 'curl' 'unrar' 'qt6-svg')
makedepends=('python-'{'build','installer','setuptools','wheel'})
makedepends=('meson' 'ninja')
source=("git+https://git.linux-gaming.ru/Boria138/PortProtonQt.git")
sha256sums=('SKIP')
@@ -17,13 +17,10 @@ pkgver() {
}
build() {
cd "$srcdir/PortProtonQt"
python -m build --wheel --no-isolation
arch-meson PortProtonQt build
meson compile -C build
}
package() {
cd "$srcdir/PortProtonQt"
python -m installer --destdir="$pkgdir" dist/*.whl
cp -r build-aux/share "$pkgdir/usr/"
cp -r build-aux/lib "$pkgdir/usr/"
meson install -C build --destdir "$pkgdir"
}

View File

@@ -1,12 +1,11 @@
%global pypi_name portprotonqt
%global pypi_version 0.1.1
%global pypi_version 0.1.10
%global oname PortProtonQt
%global build_timestamp %(date +"%Y%m%d")
%global _python_no_extras_requires 1
%global rel_build 1.git.%{build_timestamp}%{?dist}
Name: python-%{pypi_name}-git
Name: %{pypi_name}-git
Version: %{pypi_version}
Release: %{rel_build}
Summary: Modern GUI for managing and launching games from PortProton, Steam, and Epic Games Store (development build)
@@ -15,21 +14,15 @@ License: GPL-3.0
URL: https://git.linux-gaming.ru/Boria138/PortProtonQt
BuildArch: noarch
BuildRequires: meson >= 0.62.0
BuildRequires: ninja-build
BuildRequires: python3-devel
BuildRequires: python3-wheel
BuildRequires: python3-pip
BuildRequires: python3-build
BuildRequires: pyproject-rpm-macros
BuildRequires: python3dist(setuptools)
BuildRequires: git
BuildRequires: systemd-rpm-macros
%description
%{summary}
Obsoletes: python3-%{pypi_name}-git < %{version}-%{release}
Provides: python3-%{pypi_name}-git = %{version}-%{release}
%package -n python3-%{pypi_name}-git
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires: python3-babel
Requires: python3-evdev
Requires: python3-icoextract
@@ -55,27 +48,24 @@ Requires: unzip
Requires: curl
Requires: unrar
%description -n python3-%{pypi_name}-git
%description
This application provides a sleek, intuitive graphical interface for managing and launching games from PortProton, Steam, and Epic Games Store. It consolidates your game libraries into a single, user-friendly hub for seamless navigation and organization. Its lightweight structure and cross-platform support deliver a cohesive gaming experience, eliminating the need for multiple launchers. Unique PortProton integration enhances Linux gaming, enabling effortless play of Windows-based titles with minimal setup.
%{?python_disable_dependency_generator}
%prep
git clone https://git.linux-gaming.ru/Boria138/PortProtonQt.git
%build
cd %{oname}
%pyproject_wheel
%meson
%meson_build
%install
cd %{oname}
%pyproject_install
%pyproject_save_files %{pypi_name}
cp -r build-aux/share %{buildroot}/usr/
cp -r build-aux/lib %{buildroot}/usr/
%meson_install
%files -n python3-%{pypi_name}-git -f %{pyproject_files}
%files
%{_bindir}/%{pypi_name}
%{_datadir}/%{pypi_name}/
%{_datadir}/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg
%{_metainfodir}/ru.linux_gaming.PortProtonQt.metainfo.xml
%{_udevrulesdir}/60-portprotonqt.rules

View File

@@ -1,9 +1,8 @@
%global pypi_name portprotonqt
%global pypi_version 0.1.10
%global oname PortProtonQt
%global _python_no_extras_requires 1
Name: python-%{pypi_name}
Name: %{pypi_name}
Version: %{pypi_version}
Release: 1%{?dist}
Summary: Modern GUI for managing and launching games from PortProton, Steam, and Epic Games Store
@@ -12,21 +11,15 @@ License: GPL-3.0
URL: https://git.linux-gaming.ru/Boria138/PortProtonQt
BuildArch: noarch
BuildRequires: meson >= 0.62.0
BuildRequires: ninja-build
BuildRequires: python3-devel
BuildRequires: python3-wheel
BuildRequires: python3-pip
BuildRequires: python3-build
BuildRequires: pyproject-rpm-macros
BuildRequires: python3dist(setuptools)
BuildRequires: git
BuildRequires: systemd-rpm-macros
%description
%{summary}
Obsoletes: python3-%{pypi_name} < %{version}-%{release}
Provides: python3-%{pypi_name} = %{version}-%{release}
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires: python3-babel
Requires: python3-evdev
Requires: python3-icoextract
@@ -52,11 +45,9 @@ Requires: unzip
Requires: curl
Requires: unrar
%description -n python3-%{pypi_name}
%description
This application provides a sleek, intuitive graphical interface for managing and launching games from PortProton, Steam, and Epic Games Store. It consolidates your game libraries into a single, user-friendly hub for seamless navigation and organization. Its lightweight structure and cross-platform support deliver a cohesive gaming experience, eliminating the need for multiple launchers. Unique PortProton integration enhances Linux gaming, enabling effortless play of Windows-based titles with minimal setup.
%{?python_disable_dependency_generator}
%prep
git clone https://git.linux-gaming.ru/Boria138/PortProtonQt
cd %{oname}
@@ -64,17 +55,16 @@ git checkout v%{pypi_version}
%build
cd %{oname}
%pyproject_wheel
%meson
%meson_build
%install
cd %{oname}
%pyproject_install
%pyproject_save_files %{pypi_name}
cp -r build-aux/share %{buildroot}/usr/
cp -r build-aux/lib %{buildroot}/usr/
%meson_install
%files -n python3-%{pypi_name} -f %{pyproject_files}
%files
%{_bindir}/%{pypi_name}
%{_datadir}/%{pypi_name}/
%{_datadir}/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg
%{_metainfodir}/ru.linux_gaming.PortProtonQt.metainfo.xml
%{_udevrulesdir}/60-portprotonqt.rules

5
build-aux/portprotonqt Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
python_script_path=/usr/share/portprotonqt
python3 "$python_script_path/app.py" "$@"

View File

@@ -13,6 +13,7 @@ APPIMAGE_RECIPE = BASE_DIR / "build-aux" / "AppImageBuilder.yml"
ARCH_PKGBUILD = BASE_DIR / "build-aux" / "PKGBUILD"
FEDORA_SPEC = BASE_DIR / "build-aux" / "fedora.spec"
PYPROJECT = BASE_DIR / "pyproject.toml"
MESON_BUILD = BASE_DIR / "meson.build"
APP_PY = BASE_DIR / "portprotonqt" / "app.py"
GITEA_WORKFLOW = BASE_DIR / ".gitea" / "workflows" / "build.yml"
CHANGELOG = BASE_DIR / "CHANGELOG.md"
@@ -69,6 +70,19 @@ def bump_pyproject(path: Path, old: str, new: str) -> bool:
path.write_text(new_text, encoding='utf-8')
return bool(count)
def bump_meson(path: Path, old: str, new: str) -> bool:
"""
Update version in meson.build
"""
if not path.exists():
return False
text = path.read_text(encoding='utf-8')
pattern = re.compile(r"(version:\s*)'" + re.escape(old) + r"'")
new_text, count = pattern.subn(lambda m: m.group(1) + f"'{new}'", text)
if count:
path.write_text(new_text, encoding='utf-8')
return bool(count)
def bump_app_py(path: Path, old: str, new: str) -> bool:
"""
Update __app_version__ in app.py
@@ -121,6 +135,7 @@ def main():
(ARCH_PKGBUILD, bump_arch),
(FEDORA_SPEC, bump_fedora),
(PYPROJECT, bump_pyproject),
(MESON_BUILD, bump_meson),
(APP_PY, bump_app_py),
(GITEA_WORKFLOW, bump_workflow),
(CHANGELOG, bump_changelog)

61
meson.build Normal file
View File

@@ -0,0 +1,61 @@
project('portprotonqt',
version: '0.1.10',
meson_version: '>= 0.62.0',
license: 'GPL-3.0',
)
# Project directories
prefix = get_option('prefix')
datadir = prefix / get_option('datadir')
bindir = prefix / get_option('bindir')
pkgdatadir = datadir / meson.project_name()
# Install Python package
subdir('portprotonqt')
# Install entry point script
install_data(
'build-aux/portprotonqt',
install_dir: bindir,
install_mode: 'rwxr-xr-x',
)
# Install desktop file
install_data(
'build-aux/share/applications/ru.linux_gaming.PortProtonQt.desktop',
install_dir: datadir / 'applications',
)
# Install icon
install_data(
'build-aux/share/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg',
install_dir: datadir / 'icons/hicolor/scalable/apps',
)
# Install metainfo
install_data(
'build-aux/share/metainfo/ru.linux_gaming.PortProtonQt.metainfo.xml',
install_dir: datadir / 'metainfo',
)
# Install bash completion
install_data(
'build-aux/share/bash-completion/completions/portprotonqt',
install_dir: datadir / 'bash-completion/completions',
)
# Install udev rules
udevdir = get_option('udevdir')
if udevdir == ''
udev = dependency('udev', required: false)
if udev.found()
udevdir = udev.get_variable(pkgconfig: 'udevdir') / 'rules.d'
else
udevdir = prefix / get_option('libdir') / 'udev/rules.d'
endif
endif
install_data(
'build-aux/lib/udev/rules.d/60-portprotonqt.rules',
install_dir: udevdir,
)

5
meson.options Normal file
View File

@@ -0,0 +1,5 @@
option('udevdir',
type: 'string',
value: '',
description: 'Directory for udev rules (auto-detected if empty)',
)

51
portprotonqt/meson.build Normal file
View File

@@ -0,0 +1,51 @@
# Install Python source files
install_data(
'__init__.py',
'animations.py',
'app.py',
'cli.py',
'config_utils.py',
'context_menu_manager.py',
'custom_widgets.py',
'detail_pages.py',
'dialogs.py',
'downloader.py',
'egs_api.py',
'game_card.py',
'game_library_manager.py',
'get_wine_module.py',
'howlongtobeat_api.py',
'image_utils.py',
'input_manager.py',
'keyboard_layouts.py',
'localization.py',
'logger.py',
'main_window.py',
'portproton_api.py',
'preloader.py',
'search_utils.py',
'settings_manager.py',
'steam_api.py',
'system_overlay.py',
'theme_manager.py',
'theme_security.py',
'time_utils.py',
'tray_manager.py',
'version_utils.py',
'virtual_keyboard.py',
install_dir: pkgdatadir,
)
# Install themes
install_subdir(
'themes',
install_dir: pkgdatadir,
exclude_directories: ['__pycache__'],
exclude_files: ['*.pyc'],
)
# Install locales
install_subdir(
'locales',
install_dir: pkgdatadir,
)