Add snapcraft packaging script
This commit is contained in:
parent
37e7ed3042
commit
0876e0e1cf
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -32,3 +32,8 @@ profile
|
||||||
*.moved-aside
|
*.moved-aside
|
||||||
DerivedData
|
DerivedData
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
*.snap
|
||||||
|
|
||||||
|
venv/
|
||||||
|
snapcraft.yaml
|
22
packager.py
22
packager.py
|
@ -56,6 +56,8 @@ def build(skipcargo):
|
||||||
build_windows(package_info)
|
build_windows(package_info)
|
||||||
elif TARGET_OS == "macos":
|
elif TARGET_OS == "macos":
|
||||||
build_mac(package_info)
|
build_mac(package_info)
|
||||||
|
elif TARGET_OS == "linux":
|
||||||
|
build_snap(package_info)
|
||||||
|
|
||||||
|
|
||||||
def build_windows(package_info):
|
def build_windows(package_info):
|
||||||
|
@ -174,6 +176,26 @@ def build_mac(package_info):
|
||||||
|
|
||||||
print("Done!")
|
print("Done!")
|
||||||
|
|
||||||
|
|
||||||
|
def build_snap(package_info):
|
||||||
|
print("Starting packaging process for Snap package...")
|
||||||
|
|
||||||
|
print("Rendering snapcraft template...")
|
||||||
|
with open("packager/linux/snapcraft-template.yaml", "r") as snapcraft_template:
|
||||||
|
content = snapcraft_template.read()
|
||||||
|
|
||||||
|
# Replace variables
|
||||||
|
content = content.replace("{{{app_version}}}", package_info.version)
|
||||||
|
|
||||||
|
with open("snapcraft.yaml", "w") as output_file:
|
||||||
|
output_file.write(content)
|
||||||
|
|
||||||
|
print("Starting snapcraft packaging process...")
|
||||||
|
subprocess.run(["snapcraft"])
|
||||||
|
|
||||||
|
print("Done!")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print("[[ espanso packager ]]")
|
print("[[ espanso packager ]]")
|
||||||
|
|
||||||
|
|
75
packager/linux/snapcraft-template.yaml
Normal file
75
packager/linux/snapcraft-template.yaml
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
name: espanso
|
||||||
|
version: {{{app_version}}}
|
||||||
|
summary: A Cross-platform Text Expander written in Rust
|
||||||
|
description: |
|
||||||
|
espanso is a Cross-platform, Text Expander written in Rust.
|
||||||
|
|
||||||
|
## What is a Text Expander?
|
||||||
|
|
||||||
|
A text expander is a program that detects when you type
|
||||||
|
a specific keyword and replaces it with something else.
|
||||||
|
This is useful in many ways:
|
||||||
|
* Save a lot of typing, expanding common sentences.
|
||||||
|
* Create system-wide code snippets.
|
||||||
|
* Execute custom scripts
|
||||||
|
* Use emojis like a pro.
|
||||||
|
___
|
||||||
|
|
||||||
|
## Key Features
|
||||||
|
|
||||||
|
* Works on Windows, macOS and Linux
|
||||||
|
* Works with almost any program
|
||||||
|
* Works with Emojis 😄
|
||||||
|
* Works with Images
|
||||||
|
* Date expansion support
|
||||||
|
* Custom scripts support
|
||||||
|
* Shell commands support
|
||||||
|
* App-specific configurations
|
||||||
|
* Expandable with packages
|
||||||
|
* Built-in package manager for espanso hub: https://hub.espanso.org/
|
||||||
|
* File based configuration
|
||||||
|
|
||||||
|
## Get Started
|
||||||
|
|
||||||
|
Visit the official documentation: https://espanso.org/docs/
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
If you need some help to setup espanso, want to ask a question or simply get involved
|
||||||
|
in the community, Join the official Subreddit: https://www.reddit.com/r/espanso/
|
||||||
|
|
||||||
|
confinement: classic
|
||||||
|
base: core18
|
||||||
|
|
||||||
|
parts:
|
||||||
|
espanso:
|
||||||
|
plugin: rust
|
||||||
|
source: .
|
||||||
|
build-packages:
|
||||||
|
- libssl-dev
|
||||||
|
- pkg-config
|
||||||
|
- cmake
|
||||||
|
- libxtst-dev
|
||||||
|
- libx11-dev
|
||||||
|
- libxdo-dev
|
||||||
|
stage-packages:
|
||||||
|
- libx11-6
|
||||||
|
- libxau6
|
||||||
|
- libxcb1
|
||||||
|
- libxdmcp6
|
||||||
|
- libxdo3
|
||||||
|
- libxext6
|
||||||
|
- libxinerama1
|
||||||
|
- libxkbcommon0
|
||||||
|
- libxtst6
|
||||||
|
- libnotify-bin
|
||||||
|
- xclip
|
||||||
|
|
||||||
|
apps:
|
||||||
|
espanso:
|
||||||
|
command: bin/espanso
|
||||||
|
plugs:
|
||||||
|
- x11
|
||||||
|
- network-bind
|
||||||
|
- desktop
|
||||||
|
- unity7
|
|
@ -1,39 +0,0 @@
|
||||||
name: espanso
|
|
||||||
version: 0.5.1
|
|
||||||
summary: A Cross-platform Text Expander written in Rust
|
|
||||||
description: TODO
|
|
||||||
|
|
||||||
confinement: classic
|
|
||||||
base: core18
|
|
||||||
|
|
||||||
parts:
|
|
||||||
espanso:
|
|
||||||
plugin: rust
|
|
||||||
source: .
|
|
||||||
build-packages:
|
|
||||||
- libssl-dev
|
|
||||||
- pkg-config
|
|
||||||
- cmake
|
|
||||||
- libxtst-dev
|
|
||||||
- libx11-dev
|
|
||||||
- libxdo-dev
|
|
||||||
stage-packages:
|
|
||||||
- libx11-6
|
|
||||||
- libxau6
|
|
||||||
- libxcb1
|
|
||||||
- libxdmcp6
|
|
||||||
- libxdo3
|
|
||||||
- libxext6
|
|
||||||
- libxinerama1
|
|
||||||
- libxkbcommon0
|
|
||||||
- libxtst6
|
|
||||||
- libnotify-bin
|
|
||||||
- xclip
|
|
||||||
|
|
||||||
apps:
|
|
||||||
espanso:
|
|
||||||
command: bin/espanso
|
|
||||||
plugs:
|
|
||||||
- x11
|
|
||||||
- network-bind
|
|
||||||
- desktop
|
|
Loading…
Reference in New Issue
Block a user