shadPS4 icon indicating copy to clipboard operation
shadPS4 copied to clipboard

[SUGGESTION] Build as Flatpak

Open Captn138 opened this issue 1 year ago • 3 comments

Building as a Flatpak would be great for Linux users. Also, it would normalize the behavior on lal devices and facilitate installation on steam deck.

Captn138 avatar Jul 09 '24 06:07 Captn138

Most emulators are already in flathub, so it will be very welcome to his entrance too.

Caua77 avatar Aug 17 '24 22:08 Caua77

Any news about this ? Maybe someone can work on it ?

Hermiten avatar Sep 04 '24 07:09 Hermiten

I've been working on a manifest for a bit but can't quite get it working. Maybe someone else can finish it off:

app-id: com.shadps4.Emulator
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: shadps4
finish-args:
  - --share=network
  - --socket=pulseaudio
  - --socket=wayland
  - --socket=x11
  - --device=dri
  - --filesystem=home

modules:
  - name: libevdev
    buildsystem: meson
    config-opts:
      - -Dtests=disabled
      - -Ddocumentation=disabled
    # cleanup:
    #   - /bin
    #   - /include
    #   - /lib/pkgconfig
    #   - /share
    sources:
      - type: archive
        url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.3.tar.xz
        sha256: abf1aace86208eebdd5d3550ffded4c8d73bb405b796d51c389c9d0604cbcfbf
        x-checker-data:
          type: anitya
          project-id: 20540
          stable-only: true
          url-template: https://www.freedesktop.org/software/libevdev/libevdev-$version.tar.xz

  - name: shadPS4
    buildsystem: cmake
    builddir: true
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      # - -DENABLE_QT_GUI=ON
    build-options:
      env:
        CMAKE_C_COMPILER: clang
        CMAKE_CXX_COMPILER: clang++
    sources:
      # - type: git
      #   url: https://github.com/shadps4-emu/shadPS4.git
      #   branch: main
      - type: dir
        path: .

deadmeu avatar Sep 15 '24 09:09 deadmeu

I've been working on a manifest for a bit but can't quite get it working. Maybe someone else can finish it off:

app-id: com.shadps4.Emulator
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: shadps4
finish-args:
  - --share=network
  - --socket=pulseaudio
  - --socket=wayland
  - --socket=x11
  - --device=dri
  - --filesystem=home

modules:
  - name: libevdev
    buildsystem: meson
    config-opts:
      - -Dtests=disabled
      - -Ddocumentation=disabled
    # cleanup:
    #   - /bin
    #   - /include
    #   - /lib/pkgconfig
    #   - /share
    sources:
      - type: archive
        url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.3.tar.xz
        sha256: abf1aace86208eebdd5d3550ffded4c8d73bb405b796d51c389c9d0604cbcfbf
        x-checker-data:
          type: anitya
          project-id: 20540
          stable-only: true
          url-template: https://www.freedesktop.org/software/libevdev/libevdev-$version.tar.xz

  - name: shadPS4
    buildsystem: cmake
    builddir: true
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      # - -DENABLE_QT_GUI=ON
    build-options:
      env:
        CMAKE_C_COMPILER: clang
        CMAKE_CXX_COMPILER: clang++
    sources:
      # - type: git
      #   url: https://github.com/shadps4-emu/shadPS4.git
      #   branch: main
      - type: dir
        path: .

Thanks for your effort. @deadmeu any updates? A Flatpak would be awesome! A somewhat consistent experience across Distributions. But I'm already happy that so many platforms are supported and we have an AppImage!

ghost avatar Oct 27 '24 22:10 ghost

ill pick this up. i just put that manifest in as a draft PR and will see what i can do with it.

@deadmeu ill happily put you as a co-author, but your email is private :)

jardon avatar Nov 02 '24 13:11 jardon

I should point out that in order for shadps4 to be submitted to Flathub, it'll need to be tooled slightly differently. I've put together a Flatpak build in a web-based repository with automatic updates for new tagged releases here that could be easily shifted over to Flathub.

This also included putting together a metainfo.xml file and doing an svg redraw of the icon that I'd be happy to contribute over here :)

Would be happy to put my head together with @jardon to get a submission to Flathub off the ground (I've done a whole bunch of those over the past few months). I've got a whole bunch of comm channels I'm available on, give me a shout if you want to work together on this! :)

fpiesche avatar Nov 06 '24 00:11 fpiesche

I'd be happy to collaborate on that. I only refrained from setting up flathub because I think that should be set up as a verified publisher by someone actually on the team.

jardon avatar Nov 06 '24 01:11 jardon

The verification can be done via the website if needs be, but yes - someone on the team would need to approve us submitting shadps4 to Flathub at the least as part of Flathub's submission guidelines; and ideally they'd get set as the owner of the repo that'll be set up in the flathub org.

The main advantage, as a user, of a proper release on Flathub or another web repository (which can be self-hosted), is that updates to the builds there will automatically roll out to users too. The x-checker-data bits in the manifest configure Flathub's infrastructure to hourly monitor the sources set up with them for updates, and flathub's workflows will automatically create PRs. So, for example, if this repo here creates a new tag matching v?.?.?, Flathub will create a PR to update hte Manifest to use that tag and create a test build; once the PR is merged (eg. after someone's checked the test build is okay) the test build will automatically get rolled out to Flathub's live repo. On most Linux desktop environments, this will then trigger an update notification.

fpiesche avatar Nov 06 '24 01:11 fpiesche

that all sounds good to me.

my only concern is we need to work to improve the update mechanism with a flathub-delivered package. or at least disable that option if it is installed via flathub. my PR hopefully addresses when it is installed via flatpak bundle, but not from a remote.

maybe a simple environment variable can be set when the flaptak is run that disables the built-in update mechanism?

jardon avatar Nov 06 '24 01:11 jardon

We can set a cmake build variable in the flatpak manifest, then use that in the GUI code.

ngoquang2708 avatar Nov 06 '24 02:11 ngoquang2708

@fpiesche we've created this repo to house the flathub-related packaging.

can you work on setting up a PR here with all the required pieces?

jardon avatar Nov 06 '24 13:11 jardon

we also likely need this to land. for packaged builds, the built-in update system doesnt/cant work. having an option to disable the built-in updater is helpful for packages that are managed externally.

jardon avatar Nov 06 '24 13:11 jardon

Hello my open source heroes! I just saw that the Dolphin Emu Devs also worked on a Flatpak, this reminded me of this open issue. I don't want to sound pushy, I'm just curious, if this is even a goal in the long run for the Emulator.

I feel like an a...hole for asking this, because I don't even know how to build a Flatpak.

ghost avatar Dec 02 '24 13:12 ghost

https://github.com/shadps4-emu/shadPS4-flatpak/pull/1

ngoquang2708 avatar Dec 02 '24 13:12 ngoquang2708

Done

Hermiten avatar Dec 14 '24 12:12 Hermiten

Guys please have a look at https://github.com/shadps4-emu/shadPS4-flatpak/issues/4

Twig6943 avatar Dec 29 '24 18:12 Twig6943

@ngoquang2708 ?

Hermiten avatar Dec 29 '24 21:12 Hermiten

I think @fpiesche has more experiences on on this than I do.

ngoquang2708 avatar Dec 30 '24 05:12 ngoquang2708

shadPS4 is now on flathub! Thanks to everyone who worked on this! https://flathub.org/apps/net.shadps4.shadPS4

lpww avatar Jan 14 '25 15:01 lpww

Thank you! Btw, is it possible to switch to the pre release builds when using the Flatpak?

ghost avatar Jan 14 '25 21:01 ghost

Thank you! Btw, is it possible to switch to the pre release builds when using the Flatpak?

a pkg should be submitted to flathub-beta repo for that

Twig6943 avatar Jan 14 '25 21:01 Twig6943

awesome, i'm gonna try it soon (of course with bloodborne)

Captn138 avatar Jan 16 '25 10:01 Captn138

Thank you! Btw, is it possible to switch to the pre release builds when using the Flatpak?

a pkg should be submitted to flathub-beta repo for that

This unfortunately is not possible at this time. The prereleases track main and nightly releases are not allowed in flathub even in the beta channels. There have been talks of having a more formal beta once shad becomes more stable, but until then, we are only going to be able to ship the latest "stable" release per policy. :/

jardon avatar Jan 19 '25 14:01 jardon

People can just use the am pkg for the nightly I guess

Image

Twig6943 avatar Jan 19 '25 14:01 Twig6943