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
Add additional content #15
Changes from all commits
1ae659e
dab03c9
26787df
ad54929
1f673c0
7392a2c
38e06a5
0ca54d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<h1 align="center"> | ||
<img src="https://avatars1.githubusercontent.com/u/29598503?v=3&s=256" alt="Project"> | ||
<img src="snap/gui/icon.png" alt="Project" style="height: 256px"> | ||
<br /> | ||
[Project] | ||
</h1> | ||
|
@@ -15,12 +15,12 @@ distributions.</p> | |
|
||
## Install | ||
|
||
sudo snap install my-snap-name | ||
sudo snap install --channel=edge --devmode my-snap-name | ||
|
||
([Don't have snapd installed?](https://snapcraft.io/docs/core/install)) | ||
|
||
<!-- Uncomment and modify this when you have a screenshot | ||
![my-snap-name](screenshot.png?raw=true "my-snap-name") | ||
![my-snap-name](snap/screenshots/screenshot.png?raw=true "my-snap-name") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Files in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. Please revert this change @Lin-Buo-Ren |
||
--> | ||
|
||
<p align="center">Published for <img src="http://anything.codes/slack-emoji-for-techies/emoji/tux.png" align="top" width="24" /> with :gift_heart: by Snapcrafters</p> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# /snap | ||
|
||
[Snaps are universal Linux packages](https://snapcraft.io/). Snaps are containerised software packages that are simple to create and install on all major Linux systems without modification. | ||
|
||
Here are the files used for snap packaging, refer [snaps and snapcraft documentation](https://docs.snapcraft.io/) for more info. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# /snap/gui | ||
|
||
Copy the snapped application's icon here and specify it in snapcraft.yaml file using the `icon` keyword. This folder is not necessary if the icon is already existed in the source tree. | ||
|
||
NOTE: The Snap Store requires SVG scalable image or PNG image with at least 256x256px in size. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# /snap/patches | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Files in /snap/ will be copied into the package. They cannot be filtered via stage: or prime: keywords. 👎 on this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. Please revert this change @Lin-Buo-Ren |
||
|
||
Here are the patches that are required to build a snap package that functions correctly. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This sed script patches the desktop entries of the snapped | ||
# application. | ||
# | ||
# Documentation: | ||
# | ||
# * GNU Sed Manual | ||
# https://www.gnu.org/software/sed/manual | ||
# * `sed` script overview - `sed` scripts | ||
# * `sed` commands summary - `sed` scripts | ||
# * The `s` Command - `sed` scripts | ||
# * Overview of basic regular expression syntax - Regular | ||
# Expressions: selecting text | ||
# * Back-references and Subexpressions - Regular Expressions: | ||
# selecting text | ||
|
||
## Append '(Snappy Edition)' to the application name to make it | ||
## distinguishable with the other same application using different | ||
## software distribution technologies | ||
## | ||
## FIXME: The appended string is not localizable, the proper way to | ||
## implement this is to probably use a new X-Snappy-Name keys | ||
## with localestring format to let the translators fill in | ||
## additional localized string and use these values to replace | ||
## the Name keys here. | ||
s/^\(Name\(\[.\+\]\)\?=.*\)$/\1 (Snappy Edition)/g | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like calling out that an application in a snap is any different to the same application packaged elsewhere. This is an example that people will use in their packages if we include it in this repo. I therefore think this line should be dropped. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. Also Snappy is not how we refer to Snapcraft or Snaps these days. @Lin-Buo-Ren please revert this change. |
||
|
||
## Fix-up application icon lookup | ||
s|^Icon=.*|Icon=\${SNAP}/meta/gui/icon.svg| |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Screenshots | ||
|
||
The screenshots of the snapped application. This is not currently synced to the product page on the Snap Store and should be uploaded by yourself. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,63 @@ description: | | |
store. | ||
|
||
confinement: devmode # use 'strict' once you have the right plugs and slots | ||
grade: devel | ||
icon: snap/gui/icon.png | ||
|
||
apps: | ||
my-app: | ||
command: my-app | ||
desktop: share/applications/my-app.desktop | ||
#plugs: | ||
#- desktop | ||
#- desktop-legacy | ||
#- x11 | ||
#- unity7 | ||
|
||
#slots: | ||
|
||
parts: | ||
my-part: | ||
# Patches to fix other parts | ||
patches: | ||
source: snap/patches | ||
source-type: local | ||
plugin: dump | ||
|
||
# DISABLED: Bug #1775582 “`organize:{ /: another-dir/ }` causes the items under host root directory to be copied in another-dir” : Bugs : Snapcraft | ||
# https://forum.snapcraft.io/t/organize-another-dir-causes-the-items-under-host-root-directory-to-be-copied-in-another-dir/5806 | ||
#organize: | ||
#/: patches/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please drop the commented-out block There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, please remove this @Lin-Buo-Ren. I don't think we should be adding boilerplate that is only required for a few cases. |
||
override-build: | | ||
set -eu | ||
|
||
snapcraftctl build | ||
|
||
mkdir \ | ||
--parents \ | ||
"$SNAPCRAFT_PART_INSTALL"/patches | ||
mv \ | ||
"$SNAPCRAFT_PART_INSTALL"/*.diff \ | ||
"$SNAPCRAFT_PART_INSTALL"/*.patch \ | ||
"$SNAPCRAFT_PART_INSTALL"/*.sed \ | ||
"$SNAPCRAFT_PART_INSTALL"/patches \ | ||
|| true # Empty patches folder is allowed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this override script isn't needed, please drop. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really don't think we should be complicating a template yaml with patches. They are only required in rare cases. |
||
stage: | ||
- patches/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't needed. |
||
override-prime: 'true' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replace with: prime: [-*] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to see this patches stuff removed from the template yaml entirely. However, @Lin-Buo-Ren you have come up with an interesting use case. Perhaps a blog post on snapcraft.io about best practice for applying patches, when required, to a snap would be a good idea? What to collaborate on that? |
||
|
||
my-app: | ||
after: | ||
- patches | ||
|
||
# See 'snapcraft plugins' | ||
plugin: nil | ||
|
||
override-stage: | | ||
set -eu | ||
|
||
snapcraftctl stage | ||
|
||
sed \ | ||
--file "${SNAPCRAFT_STAGE}"/patches/patch-desktop-entries.sed \ | ||
--in-place \ | ||
"${SNAPCRAFT_STAGE}"/share/applications/*.desktop |
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 think we want this to remain as-is.
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 agee. Please revert this change @Lin-Buo-Ren