{"id":20346315,"url":"https://github.com/fyne-io/flatpak_demo","last_synced_at":"2025-04-12T00:51:57.585Z","repository":{"id":64304695,"uuid":"405330881","full_name":"fyne-io/flatpak_demo","owner":"fyne-io","description":"A demo of a Fyne application packaged as a Flatpak.","archived":false,"fork":false,"pushed_at":"2025-02-21T10:13:30.000Z","size":14097,"stargazers_count":12,"open_issues_count":3,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-12T00:51:48.054Z","etag":null,"topics":["example","flatpak","fyne"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fyne-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-11T08:57:28.000Z","updated_at":"2025-02-21T10:13:34.000Z","dependencies_parsed_at":"2024-01-02T14:44:49.662Z","dependency_job_id":"ff23ebf8-7991-405f-b5a1-355ba296209e","html_url":"https://github.com/fyne-io/flatpak_demo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyne-io%2Fflatpak_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyne-io%2Fflatpak_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyne-io%2Fflatpak_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fyne-io%2Fflatpak_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fyne-io","download_url":"https://codeload.github.com/fyne-io/flatpak_demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501886,"owners_count":21114681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","flatpak","fyne"],"created_at":"2024-11-14T22:12:38.720Z","updated_at":"2025-04-12T00:51:57.551Z","avatar_url":"https://github.com/fyne-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flatpak_demo\nA demo of a Fyne application packaged as a Flatpak. This project is intended to serve as a starting point to help developers package their Fyne applications using Flatpak.\n\n![screenshot](img/screenshot1.png)\n\n![software-center](img/software-center.png)\n\n## Requirements\nBoth `flatpak` and `flatpak-builder` need to be installed in order to build the packages. Commands for installing Flatpak can be found [here](https://flatpak.org/setup/). Installing the builder should be very similar.\nMore information about how to build Flatpaks can be found [here](https://docs.flatpak.org/en/latest/first-build.html) and [here](https://docs.flatpak.org/en/latest/building.html).\n\nWith that installed, we need to first get the [flathub](https://flatpak.org) repository set up.\n```\nflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo\n```\n\nWe can now move on to installing the development SDKs that we are going to use:\n```\nflatpak install flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 org.freedesktop.Sdk.Extension.golang//23.08\n```\n\n## Building and installing\n\nBuilding the package can be done with the following command:\n```\nflatpak-builder --user --force-clean build-dir io.fyne.flatpak_demo.yml\n```\n\nThe package can also be built and installed in one step, using the following command:\n```\nflatpak-builder --user --install --force-clean build-dir io.fyne.flatpak_demo.yml\n```\n\n## Running\nThe installed package can then be started by running the following command:\n```\nflatpak run --user io.fyne.flatpak_demo\n```\n\n## Vendoring\nIt is possible to enable network access during the build, but it is recommended to not do so. If you want to publish the package to [flathub](https://flathub.org), it is even a requirement.\nFor that reason, it is a good idea to vendor the project using `go mod vendor` and add the files to the git repo or use tools like [flatpak-go-mod](https://github.com/dennwc/flatpak-go-mod).\n\n## Sandbox permissions\nThe Flatpak applications run within a sandbox that restricts their communication with the host system. It is generally preferred to have the application be as strict as possible,\nwith no more permissions enabled than necessary. Our example app only opens up filesystem access for the `Documents` folder as well as the Fyne config directory to support Fyne\npreferences and Fyne document storage system. Remove these if your app do not need it.\nMore information on avaliable permissions can be found on the [sandbox-permissions](https://docs.flatpak.org/en/latest/sandbox-permissions.html) \nand the [sandbox-permissions-reference](https://docs.flatpak.org/en/latest/sandbox-permissions-reference.html) documentation pages.\n\n## Appdata and desktop files\nFlatpak requires the application to provide metadata about itself. This data is then used in application stores like [Gnome Software](https://apps.gnome.org/en-GB/app/org.gnome.Software/), [KDE Discover](https://apps.kde.org/discover/)\nand many others, to display information about the application. This metadata can easily be created using the [AppStream Metainfo Creator](https://www.freedesktop.org/software/appstream/metainfocreator/#/guiapp),\nor you can use the [io.fyne.flatpak_demo.appdata.xml](https://github.com/fyne-io/flatpak_demo/blob/main/io.fyne.flatpak_demo.appdata.xml) file as a reference.\n\nA desktop file (`.desktop`) is also required (as with any other Linux desktop application). You can let the metainfo creator above generate one for you, or you can use the [io.fyne.flatpak_demo.desktop](https://github.com/fyne-io/flatpak_demo/blob/main/io.fyne.flatpak_demo.desktop) file as a reference.\n\n### Guidelines from Flathub\nFlathub has documentation regarding their requirements and suggestions for your application metadata if you wish to publish the app there.\nMost notably, the [MetaInfo guidelines](https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/) and [Quality guidelines](https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/quality-guidelines) are important to read.\n\n## Example manifest\nThe manifest for this project can be found below. It can be used as a base to use when packaging other apps using Flatpak.\nThe sha256 field for the source can be found by downloading the file and running `sha256sum` on it.\n\nPlease note that this manifest file normally wouldn't be in the same repository as the rest of the code, but instead\npart of a separate flatpak-specific repository. We have it in the same repository here for the sake of simplicity.\nThis manifest uses the latest release of this repository and will not get local changes.\n\n```yml\napp-id: io.fyne.flatpak_demo\nruntime: org.freedesktop.Platform\nruntime-version: '23.08'\nsdk: org.freedesktop.Sdk\nsdk-extensions:\n    - org.freedesktop.Sdk.Extension.golang\ncommand: flatpak_demo\n\nfinish-args:\n    - --share=ipc # Share IPC namespace with the host (necessary for X11).\n    - --socket=x11\n    - --device=dri # OpenGL rendering support.\n\n    # Only needed if building with -tags wayland.\n    #- --socket=wayland\n\n    # Needed to support desktop notifications.\n    - --talk-name=org.freedesktop.Notifications\n\n    # Allowing access to the home directory as example.\n    - --filesystem=home\n\nbuild-options:\n  env:\n    - GOBIN=/app/bin\n    - GOROOT=/usr/lib/sdk/golang\n\nmodules:\n    - name: flatpak_demo\n      buildsystem: simple\n      build-commands:\n        - $GOROOT/bin/go build -trimpath -o flatpak_demo\n        - install -Dm00755 flatpak_demo $FLATPAK_DEST/bin/flatpak_demo\n        - install -Dm00644 Icon.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png\n        - install -Dm00644 $FLATPAK_ID.desktop $FLATPAK_DEST/share/applications/$FLATPAK_ID.desktop\n        - install -Dm00644 $FLATPAK_ID.appdata.xml $FLATPAK_DEST/share/appdata/$FLATPAK_ID.appdata.xml\n      sources:\n        - type: archive\n          url: \"https://github.com/fyne-io/flatpak_demo/archive/refs/tags/v1.3.0.tar.gz\"\n          sha256: a9d3b920404b3b699da757a9641ebc75cf43e35515dd9879622de33c6d104b63\n```\n\n### Building local code\nIf you want to build using the local code in the repository instead of the latest release, you can\nswap out the source section in the manifest above with this:\n\n```yml\n      sources:\n        - type: dir\n          path: ./\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffyne-io%2Fflatpak_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffyne-io%2Fflatpak_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffyne-io%2Fflatpak_demo/lists"}