Snapcraft uses SPDX 2.1 syntax[1], which allows specifying "or later" license style by appending a `+` operator after the license expression. Refer Appendix IV: SPDX License Expressions[2] for more info regarding this syntax. [1] https://spdx.org/spdx-specification-21-web-version [2] https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60 Refer-to: license - Snapcraft top-level metadata - doc - snapcraft.io <https://forum.snapcraft.io/t/snapcraft-top-level-metadata/8334#heading--license> Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
56 lines
2.1 KiB
YAML
56 lines
2.1 KiB
YAML
name: remote-touchpad
|
|
license: GPL-3.0+
|
|
grade: stable
|
|
adopt-info: remote-touchpad
|
|
|
|
base: core18
|
|
confinement: strict
|
|
|
|
apps:
|
|
remote-touchpad:
|
|
command: bin/remote-touchpad
|
|
plugs:
|
|
- network-bind
|
|
- desktop
|
|
- x11
|
|
remote-touchpad-wait-on-error:
|
|
command: usr/bin/remote-touchpad-wait-on-error
|
|
plugs:
|
|
- network-bind
|
|
- desktop
|
|
- x11
|
|
common-id: com.github.unrud.RemoteTouchpad
|
|
desktop: share/applications/com.github.unrud.RemoteTouchpad.desktop
|
|
|
|
parts:
|
|
remote-touchpad:
|
|
plugin: go
|
|
go-importpath: github.com/Unrud/remote-touchpad
|
|
go-buildtags: [portal x11]
|
|
source: .
|
|
source-type: git
|
|
build-packages:
|
|
- gcc
|
|
- libxt-dev
|
|
- libxtst-dev
|
|
stage-packages:
|
|
- libxt6
|
|
- libxtst6
|
|
override-pull: |
|
|
snapcraftctl pull
|
|
# WORKAROUND: Snapcraft Go Plugin doesn't set buildtags for go-get
|
|
GOPATH="$(realpath "${SNAPCRAFT_PART_SRC}/../go")"
|
|
env --chdir="$GOPATH/src" GOPATH="$GOPATH" go get -t -d -tags 'portal x11' ./github.com/Unrud/remote-touchpad/...
|
|
# WORKAROUND: Point icon to the correct location
|
|
sed -e 's|Icon=com.github.unrud.RemoteTouchpad|Icon=/usr/share/icons/hicolor/512x512/apps/com.github.unrud.RemoteTouchpad.png|' -i desktop/com.github.unrud.RemoteTouchpad.desktop
|
|
override-build: |
|
|
snapcraftctl build
|
|
install -Dm0755 -t "${SNAPCRAFT_PART_INSTALL}/usr/bin" desktop/remote-touchpad-wait-on-error
|
|
install -Dm0644 -t "${SNAPCRAFT_PART_INSTALL}/usr/share/metainfo" desktop/com.github.unrud.RemoteTouchpad.appdata.xml
|
|
install -Dm0644 -t "${SNAPCRAFT_PART_INSTALL}/usr/share/applications" desktop/com.github.unrud.RemoteTouchpad.desktop
|
|
for s in 64 128 256 512; do
|
|
install -Dm0644 desktop/remote-touchpad_${s}.png "${SNAPCRAFT_PART_INSTALL}/usr/share/icons/hicolor/${s}x${s}/apps/com.github.unrud.RemoteTouchpad.png"
|
|
done
|
|
# WORKAROUND: Version is not extracted from AppStream
|
|
snapcraftctl set-version "$(${SNAPCRAFT_PART_INSTALL}/bin/remote-touchpad --version)"
|
|
parse-info: [usr/share/metainfo/com.github.unrud.RemoteTouchpad.appdata.xml]
|