Skip to content

Commit

Permalink
Provide Snap package for Linux (#468)
Browse files Browse the repository at this point in the history
Add support for building binary snap packages with snapcraft.

Snaps are containerised software packages that are simple to create and
install. They auto-update and are safe to run. And because they bundle
their dependencies, they work on all major Linux systems without modif-
ication.  -- from Snapcraft website

Refer-to: Snapcraft - Snaps are universal Linux packages
          <https://snapcraft.io/>

Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
  • Loading branch information
brlin-tw authored and vslavik committed Aug 30, 2018
1 parent d2c2127 commit 2d80574
Show file tree
Hide file tree
Showing 7 changed files with 839 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,10 @@ xcuserdata

/packages/
/win32/distrib-*

/*.snap
/poedit_source.tar.bz2
/parts/
/prime/
/stage/
/snap/.snapcraft/
11 changes: 11 additions & 0 deletions snap/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# EditorConfig for Snap Packaging
# http://EditorConfig.org

## This config only applies to this folder
root = true

[*.{yaml,yamllint}]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
17 changes: 17 additions & 0 deletions snap/.yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# yamllint Configuration File for Snappy Packaging
# https://yamllint.readthedocs.io
#

extends: default

rules:
comments:
# Comments without starting space is disabled code
require-starting-space: false
min-spaces-from-content: 1
comments-indentation: disable
document-start: disable
line-length:
# /parts/*/source key's value is URL
allow-non-breakable-inline-mappings: true
max: 100
5 changes: 5 additions & 0 deletions snap/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

Introduction
================

This is the snap package definition to build a snap package of Poedit
11 changes: 11 additions & 0 deletions snap/patches/enchant-fix-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/Makefile.am 2017-04-05 05:13:57.000000000 +0800
+++ src/Makefile.am 2018-05-30 23:37:16.035641307 +0800
@@ -6,6 +6,8 @@

libenchant_la_LIBADD= $(ENCHANT_LIBS) @ENCHANT_WIN32_RESOURCE@

+libenchant_la_LIBTOOLFLAGS = --tag=CC
+
libenchant_la_LDFLAGS = -no-undefined -export-symbols-regex '^enchant_.*'
if OS_WIN32
libenchant_la_LDFLAGS += -avoid-version
28 changes: 28 additions & 0 deletions snap/patches/postprocess-desktop-entries.sed
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This sed script processes 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

## Fix-up application icon lookup
s|^Icon=.*|Icon=\${SNAP}/meta/gui/icon.png|
Loading

0 comments on commit 2d80574

Please sign in to comment.