forked from htacg/tidy-html5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Is. htacg#748 - Implement snap packaging
Snaps are universal Linux packages that can be installed and run on multiple GNU+Linux distributions with ease. This patch implements the necessary files to build tidy as a snap. Refer-to: Snapcraft - Snaps are universal Linux packages <https://snapcraft.io> Conforming-to: tidy-html5/CONTRIBUTING.md at next · htacg/tidy-html5 <https://github.com/htacg/tidy-html5/blob/next/README/CONTRIBUTING.md> Conforming-to: tidy-html5/CODESTYLE.md at next · htacg/tidy-html5 <https://github.com/htacg/tidy-html5/blob/next/README/CODESTYLE.md> Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
- Loading branch information
Showing
11 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,11 @@ temp* | |
.DS_Store | ||
.idea | ||
*.old | ||
|
||
# Snap packaging specific rules | ||
/parts/ | ||
/stage/ | ||
/prime/ | ||
|
||
/*.snap | ||
/*_source.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*.yaml] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Version Tracking Ignore Rules for Git VCS | ||
# https://git-scm.com/docs/gitignore | ||
/.snapcraft/ | ||
|
||
__pycache__ | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Snap Packaging for Tidy | ||
 | ||
|
||
**This is the snap for Tidy**, *"HTML parser and pretty printer. The grand daddy of HTML tools."*. It works on Ubuntu, Fedora, Debian, and other major Linux distributions. | ||
|
||
[](https://build.snapcraft.io/user/htacg/tidy-html5) | ||
|
||
 | ||
|
||
Published for <img src="http://anything.codes/slack-emoji-for-techies/emoji/tux.png" align="top" width="24" /> with 💝 by Snapcrafters | ||
|
||
## Installation | ||
([Don't have snapd installed?](https://snapcraft.io/docs/core/install)) | ||
|
||
### In Terminal | ||
# Install Snap # | ||
sudo snap install tidy-brlin | ||
|
||
# Connect the Snap to Optional Interfaces # | ||
## `removable-media`: For accessing files under /media and /run/media ## | ||
sudo snap connect tidy-brlin:removable-media | ||
|
||
### The Graphical Way | ||
Browse <https://snapcraft.io/tidy> and follow the instructions. | ||
|
||
## Support | ||
* Report issues regarding using this snap to the issue tracker: | ||
<https://github.com/htacg/tidy-html5/issues> | ||
|
||
be sure to mention you are using the snap package. | ||
|
||
* You may also post on the Snapcraft Forum, under the `snap` topic category: | ||
<https://forum.snapcraft.io/c/snap> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# /snap/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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
%YAML 1.2 | ||
--- | ||
# Snapcraft Recipe for Tidy | ||
# ------------------------------ | ||
# This file is in the YAML data serialization format: | ||
# http://yaml.org | ||
# For the spec. of writing this file refer the following documentation: | ||
# * The snapcraft syntax | ||
# https://docs.snapcraft.io/build-snaps/syntax | ||
# * Snap Docs | ||
# https://snapdocs.labix.org | ||
# * Latest doc topics in the Snapcraft Forum | ||
# https://forum.snapcraft.io/c/doc | ||
# For support refer to the snapcraft section in the Snapcraft Forum: | ||
# https://forum.snapcraft.io/c/snapcraft | ||
|
||
name: tidy | ||
summary: HTML parser and pretty printer. The grand daddy of HTML tools | ||
description: | | ||
Tidy is a console application for Mac OS X, Linux, Windows, UNIX, | ||
and more. It corrects and cleans up HTML and XML documents by fixing | ||
markup errors and upgrading legacy code to modern standards. | ||
version: determined-by-version-script | ||
version-script: snap/utilities/set-snap-version.bash | ||
|
||
confinement: strict | ||
grade: stable | ||
|
||
apps: | ||
tidy: | ||
command: tidy | ||
plugs: | ||
- home | ||
- removable-media | ||
|
||
parts: | ||
tidy: | ||
source: . | ||
source-type: local | ||
|
||
# For stable release build | ||
#source-tag: '5.6.0' | ||
|
||
plugin: cmake | ||
configflags: | ||
- -DCMAKE_BUILD_TYPE=Release | ||
|
||
build-packages: | ||
- build-essential | ||
- xsltproc | ||
|
||
filesets: | ||
executables: | ||
- bin/* | ||
library-headers: | ||
- include/* | ||
library-shared: | ||
- lib/*.so* | ||
library-static: | ||
- lib/*.a | ||
pkgconfig: | ||
- lib/pkgconfig/* | ||
manpages: | ||
- share/man/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# /snap/utilities | ||
|
||
Here are some utilities programs to help with snap packaging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
# Set snap version according to various factors | ||
# 林博仁(Buo-ren, Lin) © 2018 | ||
|
||
set \ | ||
-o errexit \ | ||
-o errtrace \ | ||
-o nounset \ | ||
-o pipefail | ||
|
||
init(){ | ||
set \ | ||
-o errexit \ | ||
-o nounset | ||
|
||
local \ | ||
upstream_version \ | ||
upstream_git_revision | ||
|
||
upstream_version="$( | ||
head \ | ||
--lines=1 \ | ||
parts/tidy/src/version.txt | ||
)" | ||
|
||
upstream_git_revision="$( | ||
git \ | ||
-C parts/tidy/src \ | ||
describe \ | ||
--always \ | ||
--dirty \ | ||
--match nothing \ | ||
| sed s/^v// | ||
)" | ||
|
||
printf \ | ||
-- \ | ||
'%s' \ | ||
"${upstream_version}-g${upstream_git_revision}" | ||
|
||
exit 0 | ||
} | ||
|
||
init "${@}" |