forked from Boria138/PortProtonQt
chore(build): switch from pyproject to meson build system
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@@ -2,22 +2,52 @@
|
||||
|
||||
set -eu
|
||||
|
||||
# Determine if git mode is enabled based on the first argument
|
||||
if [ "${1:-}" = "--git" ] || [ "${1:-}" = "-g" ]; then
|
||||
GIT_MODE=true
|
||||
else
|
||||
GIT_MODE=false
|
||||
fi
|
||||
# Initialize variables
|
||||
LOCAL_MODE=false
|
||||
BRANCH="main"
|
||||
REPO_URL="https://git.linux-gaming.ru/Boria138/PortProtonQt.git"
|
||||
|
||||
# Parse arguments
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--local|-l)
|
||||
LOCAL_MODE=true
|
||||
;;
|
||||
--branch)
|
||||
if [ -n "${2:-}" ] && [ "${2#-}" = "$2" ]; then
|
||||
BRANCH="$2"
|
||||
shift
|
||||
else
|
||||
echo "Error: --branch requires an argument"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
--repo)
|
||||
if [ -n "${2:-}" ] && [ "${2#-}" = "$2" ]; then
|
||||
REPO_URL="$2"
|
||||
shift
|
||||
else
|
||||
echo "Error: --repo requires an argument"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
ARCH="$(uname -m)"
|
||||
PACKAGE_BUILDER="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/make-aur-package.sh"
|
||||
EXTRA_PACKAGES="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/get-debloated-pkgs.sh"
|
||||
|
||||
if [ "$GIT_MODE" = true ]; then
|
||||
echo "Using git version of PortProtonQt..."
|
||||
PPQT_PKGBUILD="https://git.linux-gaming.ru/Boria138/PortProtonQt/raw/branch/main/build-aux/PKGBUILD-git"
|
||||
if [ "$LOCAL_MODE" = true ]; then
|
||||
echo "Using local PKGBUILD-git from repository..."
|
||||
PPQT_PKGBUILD=""
|
||||
else
|
||||
echo "Using stable version of PortProtonQt..."
|
||||
echo "Using stable version of PortProtonQt from main branch..."
|
||||
PPQT_PKGBUILD="https://git.linux-gaming.ru/Boria138/PortProtonQt/raw/branch/main/build-aux/PKGBUILD"
|
||||
fi
|
||||
|
||||
@@ -37,7 +67,12 @@ chmod +x ./make-aur-package.sh
|
||||
|
||||
echo "Building PortProtonQt from PKGBUILD..."
|
||||
echo "---------------------------------------------------------------"
|
||||
wget --retry-connrefused --tries=30 "$PPQT_PKGBUILD" -O ./PKGBUILD
|
||||
if [ "$LOCAL_MODE" = true ]; then
|
||||
cp ../PKGBUILD-git ./PKGBUILD
|
||||
else
|
||||
wget --retry-connrefused --tries=30 "$PPQT_PKGBUILD" -O ./PKGBUILD
|
||||
fi
|
||||
sed -i "s|source=(\"git+https://git.linux-gaming.ru/Boria138/PortProtonQt.git\")|source=(\"git+${REPO_URL}#branch=$BRANCH\")|" PKGBUILD
|
||||
makepkg -si --noconfirm
|
||||
|
||||
echo "Installing debloated packages..."
|
||||
@@ -46,7 +81,7 @@ wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh
|
||||
chmod +x ./get-debloated-pkgs.sh
|
||||
./get-debloated-pkgs.sh --add-common --prefer-nano
|
||||
|
||||
if [ "$GIT_MODE" = true ]; then
|
||||
if [ "$LOCAL_MODE" = true ]; then
|
||||
# For git version, we use portprotonqt-git
|
||||
pacman -Q portprotonqt-git | awk '{print $2}' | cut -d- -f1 > ~/version
|
||||
else
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
%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 +15,15 @@ License: GPL-3.0
|
||||
URL: https://git.linux-gaming.ru/Boria138/PortProtonQt
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: meson >= 0.61.2
|
||||
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,7 +49,7 @@ 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}
|
||||
@@ -65,17 +59,17 @@ git clone https://git.linux-gaming.ru/Boria138/PortProtonQt.git
|
||||
|
||||
%build
|
||||
cd %{oname}
|
||||
%pyproject_wheel
|
||||
%meson -Dpython_libdir=%{python3_sitelib} -Dudevdir=%{_udevrulesdir}
|
||||
%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
|
||||
%find_lang %{pypi_name}
|
||||
|
||||
%files -n python3-%{pypi_name}-git -f %{pyproject_files}
|
||||
%files -f %{oname}/%{pypi_name}.lang
|
||||
%{_bindir}/%{pypi_name}
|
||||
%{python3_sitelib}/%{pypi_name}/
|
||||
%{_datadir}/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg
|
||||
%{_metainfodir}/ru.linux_gaming.PortProtonQt.metainfo.xml
|
||||
%{_udevrulesdir}/60-portprotonqt.rules
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
%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 +12,15 @@ License: GPL-3.0
|
||||
URL: https://git.linux-gaming.ru/Boria138/PortProtonQt
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: meson >= 0.61.2
|
||||
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,7 +46,7 @@ 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}
|
||||
@@ -64,17 +58,17 @@ git checkout v%{pypi_version}
|
||||
|
||||
%build
|
||||
cd %{oname}
|
||||
%pyproject_wheel
|
||||
%meson -Dpython_libdir=%{python3_sitelib} -Dudevdir=%{_udevrulesdir}
|
||||
%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
|
||||
%find_lang %{pypi_name}
|
||||
|
||||
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
||||
%files -f %{oname}/%{pypi_name}.lang
|
||||
%{_bindir}/%{pypi_name}
|
||||
%{python3_sitelib}/%{pypi_name}/
|
||||
%{_datadir}/icons/hicolor/scalable/apps/ru.linux_gaming.PortProtonQt.svg
|
||||
%{_metainfodir}/ru.linux_gaming.PortProtonQt.metainfo.xml
|
||||
%{_udevrulesdir}/60-portprotonqt.rules
|
||||
|
||||
9
build-aux/portprotonqt
Normal file
9
build-aux/portprotonqt
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
|
||||
from portprotonqt.app import main
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in New Issue
Block a user