Commit a6f206ad01fc6bfe7eaf3cf22a31c70cdb8e9a82
1 parent
7f29a9d7
Tweak spacing and wording
Showing
3 changed files
with
175 additions
and
97 deletions
README-appimage.md
| 1 | # Using the QPDF AppImage bundle (for Linux x86_64 systems only) | 1 | # Using the QPDF AppImage bundle (for Linux x86_64 systems only) |
| 2 | 2 | ||
| 3 | -First advice: | 3 | +Tips: |
| 4 | 4 | ||
| 5 | -- After downloading, you have to set the executable bit for any AppImage (for security reasons | ||
| 6 | - this is disabled by default): `chmod +x <name-of-application>.AppImage` | 5 | +* After downloading, you have to set the executable bit for any AppImage (for security reasons this is disabled by default): `chmod +x <name-of-application>.AppImage` |
| 7 | 6 | ||
| 8 | -- Run the QPDF AppImage with the '--usage' parameter to start learning some useful details about | ||
| 9 | - built-in features of this specific AppImage. | 7 | +* Run the QPDF AppImage with the `--ai-usage` parameter to start learning some useful details about built-in features of this specific AppImage. |
| 10 | 8 | ||
| 11 | - | ||
| 12 | -More tips: | ||
| 13 | - | ||
| 14 | -- You can rename the AppImage to any name allowed for file names on Linux. The '.AppImage' suffix | ||
| 15 | - is not required for it to function. It will also work as expected if you invoke it from a | ||
| 16 | - symlink. Using 'qpdf' as its filename or symlink name is OK. However, you may want to continue | ||
| 17 | - using the QPDF package provided by your system's package manager side by side with the AppImage | ||
| 18 | - bundle: in this case it is recommended to use 'qpdf.ai' as a short name for (or as the symlink | ||
| 19 | - name to) the qpdf-<version>.AppImage. | ||
| 20 | - | ||
| 21 | -- [...more tips to come... work in progress...] | 9 | +* You can rename the AppImage to any name allowed for file names on Linux. The `.AppImage` suffix is not required for it to function. It will also work as expected if you invoke it from a symlink. Using `qpdf` as its filename or symlink name is OK. However, you may want to continue using the QPDF package provided by your system's package manager side by side with the AppImage bundle: in this case it is recommended to use `qpdf.ai` as a short name for (or as the symlink name to) the qpdf-<version>.AppImage. |
appimage/AppRun
| @@ -5,32 +5,38 @@ | @@ -5,32 +5,38 @@ | ||
| 5 | # | 5 | # |
| 6 | # License: MIT | 6 | # License: MIT |
| 7 | # | 7 | # |
| 8 | -# The purpose of this custom AppRun script is to enable symlinking the AppImage and invoking the corresponding | ||
| 9 | -# binary depending on which symlink name was used to invoke the AppImage. | 8 | +# The purpose of this custom AppRun script is to enable symlinking the |
| 9 | +# AppImage and invoking the corresponding binary depending on which | ||
| 10 | +# symlink name was used to invoke the AppImage. | ||
| 10 | # | 11 | # |
| 11 | -# At the same time it also allows to invoke the embedded binaries as 'sub-commands'. This is in the interest of | ||
| 12 | -# saving users from creating extra symlinks (without preventing others from STILL using such, should they want | ||
| 13 | -# or need these). | 12 | +# At the same time it also allows to invoke the embedded binaries as |
| 13 | +# 'sub-commands'. This is in the interest of saving users from | ||
| 14 | +# creating extra symlinks (without preventing others from STILL using | ||
| 15 | +# such, should they want or need these). | ||
| 14 | # | 16 | # |
| 15 | -# It also provides some additional help parameters in order to allow faster familiarization with functionality | ||
| 16 | -# embedded in this AppImage. For example it support the listing and viewing of embedded manpages, HTML files, | ||
| 17 | -# PDF files, licenses and READMEs. | 17 | +# It also provides some additional help parameters in order to allow |
| 18 | +# faster familiarization with functionality embedded in this AppImage. | ||
| 19 | +# For example it support the listing and viewing of embedded manpages, | ||
| 20 | +# HTML files, PDF files, licenses and READMEs. | ||
| 18 | # | 21 | # |
| 19 | -# Note, the AppImage can be renamed to anything what's 'legal' for an executable name under Linux or used via | ||
| 20 | -# a symlink under any name and it should behave like 'qpdf' is expected to behave. If the symlink name is | ||
| 21 | -# 'fix-qdf' or 'zlib-flate' it should behave like these... | 22 | +# Note, the AppImage can be renamed to anything what's 'legal' for an |
| 23 | +# executable name under Linux or used via a symlink under any name and | ||
| 24 | +# it should behave like 'qpdf' is expected to behave. If the symlink | ||
| 25 | +# name is 'fix-qdf' or 'zlib-flate' it should behave like these... | ||
| 22 | 26 | ||
| 23 | HERE="$(dirname "$(readlink -f "${0}")")" | 27 | HERE="$(dirname "$(readlink -f "${0}")")" |
| 24 | 28 | ||
| 25 | # Set APPDIR and ARGV0 when running directly from the AppDir. | 29 | # Set APPDIR and ARGV0 when running directly from the AppDir. |
| 26 | -# Running from the AppDir can be beneficial when debugging the AppImage (or give performance improvements): | 30 | +# Running from the AppDir can be beneficial when debugging the |
| 31 | +# AppImage (or give performance improvements): | ||
| 27 | if [ -z $APPDIR ]; then | 32 | if [ -z $APPDIR ]; then |
| 28 | APPDIR="$HERE" | 33 | APPDIR="$HERE" |
| 29 | ARGV0="$0" | 34 | ARGV0="$0" |
| 30 | fi | 35 | fi |
| 31 | 36 | ||
| 32 | -# This is a semi-secret environment variable which can be set for debugging the AppImage. | ||
| 33 | -# For now it is only meant for temporary use and may be removed again in the near future once things have | 37 | +# This is a semi-secret environment variable which can be set for |
| 38 | +# debugging the AppImage. For now it is only meant for temporary use | ||
| 39 | +# and may be removed again in the near future once things have | ||
| 34 | # settled: | 40 | # settled: |
| 35 | if [ "x$SET_BASH_X_FOR_APPRUN" == "xYeSS" ] ; then | 41 | if [ "x$SET_BASH_X_FOR_APPRUN" == "xYeSS" ] ; then |
| 36 | set -x | 42 | set -x |
| @@ -54,8 +60,9 @@ echo " | @@ -54,8 +60,9 @@ echo " | ||
| 54 | All QPDF command line functionality inside an AppImage package. | 60 | All QPDF command line functionality inside an AppImage package. |
| 55 | -------------------------------------------------------------------------- | 61 | -------------------------------------------------------------------------- |
| 56 | 62 | ||
| 57 | - (This package uses the AppImage software packaging technology for Linux ['One App == One File'] | ||
| 58 | - for easy availability of the newest QPDF releases across all major Linux distributions.) | 63 | + (This package uses the AppImage software packaging technology for |
| 64 | + Linux ['One App == One File'] for easy availability of the newest | ||
| 65 | + QPDF releases across all major Linux distributions.) | ||
| 59 | 66 | ||
| 60 | Usage: | 67 | Usage: |
| 61 | ------ | 68 | ------ |
| @@ -64,7 +71,8 @@ echo " | @@ -64,7 +71,8 @@ echo " | ||
| 64 | # Show help screen of QPDF itself | 71 | # Show help screen of QPDF itself |
| 65 | 72 | ||
| 66 | $ARGV0 --ai-usage | 73 | $ARGV0 --ai-usage |
| 67 | - # This message (it's only present in the AppImage incarnation of QPDF) | 74 | + # This message (it's only present in the AppImage |
| 75 | + # incarnation of QPDF) | ||
| 68 | 76 | ||
| 69 | $ARGV0 fix-qdf|zlib-flate | 77 | $ARGV0 fix-qdf|zlib-flate |
| 70 | # Run the named sub-command | 78 | # Run the named sub-command |
| @@ -89,7 +97,8 @@ echo " | @@ -89,7 +97,8 @@ echo " | ||
| 89 | # List all PDF documents embedded in AppImage | 97 | # List all PDF documents embedded in AppImage |
| 90 | 98 | ||
| 91 | $ARGV0 --pdf <path/to/file> | 99 | $ARGV0 --pdf <path/to/file> |
| 92 | - # Use system default PDF viewer to display embedded PDF document(s) | 100 | + # Use system default PDF viewer to display embedded PDF |
| 101 | + # document(s) | ||
| 93 | # (for list of available PDF files see \"$ARGV0 --list-pdf\") | 102 | # (for list of available PDF files see \"$ARGV0 --list-pdf\") |
| 94 | 103 | ||
| 95 | $ARGV0 --list-readme | 104 | $ARGV0 --list-readme |
| @@ -103,10 +112,12 @@ echo " | @@ -103,10 +112,12 @@ echo " | ||
| 103 | # List all LICENSE files embedded in AppImage | 112 | # List all LICENSE files embedded in AppImage |
| 104 | 113 | ||
| 105 | $ARGV0 --license <name-of-license> | 114 | $ARGV0 --license <name-of-license> |
| 106 | - # Show content of LICENSE file embedded in AppImage (piped thru 'less -N') | 115 | + # Show content of LICENSE file embedded in AppImage |
| 116 | + # (piped thru 'less -N') | ||
| 107 | 117 | ||
| 108 | $ARGV0 --show-apprun|--self-show|--selfshow | 118 | $ARGV0 --show-apprun|--self-show|--selfshow |
| 109 | - # Show 'AppRun' invoked by 'less -N'; type '-N' to toogle line number display | 119 | + # Show 'AppRun' invoked by 'less -N'; type '-N' to toggle |
| 120 | + # line number display | ||
| 110 | 121 | ||
| 111 | $ARGV0 --appimage-help | 122 | $ARGV0 --appimage-help |
| 112 | # Show AppImage options available for all 'type 2' AppImages | 123 | # Show AppImage options available for all 'type 2' AppImages |
| @@ -114,15 +125,17 @@ echo " | @@ -114,15 +125,17 @@ echo " | ||
| 114 | $ARGV0 --help | 125 | $ARGV0 --help |
| 115 | # Show help screen of QPDF itself | 126 | # Show help screen of QPDF itself |
| 116 | 127 | ||
| 117 | - ------------------------------------------------------------------------------------------------ | ||
| 118 | - NOTE: The execution of this AppImage is controlled by a custom AppRun script. The state of this | ||
| 119 | - script is experimental and preliminary. Hence it may not work as expected, or miss some | ||
| 120 | - functionality. You can hack on this script by unpacking this AppImage into a local sub directory | ||
| 121 | - [currently named 'squashfs-root'] with this command: | 128 | + ------------------------------------------------------------------------------ |
| 129 | + NOTE: The execution of this AppImage is controlled by a custom AppRun | ||
| 130 | + script. The state of this script is experimental and preliminary. | ||
| 131 | + Hence it may not work as expected, or miss some functionality. You | ||
| 132 | + can hack on this script by unpacking this AppImage into a local | ||
| 133 | + subdirectory [currently named 'squashfs-root'] with this command: | ||
| 122 | 134 | ||
| 123 | $ARGV0 --appimage-extract | 135 | $ARGV0 --appimage-extract |
| 124 | 136 | ||
| 125 | - After you're done with your hacks, repackage the AppImage again with this command: | 137 | + After you're done with your hacks, repackage the AppImage again with |
| 138 | + this command: | ||
| 126 | 139 | ||
| 127 | appimagetool [/path/to/]squashfs-root [/path/to/]QPDF-*.AppImage | 140 | appimagetool [/path/to/]squashfs-root [/path/to/]QPDF-*.AppImage |
| 128 | 141 | ||
| @@ -131,7 +144,7 @@ echo " | @@ -131,7 +144,7 @@ echo " | ||
| 131 | * https://github.com/AppImage/AppImageUpdate/releases/ and | 144 | * https://github.com/AppImage/AppImageUpdate/releases/ and |
| 132 | * https://github.com/AppImage/zsync2/releases and | 145 | * https://github.com/AppImage/zsync2/releases and |
| 133 | * https://github.com/probonopd/linuxdeployqt/releases/ | 146 | * https://github.com/probonopd/linuxdeployqt/releases/ |
| 134 | - ------------------------------------------------------------------------------------------------ | 147 | + ------------------------------------------------------------------------------ |
| 135 | " | 148 | " |
| 136 | } | 149 | } |
| 137 | 150 | ||
| @@ -168,14 +181,30 @@ esac | @@ -168,14 +181,30 @@ esac | ||
| 168 | } | 181 | } |
| 169 | 182 | ||
| 170 | 183 | ||
| 171 | -if [ x"$1" == "xshow-apprun" -o x"$1" == "x--show-apprun" -o x"$1" == "x--apprunshow" -o x"$1" == "x--apprun-show" -o x"$1" == "xselfshow" -o x"$1" == "x--selfshow" -o x"$1" == "xself-show" -o x"$1" == "x--self-show" -o x"$1" == "x--show-self" -o x"$1" == "x--showself" -o x"$1" == "xshow-self" -o x"$1" == "xshowself" ] ; then | 184 | +if [ x"$1" == "xshow-apprun" -o \ |
| 185 | + x"$1" == "x--show-apprun" -o \ | ||
| 186 | + x"$1" == "x--apprunshow" -o \ | ||
| 187 | + x"$1" == "x--apprun-show" -o \ | ||
| 188 | + x"$1" == "xselfshow" -o \ | ||
| 189 | + x"$1" == "x--selfshow" -o \ | ||
| 190 | + x"$1" == "xself-show" -o \ | ||
| 191 | + x"$1" == "x--self-show" -o \ | ||
| 192 | + x"$1" == "x--show-self" -o \ | ||
| 193 | + x"$1" == "x--showself" -o \ | ||
| 194 | + x"$1" == "xshow-self" -o \ | ||
| 195 | + x"$1" == "xshowself" ] ; then | ||
| 172 | cd "$HERE" | 196 | cd "$HERE" |
| 173 | less -N AppRun | 197 | less -N AppRun |
| 174 | exit $? | 198 | exit $? |
| 175 | fi | 199 | fi |
| 176 | 200 | ||
| 177 | 201 | ||
| 178 | -if [ x"$1" == "xlistlicense" -o x"$1" == "x--listlicense" -o x"$1" == "xlist-license" -o x"$1" == "x--list-license" -o x"$1" == "x--licenselist" -o x"$1" == "x--license-list" ] ; then | 202 | +if [ x"$1" == "xlistlicense" -o \ |
| 203 | + x"$1" == "x--listlicense" -o \ | ||
| 204 | + x"$1" == "xlist-license" -o \ | ||
| 205 | + x"$1" == "x--list-license" -o \ | ||
| 206 | + x"$1" == "x--licenselist" -o \ | ||
| 207 | + x"$1" == "x--license-list" ] ; then | ||
| 179 | cd "$HERE" | 208 | cd "$HERE" |
| 180 | echo "" | 209 | echo "" |
| 181 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." | 210 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." |
| @@ -187,14 +216,22 @@ if [ x"$1" == "xlistlicense" -o x"$1" == "x--listlicense" -o x"$1" == "xlist-li | @@ -187,14 +216,22 @@ if [ x"$1" == "xlistlicense" -o x"$1" == "x--listlicense" -o x"$1" == "xlist-li | ||
| 187 | fi | 216 | fi |
| 188 | 217 | ||
| 189 | 218 | ||
| 190 | -if [ "x$1" == "xai-usage" -o "x$1" == "x--aiusage" -o "x$1" == "x--ai-usage" -o "x$1" == "x-u" ] ; then | 219 | +if [ x"$1" == "xai-usage" -o \ |
| 220 | + x"$1" == "x--aiusage" -o \ | ||
| 221 | + x"$1" == "x--ai-usage" -o \ | ||
| 222 | + x"$1" == "x-u" ] ; then | ||
| 191 | usage | less | 223 | usage | less |
| 192 | #usage | 224 | #usage |
| 193 | exit $? | 225 | exit $? |
| 194 | fi | 226 | fi |
| 195 | 227 | ||
| 196 | 228 | ||
| 197 | -if [ x"$1" == "xlistman" -o x"$1" == "x--listman" -o x"$1" == "xlist-man" -o x"$1" == "x--list-man" -o x"$1" == "x--manlist" -o x"$1" == "x--man-list" ] ; then | 229 | +if [ x"$1" == "xlistman" -o \ |
| 230 | + x"$1" == "x--listman" -o \ | ||
| 231 | + x"$1" == "xlist-man" -o \ | ||
| 232 | + x"$1" == "x--list-man" -o \ | ||
| 233 | + x"$1" == "x--manlist" -o \ | ||
| 234 | + x"$1" == "x--man-list" ] ; then | ||
| 198 | cd "$HERE" | 235 | cd "$HERE" |
| 199 | echo "" | 236 | echo "" |
| 200 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." | 237 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." |
| @@ -206,7 +243,12 @@ if [ x"$1" == "xlistman" -o x"$1" == "x--listman" -o x"$1" == "xlist-man" -o x"$ | @@ -206,7 +243,12 @@ if [ x"$1" == "xlistman" -o x"$1" == "x--listman" -o x"$1" == "xlist-man" -o x"$ | ||
| 206 | fi | 243 | fi |
| 207 | 244 | ||
| 208 | 245 | ||
| 209 | -if [ x"$1" == "xlistexe" -o x"$1" == "x--listexe" -o x"$1" == "xlist-exe" -o x"$1" == "x--list-exe" -o x"$1" == "x--exelist" -o x"$1" == "x--exe-list" ] ; then | 246 | +if [ x"$1" == "xlistexe" -o \ |
| 247 | + x"$1" == "x--listexe" -o \ | ||
| 248 | + x"$1" == "xlist-exe" -o \ | ||
| 249 | + x"$1" == "x--list-exe" -o \ | ||
| 250 | + x"$1" == "x--exelist" -o \ | ||
| 251 | + x"$1" == "x--exe-list" ] ; then | ||
| 210 | cd "$HERE" | 252 | cd "$HERE" |
| 211 | echo "" | 253 | echo "" |
| 212 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." | 254 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." |
| @@ -220,7 +262,12 @@ if [ x"$1" == "xlistexe" -o x"$1" == "x--listexe" -o x"$1" == "xlist-exe" -o x"$ | @@ -220,7 +262,12 @@ if [ x"$1" == "xlistexe" -o x"$1" == "x--listexe" -o x"$1" == "xlist-exe" -o x"$ | ||
| 220 | fi | 262 | fi |
| 221 | 263 | ||
| 222 | 264 | ||
| 223 | -if [ x"$1" == "xlistreadme" -o x"$1" == "x--listreadme" -o x"$1" == "xlist-readme" -o x"$1" == "x--list-readme" -o x"$1" == "x--readmelist" -o x"$1" == "x--readme-list" ] ; then | 265 | +if [ x"$1" == "xlistreadme" -o \ |
| 266 | + x"$1" == "x--listreadme" -o \ | ||
| 267 | + x"$1" == "xlist-readme" -o \ | ||
| 268 | + x"$1" == "x--list-readme" -o \ | ||
| 269 | + x"$1" == "x--readmelist" -o \ | ||
| 270 | + x"$1" == "x--readme-list" ] ; then | ||
| 224 | cd "$HERE" | 271 | cd "$HERE" |
| 225 | echo "" | 272 | echo "" |
| 226 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." | 273 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." |
| @@ -232,7 +279,12 @@ if [ x"$1" == "xlistreadme" -o x"$1" == "x--listreadme" -o x"$1" == "xlist-readm | @@ -232,7 +279,12 @@ if [ x"$1" == "xlistreadme" -o x"$1" == "x--listreadme" -o x"$1" == "xlist-readm | ||
| 232 | fi | 279 | fi |
| 233 | 280 | ||
| 234 | 281 | ||
| 235 | -if [ x"$1" == "xlisthtml" -o x"$1" == "x--listhtml" -o x"$1" == "xlist-html" -o x"$1" == "x--list-html" -o x"$1" == "x--htmllist" -o x"$1" == "x--html-list" ] ; then | 282 | +if [ x"$1" == "xlisthtml" -o \ |
| 283 | + x"$1" == "x--listhtml" -o \ | ||
| 284 | + x"$1" == "xlist-html" -o \ | ||
| 285 | + x"$1" == "x--list-html" -o \ | ||
| 286 | + x"$1" == "x--htmllist" -o \ | ||
| 287 | + x"$1" == "x--html-list" ] ; then | ||
| 236 | cd "$HERE" | 288 | cd "$HERE" |
| 237 | echo "" | 289 | echo "" |
| 238 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." | 290 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." |
| @@ -244,7 +296,12 @@ if [ x"$1" == "xlisthtml" -o x"$1" == "x--listhtml" -o x"$1" == "xlist-html" -o | @@ -244,7 +296,12 @@ if [ x"$1" == "xlisthtml" -o x"$1" == "x--listhtml" -o x"$1" == "xlist-html" -o | ||
| 244 | fi | 296 | fi |
| 245 | 297 | ||
| 246 | 298 | ||
| 247 | -if [ x"$1" == "xlistpdf" -o x"$1" == "x--listpdf" -o x"$1" == "xlist-pdf" -o x"$1" == "x--list-pdf" -o x"$1" == "x--pdflist" -o x"$1" == "x--pdf-list" ] ; then | 299 | +if [ x"$1" == "xlistpdf" -o \ |
| 300 | + x"$1" == "x--listpdf" -o \ | ||
| 301 | + x"$1" == "xlist-pdf" -o \ | ||
| 302 | + x"$1" == "x--list-pdf" -o \ | ||
| 303 | + x"$1" == "x--pdflist" -o \ | ||
| 304 | + x"$1" == "x--pdf-list" ] ; then | ||
| 248 | cd "$HERE" | 305 | cd "$HERE" |
| 249 | echo "" | 306 | echo "" |
| 250 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." | 307 | echo "You may invoke \"$ARGV0\" with one of the following additional arguments." |
| @@ -256,7 +313,8 @@ if [ x"$1" == "xlistpdf" -o x"$1" == "x--listpdf" -o x"$1" == "xlist-pdf" -o x"$ | @@ -256,7 +313,8 @@ if [ x"$1" == "xlistpdf" -o x"$1" == "x--listpdf" -o x"$1" == "xlist-pdf" -o x"$ | ||
| 256 | fi | 313 | fi |
| 257 | 314 | ||
| 258 | 315 | ||
| 259 | -if [ x"$1" == "xreadme" -o x"$1" == "x--readme" ] ; then | 316 | +if [ x"$1" == "xreadme" -o \ |
| 317 | + x"$1" == "x--readme" ] ; then | ||
| 260 | cd "$HERE" | 318 | cd "$HERE" |
| 261 | shift | 319 | shift |
| 262 | echo "" | 320 | echo "" |
| @@ -287,7 +345,8 @@ if [ x"$1" == "xreadme" -o x"$1" == "x--readme" ] ; then | @@ -287,7 +345,8 @@ if [ x"$1" == "xreadme" -o x"$1" == "x--readme" ] ; then | ||
| 287 | fi | 345 | fi |
| 288 | 346 | ||
| 289 | 347 | ||
| 290 | -if [ x"$1" == "xlicense" -o x"$1" == "x--license" ] ; then | 348 | +if [ x"$1" == "xlicense" -o \ |
| 349 | + x"$1" == "x--license" ] ; then | ||
| 291 | cd "$HERE" | 350 | cd "$HERE" |
| 292 | shift | 351 | shift |
| 293 | echo "" | 352 | echo "" |
| @@ -489,4 +548,3 @@ else | @@ -489,4 +548,3 @@ else | ||
| 489 | fi | 548 | fi |
| 490 | 549 | ||
| 491 | fi | 550 | fi |
| 492 | - |
appimage/build-appimage
| @@ -2,39 +2,45 @@ | @@ -2,39 +2,45 @@ | ||
| 2 | 2 | ||
| 3 | # Copyright (c) 2018 Jay Berkenbilt and Kurt Pfeifle | 3 | # Copyright (c) 2018 Jay Berkenbilt and Kurt Pfeifle |
| 4 | # | 4 | # |
| 5 | -# This script is mainly meant to build an 'AppImage' from GitHub sources of QPDF via Travis CI on an | ||
| 6 | -# Ubuntu Trusty (14.04) LTS system (see https://appimage.org/). | 5 | +# This script is mainly meant to build an 'AppImage' from GitHub |
| 6 | +# sources of QPDF via Travis CI on an Ubuntu Trusty (14.04) LTS system | ||
| 7 | +# (see https://appimage.org/). | ||
| 7 | # | 8 | # |
| 8 | -# But it also allows Linux users to build such an AppImage on their own systems. Please read | ||
| 9 | -# 'README.md' from the top level Git sources to see what preconditions you must meet to build QPDF | ||
| 10 | -# in general. The same apply to build an AppImage. Then follow these three steps: | 9 | +# But it also allows Linux users to build such an AppImage on their |
| 10 | +# own systems. Please read 'README.md' from the top level Git sources | ||
| 11 | +# to see what preconditions you must meet to build QPDF in general. | ||
| 12 | +# The same apply to build an AppImage. Then follow these three steps: | ||
| 11 | # | 13 | # |
| 12 | # 1. Clone Git sources: `git clone https://github.com/qpdf/qpdf.git git.qpdf` | 14 | # 1. Clone Git sources: `git clone https://github.com/qpdf/qpdf.git git.qpdf` |
| 13 | # 2. Change into git dir: `cd git.qpdf` | 15 | # 2. Change into git dir: `cd git.qpdf` |
| 14 | # 3. Run this script: `bash appimage/build-appimage` | 16 | # 3. Run this script: `bash appimage/build-appimage` |
| 15 | # | 17 | # |
| 16 | -# The resulting AppImage will be placed in './appimage/build/QPDF-x86_64.AppImage'. | ||
| 17 | -# Read the output of the script for hints in case something goes wrong. | 18 | +# The resulting AppImage will be placed in |
| 19 | +# './appimage/build/QPDF-x86_64.AppImage'. Read the output of the | ||
| 20 | +# script for hints in case something goes wrong. | ||
| 18 | # | 21 | # |
| 19 | -# You may pass custom options for the configure step by setting them into the 'CUSTOM_CONFIGURE' | ||
| 20 | -# environment variable and exporting it before running this script. For example: | 22 | +# You may pass custom options for the configure step by setting them |
| 23 | +# into the 'CUSTOM_CONFIGURE' environment variable and exporting it | ||
| 24 | +# before running this script. For example: | ||
| 21 | # | 25 | # |
| 22 | # export CUSTOM_CONFIGURE=" --enable-test-compare-images [--more-other-options]" | 26 | # export CUSTOM_CONFIGURE=" --enable-test-compare-images [--more-other-options]" |
| 23 | # | 27 | # |
| 24 | # ATTENTION: | 28 | # ATTENTION: |
| 25 | # | 29 | # |
| 26 | -# 1. To build the AppImage you should have a working internet connection. | ||
| 27 | -# Reason: the script downloads the most recent 'linuxdeployqt' utility for building the AppImage. | ||
| 28 | -# 2. If you build the AppImage on a too recent Linux distribution, it may only work on the exact | ||
| 29 | -# distribution you build it on. For an AppImage to work on a wide range of different | ||
| 30 | -# distributions from the last 3-4 years if should be built on Ubuntu Trusty (14.04). | ||
| 31 | - | 30 | +# 1. To build the AppImage you should have a working internet |
| 31 | +# connection. Reason: the script downloads the most recent | ||
| 32 | +# 'linuxdeployqt' utility for building the AppImage. | ||
| 33 | +# 2. If you build the AppImage on a too recent Linux distribution, | ||
| 34 | +# it may only work on the exact distribution you build it on. For | ||
| 35 | +# an AppImage to work on a wide range of different distributions | ||
| 36 | +# from the last 3-4 years if should be built on Ubuntu Trusty | ||
| 37 | +# (14.04). | ||
| 32 | 38 | ||
| 33 | set -ex | 39 | set -ex |
| 34 | 40 | ||
| 35 | # Support for signing the AppImage (only by original maintainer): | 41 | # Support for signing the AppImage (only by original maintainer): |
| 36 | sign= | 42 | sign= |
| 37 | -if [ "x$1" == "x--sign" ] ; then | 43 | +if [ "x$1" == "x--sign" ]; then |
| 38 | sign=--sign | 44 | sign=--sign |
| 39 | fi | 45 | fi |
| 40 | 46 | ||
| @@ -46,14 +52,18 @@ _osversion=$(cat /etc/os-release | grep PRETTY_NAME | awk -F'=' '{print $2}' | s | @@ -46,14 +52,18 @@ _osversion=$(cat /etc/os-release | grep PRETTY_NAME | awk -F'=' '{print $2}' | s | ||
| 46 | if [ x"$_osversion" != x"Ubuntu 14.04.5 LTS" ] ; then | 52 | if [ x"$_osversion" != x"Ubuntu 14.04.5 LTS" ] ; then |
| 47 | set +x | 53 | set +x |
| 48 | echo "" | 54 | echo "" |
| 49 | - echo "+==============================================================================================================+" | ||
| 50 | - echo "|| WARNING: You are about to build a QPDF AppImage on a system which is NOT Ubuntu 14.04.5 LTS ('Trusty'). ||" | ||
| 51 | - echo "|| ||" | ||
| 52 | - echo "|| Very likely you use a newer Linux distribution. ||" | ||
| 53 | - echo "|| The resulting AppImage will not be 'universally' usable. ||" | ||
| 54 | - echo "|| Hence, it likely will not be capable of running on a large range of Linux distributions. ||" | ||
| 55 | - echo "|| It will only reliably run on the very same systems it has been created on, and maybe some similar ones. ||" | ||
| 56 | - echo "+==============================================================================================================+" | 55 | + # 0 1 2 3 4 5 6 7 |
| 56 | + # 01234567890123456789012345678901234567890123456789012345678901234567890123456789 | ||
| 57 | + echo "+===========================================================================+" | ||
| 58 | + echo "|| WARNING: You are about to build a QPDF AppImage on a system which is ||" | ||
| 59 | + echo "|| NOT Ubuntu 14.04 LTS ('Trusty'). ||" | ||
| 60 | + echo "|| ||" | ||
| 61 | + echo "|| It is recommended that you use a distribution that is at least a ||" | ||
| 62 | + echo "|| few years old to maximize the number of Linux distributions the ||" | ||
| 63 | + echo "|| resulting AppImage will work on. AppImages often don't work on ||" | ||
| 64 | + echo "|| distributions older than the one they were built on because of ||" | ||
| 65 | + echo "|| standard library differences. ||" | ||
| 66 | + echo "+===========================================================================+" | ||
| 57 | echo "" | 67 | echo "" |
| 58 | set -x | 68 | set -x |
| 59 | fi | 69 | fi |
| @@ -74,7 +84,9 @@ rm -rf $here/build | @@ -74,7 +84,9 @@ rm -rf $here/build | ||
| 74 | 84 | ||
| 75 | # Prepare build of QPDF from sources: | 85 | # Prepare build of QPDF from sources: |
| 76 | ./autogen.sh | 86 | ./autogen.sh |
| 77 | -./configure --prefix=/usr --enable-werror --enable-show-failed-test-output --enable-html-doc --enable-pdf-doc "$CUSTOM_CONFIGURE" | 87 | +./configure --prefix=/usr --enable-werror \ |
| 88 | + --enable-show-failed-test-output \ | ||
| 89 | + --enable-html-doc --enable-pdf-doc "$CUSTOM_CONFIGURE" | ||
| 78 | 90 | ||
| 79 | # Build! | 91 | # Build! |
| 80 | make -j$(nproc) | 92 | make -j$(nproc) |
| @@ -86,7 +98,7 @@ make check | @@ -86,7 +98,7 @@ make check | ||
| 86 | mkdir -p $appdir | 98 | mkdir -p $appdir |
| 87 | 99 | ||
| 88 | # Install build result into AppDir: | 100 | # Install build result into AppDir: |
| 89 | -make install DESTDIR=$appdir ; find $appdir | 101 | +make install DESTDIR=$appdir; find $appdir |
| 90 | 102 | ||
| 91 | # Change into build directory: | 103 | # Change into build directory: |
| 92 | cd $here/build | 104 | cd $here/build |
| @@ -95,18 +107,35 @@ cd $here/build | @@ -95,18 +107,35 @@ cd $here/build | ||
| 95 | rm -rf appdir/usr/include appdir/usr/lib/pkgconfig appdir/usr/lib/*.{a,la,so} | 107 | rm -rf appdir/usr/include appdir/usr/lib/pkgconfig appdir/usr/lib/*.{a,la,so} |
| 96 | 108 | ||
| 97 | # Copy icon which is needed for desktop integration into place: | 109 | # Copy icon which is needed for desktop integration into place: |
| 98 | -for i in appdir/usr/share/icons/hicolor/512x512/apps ; do | 110 | +for i in appdir/usr/share/icons/hicolor/512x512/apps; do |
| 99 | mkdir -p $i | 111 | mkdir -p $i |
| 100 | cp $top/logo/qpdf.png $i | 112 | cp $top/logo/qpdf.png $i |
| 101 | done | 113 | done |
| 102 | 114 | ||
| 103 | # Copy .desktop and .appdata.xml metadata for desktop integration into place: | 115 | # Copy .desktop and .appdata.xml metadata for desktop integration into place: |
| 104 | -for i in appdir/usr/share/applications ; do mkdir -p $i ; cp $top/appimage/qpdf.desktop $i ; done | ||
| 105 | -for i in appdir/usr/share/metainfo ; do mkdir -p $i ; cp $top/appimage/qpdf.appdata.xml $i ; done | ||
| 106 | -for i in appdir/usr/share/doc/qpdf ; do mkdir -p $i ; cp $top/README* $i ; cp $top/NOTICE.md $i/README-notice.md ; cp $top/LICENSE.txt $i ; cp $top/Artistic-2.0 $i/Artistic-LICENSE.txt ; cp $top/ChangeLog $i/README-ChangeLog ; cp $top/TODO $i/README-todo ; done | 116 | +for i in appdir/usr/share/applications; do |
| 117 | + mkdir -p $i | ||
| 118 | + cp $top/appimage/qpdf.desktop $i | ||
| 119 | +done | ||
| 120 | +for i in appdir/usr/share/metainfo; do | ||
| 121 | + mkdir -p $i | ||
| 122 | + cp $top/appimage/qpdf.appdata.xml $i | ||
| 123 | +done | ||
| 124 | +for i in appdir/usr/share/doc/qpdf; do | ||
| 125 | + mkdir -p $i | ||
| 126 | + cp $top/README* $i | ||
| 127 | + cp $top/NOTICE.md $i/README-notice.md | ||
| 128 | + cp $top/LICENSE.txt $i | ||
| 129 | + cp $top/Artistic-2.0 $i/Artistic-LICENSE.txt | ||
| 130 | + cp $top/ChangeLog $i/README-ChangeLog | ||
| 131 | + cp $top/TODO $i/README-todo | ||
| 132 | +done | ||
| 107 | 133 | ||
| 108 | -# The following lines are experimental (for debugging; and to test support for unexpected future binaries added to QPDF): | ||
| 109 | -for i in /usr/bin/env /bin/less /bin/busybox ; do cp $i appdir/usr/bin/ ; done | 134 | +# The following lines are experimental (for debugging; and to test |
| 135 | +# support for unexpected future binaries added to QPDF): | ||
| 136 | +for i in /usr/bin/env /bin/less /bin/busybox; do | ||
| 137 | + cp $i appdir/usr/bin/ | ||
| 138 | +done | ||
| 110 | ls -l /usr/bin/env /bin/less /bin/busybox | 139 | ls -l /usr/bin/env /bin/less /bin/busybox |
| 111 | 140 | ||
| 112 | # Fetch 'linuxdeployqt' which will transform the AppDir into an AppImage: | 141 | # Fetch 'linuxdeployqt' which will transform the AppDir into an AppImage: |
| @@ -114,7 +143,7 @@ wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous | @@ -114,7 +143,7 @@ wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous | ||
| 114 | chmod a+x linuxdeployqt*.AppImage | 143 | chmod a+x linuxdeployqt*.AppImage |
| 115 | 144 | ||
| 116 | # Set up a clean environment: | 145 | # Set up a clean environment: |
| 117 | -unset QTDIR ; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH | 146 | +unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH |
| 118 | 147 | ||
| 119 | # Let 'linuxdeployqt' do its first stage of work: | 148 | # Let 'linuxdeployqt' do its first stage of work: |
| 120 | ./linuxdeployqt*.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs | 149 | ./linuxdeployqt*.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs |
| @@ -122,11 +151,13 @@ unset QTDIR ; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH | @@ -122,11 +151,13 @@ unset QTDIR ; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH | ||
| 122 | # In addition to the main executable, we have additional ones to process | 151 | # In addition to the main executable, we have additional ones to process |
| 123 | ./linuxdeployqt*.AppImage appdir/usr/bin/zlib-flate -bundle-non-qt-libs | 152 | ./linuxdeployqt*.AppImage appdir/usr/bin/zlib-flate -bundle-non-qt-libs |
| 124 | 153 | ||
| 125 | -# To eventually generate the AppImage we extract the linuxdeployqt AppImage to get access to the embedded 'appimagetool': | 154 | +# To eventually generate the AppImage we extract the linuxdeployqt |
| 155 | +# AppImage to get access to the embedded 'appimagetool': | ||
| 126 | ./linuxdeployqt*.AppImage --appimage-extract | 156 | ./linuxdeployqt*.AppImage --appimage-extract |
| 127 | 157 | ||
| 128 | -# We want to run our custom AppRun script: | ||
| 129 | -rm appdir/AppRun ; cp $top/appimage/AppRun appdir ; chmod a+x appdir/AppRun # Replace symlink with custom script | 158 | +# We want to run our custom AppRun script. |
| 159 | +# Replace symlink with custom script | ||
| 160 | +rm appdir/AppRun; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun | ||
| 130 | 161 | ||
| 131 | # If we are not on Ubuntu Trusty, we need to disable 'appstreamcli' validation: | 162 | # If we are not on Ubuntu Trusty, we need to disable 'appstreamcli' validation: |
| 132 | if [ x"$_osversion" == x"Ubuntu 14.04.5 LTS" ] ; then | 163 | if [ x"$_osversion" == x"Ubuntu 14.04.5 LTS" ] ; then |
| @@ -136,8 +167,10 @@ else | @@ -136,8 +167,10 @@ else | ||
| 136 | set +x | 167 | set +x |
| 137 | echo "" | 168 | echo "" |
| 138 | echo " Running 'appimagetool' with '-n' parameter..." | 169 | echo " Running 'appimagetool' with '-n' parameter..." |
| 139 | - echo " Reason: this does not seem to be a Travis CI build running on Ubuntu Trusty 14.04." | ||
| 140 | - echo " '-n' disables checking of AppStream data by the 'appstreamcli' utility since post-Trusty versions have incompatible changes." | 170 | + echo " Reason: this does not seem to be a Travis CI build running on" |
| 171 | + echo " Ubuntu Trusty 14.04." | ||
| 172 | + echo " '-n' disables checking of AppStream data by the 'appstreamcli'" | ||
| 173 | + echo " utility since post-Trusty versions have incompatible changes." | ||
| 141 | echo "" | 174 | echo "" |
| 142 | set -x | 175 | set -x |
| 143 | fi | 176 | fi |
| @@ -147,16 +180,15 @@ MAJOR_QPDF_VERSION=$( ./appdir/usr/bin/qpdf --version | grep "qpdf version" | aw | @@ -147,16 +180,15 @@ MAJOR_QPDF_VERSION=$( ./appdir/usr/bin/qpdf --version | grep "qpdf version" | aw | ||
| 147 | VERSION=${MAJOR_QPDF_VERSION}-continuous-${TRAVIS_JOB_NUMBER}-$(date "+%Y-%m-%d")-git.$(git rev-parse --short HEAD)-x86_64 | 180 | VERSION=${MAJOR_QPDF_VERSION}-continuous-${TRAVIS_JOB_NUMBER}-$(date "+%Y-%m-%d")-git.$(git rev-parse --short HEAD)-x86_64 |
| 148 | 181 | ||
| 149 | # Remove the default AppRun/symlink and use our own custom AppRun script | 182 | # Remove the default AppRun/symlink and use our own custom AppRun script |
| 150 | -rm appdir/AppRun ; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun | 183 | +rm appdir/AppRun; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun |
| 151 | 184 | ||
| 152 | set +x | 185 | set +x |
| 153 | # Finally, generate the AppImage: | 186 | # Finally, generate the AppImage: |
| 154 | -PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool $sign -g $appimagetool_param appdir qpdf-$VERSION.AppImage | 187 | +PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool $sign -g $appimagetool_param appdir qpdf-$VERSION-x86_64.AppImage |
| 155 | 188 | ||
| 156 | # Tell everyone where our result is stored: | 189 | # Tell everyone where our result is stored: |
| 157 | echo "" | 190 | echo "" |
| 158 | -echo "====================================================================================" | 191 | +echo "=============================================================================" |
| 159 | echo " === AppImage is ready in $top/appimage/build ===" | 192 | echo " === AppImage is ready in $top/appimage/build ===" |
| 160 | -echo "====================================================================================" | 193 | +echo "=============================================================================" |
| 161 | echo "" | 194 | echo "" |
| 162 | - |