-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundling app into Flatpak #72
base: main
Are you sure you want to change the base?
Conversation
io.github.steamdeck.yml
Outdated
- name: golang | ||
buildsystem: simple | ||
sources: | ||
- type: archive | ||
only-arches: | ||
- aarch64 | ||
url: https://go.dev/dl/go1.20.1.linux-arm64.tar.gz | ||
sha256: fc0aa29c933cec8d76f5435d859aaf42249aa08c74eb2d154689ae44c08d23b3 | ||
- type: archive | ||
only-arches: | ||
- x86_64 | ||
url: https://go.dev/dl/go1.20.1.linux-amd64.tar.gz | ||
sha256: 000a5b1fca4f75895f78befeb2eecf10bfff3c428597f3f1e69133b63b911b02 | ||
build-commands: | ||
- install -d /app/lib/sdk/golang | ||
- cp -rpv * /app/lib/sdk/golang/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need go 1.20, but the SDK extension was only providing go 1.19. It may be there was something I was missing.
io.github.steamdeck.yml
Outdated
sources: | ||
- type: git | ||
path: . | ||
branch: relative-homdir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a trick I use for iterating on builds, but isn't the end solution. If we were to use this "for real", we would want to use a tag/commit hash combination for a release.
@@ -3,4 +3,4 @@ if [ "$(xrandr | grep ' connected' | wc -l)" -eq 1 ]; then | |||
export FYNE_SCALE=0.25 | |||
fi | |||
|
|||
"$HOME"/.cryo_utilities/cryo_utilities gui |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to think of a better way to rectify launching in the flatpak vs. out of the flatpak. It should be an easy thing to solve.
|
||
func setUnitValueWithinFlatpak(param string, value string) error { | ||
hostSpawnCmd := "host-spawn" | ||
hostCommandArgs := []string{"sudo", "sh", "-c"} | ||
shellCmd := fmt.Sprintf("echo %v | tee %v", value, UnitMatrix[param]) | ||
hostCommandArgs = append(hostCommandArgs, shellCmd) | ||
fmt.Println("Executing command ", hostSpawnCmd, hostCommandArgs) | ||
cmd := exec.Command(hostSpawnCmd, hostCommandArgs...) | ||
stdin, err := cmd.StdinPipe() | ||
if err != nil { | ||
fmt.Println(err) | ||
return err | ||
} | ||
cmd.Start() | ||
_, err = stdin.Write([]byte(CryoUtils.UserPassword + "\n")) | ||
if err != nil { | ||
fmt.Println(err) | ||
return err | ||
} | ||
return cmd.Wait() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these functions would need to be documented prior to being ready for prime-time.
io.github.steamdeck.yml
Outdated
@@ -0,0 +1,53 @@ | |||
app-id: io.github.steamdeckutilities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a real domain controlled by the project to be listed on flathub. I just made something up for iteration purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I own cryobyte.io, which would be perfect. Does it need to have its own subdomain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short answer: From my reading of the docs, the project just needs to control the root domain, so controlling io.cryobyte should be sufficient. The third part of the url will just be the project identifier, so my recommendation would be io.cryobyte.steamdeckutilities
Docs: https://docs.flatpak.org/en/latest/conventions.html#application-ids
Amazing work! I'll be busy moving for the next few days, but I'll review as I can! |
That's very nice indeed. Your createCommand is much cleaner. It would be great if you could do another PR with the |
I can spin out Thank you for the feedback - I originally thought of naming it |
My usage of downloading golang manually is a work around for flathub/org.freedesktop.Sdk.Extension.golang#82 - once that is fixed we can just use the SDK extension. |
|
||
<developer_name>Cryobyte33</developer_name> | ||
|
||
<metadata_license>MIT</metadata_license> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-metadata_license, the metadata license supported does not appear to include GPL. This is not the code/project license, this is strictly the license for this metadata itself. Other options are:
FSFAP
MIT
0BSD
CC0-1.0
CC-BY-3.0
CC-BY-4.0
CC-BY-SA-3.0
CC-BY-SA-4.0
GFDL-1.1
GFDL-1.2
GFDL-1.3
BSL-1.0
FTL
FSFUL
@CryoByte33 Do you have a preference on this, or are you comfortable with MIT?
<description> | ||
<p> | ||
# Cryobyte Utilities is a game performance enhancher for Linux. This application is designed primarily for the Steam Deck, however it will work on other distributions on a "best-effort" basis. | ||
</p> | ||
<p> | ||
Written by Cryobyte33, this application fine tunes Linux system settings for gaming performance. | ||
</p> | ||
<p> | ||
Key Features: | ||
</p> | ||
<p> | ||
One-click set-to-recommended settings | ||
One-click revert-to-stock settings | ||
Swap Tuner | ||
Swap File Resizer + Recovery | ||
Swappiness Changer | ||
Memory Parameter Tuning | ||
HugePages Toggle | ||
Compaction Proactiveness Changer | ||
HugePage Defragmentation Toggle | ||
Page Lock Unfairness Changer | ||
Shared Memory (shmem) Toggle | ||
Storage Manager | ||
Sync shadercache and compatdata to the same location the game is installed | ||
Delete shadercache and compatdata for whichever games you select | ||
NEW Delete the shadercache and compatdata for all uninstalled games with a single click | ||
Full CLI mode | ||
</p> | ||
</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user will see this copy on this discover store - I would like feedback from Cryo and the community. This can be changed on a per-update basis.
<image>https://raw.githubusercontent.com/CryoByte33/steam-deck-utilities/main/cmd/cryoutilities/Icon.png</image> | ||
</screenshot> | ||
<!-- <screenshot> | ||
<image>@TODO</image> | ||
</screenshot> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need at least one screenshot for flathub.
- install -D cryo_utilities /app/bin/cryo_utilities | ||
- install -D launcher.sh /app/bin/launcher.sh | ||
- mkdir -p /app/share/applications/ | ||
- install -D ./cmd/cryoutilities/Icon.png /app/share/icons/hicolor/512x512/apps/io.cryobyte.cryobyteutilities.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CryoByte33 Do you have a 512x512 version of the project icon? Flatpak will auto downsample the image to smaller versions (256x256, 128x128 etc), but our current icon isn't very high res and looks washed out when upscaled to 512x512.
The code work for this is pretty much done. This is mostly admin work, with one code change. The remaining work:
|
This draft PR is to capture my work to show a prototype of packaging the app as a flatpak.
In order to run this, you must first run
go mod vendor && git add vendor && git commit -m "Running go mod vendor"
From there you can build the flatpak via
flatpak-builder --force-clean --user --install --repo=repo ./build-dir io.cryobyte.cryobyteutilities.yml
and run via
flatpak run io.cryobyte.cryobyteutilities.yml