diff --git a/.github/workflows/deb.yml b/.github/workflows/deb.yml new file mode 100644 index 00000000..b42cc247 --- /dev/null +++ b/.github/workflows/deb.yml @@ -0,0 +1,96 @@ +name: Debian package + +concurrency: + group: deb-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: [main] + paths: + - "debian/**" + - "src/**" + - "data/**" + - "po/**" + - "meson.build" + - ".github/workflows/deb.yml" + pull_request: + paths: + - "debian/**" + - "meson.build" + - ".github/workflows/deb.yml" + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: "Build .deb (${{ matrix.arch }})" + runs-on: ${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + include: + - runs-on: ubuntu-latest + arch: amd64 + - runs-on: ubuntu-24.04-arm + arch: arm64 + # Debian 13 fournit libsdl3-dev (>= 3.2), absent d'Ubuntu 24.04. + container: debian:trixie + steps: + - name: Install packaging tools + run: | + apt-get update + apt-get install -y --no-install-recommends \ + build-essential devscripts equivs git ca-certificates lintian + + - uses: actions/checkout@v6 + + - name: Install build dependencies + run: | + mk-build-deps --install --remove \ + --tool "apt-get -y --no-install-recommends" debian/control + + - name: Build package + run: dpkg-buildpackage -us -uc -b + + - name: Lint package + # Informatif : ne bloque pas le build. + run: lintian --no-tag-display-limit ../protonplus_*.deb || true + + - name: Collect artifacts + run: | + mkdir -p dist + cp ../protonplus_*.deb ../protonplus_*.buildinfo ../protonplus_*.changes dist/ + + - name: Smoke test installation + run: | + apt-get install -y --no-install-recommends ./dist/protonplus_*.deb + dpkg -L protonplus + + - uses: actions/upload-artifact@v4 + with: + name: protonplus-deb-${{ matrix.arch }} + path: dist/*.deb + if-no-files-found: error + + release: + name: Attach to release + if: github.event_name == 'release' + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + pattern: protonplus-deb-* + merge-multiple: true + path: dist + - name: Upload to release + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload "${{ github.event.release.tag_name }}" dist/*.deb --repo "${{ github.repository }}" --clobber diff --git a/.gitignore b/.gitignore index 43ad3822..e923508e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,16 @@ __pycache__/ .pytest_cache/ .ruff_cache/ +# deb build (a ajouter a .gitignore). +/obj-*/ +debian/.debhelper/ +debian/protonplus/ +debian/files +debian/*.substvars +debian/*.debhelper.log +debian/debhelper-build-stamp + + # Miscellaneous. /.idea/ /.vscode/ diff --git a/data/com.vysp3r.ProtonPlus.metainfo.xml.in b/data/com.vysp3r.ProtonPlus.metainfo.xml.in index 522b85c8..185ab6e8 100644 --- a/data/com.vysp3r.ProtonPlus.metainfo.xml.in +++ b/data/com.vysp3r.ProtonPlus.metainfo.xml.in @@ -44,7 +44,6 @@ Game - GameTool diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..44bc0a33 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,7 @@ +protonplus (0.6.9) unstable; urgency=medium + + * Initial Debian package. + * Build ProtonPlus using Meson. + * Add native Debian packaging. + + -- N3oray Sat, 21 Nov 2026 19:20:00 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..24f13d68 --- /dev/null +++ b/debian/control @@ -0,0 +1,40 @@ +Source: protonplus +Section: games +Priority: optional +Maintainer: N3oray +Build-Depends: + debhelper-compat (= 13), + appstream, + desktop-file-utils, + gettext, + libadwaita-1-dev (>= 1.5), + libarchive-dev, + libcairo2-dev, + libgee-0.8-dev, + libglib2.0-bin, + libglib2.0-dev, + libgtk-4-dev, + libjson-glib-dev, + libsdl3-dev, + libsoup-3.0-dev, + meson (>= 1.0.0), + ninja-build, + pkgconf | pkg-config, + python3, + valac, +Standards-Version: 4.7.2 +Homepage: https://github.com/N3oRay/ProtonPlus +Vcs-Browser: https://github.com/N3oRay/ProtonPlus +Vcs-Git: https://github.com/N3oRay/ProtonPlus.git +Rules-Requires-Root: no + +Package: protonplus +Architecture: any +Depends: + ${misc:Depends}, + ${shlibs:Depends}, +Description: compatibility tools manager for Linux + ProtonPlus is a GTK4 application to manage compatibility tools + such as Proton, Wine, DXVK and VKD3D. + . + It supports Steam, Lutris, Heroic, Bottles and other launchers. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..2b0b8d70 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ProtonPlus +Upstream-Contact: https://github.com/N3oRay/ProtonPlus +Source: https://github.com/N3oRay/ProtonPlus + +Files: * +Copyright: ProtonPlus contributors +License: GPL-3.0-or-later + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + https://www.gnu.org/licenses/. + +License: GPL-3.0-or-later + On Debian systems, the complete text of the GNU General Public + License version 3 can be found in + /usr/share/common-licenses/GPL-3. diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..a3f5755b --- /dev/null +++ b/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem=meson + +# Les tests dependent du temps reel (reseau local, timeouts, backoff) et de +# Xvfb : on les execute en developpement, pas pendant la construction du .deb. +override_dh_auto_test: + : diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/docs/debian.md b/docs/debian.md new file mode 100644 index 00000000..dd930899 --- /dev/null +++ b/docs/debian.md @@ -0,0 +1,35 @@ +# **Debian Package** +## **1. Build the Package** +To build the Debian package, run the following command from the root of the project: +bash +dpkg-buildpackage -us -uc -b +## **2. Inspect the Package Without Installing It** +Navigate to the parent directory where the generated .deb package is located: +bash +cd .. +List the generated packages: +bash +ls protonplus_*.deb +Inspect the package metadata and calculated dependencies: +bash +dpkg -I protonplus_0.6.9_amd64.deb +List all files included in the package: +bash +dpkg -c protonplus_0.6.9_amd64.deb +Check the package for common Debian packaging issues: +bash +lintian protonplus_0.6.9_amd64.deb +## **3. Install the Package** +Install the generated package on your system using APT: +bash +sudo apt install ./protonplus_0.6.9_amd64.deb +APT will automatically handle the package dependencies. +## **4. Verify the Installation** +Check the files installed by the package: +bash +dpkg -L protonplus | grep -E "bin/|\\.desktop|\\.gschema|metainfo" +You can then launch ProtonPlus using its application ID: +bash +com.vysp3r.ProtonPlus +Alternatively, use the executable name found in the package contents (dpkg -c). +  diff --git a/src/meson.build b/src/meson.build index 6b71e0ce..30a29388 100644 --- a/src/meson.build +++ b/src/meson.build @@ -19,7 +19,7 @@ deps = [ dependency('gtk4'), dependency('glib-2.0'), dependency('gio-unix-2.0'), - dependency('libadwaita-1', version : '>= 1.6'), + dependency('libadwaita-1', version : '>= 1.5'), dependency('json-glib-1.0'), dependency('libsoup-3.0'), dependency('gee-0.8'), diff --git a/src/widgets/loading/loading-box.vala b/src/widgets/loading/loading-box.vala index 2764a8c9..81d012f8 100644 --- a/src/widgets/loading/loading-box.vala +++ b/src/widgets/loading/loading-box.vala @@ -5,7 +5,7 @@ namespace ProtonPlus.Widgets.Loading { public bool loading { get; set; } Adw.StatusPage status_page { get; set; } - Adw.Spinner spinner { get; set; } + Gtk.Spinner spinner { get; set; } Gtk.FlowBox bug_box { get; set; } Gtk.Box welcome_box { get; set; } Gtk.Button retry_button { get; set; } @@ -15,15 +15,20 @@ namespace ProtonPlus.Widgets.Loading { public Box () { Object (orientation: Gtk.Orientation.VERTICAL, spacing: 0); - spinner = new Adw.Spinner (); + spinner = new Gtk.Spinner (); spinner.set_size_request (32, 32); spinner.set_halign (Gtk.Align.CENTER); spinner.set_valign (Gtk.Align.CENTER); + spinner.set_spinning (false); - bind_property ("loading", spinner, "visible", GLib.BindingFlags.DEFAULT); + bind_property ( + "loading", + spinner, + "visible", + GLib.BindingFlags.DEFAULT + ); bug_box = create_bug_box (); - welcome_box = create_welcome_box (); var content_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 30); @@ -45,7 +50,7 @@ namespace ProtonPlus.Widgets.Loading { return; loading = true; - + spinner.set_spinning (true); bug_box.visible = false; welcome_box.visible = false; @@ -77,6 +82,7 @@ namespace ProtonPlus.Widgets.Loading { } if (!success) { + spinner.set_spinning (false); status_page.set_icon_name ("dialog-error-symbolic"); status_page.set_title (_ ("An unexpected error occurred")); status_page.set_description (_ ("We encountered a problem while loading your application.\nPlease try again or report the problem.")); @@ -97,6 +103,7 @@ namespace ProtonPlus.Widgets.Loading { status_page.set_description (null); welcome_box.visible = true; } + spinner.set_spinning (false); loading = false; } diff --git a/src/widgets/preferences/preferences-delete-cache-row.vala b/src/widgets/preferences/preferences-delete-cache-row.vala index 770f8453..644dc8fc 100644 --- a/src/widgets/preferences/preferences-delete-cache-row.vala +++ b/src/widgets/preferences/preferences-delete-cache-row.vala @@ -2,7 +2,7 @@ namespace ProtonPlus.Widgets.Preferences { using ProtonPlus.Utils; public class DeleteCacheRow : Adw.ActionRow { Gtk.Button delete_button; - Adw.Spinner spinner; + Gtk.Spinner spinner; construct { delete_button = new Gtk.Button.from_icon_name ("user-trash-symbolic"); @@ -15,7 +15,7 @@ namespace ProtonPlus.Widgets.Preferences { ); delete_button.clicked.connect (() => delete_cache.begin ()); - spinner = new Adw.Spinner (); + spinner = new Gtk.Spinner (); set_title (_ ("Delete cache")); set_subtitle (_ ("Removes all cached information and temporary downloads")); diff --git a/src/widgets/preferences/preferences-refresh-application-data-row.vala b/src/widgets/preferences/preferences-refresh-application-data-row.vala index cb36a555..bffb68e3 100644 --- a/src/widgets/preferences/preferences-refresh-application-data-row.vala +++ b/src/widgets/preferences/preferences-refresh-application-data-row.vala @@ -1,7 +1,7 @@ namespace ProtonPlus.Widgets.Preferences { public class RefreshApplicationDataRow : Adw.ActionRow { Gtk.Button refresh_button; - Adw.Spinner spinner; + Gtk.Spinner spinner; construct { refresh_button = new Gtk.Button.from_icon_name ("view-refresh-symbolic"); @@ -13,7 +13,7 @@ namespace ProtonPlus.Widgets.Preferences { ); refresh_button.clicked.connect (refresh); - spinner = new Adw.Spinner (); + spinner = new Gtk.Spinner (); set_title (_ ("Refresh application data")); set_subtitle (_ ("Refreshes the launchers, tools and games")); diff --git a/src/widgets/tools/tools-releases-box.vala b/src/widgets/tools/tools-releases-box.vala index 7a781b0f..cad0bea3 100644 --- a/src/widgets/tools/tools-releases-box.vala +++ b/src/widgets/tools/tools-releases-box.vala @@ -199,7 +199,7 @@ namespace ProtonPlus.Widgets.Tools { }; list_box.append (load_more_row); - var spinner = new Adw.Spinner () { + var spinner = new Gtk.Spinner () { halign = Gtk.Align.CENTER, valign = Gtk.Align.CENTER, hexpand = true, diff --git a/tests/web_test.vala b/tests/web_test.vala index d81cbc99..0f3a64a7 100644 --- a/tests/web_test.vala +++ b/tests/web_test.vala @@ -155,15 +155,27 @@ namespace AppTests.WebTest { requests++; if (requests == 1) first_request_at = get_monotonic_time (); - if (requests == 2 && (scenario == "retry-after" || scenario == "retry-after-date")) - assert (get_monotonic_time () - first_request_at >= 2000000); + if (requests == 2 && scenario == "retry-after") + assert (get_monotonic_time () - first_request_at >= 1800000); + + if (requests == 2 && scenario == "retry-after-date") + assert (get_monotonic_time () - first_request_at >= 4500000); assert (message.get_request_headers ().get_one ("Accept-Encoding") == "identity"); var range = message.get_request_headers ().get_one ("Range"); var validator = message.get_request_headers ().get_one ("If-Range"); string response; - if ((scenario == "retry-after" || scenario == "retry-after-date" || scenario == "retry-after-long") && requests == 1) { - response = "HTTP/1.1 503 Service Unavailable\r\nContent-Length: 0\r\nRetry-After: %s\r\n\r\n".printf ( - scenario == "retry-after" ? "2" : scenario == "retry-after-date" ? new DateTime.now_utc ().add_seconds (3).format ("%a, %d %b %Y %H:%M:%S GMT") : "1200"); + if ((scenario == "retry-after" || + scenario == "retry-after-date" || + scenario == "retry-after-long") && requests == 1) { + + var retry_after = scenario == "retry-after" ? "2" : + scenario == "retry-after-date" ? + Soup.date_time_to_string (new DateTime.now_utc ().add_seconds (6), Soup.DateFormat.HTTP) : + "1200"; + + response = "HTTP/1.1 503 Service Unavailable\r\n" + + "Content-Length: 0\r\n" + + "Retry-After: %s\r\n\r\n".printf (retry_after); } else if (scenario == "http-permanent") { response = "HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\n\r\n"; } else if (scenario == "http-retry" && requests == 1) {