├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README (copy 1).md ├── README.md ├── YML.md ├── appdir-lint.sh ├── bintray-tidy.sh ├── bintray.sh ├── dogfeeding.sh ├── excludedeblist ├── excludelist ├── excludesuselist ├── functions.sh ├── lum-qt.yml ├── old ├── README.md ├── appdir-lint.sh ├── bintray-tidy.sh ├── bintray.sh ├── dogfeeding.sh ├── excludedeblist ├── excludelist ├── excludesuselist ├── functions.sh ├── lum-qt.yml ├── mx-live-usb-maker.desktop ├── pkg2appimage ├── set-up-ppas.sh ├── test.sh ├── travis.sh └── trigger.sh ├── pkg2appimage ├── pkg2appimage.appdata.xml ├── set-up-ppas.sh ├── test.sh ├── travis.sh └── trigger.sh /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Welcome to AppImage. A good starting point for most questions is our wiki at https://github.com/AppImage/AppImageKit/wiki. 4 | 5 | ### I would like to request an AppImage for an application 6 | 7 | If there is no AppImage of your favorite application available, please request it from the author(s) of the application, e.g., as a feature request in the issue tracker of the application. For example, if you would like to see an AppImage of Mozilla Firefox, then please leave a comment at https://bugzilla.mozilla.org/show_bug.cgi?id=1249971. The more people request an AppImage from the upstream authors, the more likely is that an AppImage will be provided. 8 | 9 | ### I would like to provide an AppImage for my application 10 | 11 | If you are an application author and would like to make your application available as an AppImage, please start here: https://github.com/AppImage/AppImageKit/wiki/Creating-AppImages. Feel free to open a [GitHub Issue](https://github.com/AppImage/AppImageKit/issues) in the AppImageKit project if you need support using the tools provided by AppImageKit. 12 | 13 | ### I would like to have my AppImage included in the AppImageHub central directory of available AppImages 14 | 15 | Please see the [AppImageHub Readme](https://github.com/AppImage/appimage.github.io/blob/master/README.md). 16 | 17 | ### I would like to contribute to AppImageKit development 18 | 19 | If you would like to report issues with AppImageKit itself, or would like to contribute to its development, please see our [list of issues](https://github.com/AppImage/AppImageKit/issues) and get in touch with us in `#AppImage` on `irc.libera.chat`. We welcome pull requests addressing any of the open issues and/or other bugfixes and/or feature additions. In the case of complex feature additions, it is best to contact us first, before you spend much time. 20 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2004-16 Simon Peter 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /README (copy 1).md: -------------------------------------------------------------------------------- 1 | # pkg2appimage [![discourse](https://img.shields.io/badge/forum-discourse-orange.svg)](http://discourse.appimage.org) [![Build Status](https://travis-ci.org/AppImage/pkg2appimage.svg)](https://travis-ci.org/AppImage/pkg2appimage) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/0e7dd241a1bf44af9eebc80fd2c71763)](https://www.codacy.com/app/AppImage/pkg2appimage?utm_source=github.com&utm_medium=referral&utm_content=AppImage/pkg2appimage&utm_campaign=Badge_Grade) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZT9CL8M5TJU72) 2 | 3 | [Download as an AppImage](../../releases/tag/continuous) 4 | 5 | This repository is intended to showcase the [AppImage](http://appimage.org) format and [AppImageKit](https://github.com/probonopd/AppImageKit) software used to create AppImages. It contains the `pkg2appimage` tool and some recipes to generate __AppImages__ (portable Linux apps) using [AppImageKit](https://github.com/probonopd/appimagekit). 6 | 7 | There are [multiple ways](https://github.com/probonopd/AppImageKit/wiki/Creating-AppImages) to generate AppImages. Upstream projects are encouraged to produce their own __upstream packaging__ AppImages, like [many projects](https://appimage.github.io) already do. 8 | 9 | Some branded applications are unfortunately not provided in AppImage format by their authors yet, and are not allowed to be redistributed. However, if there are suitable existing binary packages (either in archive or `.deb` format or a ppa) then once can to convert these to an AppImage using [pkg2appimage](../../releases/tag/continuous). 10 | 11 | ![image](https://user-images.githubusercontent.com/2480569/91085594-3aac8600-e63d-11ea-8c2e-a648e6ef3fdb.png) 12 | 13 | ## Usage 14 | 15 | For applications for which there is already an existing [`.yml` recipe file](../../tree/master/recipes), you can simply use the name of the application (without `.yml`) as an argument. For example, to produce a Spotify AppImage, it is sufficient to do: 16 | 17 | ``` 18 | wget -c $(wget -q https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases -O - | grep "pkg2appimage-.*-x86_64.AppImage" | grep browser_download_url | head -n 1 | cut -d '"' -f 4) 19 | chmod +x ./pkg2appimage-*.AppImage 20 | ./pkg2appimage-*.AppImage Spotify 21 | ``` 22 | 23 | `.yml` recipes tell pkg2appimage where to get the ingredients from, and how to convert them to an AppImage. Study some [examples](https://github.com/AppImage/AppImages/tree/master/recipes) to see how it works. 24 | 25 | To build an AppImage from a local `.yml` recipe (e.g., during development): 26 | 27 | ``` 28 | wget -c $(wget -q https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases -O - | grep "pkg2appimage-.*-x86_64.AppImage" | grep browser_download_url | head -n 1 | cut -d '"' -f 4) 29 | chmod +x ./pkg2appimage-*.AppImage 30 | ./pkg2appimage-*.AppImage recipes/XXX.yml 31 | ``` 32 | 33 | ## Contributing 34 | 35 | You are invited to contribute to the AppImage format, the AppImageKit tools, and the example AppImages provided by us). 36 | 37 | The preferred channel of communication for general questions and remarks is our forum and mailing list at http://discourse.appimage.org/. 38 | 39 | There is also the #AppImage IRC channel on irc.libera.chat - please stay in there for at least 48 hours because we are not all in the same timezone. 40 | 41 | ## Donations 42 | 43 | [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZT9CL8M5TJU72) 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # lum-qt-appimage 2 | appimage package for the live-usb-maker system from antiX and MX, renamed here live-usb-maker-qt 3 | based on mx-live-usb-maker gui from MX and live-usb-maker from antiX 4 | -------------------------------------------------------------------------------- /YML.md: -------------------------------------------------------------------------------- 1 | # About `.yml` files 2 | 3 | The easiest way to build an AppImage is to write a `.yml` file. We developed a rather simple format that allows developers to write a `app.yml` file that describes how to build an AppImage for `app`, being able to reuse pre-built binaries, e.g. from Debian packages, both to save time for creating and building an AppImage. 4 | 5 | This document provides an introduction to the `.yml` files' purpose, their structure and a few examples describing how to use all the advanced features. 6 | 7 | 8 | ## Purpose of `.yml` files 9 | 10 | `.yml` is the file extension commonly used for _YAML_ (_Yet Another Markup Language_, nowadays also serves as an abbreviation for _YAML Ain’t Markup Language_). 11 | 12 | YAML's approach to describing data is to combine associative lists (known as `dict`s in Python or `object literal`s in JavaScript, for example), lists (arrays) and scalar values. This results in an easy to parse and also easy to read format. 13 | 14 | The `.yml` files are used by [`pkg2appimage`](https://github.com/AppImage/AppImages/blob/master/pkg2appimage) which is used in the _AppImages_ project to convert binary _ingredients_ into AppImages for demonstration purposes. Their primary objective is to make it very simple to convert pre-existing binaries into the AppImage format. If you can build your software from source, you may generate AppImages directly as part of your build workflow; in this case you may not need a `.yml` file (but a Travis CI `.travis.yml` and/or a `Makefile`, etc.). 15 | 16 | The `.yml` file format is not part of the AppImage standard, which just describes the AppImage container format and is agnostic as to how the payload inside an AppImage gets generated. Neither it is part of AppImageKit, because AppImageKit is only concerned with taking a pre-existing _AppDir_ and converting that into an AppImage. Such an AppDir is created from the instructions stored in the `.yml` files, and converted to an AppImage using _AppImageKit_. 17 | 18 | 19 | 20 | ## General anatomy of `.yml` files 21 | 22 | The general format of `.yml` files is as follows: 23 | 24 | ``` 25 | app: (name of the application) 26 | (optional flags) 27 | 28 | ingredients: 29 | (instructions that describe from where to get 30 | the binary ingredients used for the AppImage) 31 | 32 | script: 33 | (instuctions on how to convert these ingredients to an AppImage) 34 | ``` 35 | 36 | As you can see, the `.yml` file consists of three sections: 37 | 38 | 1. The __overall section__ (containing the name of the application and optional flags) 39 | 2. The __ingredients section__ (describing from where to get the binary ingredients used for the AppImage) 40 | 3. The __script section__ (describing how to convert these ingredients to an AppImage) 41 | 42 | Note that the sections may contain sub-sections. For example, the ingredients section can also have a script section containing instuctions on how to determine the most recent version of the ingredients and how to download them. 43 | 44 | 45 | ### Overall section 46 | 47 | #### `app` key 48 | 49 | Mandatory. Contains the name of the application. If the `.yml` file uses ingredients from packages (e.g., `.deb`), then the name must match the package name of the main executable. 50 | 51 | 52 | #### Keys that enable ability to relocate 53 | 54 | Optional. Either `binpatch: true` or `union: true`. These keys enable workarounds that make it possible to run applications from different, changing places in the filesystem (i.e., make them relocateable) that are not made for this. For example, some applications contain hardcoded paths to a compile-time `$PREFIX` such as `/usr`. This is generally discouraged, and application authors are asked to use paths relative to the main executable instead. Libraries like _binreloc_ exist to make this easier. Since many applications are not relocateable yet, there are workarounds which can be used by one of these keys: 55 | 56 | * `binpatch: true` indicates that binaries in the AppImage should be patched to replace the string `/usr` by the string `././`, an `AppRun` file should be put inside the AppImage that does a `chdir()` to the `usr/` directory of inside AppDir before executing the payload application. The net effect is this that applications can find their resources in the `usr/` directory inside the AppImage as long as they do not internally use `chdir()` operations themselves. 57 | * `union: true` indicates that an `AppRun` file should be put inside the AppImage that tries to create the impression of a union filesystem, effectively creating the impression to the payload application that the contents of the AppImage are overlayed over `/`. This can be achieved, e.g., using `LD_PRELOAD` and a library that redirects filesystem calls. This works as long as the payload application is a dynamically linked binary. 58 | 59 | 60 | ### Ingredients section 61 | 62 | Describes how to acquire the binary ingredients that go into the AppImage. Binary ingredients can be archives like `.zip` files, packages like `.deb` files or APT repositories like Debian package archives or PPAs. 63 | 64 | __NOTE:__ In the future, source ingredients could also be included in the `.yml` file definition. Source ingredients could include tarballs and Git repositories. It would probably be advantageous if we could share the definition with other formats like snapcraft's `.yaml` files. Proposals for this are welcome. 65 | 66 | `.yml` files are supposed not to hardcode version numbers, but determine the latest version at runtime. If the `.yml` files describes the released version, it should determine the latest released version at runtime. If the `.yml` files describes the development version, it might reference the latest nightly or continuous build instead. 67 | 68 | 69 | #### Using ingredients from a binary archive 70 | 71 | The following example ingredients section describes how to get the latest version of a binary archive: 72 | 73 | ``` 74 | ingredients: 75 | script: 76 | - DLD=$(wget -q "https://api.github.com/repos/atom/atom/releases/latest" -O - | grep -E "https.*atom-amd64.tar.gz" | cut -d'"' -f4) 77 | - wget -c $DLD 78 | - tar zxvf atom*tar.gz 79 | ``` 80 | 81 | The `script` section inside the `ingredients` section determines its URL, downloads and extracts the binary archive. 82 | 83 | 84 | #### Using ingredients from a debian repository 85 | 86 | The following example ingredients section describes how to get the latest version of a package from a Debian archive: 87 | 88 | ``` 89 | ingredients: 90 | dist: trusty 91 | sources: 92 | - deb http://archive.ubuntu.com/ubuntu/ trusty main universe 93 | - deb http://download.opensuse.org/repositories/isv:/KDAB/xUbuntu_14.04/ / 94 | ``` 95 | 96 | The `dist` section inside the `ingredients` section defines which Debian distribution should be used as a base. The `sources` section inside the `ingredients` section describes the repositories from which the package should be pulled. The entries are in the same format as lines in a debian `sources.list` file. Note that the `http://download.opensuse.org/repositories/isv:/KDAB/xUbuntu_14.04` repository needs the `http://archive.ubuntu.com/ubuntu/` repository so that the dependencies can be resolved. 97 | 98 | __NOTE:__ In the future, other types of packages like `.rpm` could also be included in the `.yml` file definition. Proposals for this are welcome if the proposer also implements support for this in the [`pkg2appimage`](https://github.com/AppImage/AppImages/blob/master/pkg2appimage) script. 99 | 100 | 101 | #### Using ingredients from an Ubuntu PPA 102 | 103 | This is a special case of a Debian repository. PPAs can be uniquely identified with the pattern `onwer/name` and can, for brevity, be specified like this: 104 | 105 | ``` 106 | ingredients: 107 | dist: trusty 108 | sources: 109 | - deb http://us.archive.ubuntu.com/ubuntu/ trusty main universe 110 | ppas: 111 | - geany-dev/ppa 112 | ``` 113 | 114 | The `ppas` section inside the `ingredients` section lets you specify one or more Ubuntu PPAs. This is equivalent to, but more elegant than, adding the corresponding `sources.list` entries to the `sources` section inside the `ingredients` section. 115 | 116 | __NOTE:__ In the future, similar shortcuts for other types of personal repositories, such as projects on openSUSE build service, could also be included in the `.yml` file definition. Proposals for this are welcome if the proposer also implements support for this in the [`pkg2appimage`](https://github.com/AppImage/AppImages/blob/master/pkg2appimage) script. 117 | 118 | #### Using deb files from a download page 119 | 120 | The following will fetch the first deb from https://www.bitwig.com/en/download.html: 121 | 122 | ``` 123 | script: 124 | - URL=$(wget -q "https://www.bitwig.com/en/download.html" -O - | grep -oP -m1 "(https)[^'\"]+?.deb" | head -n 1) 125 | - wget -c "$URL" 126 | - echo "$URL" | cut -d "/" -f 5 > VERSION 127 | ``` 128 | 129 | #### Using local deb files 130 | 131 | This allows the use of local deb files (rather than downloading the deb ingredients) 132 | 133 | ``` 134 | ingredients: 135 | dist: trusty 136 | sources: 137 | - deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe 138 | debs: 139 | - /home/area42/kdenlive.deb 140 | - /home/area42/kdenlive/* 141 | ``` 142 | 143 | As you can see, for a single file, just use 144 | ``` 145 | - /path/to/file.deb 146 | ``` 147 | And for all files in a directory (like local repository). Note that the end of the path ends with "`/*`": 148 | ``` 149 | - /path/to/local/repo/* 150 | ``` 151 | __Note:__ this is for personal use, if you use your recipe it will NOT work on another computer if the debs files are not in the specified directory 152 | 153 | 154 | #### Excluding certain packages 155 | 156 | Some packages declare dependencies that are not necessarily required to run the software. The `.yml` format allow overriding these by pretending that the packages are installed already. To exclude these dependencies (and any dependencies they would otherwise pull in), the packages have to be added to the `exclude` key in the `ingredients` section: 157 | 158 | ``` 159 | ingredients: 160 | dist: trusty 161 | packages: 162 | - multisystem 163 | - gksu 164 | sources: 165 | - deb http://us.archive.ubuntu.com/ubuntu/ trusty main universe 166 | - deb http://liveusb.info/multisystem/depot all main 167 | exclude: 168 | - qemu 169 | - qemu-kvm 170 | - cryptsetup 171 | - libwebkitgtk-3.0-0 172 | - dmsetup 173 | ``` 174 | In this example, excluding `qemu` means that the qemu package and all of its dependencies that it would normally pull into the AppImage will be excluded from the AppImage (unless something else in the AppImage pulls in some of those depdencies already). 175 | 176 | #### Pretending certain versions of dependencies being installed 177 | 178 | The dependency information in some packages may result in the package manager to refuse the application to be installed if some __exact__ versions of dependencies are not present in the system. In this case, it may be necessary pretend the __exact__ version of a dependency to be installed on the target system by using the `pretend` key in the `ingredients` section: 179 | 180 | ``` 181 | ingredients: 182 | dist: trusty 183 | sources: 184 | - deb http://archive.ubuntu.com/ubuntu/ trusty main universe 185 | ppas: 186 | - otto-kesselgulasch/gimp-edge 187 | pretend: 188 | - libcups2 1.7.2-0ubuntu1 189 | ``` 190 | 191 | The assumption here is that every target system has at least the pretended version available, and that newer versions of the pretended package are able to run the application just as well as the pretended version itself _(if this is not the case, then the pretended package has broken downward compatibility and should be fixed)_. 192 | 193 | 194 | #### Arbitrary scripts in the ingredients section 195 | 196 | You may add arbitrary shell commands to the `script` section inside the `ingredients` section in order to facilitate the retrieval of the binary ingredients. This allows building AppImages for complex situations as illustrated in the following example: 197 | 198 | ``` 199 | ingredients: 200 | script: 201 | - URL=$(wget -q https://www.fosshub.com/JabRef.html -O - | grep jar | cut -d '"' -f 10) 202 | - wget -c "$URL" 203 | - wget -c --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jre-8u66-linux-x64.tar.gz 204 | ``` 205 | 206 | This downloads the payload application, JabRef, and the required JRE which requires to set a special cookie header. 207 | 208 | The script could also be used to fetch pre-built Debian packages from a GitHub release page, or to override the version of a package. 209 | 210 | Use `post_script` instead of `script` if you need this to run _after_ the other ingredient processing has taken place. 211 | 212 | ### Script section 213 | 214 | The `script` section may contain arbitrary shell commands that are required to translate the binary ingredients to an `AppDir` suitable for generating an AppImage. 215 | 216 | 217 | #### The script section needs to copy ingedients into place 218 | 219 | If `.deb` packages, Debian repositories or PPAs have been specified in the `ingredients` section, then their dependencies are resolved automatically (taking a blacklist of packages that are assumed to be present on all target systems in a recent enough version into account, such as glibc) and the packages are extracted into an AppDir. The shell commands contained in the `script` section are executed inside the root directory of this AppDir. However, some packages place things in non-standard locations, i.e. the main executable is outside of `usr/bin`. In these cases, the commands contained in the `script` section should normalize the filesystem structure. Sometimes it is also necessary to edit further files to reflect the changed file location. The following example illustrates this: 220 | 221 | ``` 222 | ingredients: 223 | dist: trusty 224 | sources: 225 | - deb http://archive.ubuntu.com/ubuntu/ trusty main universe 226 | script: 227 | - DLD=$(wget -q "https://github.com/feross/webtorrent-desktop/releases/" -O - | grep _amd64.deb | head -n 1 | cut -d '"' -f 2) 228 | - wget -c "https://github.com/$DLD" 229 | 230 | script: 231 | - mv opt/webtorrent-desktop/* usr/bin/ 232 | - sed -i -e 's|/opt/webtorrent-desktop/||g' webtorrent-desktop.desktop 233 | ``` 234 | 235 | In the `ingredients` section, a `.deb` package is downloaded. Then, in the `script` section, the main executable is moved to its standard location in the AppDir. Finally, the `.desktop` file is updated to reflect this. 236 | 237 | If other types of binary ingredients have been specified, then the shell commands contained in the `script` section need to retrieve these by copying them into place. Note that since the commands contained in the `script` section are executed inside the root directory of the AppDir, the ingredients downloaded in the `ingredients` sections are one directory level above, i.e., in `../`. The following example illustrates this: 238 | 239 | ``` 240 | ingredients: 241 | script: 242 | - wget -c "https://telegram.org/dl/desktop/linux" --trust-server-names 243 | - tar xf tsetup.*.tar.xz 244 | 245 | script: 246 | - cp ../Telegram/Telegram ./usr/bin/telegram-desktop 247 | ``` 248 | 249 | In the `ingredients` section, an archive is downloaded and unpacked. Then, in the `script` section, the main executable is copied into place inside the AppDir. 250 | 251 | 252 | ### The script section needs to copy icon and `.desktop` file in place 253 | 254 | Since an AppImage may contain more than one executable binary (e.g. helper binaries launched by the main executable) and also may contain multiple `.desktop` files, a clear entry point into the AppImage is required. For this reason, there is the convention that there should be exactly one `$ID.desktop` file and corresponding icon file in the top-level directory of the AppDir. 255 | 256 | The script running the `.yml` file tries to do this automatically, which works if the name of the application specified in the `app:` key matches the name of the `$ID.desktop` file and the corresponding icon file. For example, if `app: myapp` is set, and there is `usr/bin/myapp`, `usr/share/applications/myapp.desktop`, and `usr/share/icons/*/myapp.png`, then the `myapp.desktop` and `myapp.png` files are automatically copied into the top-level directory of the AppDir. Unfortunately, many packages are in their naming. In that case, the shell commands contained in the `script` section must copy exactly one `$ID.desktop` file and the corresponding icon file into the top-level directory of the AppDir. The following example illustrates this: 257 | 258 | ``` 259 | script: 260 | - tar xf ../fritzing* -C usr/bin/ --strip 1 261 | - mv usr/bin/fritzing.desktop . 262 | ``` 263 | 264 | Unfortunately, many applications don't include a `$ID.desktop` file. If it is missing, the shell commands contained in the `script` section need to create it. The following (simplified) example illustrates this: 265 | 266 | ``` 267 | script: 268 | - # Workaround for: 269 | - # https://bugzilla.mozilla.org/show_bug.cgi?id=296568 270 | - cat > firefox.desktop </dev/null 21 | if [ ! $? -eq 0 ] ; then 22 | fatal "desktop-file-validate is missing, please install it" 23 | fi 24 | 25 | if [ ! -e "${HERE}/excludelist" ] ; then 26 | fatal "excludelist missing, please install it" 27 | fi 28 | 29 | if [ ! -d "${APPDIR}" ] ; then 30 | fatal "${APPDIR} is no directory" 31 | fi 32 | 33 | if [ ! -e "${APPDIR}/AppRun" ] ; then 34 | fatal "AppRun is missing in ${APPDIR}" 35 | fi 36 | 37 | if [ ! -e "${APPDIR}/.DirIcon" ] ; then 38 | fatal ".DirIcon is missing in ${APPDIR}" 39 | fi 40 | 41 | DIR_ICON_MIME=$(mimetype $(readlink -f ${APPDIR}/.DirIcon) | awk '{print $2}') 42 | 43 | if [[ ! "$DIR_ICON_MIME" = "image/png" ]] ; then 44 | warn "Icon is not in PNG format. It should be so that it can be used as a thumbnail" 45 | fi 46 | 47 | if [ ! -x "${APPDIR}/AppRun" ] ; then 48 | fatal "AppRun is not executable" // This seems to generate false alarms? https://travis-ci.org/AppImage/AppImageHub/builds/266084511#L539 49 | fi 50 | 51 | NUM_DESKTOP=$(ls "${APPDIR}"/*.desktop 2>/dev/null | wc -l) 52 | if [ ${NUM_DESKTOP} != 1 ] ; then 53 | fatal "No .desktop file or multiple desktop files present" 54 | fi 55 | 56 | num_keys_fatal () { 57 | while IFS='=' read key val 58 | do 59 | if [[ $key == \[*\] ]] ; then 60 | # in a new section; confirm we saw the key once in [Desktop Entry] 61 | if [[ "${raw_section}" == "[Desktop Entry]" ]] ; then 62 | local seen_key="seen__${section}__${1}" 63 | if [[ "${!seen_key}" != "1" ]] ; then 64 | fatal "Key $1 is not in .desktop file exactly once in section $raw_section" 65 | fi 66 | fi 67 | local raw_section=$key 68 | local section="${key//[\[\]\- ]/_}" 69 | elif [[ $key == "$1" ]] ; then 70 | local seen_key="seen__${section}__${key}" 71 | printf -v "$seen_key" %s "$(( $seen_key + 1 ))" 72 | fi 73 | done < "${APPDIR}"/*.desktop 74 | 75 | 76 | # in case there is only one section 77 | # check for existence of key in [Desktop Entry] 78 | local seen_key="seen__${section}__${1}" 79 | if [[ "${section}" == "[Desktop Entry]" && "${!seen_key}" != "1" ]] ; then 80 | fatal "Key $1 is not in .desktop file exactly once in section $raw_section" 81 | fi 82 | } 83 | 84 | desktop-file-validate "${APPDIR}"/*.desktop 85 | if [ ! $? -eq 0 ] ; then 86 | fatal "desktop-file-validate did not exit cleanly on the .desktop file" 87 | fi 88 | 89 | num_keys_warn () { 90 | while IFS='=' read key val 91 | do 92 | if [[ $key == \[*\] ]] ; then 93 | # in a new section; confirm we saw the key once in [Desktop Entry] 94 | if [[ "${raw_section}" == "[Desktop Entry]" ]] ; then 95 | local seen_key="seen__${section}__${1}" 96 | if [[ "${!seen_key}" != "1" ]] ; then 97 | warn "Key $1 is not in .desktop file exactly once in section $raw_section" 98 | fi 99 | fi 100 | local raw_section=$key 101 | local section="${key//[\[\]\- ]/_}" 102 | elif [[ $key == "$1" ]] ; then 103 | local seen_key="seen__${section}__${key}" 104 | printf -v "$seen_key" %s "$(( $seen_key + 1 ))" 105 | fi 106 | done < "${APPDIR}"/*.desktop 107 | 108 | 109 | # in case there is only one section 110 | # check for existence of key in [Desktop Entry] 111 | local seen_key="seen__${section}__${1}" 112 | if [[ "${section}" == "[Desktop Entry]" && "${!seen_key}" != "1" ]] ; then 113 | warn "Key $1 is not in .desktop file exactly once in section $raw_section" 114 | fi 115 | } 116 | 117 | # num_keys_fatal Name # This is not a valid test since [Desktop Action ...] sections can also have Name= 118 | # num_keys_fatal Exec # This is not a valid test since [Desktop Action ...] sections can also have Name= 119 | # e.g, https://github.com/CDrummond/cantata/blob/master/cantata.desktop.cmake 120 | num_keys_fatal Icon 121 | num_keys_fatal Categories 122 | # num_keys_warn Comment 123 | 124 | # Find the relevant appdata.xml file; 125 | # according to ximion, usr/share/appdata is a legacy path replaced by usr/share/metainfo 126 | APPDATA=$(ls "${APPDIR}"/usr/share/metainfo/*appdata.xml 2>/dev/null | head -n 1) # TODO: Handle more than one better 127 | if [ -z "$APPDATA" ] ; then 128 | APPDATA=$(ls "${APPDIR}"/usr/share/appdata/*appdata.xml 2>/dev/null | head -n 1) # TODO: Handle more than one better 129 | fi 130 | if [ -z "$APPDATA" ] ; then 131 | warn 'No appdata file present. Please provide one in the AppImage as per the instructions on https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps' 132 | else 133 | if [ ! -z $(which appstreamcli) ] ; then 134 | appstreamcli validate-tree "${APPDIR}" 135 | else 136 | echo "Skipping AppStream validation since appstreamcli is not on the \$PATH" 137 | fi 138 | fi 139 | 140 | 141 | BLACKLISTED_FILES=$(cat "${HERE}/excludelist" | sed '/^\s*$/d ; /^#.*$/d ; s/\s*#.*$//') 142 | for FILE in $BLACKLISTED_FILES ; do 143 | if [ ! -z $(find "${APPDIR}" -name $FILE) ] ; then 144 | warn "Blacklisted file $FILE found" 145 | fi 146 | done 147 | 148 | echo "Lint found no fatal issues" 149 | exit 0 150 | -------------------------------------------------------------------------------- /bintray-tidy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # bintray-tidy.sh - delete old versions from a package hosted on Bintray. 4 | # 5 | # Note: There is no official quota for open source projects on Bintray, but 6 | # they will suspend the account if they think you are taking advantage. 7 | 8 | set -e # exit on error - don't want to accidently delete the wrong version! 9 | #set -x 10 | 11 | function showHelp() { 12 | cat < Keep newest versions and delete the rest. 21 | max-days Delete all versions created more than days ago. 22 | archive Keep some older versions for archival purposes. 23 | 24 | OPTIONS: 25 | -h, -?, --help Show this help. 26 | -s, --simulate Show what would be deleted without actually deleting it. 27 | 28 | ENVIRONMENT: 29 | * BINTRAY_USER, BINTRAY_API_KEY - required 30 | * BINTRAY_REPO, BINTRAY_REPO_OWNER - optional 31 | 32 | EXAMPLES: 33 | 34 | 1) Keep the 10 most recent versions and delete everything else: 35 | 36 | $ ./bintray-tidy.sh max-versions 10 MyRepo/CoolPackage 37 | 38 | 2) Simulate running the archive strategy to see what would be deleted: 39 | 40 | $ ./bintray-tidy.sh -s archive DreamTeam/TeamRepo/SharedPackage 41 | 42 | ~~~ bintray-tidy.sh ~~~ 43 | EOF 44 | } 45 | 46 | main() { 47 | initialize_variables 48 | 49 | echo "$0" 50 | echo "Tidying package '${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${package}'." 51 | 52 | set -x 53 | get_remote_versions 54 | echo "$REMOTE_VERSIONS" 55 | 56 | # Debugging for https://travis-ci.org/AppImage/AppImages/jobs/347101634#L2574 57 | get_version_date 58 | echo version_date_YMD="$version_date_YMD" 59 | echo version_date_Ywk="$version_date_Ywk" 60 | set +x 61 | 62 | [ "$arg_s" ] && echo "SIMULATION: No versions will actually be deleted from the server." || true 63 | 64 | case "${strategy}" in 65 | max-versions ) 66 | max_versions 67 | ;; 68 | max-days ) 69 | max_days 70 | ;; 71 | archive ) 72 | archive 73 | ;; 74 | * ) 75 | fatal_error "invalid strategy '${strategy}'" 76 | exit 1 77 | ;; 78 | esac 79 | 80 | [ "$arg_s" ] && echo "SIMULATION: Nothing was deleted. Rerun without '-s' to actually delete versions." || true 81 | } 82 | 83 | function initialize_variables() { 84 | # Constants 85 | API="https://api.bintray.com" 86 | 87 | # Required environment variables 88 | BINTRAY_USER="${BINTRAY_USER:?Environment variable missing/empty!}" # env 89 | BINTRAY_API_KEY="${BINTRAY_API_KEY:?Environment variable missing/empty!}" # env 90 | 91 | # Optional environment variables 92 | BINTRAY_REPO_OWNER="${BINTRAY_REPO_OWNER:-$BINTRAY_USER}" # env, or use BINTRAY_USER 93 | BINTRAY_REPO="${BINTRAY_REPO:?Not specified and not set in environment.}" # env or CLI 94 | 95 | # Variables 96 | PCK_URL="${API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${package}" 97 | CURL="curl --silent --show-error -u${BINTRAY_USER}:${BINTRAY_API_KEY} \ 98 | -H Content-Type:application/json \ 99 | -H Accept:application/json" 100 | } 101 | 102 | function get_remote_versions() { 103 | readarray -t REMOTE_VERSIONS < <( \ 104 | curl --silent --show-error -X GET "${PCK_URL}" \ 105 | | sed -nr 's|.*"versions":\["([^]]*)"\].*|\1|p' \ 106 | | sed 's|","|\n|g' ) 107 | echo "$0: ${#REMOTE_VERSIONS[@]} versions found on the remote server." 108 | } 109 | 110 | function max_versions() { 111 | # Enforce upper limit on the number of versions: 112 | for ((i=0;i<${#REMOTE_VERSIONS[@]};i++)); do 113 | if [ "$i" -lt "$max_versions" ]; then 114 | print_action "Keeping" "${REMOTE_VERSIONS[$i]}" 115 | else 116 | delete_version "${REMOTE_VERSIONS[$i]}" 117 | fi 118 | done 119 | } 120 | 121 | function max_days() { 122 | # Delete versions that are more than ${max_days} days old: 123 | cuttoff_date_YMD="$(date --utc -d "$max_days days ago" +%Y%m%d)" # YYYYMMDD 124 | for ((i=0;i<${#REMOTE_VERSIONS[@]};i++)); do 125 | get_version_date "${REMOTE_VERSIONS[$i]}" || continue # skip version 126 | 127 | if [ "$version_date_YMD" -ge "$cuttoff_date_YMD" ]; then 128 | print_action "Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 129 | else 130 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 131 | fi 132 | done 133 | } 134 | 135 | function archive() { 136 | # Delete old versions, but keep a few for archival purposes. 137 | # The algorithm that decides what to keep is hard-coded to prevent the stategy 138 | # being run with contradictory arguments that could have undesirable results. 139 | algorithm_last_changed="2016-01-01 00:00:00 UTC" # TODO: Keep this up-to-date! 140 | # No versions will be deleted that were created before an algorithm change. 141 | previous_version_date_YMD="" previous_version_date_Ywk="" # initialize values. 142 | for ((i=0;i<${#REMOTE_VERSIONS[@]};i++)); do 143 | get_version_date "${REMOTE_VERSIONS[$i]}" || continue # skip version 144 | 145 | [ "$version_date_YMD" -gt "$(date --utc -d "$algorithm_last_changed" +%Y%m%d)" ] || continue 146 | 147 | if [ "$version_date_YMD" -ge "$(date --utc -d "7 days ago" +%Y%m%d)" ]; then 148 | # Keep every version from last 7 days 149 | print_action "7D: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 150 | elif [ "$version_date_YMD" -ge "$(date --utc -d "1 month ago" +%Y%m%d)" ]; then 151 | # Keep maximum one version per day for past month 152 | if [ "$version_date_YMD" != "$previous_version_date_YMD" ]; then 153 | print_action "1pD: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 154 | else 155 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 156 | fi 157 | elif [ "$version_date_YMD" -ge "$(date --utc -d "3 months ago" +%Y%m%d)" ]; then 158 | # Keep maximum one version per week for past 3 months 159 | if [ "$version_date_Ywk" != "$previous_version_date_Ywk" ]; then 160 | print_action "1pW: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 161 | else 162 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 163 | fi 164 | else 165 | if [ "${version_date_YMD:0:6}" != "${previous_version_date_YMD:0:6}" ]; then 166 | # Maximum one version per month... 167 | if [ "$version_date_YMD" -ge "$(date --utc -d "1 year ago" +%Y%m%d)" ]; then 168 | # Keep it if less than a year old 169 | print_action "1pM: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 170 | elif [ "$((${version_date_YMD:4:2}%3))" == "0" ]; then 171 | # Otherwise only keep it every 3rd month. (Keep one every 3 months.) 172 | print_action "1p3M: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 173 | else 174 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 175 | fi 176 | else 177 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 178 | fi 179 | fi 180 | previous_version_date_YMD="$version_date_YMD" 181 | previous_version_date_Ywk="$version_date_Ywk" 182 | done 183 | } 184 | 185 | function get_version_date() { 186 | created="$(${CURL} -X GET "${PCK_URL}/versions/$1" 2>/dev/null | sed -nr \ 187 | 's|.*"created":"([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z)".*|\1|p' )" 188 | [ "$created" ] || return 1 # failed to fetch "created" field 189 | export version_date_YMD="$(date --utc -d "$created" +%Y%m%d)" # YYYYMMDD 190 | export version_date_Ywk="$(date --utc -d "$created" +%Y%V)" # YYYY 191 | [ "$version_date_YMD" ] || return 1 # "created" field was wrong format 192 | } 193 | 194 | function print_action() { 195 | if [ "$3" ]; then 196 | echo "$1 version $2 ($(date --utc -d "$3" "+%d-%b-%Y %T %Z"))" 197 | else 198 | echo "$1 version $2" 199 | fi 200 | } 201 | 202 | function delete_version() { 203 | print_action "Deleting" "$1" "$2" 204 | [ "$arg_s" ] && return 0 || true 205 | ${CURL} -X DELETE "${PCK_URL}/versions/$1" && echo "" 206 | } 207 | 208 | function fatal_error() { 209 | echo "$0: Error: $1. Try '-h' for help." >&2 210 | exit 1 211 | } 212 | 213 | # Get arguments & parameters that were passed in on the command line 214 | while [ "${1:0:1}" == "-" ]; do 215 | arg="${1:1}" # Could be passed in like: -i -e, -ie, or --argument-name 216 | while [ "${arg}" ]; do 217 | case "-${arg}" in 218 | -h*|-\?*|--help ) 219 | showHelp && exit 0 220 | ;; 221 | -s*|--simulate|--just-print|--dry-run|--recon|--no-act ) 222 | arg_s="true" 223 | ;; 224 | * ) 225 | [ "-${arg:0:1}" == "--" ] || arg="${arg:0:1}" 226 | echo fatal_error "unknown option '-${arg}'" 227 | ;; 228 | esac 229 | [ "-${arg:0:1}" == "--" ] && arg="" || arg="${arg:1}" # pop 1st character 230 | done 231 | shift 232 | done 233 | 234 | # Get strategy (passed in on the command line) 235 | strategy="$1" && shift || true 236 | case "${strategy}" in 237 | max-versions ) 238 | [ "$1" -eq "$1" ] 2>/dev/null || fatal_error "max-versions requires integer" 239 | max_versions="$1" && shift 240 | ;; 241 | max-days ) 242 | [ "$1" -eq "$1" ] 2>/dev/null || fatal_error "max-days requires integer" 243 | max_days="$1" && shift 244 | ;; 245 | archive ) 246 | ;; 247 | '' ) 248 | fatal_error "missing strategy" 249 | ;; 250 | * ) 251 | fatal_error "invalid strategy '${strategy}'" 252 | ;; 253 | esac 254 | 255 | # Get package (passed in on the command line) 256 | [ "$1" ] || fatal_error "missing package" 257 | package="$(sed -nr 's|^([^/]*/){0,2}([^/]*)$|\2|p' <<< "$1")" # required 258 | repo="$(sed -nr 's|^([^/]*/){0,1}([^/]*)/[^/]*$|\2|p' <<< "$1")" # optional 259 | owner="$(sed -nr 's|^([^/]*)/[^/]*/[^/]*$|\1|p' <<< "$1")" # optional 260 | [ "${package}" ] || fatal_error "package '$1' badly formed" 261 | [ "${repo}" ] && BINTRAY_REPO="${repo}" || true # override env 262 | [ "${owner}" ] && BINTRAY_REPO_OWNER="${owner}" || true # override env 263 | 264 | main "$@" 265 | -------------------------------------------------------------------------------- /bintray.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Push AppImages and related metadata to Bintray 4 | # https://bintray.com/docs/api/ 5 | 6 | set -e # Exit on errors 7 | trap 'exit 1' ERR 8 | 9 | API=https://api.bintray.com 10 | FILE="$1" 11 | 12 | [ -f "$FILE" ] || { echo "File '$FILE' doesn't exist"; exit; } 13 | 14 | if [ "${BINTRAY_API_KEY}" == "" ] ; then 15 | echo "BINTRAY_API_KEY is missing; assuming this is a PR, uploading to transfer.sh" 16 | curl --upload-file ./"$FILE" https://transfer.sh/$(basename "$FILE") 17 | exit 0 18 | fi 19 | 20 | PCK_NAME="$(basename "$1")" 21 | BINTRAY_USER="${BINTRAY_USER:-probono}" 22 | BINTRAY_API_KEY="$BINTRAY_API_KEY" # env 23 | BINTRAY_REPO="${BINTRAY_REPO:-AppImages}" 24 | BINTRAY_REPO_OWNER="${BINTRAY_REPO_OWNER:-$BINTRAY_USER}" # owner and user not always the same 25 | WEBSITE_URL="${WEBSITE_URL:-http://appimage.org}" 26 | ISSUE_TRACKER_URL="${ISSUE_TRACKER_URL:-https://github.com/AppImage/AppImages/issues}" 27 | VCS_URL="${VCS_URL:-https://github.com/AppImage/AppImages.git}" # Mandatory for packages in free Bintray repos 28 | 29 | # Figure out whether we should use sudo 30 | SUDO='' 31 | if (( EUID != 0 )); then 32 | SUDO='sudo' 33 | fi 34 | 35 | if [ -e /usr/bin/apt-get ] ; then 36 | $SUDO apt-get update >/dev/null 37 | $SUDO apt-get -y install curl bsdtar zsync 38 | fi 39 | 40 | if [ -e /usr/bin/yum ] ; then 41 | $SUDO yum -y install install curl bsdtar zsync 42 | fi 43 | 44 | if [ -e /usr/bin/pacman ] ; then 45 | builddeps=('curl' 'libarchive' 'zsync') 46 | for i in "${builddeps[@]}"; do 47 | if ! pacman -Q "$i" >/dev/null; then 48 | $SUDO pacman -S "$i" 49 | fi 50 | done 51 | fi 52 | 53 | which curl >/dev/null || exit 1 54 | which bsdtar >/dev/null || exit 1 # https://github.com/libarchive/libarchive/wiki/ManPageBsdtar1 ; isoinfo cannot read zisofs 55 | which grep >/dev/null || exit 1 56 | which zsyncmake >/dev/null || exit 1 57 | 58 | # Do not upload artefacts generated as part of a pull request 59 | if [ ! -z "$TRAVIS_PULL_REQUEST" ] ; then 60 | if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then 61 | echo "Not uploading since this is a pull request" 62 | exit 0 63 | fi 64 | fi 65 | 66 | CURL="curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -H Accept:application/json -w \n" 67 | 68 | set -x # Be verbose from here on 69 | 70 | IS_AN_APPIMAGE=$(file -kib "$FILE" | grep -q "application/x-executable" && file -kib "$FILE" | grep -q "application/x-iso9660-image" && echo 1 || true); 71 | if [ "$IS_AN_APPIMAGE" ] ; then 72 | # Get metadata from the desktop file inside the AppImage 73 | DESKTOP=$(bsdtar -tf "$FILE" | grep '^./[^/]*.desktop$' | head -n 1) 74 | # Extract the description from the desktop file 75 | 76 | echo "* DESKTOP $DESKTOP" 77 | 78 | PCK_NAME=$(bsdtar -f "$FILE" -O -x ./"${DESKTOP}" | grep -e "^Name=" | head -n 1 | sed s/Name=//g | cut -d " " -f 1 | xargs) 79 | if [ "$PCK_NAME" == "" ] ; then 80 | bsdtar -f "$FILE" -O -x ./"${DESKTOP}" 81 | echo "PCK_NAME missing in ${DESKTOP}" 82 | fi 83 | 84 | DESCRIPTION=$(bsdtar -f "$FILE" -O -x ./"${DESKTOP}" | grep -e "^Comment=" | sed s/Comment=//g) 85 | 86 | # Check if there is appstream data and use it 87 | APPDATANAME=$(echo "${DESKTOP}" | sed 's/.desktop/.appdata.xml/g' | sed 's|./||' ) 88 | APPDATAFILE=$(bsdtar -tf "$FILE" | grep "${APPDATANAME}$" | head -n 1 || true) 89 | APPDATA=$(bsdtar -f "$FILE" -O -x "${APPDATAFILE}" || true) 90 | if [ "$APPDATA" == "" ] ; then 91 | echo "* APPDATA missing" 92 | else 93 | echo "* APPDATA found" 94 | DESCRIPTION=$(echo "$APPDATA" | grep -o -e "" | sed -e 's/<[^>]*>//g') 95 | WEBSITE_URL=$(echo "$APPDATA" | grep "homepage" | head -n 1 | cut -d ">" -f 2 | cut -d "<" -f 1) 96 | fi 97 | 98 | if [ "$DESCRIPTION" == "" ] ; then 99 | bsdtar -f "$FILE" -O -x ./"${DESKTOP}" 100 | echo "DESCRIPTION missing and no Comment= in ${DESKTOP}" 101 | fi 102 | fi 103 | 104 | IS_TYPE2_APPIMAGE=$(dd if="$FILE" bs=1 skip=8 count=3 | xxd -u -ps | grep -q 414902 && echo 1 || true) 105 | if [ "$IS_TYPE2_APPIMAGE" ] ; then 106 | ./"$FILE" --appimage-mount & 107 | AIPID=$? 108 | echo Mounted with PID $AIPID 109 | AIMOUNTPOINT=$(mount | grep "$(readlink -f "$FILE")" | cut -d " " -f 3) 110 | echo "$AIMOUNTPOINT" 111 | 112 | # Get metadata from the desktop file inside the AppImage 113 | DESKTOP=$(find "$AIMOUNTPOINT" -maxdepth 1 -name '*.desktop' | head -n 1) 114 | # Extract the description from the desktop file 115 | echo "* DESKTOP $DESKTOP" 116 | 117 | PCK_NAME=$(cat "${DESKTOP}" | grep -e "^Name=" | head -n 1 | sed s/Name=//g | cut -d " " -f 1 | xargs) 118 | if [ "$PCK_NAME" == "" ] ; then 119 | echo "PCK_NAME missing in ${DESKTOP}" 120 | fi 121 | echo "* PCK_NAME PCK_NAME" 122 | 123 | DESCRIPTION=$(cat "${DESKTOP}" | grep -e "^Comment=" | sed s/Comment=//g) 124 | echo "* DESCRIPTION $DESCRIPTION" 125 | 126 | # Check if there is appstream data and use it 127 | APPDATA=$(echo "${DESKTOP}" | sed 's/.desktop/.appdata.xml/g' | sed 's|./||') 128 | if [ ! -e "$APPDATA" ] ; then 129 | echo "* APPDATA missing" 130 | else 131 | echo "* APPDATA found" 132 | DESCRIPTION=$(cat "$APPDATA" | grep -o -e "" | sed -e 's/<[^>]*>//g') 133 | WEBSITE_URL=$(cat "$APPDATA" | grep "homepage" | head -n 1 | cut -d ">" -f 2 | cut -d "<" -f 1) 134 | fi 135 | 136 | if [ "$DESCRIPTION" == "" ] ; then 137 | echo "No AppStream data and no Comment= in ${DESKTOP}" 138 | fi 139 | fi 140 | 141 | [ "$PCK_NAME" == "" ] && PCK_NAME=$(basename "$FILE" | cut -d "-" -f 1) 142 | [ "$VERSION" == "" ] && VERSION=$(basename "$FILE" | cut -d "-" -f 2) 143 | 144 | if [ "$PCK_NAME" == "" ] ; then 145 | echo "* PCK_NAME missing, exiting" 146 | exit 1 147 | else 148 | echo "* PCK_NAME $PCK_NAME" 149 | fi 150 | 151 | if [ "$VERSION" == "" ] ; then 152 | echo "* VERSION missing, exiting" 153 | exit 1 154 | else 155 | echo "* VERSION $VERSION" 156 | fi 157 | 158 | if [ "$DESCRIPTION" == "" ] ; then 159 | echo "* DESCRIPTION " 160 | else 161 | echo "* DESCRIPTION $DESCRIPTION" 162 | fi 163 | 164 | set +x # Do not be verbose from here on 165 | ########## 166 | 167 | echo "" 168 | echo "Creating package ${PCK_NAME}..." 169 | data="{ 170 | \"name\": \"${PCK_NAME}\", 171 | \"desc\": \"${DESCRIPTION}\", 172 | \"desc_url\": \"auto\", 173 | \"website_url\": [\"${WEBSITE_URL}\"], 174 | \"vcs_url\": [\"${VCS_URL}\"], 175 | \"issue_tracker_url\": [\"${ISSUE_TRACKER_URL}\"], 176 | \"licenses\": [\"MIT\"], 177 | \"labels\": [\"AppImage\", \"AppImageKit\"] 178 | }" 179 | ${CURL} -H Content-Type:application/json -X POST -d "${data}" "${API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}" 180 | 181 | if [ "$IS_AN_APPIMAGE" ] ; then 182 | # Eventually AppImageAssistant/package should do this. Do it manually in the meantime. 183 | echo "Embedding magic bytes for AppImage MIME type into ${FILE}..." 184 | printf "\x41\x49\x01" | dd bs=1 seek=8 conv=notrunc of="$FILE" 185 | if which zsyncmake > /dev/null 2>&1; then 186 | echo "" 187 | echo "Embedding update information into ${FILE}..." 188 | # Clear ISO 9660 Volume Descriptor #1 field "Application Used" 189 | # (contents not defined by ISO 9660) and write URL there 190 | dd if=/dev/zero of="$FILE" bs=1 seek=33651 count=512 conv=notrunc 191 | # Example for next line: Subsurface-_latestVersion-x86_64.AppImage 192 | NAMELATESTVERSION="$(basename "$FILE" | sed -e "s|${VERSION}|_latestVersion|g")" 193 | # Example for next line: bintray-zsync|probono|AppImages|Subsurface|Subsurface-_latestVersion-x86_64.AppImage.zsync 194 | LINE="bintray-zsync|${BINTRAY_REPO_OWNER}|${BINTRAY_REPO}|${PCK_NAME}|${NAMELATESTVERSION}.zsync" 195 | echo "$LINE" | dd of="$FILE" bs=1 seek=33651 count=512 conv=notrunc 196 | echo "" 197 | echo "Uploading and publishing zsync file for ${FILE}..." 198 | zsyncmake -u "http://dl.bintray.com/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$(basename "$FILE")" "$FILE" -o "${FILE}.zsync" 199 | ${CURL} -H Content-Type:application/octet-stream -T "${FILE}.zsync" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE").zsync?publish=1&override=1" 200 | else 201 | echo "zsyncmake not found, skipping zsync file generation and upload" 202 | fi 203 | fi 204 | 205 | if [ "$IS_TYPE2_APPIMAGE" ] ; then 206 | if which zsyncmake > /dev/null 2>&1; then 207 | echo "" 208 | echo "Sanity checking update information of ${FILE}..." 209 | HEXOFFSET=$(objdump -h "${FILE}" | grep .upd_info | awk '{print $6}') 210 | dd bs=1 if="${FILE}" skip=$((0x$HEXOFFSET)) count=7 | grep "bintray" || exit 1 211 | echo "" 212 | echo "Uploading and publishing zsync file for ${FILE}..." 213 | zsyncmake -u "http://dl.bintray.com/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$(basename "$FILE")" "$FILE" -o "${FILE}.zsync" 214 | ${CURL} -H Content-Type:application/octet-stream -T "${FILE}.zsync" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE").zsync?publish=1&override=1" 215 | else 216 | echo "zsyncmake not found, skipping zsync file generation and upload" 217 | fi 218 | fi 219 | 220 | echo "" 221 | echo "Uploading and publishing ${FILE}..." 222 | if [ -z "$IS_TYPE2_APPIMAGE" ] ; then 223 | ${CURL} -H Content-Type:application/x-iso9660-appimage -T "$FILE" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE")?publish=1&override=1" 224 | else 225 | ${CURL} -H Content-Type:application/octet-stream -T "$FILE" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE")?publish=1&override=1" 226 | fi 227 | 228 | 229 | if [ "$TRAVIS_JOB_ID" ] ; then 230 | echo "" 231 | echo "Adding Travis CI log to release notes..." 232 | BUILD_LOG="https://api.travis-ci.org/jobs/${TRAVIS_JOB_ID}/log.txt?deansi=true" 233 | data='{ 234 | "bintray": { 235 | "syntax": "markdown", 236 | "content": "'${BUILD_LOG}'" 237 | } 238 | }' 239 | ${CURL} -H Content-Type:application/json -X POST -d "${data}" "${API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/versions/${VERSION}/release_notes" 240 | fi 241 | 242 | HERE="$(dirname "$(readlink -f "${0}")")" 243 | "${HERE}/bintray-tidy.sh" archive "${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}" # -s to simulate 244 | 245 | # Seemingly this works only after the second time running this script - thus disabling for now (FIXME) 246 | # echo "" 247 | # echo "Adding ${FILE} to download list..." 248 | # sleep 5 # Seemingly needed 249 | # data="{ 250 | # \"list_in_downloads\": true 251 | # }" 252 | # ${CURL} -H Content-Type:application/json -X PUT -d "${data}" ${API}/file_metadata/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$(basename ${FILE}) 253 | # echo "TODO: Remove earlier versions of the same architecture from the download list" 254 | 255 | # echo "" 256 | # echo "TODO: Uploading screenshot for ${FILE}..." 257 | -------------------------------------------------------------------------------- /dogfeeding.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Eating our own dogfood. Preparing an AppImage of pkg2appimage 4 | 5 | HERE="$(dirname "$(readlink -f "${0}")")" 6 | 7 | . ./functions.sh 8 | 9 | mkdir -p build/ 10 | 11 | cd build/ 12 | # apt download -y apt libapt-pkg5.0 libbz2-1.0 liblzma5 multiarch-support zlib1g dpkg 13 | apt download -y dpkg # We are still using dpkg-deb to extract debs, so we need to bundle it 14 | 15 | wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$SYSTEM_ARCH.AppImage" # FIXME: Make arch independent 16 | wget -c "https://github.com/ImageMagick/ImageMagick/releases/download/7.0.8-17/ImageMagick-0b0ce48-gcc-$SYSTEM_ARCH.AppImage" # FIXME: Make arch independent 17 | chmod +x ./*.AppImage 18 | 19 | ./appimagetool-*.AppImage --appimage-extract && mv ./squashfs-root ./pkg2appimage.AppDir 20 | cd ./pkg2appimage.AppDir 21 | 22 | find ../*.deb -exec dpkg-deb -x {} . \; || true 23 | 24 | rm *.desktop || true 25 | mv ./usr/share/applications/appimagetool.desktop ./usr/share/applications/pkg2appimage.desktop 26 | sed -i -e 's|Name=appimagetool|Name=pkg2appimage|g' ./usr/share/applications/pkg2appimage.desktop 27 | sed -i -e 's|Exec=appimagetool|Exec=pkg2appimage|g' ./usr/share/applications/pkg2appimage.desktop 28 | sed -i -e 's|Comment=.*|Comment=Create AppImages from Debian/Ubuntu repositories|g' ./usr/share/applications/pkg2appimage.desktop 29 | cp ./usr/share/applications/pkg2appimage.desktop . 30 | 31 | cp ../ImageMagick-*.AppImage usr/bin/convert 32 | 33 | # We don't suffer from NIH 34 | # mkdir -p usr/src/ 35 | # wget -q "https://raw.githubusercontent.com/mikix/deb2snap/master/src/preload.c" -O - | \ 36 | # sed -e 's|SNAPPY|UNION|g' | sed -e 's|SNAPP|UNION|g' | sed -e 's|SNAP|UNION|g' | \ 37 | # sed -e 's|snappy|union|g' > usr/src/libunionpreload.c 38 | # gcc -shared -fPIC usr/src/libunionpreload.c -o libunionpreload.so -ldl -DUNION_LIBNAME=\"libunionpreload.so\" 39 | # strip libunionpreload.so 40 | 41 | cp ../../pkg2appimage AppRun ; chmod + AppRun 42 | 43 | mkdir -p ./usr/share/pkg2appimage/ 44 | cp ../../{functions.sh,excludelist,excludedeblist,appdir-lint.sh} ./usr/share/pkg2appimage/ 45 | rm -rf ./usr/share/metainfo/* || true 46 | mkdir -p ./usr/share/metainfo 47 | cp ../../pkg2appimage.appdata.xml ./usr/share/metainfo/ 48 | 49 | copy_deps 50 | move_lib 51 | delete_blacklisted 52 | 53 | rm usr/lib/*-gnu/liblzma.so.5 54 | 55 | cd .. 56 | NO_GLIBC_VERSION=true APP=pkg2appimage VERSION=$TRAVIS_BUILD_NUMBER generate_type2_appimage # FIXME: This embeds bintray-zsync 57 | -------------------------------------------------------------------------------- /excludedeblist: -------------------------------------------------------------------------------- 1 | # The files contained in these debian packages and their dependencies 2 | # are assumed to be present in the base system (distribution) 3 | # in a "recent enough" version (or the end user has to install 4 | # missing ones from this manually using the distribution's 5 | # package manager if required). Note that this only works if 6 | # the ingredients to the AppImage do not require newer versions 7 | # of these packages than what can safely be assumed to be part 8 | # of the base system. This is why we recommend oldstable 9 | # ingredients for AppImages 10 | apt 11 | apt-transport-https 12 | dbus 13 | debconf 14 | dictionaries-common 15 | dpkg 16 | fontconfig 17 | fontconfig-config 18 | # gconf2 # elementary OS 0.4 Loki does NOT have libgconf-2-4 19 | # gconf2-common # elementary OS 0.4 Loki does NOT have libgconf-2-4 20 | # gconf-service # elementary OS 0.4 Loki does NOT have libgconf-2-4 21 | gvfs-backends # e.g., for Bluefish 22 | gksu 23 | glib-networking 24 | gstreamer1.0-plugins-base 25 | gstreamer1.0-plugins-good 26 | gstreamer1.0-plugins-ugly 27 | gstreamer1.0-pulseaudio 28 | gtk2-engines-pixbuf 29 | kde-runtime 30 | libasound2 31 | libatk1.0-0 32 | libc6 33 | libc6-dev 34 | libcairo2 35 | libcups2 36 | # libcurl3 # Does draw in a lot of libs including security relevant ones; e.g., in supertux2; but otherwise get ../lib/x86_64-linux-gnu/libssl.so.1.0.0: version `OPENSSL_1.0.2' not found (required by /usr/lib/x86_64-linux-gnu/libcurl.so.4) 37 | # libcurl3-gnutls # https://github.com/AppImage/AppImages/issues/120#issuecomment-261749714 38 | # libdbm2 # seems not to exist 39 | libdbus-1-3 40 | libdrm2 41 | libegl1-mesa 42 | libfontconfig1 43 | libgbm1 44 | libgcc1 45 | # libgconf-2-4 # elementary OS 0.4 Loki does NOT have it 46 | libgdk-pixbuf2.0-0 47 | libgl1 48 | libgl1-mesa 49 | libgl1-mesa-dri 50 | libgl1-mesa-glx 51 | # libglib2.0-0 # https://github.com/LibreCAD/LibreCAD/issues/858#issuecomment-345449318 52 | libglu1-mesa 53 | # libgnutls26 cannot be expected to be eveywhere, e.g., KDE neon 54 | # libgpg-error0 gives non-fatal errors on many systems and is low-level, can it be expected to be everywhere? 55 | libgpg-error0 56 | # libgstreamer1.0-0 57 | libgtk2.0-0 58 | libgtk-3-0 59 | libnss3 60 | libpango1.0-0 61 | libpango-1.0-0 62 | libpangocairo-1.0-0 # Workaround for: openSUSE: undefined symbol: hb_buffer_set_cluster_level?; commenting this out leads to square boxes instead of fonts 63 | libpangoft2-1.0-0 # Workaround for: openSUSE: undefined symbol: hb_buffer_set_cluster_level?; commenting this out leads to square boxes instead of fonts 64 | libstdc++6 65 | libtasn1-6 66 | libwayland-egl1-mesa # e.g., OpenRA 67 | lsb-base 68 | libxcb1 # Workaround for: Fedora 25: undefined symbol: xcb_send_request_with_fds, https://github.com/AppImage/AppImages/issues/128 69 | mime-support 70 | passwd 71 | udev 72 | uuid-runtime 73 | -------------------------------------------------------------------------------- /excludelist: -------------------------------------------------------------------------------- 1 | # This file lists libraries that we will assume to be present on the host system and hence 2 | # should NOT be bundled inside AppImages. This is a working document; expect it to change 3 | # over time. File format: one filename per line. Each entry should have a justification comment. 4 | 5 | # See the useful tool at https://abi-laboratory.pro/index.php?view=navigator&symbol=hb_buffer_set_cluster_level#result 6 | # to investigate issues with missing symbols. 7 | 8 | ld-linux.so.2 9 | ld-linux-x86-64.so.2 10 | libanl.so.1 11 | libBrokenLocale.so.1 12 | libcidn.so.1 13 | # libcrypt.so.1 # Not part of glibc anymore as of Fedora 30. See https://github.com/slic3r/Slic3r/issues/4798 and https://pagure.io/fedora-docs/release-notes/c/01d74b33564faa42959c035e1eee286940e9170e?branch=f28 14 | libc.so.6 15 | libdl.so.2 16 | libm.so.6 17 | libmvec.so.1 18 | # libnsl.so.1 # Not part of glibc anymore as of Fedora 28. See https://github.com/RPCS3/rpcs3/issues/5224#issuecomment-434930594 19 | libnss_compat.so.2 20 | # libnss_db.so.2 # Not part of neon-useredition-20190321-0530-amd64.iso 21 | libnss_dns.so.2 22 | libnss_files.so.2 23 | libnss_hesiod.so.2 24 | libnss_nisplus.so.2 25 | libnss_nis.so.2 26 | libpthread.so.0 27 | libresolv.so.2 28 | librt.so.1 29 | libthread_db.so.1 30 | libutil.so.1 31 | # These files are all part of the GNU C Library which should never be bundled. 32 | # List was generated from a fresh build of glibc 2.25. 33 | 34 | libstdc++.so.6 35 | # Workaround for: 36 | # usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found 37 | 38 | libGL.so.1 39 | # The above may be missing on Chrome OS, https://www.reddit.com/r/Crostini/comments/d1lp67/ultimaker_cura_no_longer_running_as_an_appimage/ 40 | libEGL.so.1 41 | # Part of the video driver (OpenGL); present on any regular 42 | # desktop system, may also be provided by proprietary drivers. 43 | # Known to cause issues if it's bundled. 44 | 45 | libGLdispatch.so.0 46 | libGLX.so.0 47 | # reported to be superfluent and conflicting system libraries (graphics driver) 48 | # see https://github.com/linuxdeploy/linuxdeploy/issues/89 49 | 50 | libOpenGL.so.0 51 | # Qt installed via install-qt.sh apparently links to this library 52 | # part of OpenGL like libGL/libEGL, so excluding it should not cause any problems 53 | # https://github.com/linuxdeploy/linuxdeploy/issues/152 54 | 55 | libdrm.so.2 56 | # Workaround for: 57 | # Antergos Linux release 2015.11 (ISO-Rolling) 58 | # /usr/lib/libdrm_amdgpu.so.1: error: symbol lookup error: undefined symbol: drmGetNodeTypeFromFd (fatal) 59 | # libGL error: unable to load driver: swrast_dri.so 60 | # libGL error: failed to load driver: swrast 61 | # Unrecognized OpenGL version 62 | 63 | libglapi.so.0 64 | # Part of mesa 65 | # known to cause problems with graphics, see https://github.com/RPCS3/rpcs3/issues/4427#issuecomment-381674910 66 | 67 | libgbm.so.1 68 | # Part of mesa 69 | # https://github.com/probonopd/linuxdeployqt/issues/390#issuecomment-529036305 70 | 71 | libxcb.so.1 72 | # Workaround for: 73 | # Fedora 23 74 | # symbol lookup error: /lib64/libxcb-dri3.so.0: undefined symbol: xcb_send_fd 75 | # Uncertain if this is required to be bundled for some distributions - if so we need to write a version check script and use LD_PRELOAD to load the system version if it is newer 76 | # Fedora 25: 77 | # undefined symbol: xcb_send_request_with_fds 78 | # https://github.com/AppImage/AppImages/issues/128 79 | 80 | libX11.so.6 81 | # Workaround for: 82 | # Fedora 23 83 | # symbol lookup error: ./lib/libX11.so.6: undefined symbol: xcb_wait_for_reply64 84 | # Uncertain if this is required to be bundled for some distributions - if so we need to write a version check script and use LD_PRELOAD to load the system version if it is newer 85 | 86 | libX11-xcb.so.1 87 | # https://github.com/probonopd/linuxdeployqt/issues/582 88 | # Uncertain if this is required to be bundled for some distributions - if so, please let us know 89 | 90 | # --- Bundling GLib and its consequences --- 91 | # The following libraries need to be privately bundled, otherwise this error can happen: 92 | # - /usr/lib/x86_64-linux-gnu/libgnutls.so.30: version `GNUTLS_3_6_9' not found (required by /lib64/libglib-2.0.so.0) 93 | # See https://github.com/probonopd/Emacs.AppImage/issues/16 94 | # - /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined symbol: g_module_open_full 95 | # See https://github.com/AppImage/pkg2appimage/pull/500#issuecomment-997183221 96 | # libgio-2.0.so.0 97 | # libglib-2.0.so.0 98 | # libgmodule-2.0.so.0 99 | # libgobject-2.0.so.0 100 | # libgthread-2.0.so.0 101 | # NOTE: Privately bundling libglib-2.0.so.0 and libgobject-2.0.so.0 may break https://wiki.gnome.org/Projects/Libsecret, 102 | # see https://github.com/probonopd/linuxdeployqt/issues/544 for details 103 | # NOTE: Privately bundling libgio-2.0.so.0 can lead to this error on Ubuntu: 104 | # symbol lookup error: /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/liboverlay-scrollbar.so: undefined symbol: g_settings_new 105 | 106 | # Since we bundle GLib (again), we have to bundle libpango to avoid undefined symbol: g_memdup2 etc. 107 | # see, e.g., https://github.com/TheAssassin/AppImageLauncher/issues/508 108 | # libpangoft2-1.0.so.0 109 | # libpangocairo-1.0.so.0 110 | # libpango-1.0.so.0 111 | # NOTE: Pango requires libharfbuzz >= 2.6.0 which isn't available on some older systems, so this error can happen: 112 | # libpango-1.0.so.0: undefined symbol: hb_ot_layout_get_horizontal_baseline_tag_for_script 113 | # See https://github.com/AppImageCommunity/pkg2appimage/issues/528 114 | 115 | # Commented as we currently bundle libpango 116 | # If libthai is bundled but libpango is not, this error can happen: 117 | # audacity: /tmp/.mount_AudaciUsFbON/usr/lib/libthai.so.0: version `LIBTHAI_0.1.25' not found (required by /usr/lib64/libpango-1.0.so.0) 118 | # on openSUSE Tumbleweed 119 | # libthai.so.0 120 | # If libcairo is bundled but libpango is not, this error can happen: 121 | # Can get symbol lookup error: /lib64/libpango-1.0.so.0: undefined symbol: g_log_structured_standard 122 | # --- Bundling GLib and its consequences --- 123 | 124 | # libgdk-x11-2.0.so.0 # Missing on openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20170601-Media.iso 125 | # libgtk-x11-2.0.so.0 # Missing on openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20170601-Media.iso 126 | 127 | libasound.so.2 128 | # Workaround for: 129 | # No sound, e.g., in VLC.AppImage (does not find sound cards) 130 | 131 | # https://github.com/AppImage/pkg2appimage/issues/475 132 | # libgdk_pixbuf-2.0.so.0 133 | # Was: Workaround for: 134 | # On Ubuntu, get (inkscape:25621): GdkPixbuf-WARNING **: Error loading XPM image loader: Image type 'xpm' is not supported 135 | 136 | libfontconfig.so.1 137 | # Workaround for: 138 | # Application stalls when loading fonts during application launch; e.g., KiCad on ubuntu-mate 139 | 140 | # other "low-level" font rendering libraries 141 | # should fix https://github.com/probonopd/linuxdeployqt/issues/261#issuecomment-377522251 142 | # and https://github.com/probonopd/linuxdeployqt/issues/157#issuecomment-320755694 143 | libfreetype.so.6 144 | libharfbuzz.so.0 145 | 146 | # Note, after discussion we do not exclude this, but we can use a dummy library that just does nothing 147 | # libselinux.so.1 148 | # Workaround for: 149 | # sed: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory 150 | # Some distributions, such as Arch Linux, do not come with libselinux.so.1 by default. 151 | # The solution is to bundle a dummy mock library: 152 | # echo "extern int is_selinux_enabled(void){return 0;}" >> selinux-mock.c 153 | # gcc -s -shared -o libselinux.so.1 -Wl,-soname,libselinux.so.1 selinux-mock.c 154 | # strip libselinux.so.1 155 | # More information: https://github.com/AppImage/AppImages/issues/83 156 | # and https://github.com/AppImage/AppImageKit/issues/775#issuecomment-614954821 157 | # https://gitlab.com/sulinos/devel/libselinux-dummy 158 | 159 | # The following are assumed to be part of the base system 160 | # Removing these has worked e.g., for Krita. Feel free to report if 161 | # you think that some of these should go into AppImages and why. 162 | libcom_err.so.2 163 | libexpat.so.1 164 | libgcc_s.so.1 165 | libgpg-error.so.0 166 | # libgssapi_krb5.so.2 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there 167 | # libgssapi.so.3 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 168 | # libhcrypto.so.4 # Missing on openSUSE LEAP 42.0 169 | # libheimbase.so.1 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 170 | # libheimntlm.so.0 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 171 | # libhx509.so.5 # Missing on openSUSE LEAP 42.0 172 | libICE.so.6 173 | # libidn.so.11 # Does not come with Solus by default 174 | # libk5crypto.so.3 # Running AppImage built on Debian 9 or Ubuntu 16.04 on an Archlinux fails otherwise; https://github.com/AppImage/AppImages/issues/301 175 | # libkeyutils.so.1 # Does not come with Void Linux by default; https://github.com/Subsurface-divelog/subsurface/issues/1971#issuecomment-466606834 176 | # libkrb5.so.26 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there. Missing on openSUSE LEAP 42.0 177 | # libkrb5.so.3 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there 178 | # libkrb5support.so.0 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there 179 | # libp11-kit.so.0 # https://github.com/AppImageCommunity/pkg2appimage/issues/547 180 | # libpcre.so.3 # Missing on Fedora 24, SLED 12 SP1, and openSUSE Leap 42.2 181 | # libroken.so.18 # Mission on openSUSE LEAP 42.0 182 | # libsasl2.so.2 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 183 | libSM.so.6 184 | libusb-1.0.so.0 185 | libuuid.so.1 186 | # libwind.so.0 # Missing on openSUSE LEAP 42.0 187 | libz.so.1 188 | 189 | # Workaround for: 190 | # e.g., Spotify 191 | # relocation error: /lib/x86_64-linux-gnu/libgcrypt.so.20: 192 | # symbol gpgrt_lock_lock, version GPG_ERROR_1.0 not defined 193 | # in file libgpg-error.so.0 with link time reference 194 | libgpg-error.so.0 195 | 196 | libjack.so.0 197 | # it must match the ABI of the JACK server which is installed in the base system 198 | # rncbc confirmed this 199 | # However, this library is missing on Fedora-WS-Live-31-1-9 200 | # which means that we should avoid using JACK altogether if possible 201 | 202 | libpipewire-0.3.so.0 203 | # like libjack, it must match the ABI of the JACK server which is installed in the base system 204 | # https://github.com/linuxdeploy/linuxdeploy/issues/292 205 | 206 | # Unsolved issue: 207 | # https://github.com/probonopd/linuxdeployqt/issues/35 208 | # Error initializing NSS with a persistent database (sql:/home/me/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory 209 | # Error initializing NSS without a persistent database: NSS error code: -5925 210 | # nss_error=-5925, os_error=0 211 | # libnss3.so should not be removed from the bundles, as this causes other issues, e.g., 212 | # https://github.com/probonopd/linuxdeployqt/issues/35#issuecomment-256213517 213 | # and https://github.com/AppImage/AppImages/pull/114 214 | # libnss3.so 215 | 216 | # The following cannot be excluded, see 217 | # https://github.com/AppImage/AppImages/commit/6c7473d8cdaaa2572248dcc53d7f617a577ade6b 218 | # http://stackoverflow.com/questions/32644157/forcing-a-binary-to-use-a-specific-newer-version-of-a-shared-library-so 219 | # libssl.so.1 220 | # libssl.so.1.0.0 221 | # libcrypto.so.1 222 | # libcrypto.so.1.0.0 223 | 224 | # According to https://github.com/RicardoEPRodrigues/3Engine/issues/4#issuecomment-511598362 225 | # libGLEW is not tied to a specific GPU. It's linked against libGL.so.1 226 | # and that one is different depending on the installed driver. 227 | # In fact libGLEW is changing its soversion very often, so you should always bundle libGLEW.so.2.0 228 | 229 | # libglut.so.3 # to be confirmed 230 | 231 | libxcb-dri3.so.0 # https://github.com/AppImage/AppImages/issues/348 232 | libxcb-dri2.so.0 # https://github.com/probonopd/linuxdeployqt/issues/331#issuecomment-442276277 233 | 234 | # If the next line turns out to cause issues, we will have to remove it again and find another solution 235 | libfribidi.so.0 # https://github.com/olive-editor/olive/issues/221 and https://github.com/knapsu/plex-media-player-appimage/issues/14 236 | 237 | # Workaround for: 238 | # symbol lookup error: /lib/x86_64-linux-gnu/libgnutls.so.30: undefined symbol: __gmpz_limbs_write 239 | # https://github.com/ONLYOFFICE/appimage-desktopeditors/issues/3 240 | # Apparently coreutils depends on it, so it should be safe to assume that it comes with every target system 241 | libgmp.so.10 242 | -------------------------------------------------------------------------------- /excludesuselist: -------------------------------------------------------------------------------- 1 | # Automatically generated by running on openSUSE 13.1: 2 | # wget https://github.com/AppImage/AppImages/raw/master/excludelist 3 | # FILES=$(cat excludelist | sed '/^\s*$/d' | sed '/^#.*$/d') 4 | # for FILE in $FILES; do zypper search -f "$FILE" | grep "| package" | head -n 1 | cut -d "|" -f 2 | cut -d " " -f 2 >> packages; done 5 | # cat packages | sort | uniq 6 | 7 | Mesa-libGL1 8 | fontconfig 9 | glibc 10 | # krb5 # openSUSE LEAP 42.0 has other .so filenames than other distributions 11 | libICE6 12 | libSM6 13 | libX11-6 14 | libasound2 15 | libcom_err2 16 | libdrm2 17 | libexpat1 18 | libgcc_s1 19 | libgdk_pixbuf-2_0-0 20 | libgio-2_0-0 21 | libglib-2_0-0 22 | libgobject-2_0-0 23 | libgpg-error0 24 | libgtk-2_0-0 25 | libidn11 26 | libkeyutils1 27 | libp11-kit0 28 | libselinux1 29 | libstdc++6 30 | libusb-1_0-0 31 | libuuid1 32 | libxcb1 33 | libz1 34 | -------------------------------------------------------------------------------- /functions.sh: -------------------------------------------------------------------------------- 1 | # This file is supposed to be sourced by each Recipe 2 | # that wants to use the functions contained herein 3 | # like so: 4 | # wget -q https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/functions.sh -O ./functions.sh 5 | # . ./functions.sh 6 | 7 | # RECIPE=$(realpath "$0") 8 | 9 | # Specify a certain commit if you do not want to use master 10 | # by using: 11 | # export PKG2AICOMMIT= 12 | if [ -z "$PKG2AICOMMIT" ] ; then 13 | PKG2AICOMMIT=master 14 | fi 15 | 16 | # Options for apt-get to use local files rather than the system ones 17 | OPTIONS="-o Debug::NoLocking=1 18 | -o APT::Cache-Limit=125829120 19 | -o Dir::Etc::sourcelist=./sources.list 20 | -o Dir::State=./tmp 21 | -o Dir::Cache=./tmp 22 | -o Dir::State::status=./status 23 | -o Dir::Etc::sourceparts=- 24 | -o APT::Get::List-Cleanup=0 25 | -o APT::Get::AllowUnauthenticated=1 26 | -o Debug::pkgProblemResolver=true 27 | -o Debug::pkgDepCache::AutoInstall=true 28 | -o APT::Install-Recommends=0 29 | -o APT::Install-Suggests=0 30 | " 31 | 32 | # Detect if we are running inside Docker 33 | grep docker /proc/1/cgroup >/dev/null && export DOCKER_BUILD=1 || true 34 | 35 | # Detect system architecture to know which binaries of AppImage tools 36 | # should be downloaded and used. 37 | case "$(uname -i)" in 38 | x86_64|amd64) 39 | # echo "x86-64 system architecture" 40 | SYSTEM_ARCH="x86_64";; 41 | i?86) 42 | # echo "x86 system architecture" 43 | SYSTEM_ARCH="i686";; 44 | # arm*) 45 | # echo "ARM system architecture" 46 | # SYSTEM_ARCH="";; 47 | unknown|AuthenticAMD|GenuineIntel) 48 | # uname -i not answer on debian, then: 49 | case "$(uname -m)" in 50 | x86_64|amd64) 51 | # echo "x86-64 system architecture" 52 | SYSTEM_ARCH="x86_64";; 53 | i?86) 54 | # echo "x86 system architecture" 55 | SYSTEM_ARCH="i686";; 56 | esac ;; 57 | *) 58 | echo "Unsupported system architecture" 59 | exit 1;; 60 | esac 61 | 62 | # Either get the file from remote or from a static place. 63 | # critical for builds without network access like in Open Build Service 64 | cat_file_from_url() 65 | { 66 | cat_excludelist="wget -q $1 -O -" 67 | [ -e "$STATIC_FILES/${1##*/}" ] && cat_excludelist="cat $STATIC_FILES/${1##*/}" 68 | $cat_excludelist 69 | } 70 | 71 | git_pull_rebase_helper() 72 | { 73 | git reset --hard HEAD 74 | git pull 75 | } 76 | 77 | # Patch /usr to ././ in ./usr 78 | # to make the contents of usr/ relocateable 79 | # (this requires us to cd ./usr before running the application; AppRun does that) 80 | patch_usr() 81 | { 82 | find usr/ -type f -executable -exec sed -i -e "s|/usr|././|g" {} \; 83 | } 84 | 85 | # Download AppRun and make it executable 86 | get_apprun() 87 | { 88 | TARGET_ARCH=${ARCH:-$SYSTEM_ARCH} 89 | wget -c https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${TARGET_ARCH} -O AppRun 90 | chmod a+x AppRun 91 | } 92 | 93 | # Copy the library dependencies of all exectuable files in the current directory 94 | # (it can be beneficial to run this multiple times) 95 | copy_deps() 96 | { 97 | PWD=$(readlink -f .) 98 | FILES=$(find . -type f -executable -or -name *.so.* -or -name *.so | sort | uniq ) 99 | for FILE in $FILES ; do 100 | ldd "${FILE}" | grep "=>" | awk '{print $3}' | xargs -I '{}' echo '{}' >> DEPSFILE 101 | done 102 | DEPS=$(cat DEPSFILE | sort | uniq) 103 | for FILE in $DEPS ; do 104 | if [ -e $FILE ] && [[ $(readlink -f $FILE)/ != $PWD/* ]] ; then 105 | cp -v --parents -rfL $FILE ./ || true 106 | fi 107 | done 108 | rm -f DEPSFILE 109 | } 110 | 111 | # Move ./lib/ tree to ./usr/lib/ 112 | move_lib() 113 | { 114 | mkdir -p ./usr/lib ./lib && find ./lib/ -exec cp -v --parents -rfL {} ./usr/ \; && rm -rf ./lib 115 | mkdir -p ./usr/lib ./lib64 && find ./lib64/ -exec cp -v --parents -rfL {} ./usr/ \; && rm -rf ./lib64 116 | } 117 | 118 | # Delete blacklisted files 119 | delete_blacklisted() 120 | { 121 | BLACKLISTED_FILES=$(cat_file_from_url https://github.com/AppImage/pkg2appimage/raw/${PKG2AICOMMIT}/excludelist | sed 's|#.*||g') 122 | echo $BLACKLISTED_FILES 123 | 124 | local DOT_DIR=$(readlink -f .) 125 | local TARGET 126 | for FILE in $BLACKLISTED_FILES ; do 127 | FILES="$(find . -name "${FILE}" -not -path "./usr/optional/*")" 128 | for FOUND in $FILES ; do 129 | TARGET=$(readlink -f "$FOUND") 130 | 131 | # Only delete files from inside the current dir. 132 | if [[ $TARGET = $DOT_DIR/* ]]; then 133 | rm -vf "$TARGET" 134 | fi 135 | 136 | rm -vf "$FOUND" 137 | done 138 | done 139 | 140 | # Do not bundle developer stuff 141 | rm -rf usr/include || true 142 | rm -rf usr/lib/cmake || true 143 | rm -rf usr/lib/pkgconfig || true 144 | find . -name '*.la' | xargs -i rm {} 145 | } 146 | 147 | # Echo highest glibc version needed by the executable files in the current directory 148 | glibc_needed() 149 | { 150 | find . -name *.so -or -name *.so.* -or -type f -executable -exec strings {} \; | grep ^GLIBC_2 | sed s/GLIBC_//g | sort --version-sort | uniq | tail -n 1 151 | # find . -name *.so -or -name *.so.* -or -type f -executable -exec readelf -s '{}' 2>/dev/null \; | sed -n 's/.*@GLIBC_//p'| awk '{print $1}' | sort --version-sort | tail -n 1 152 | } 153 | # Add desktop integration 154 | # Usage: get_desktopintegration name_of_desktop_file_and_exectuable 155 | get_desktopintegration() 156 | { 157 | # REALBIN=$(grep -o "^Exec=.*" *.desktop | sed -e 's|Exec=||g' | cut -d " " -f 1 | head -n 1) 158 | # cat_file_from_url https://raw.githubusercontent.com/AppImage/AppImageKit/deprecated/AppImageAssistant/desktopintegration > ./usr/bin/$REALBIN.wrapper 159 | # chmod a+x ./usr/bin/$REALBIN.wrapper 160 | echo "The desktopintegration script is deprecated. Please advise users to use https://github.com/AppImage/appimaged instead." 161 | # sed -i -e "s|^Exec=$REALBIN|Exec=$REALBIN.wrapper|g" $1.desktop 162 | } 163 | 164 | # Generate AppImage; this expects $ARCH, $APP and $VERSION to be set 165 | generate_appimage() 166 | { 167 | # Download AppImageAssistant 168 | URL="https://github.com/AppImage/AppImageKit/releases/download/6/AppImageAssistant_6-${SYSTEM_ARCH}.AppImage" 169 | wget -c "$URL" -O AppImageAssistant 170 | chmod a+x ./AppImageAssistant 171 | 172 | # if [[ "$RECIPE" == *ecipe ]] ; then 173 | # echo "#!/bin/bash -ex" > ./$APP.AppDir/Recipe 174 | # echo "# This recipe was used to generate this AppImage." >> ./$APP.AppDir/Recipe 175 | # echo "# See http://appimage.org for more information." >> ./$APP.AppDir/Recipe 176 | # echo "" >> ./$APP.AppDir/Recipe 177 | # cat $RECIPE >> ./$APP.AppDir/Recipe 178 | # fi 179 | # 180 | # Detect the architecture of what we are packaging. 181 | # The main binary could be a script, so let's use a .so library 182 | BIN=$(find . -name *.so* -type f | head -n 1) 183 | INFO=$(file "$BIN") 184 | if [ -z $ARCH ] ; then 185 | if [[ $INFO == *"x86-64"* ]] ; then 186 | ARCH=x86_64 187 | elif [[ $INFO == *"i686"* ]] ; then 188 | ARCH=i686 189 | elif [[ $INFO == *"armv6l"* ]] ; then 190 | ARCH=armhf 191 | else 192 | echo "Could not automatically detect the architecture." 193 | echo "Please set the \$ARCH environment variable." 194 | exit 1 195 | fi 196 | fi 197 | 198 | mkdir -p ../out || true 199 | rm ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage" 2>/dev/null || true 200 | GLIBC_NEEDED=$(glibc_needed) 201 | ./AppImageAssistant ./$APP.AppDir/ ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage" 202 | } 203 | 204 | # Generate AppImage type 2 205 | # Additional parameters given to this routine will be passed on to appimagetool 206 | # 207 | # If the environment variable NO_GLIBC_VERSION is set, the required glibc version 208 | # will not be added to the AppImage filename 209 | generate_type2_appimage() 210 | { 211 | # Get the ID of the last successful build on Travis CI 212 | # ID=$(wget -q https://api.travis-ci.org/repos/AppImage/appimagetool/builds -O - | head -n 1 | sed -e 's|}|\n|g' | grep '"result":0' | head -n 1 | sed -e 's|,|\n|g' | grep '"id"' | cut -d ":" -f 2) 213 | # Get the transfer.sh URL from the logfile of the last successful build on Travis CI 214 | # Only Travis knows why build ID and job ID don't match and why the above doesn't give both... 215 | # URL=$(wget -q "https://s3.amazonaws.com/archive.travis-ci.org/jobs/$((ID+1))/log.txt" -O - | grep "https://transfer.sh/.*/appimagetool" | tail -n 1 | sed -e 's|\r||g') 216 | # if [ -z "$URL" ] ; then 217 | # URL=$(wget -q "https://s3.amazonaws.com/archive.travis-ci.org/jobs/$((ID+2))/log.txt" -O - | grep "https://transfer.sh/.*/appimagetool" | tail -n 1 | sed -e 's|\r||g') 218 | # fi 219 | if [ -z "$(which appimagetool)" ] ; then 220 | URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${SYSTEM_ARCH}.AppImage" 221 | wget -c "$URL" -O appimagetool 222 | chmod a+x ./appimagetool 223 | appimagetool=$(readlink -f appimagetool) 224 | else 225 | appimagetool=$(which appimagetool) 226 | fi 227 | if [ "$DOCKER_BUILD" ]; then 228 | appimagetool_tempdir=$(mktemp -d) 229 | mv "$appimagetool" "$appimagetool_tempdir" 230 | pushd "$appimagetool_tempdir" &>/dev/null 231 | ls -al 232 | ./appimagetool --appimage-extract 233 | rm appimagetool 234 | appimagetool=$(readlink -f squashfs-root/AppRun) 235 | popd &>/dev/null 236 | _appimagetool_cleanup() { [ -d "$appimagetool_tempdir" ] && rm -r "$appimagetool_tempdir"; } 237 | trap _appimagetool_cleanup EXIT 238 | fi 239 | 240 | if [ -z ${NO_GLIBC_VERSION+true} ]; then 241 | GLIBC_NEEDED=$(glibc_needed) 242 | VERSION_EXPANDED=$VERSION.glibc$GLIBC_NEEDED 243 | else 244 | VERSION_EXPANDED=$VERSION 245 | fi 246 | 247 | set +x 248 | 249 | GLIBC_NEEDED=$(glibc_needed) 250 | _APP_DIR="${PWD}/$APP.AppDir/" 251 | export OWD="${PWD}" 252 | 253 | if ( [ ! -z "$KEY" ] ) && ( ! -z "$TRAVIS" ) ; then 254 | wget https://github.com/AppImage/AppImageKit/files/584665/data.zip -O data.tar.gz.gpg 255 | ( set +x ; echo $KEY | gpg2 --batch --passphrase-fd 0 --no-tty --skip-verify --output data.tar.gz --decrypt data.tar.gz.gpg ) 256 | tar xf data.tar.gz 257 | sudo chown -R $USER .gnu* 258 | mv $HOME/.gnu* $HOME/.gnu_old ; mv .gnu* $HOME/ 259 | if [ -z "$RECIPE" ] ; then 260 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n -s -g -v "${_APP_DIR}" 261 | else 262 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n -s --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v "${_APP_DIR}" 263 | fi 264 | else 265 | if [ -z "$RECIPE" ] ; then 266 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n -g -v "${_APP_DIR}" 267 | else 268 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v "${_APP_DIR}" 269 | fi 270 | fi 271 | set -x 272 | mkdir -p ../out/ || true 273 | mv *.AppImage* ../out/ 274 | } 275 | 276 | # Generate status file for use by apt-get; assuming that the recipe uses no newer 277 | # ingredients than what would require more recent dependencies than what we assume 278 | # to be part of the base system 279 | generate_status() 280 | { 281 | mkdir -p ./tmp/archives/ 282 | mkdir -p ./tmp/lists/partial 283 | touch tmp/pkgcache.bin tmp/srcpkgcache.bin 284 | if [ -e "${HERE}/usr/share/pkg2appimage/excludedeblist" ] ; then 285 | EXCLUDEDEBLIST="${HERE}/usr/share/pkg2appimage/excludedeblist" 286 | else 287 | wget -q -c "https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/excludedeblist" 288 | EXCLUDEDEBLIST=excludedeblist 289 | fi 290 | rm status 2>/dev/null || true 291 | for PACKAGE in $(cat "$EXCLUDEDEBLIST" | cut -d "#" -f 1) ; do 292 | printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status 293 | done 294 | } 295 | 296 | # Find the desktop file and copy it to the AppDir 297 | get_desktop() 298 | { 299 | find usr/share/applications -iname "*${LOWERAPP}.desktop" -exec cp {} . \; || true 300 | } 301 | 302 | fix_desktop() { 303 | # fix trailing semicolons 304 | for key in Actions Categories Implements Keywords MimeType NotShowIn OnlyShowIn; do 305 | sed -i '/'"$key"'.*[^;]$/s/$/;/' $1 306 | done 307 | } 308 | 309 | # Find the icon file and copy it to the AppDir 310 | get_icon() 311 | { 312 | find ./usr/share/pixmaps/$LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 313 | find ./usr/share/icons -path *64* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 314 | find ./usr/share/icons -path *128* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 315 | find ./usr/share/icons -path *512* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 316 | find ./usr/share/icons -path *256* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 317 | ls -lh $LOWERAPP.png || true 318 | } 319 | 320 | # Find out the version 321 | get_version() 322 | { 323 | THEDEB=$(find ../*.deb -name $LOWERAPP"_*" | head -n 1) 324 | if [ -z "$THEDEB" ] ; then 325 | echo "Version could not be determined from the .deb; you need to determine it manually" 326 | fi 327 | VERSION=$(echo $THEDEB | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' | sed -e 's|.dfsg||g' ) 328 | echo $VERSION 329 | } 330 | 331 | # transfer.sh 332 | transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi 333 | tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; } 334 | 335 | # Patch binary files; fill with padding if replacement is shorter than original 336 | # http://everydaywithlinux.blogspot.de/2012/11/patch-strings-in-binary-files-with-sed.html 337 | # Example: patch_strings_in_file foo "/usr/local/lib/foo" "/usr/lib/foo" 338 | patch_strings_in_file() { 339 | local FILE="$1" 340 | local PATTERN="$2" 341 | local REPLACEMENT="$3" 342 | # Find all unique strings in FILE that contain the pattern 343 | STRINGS=$(strings ${FILE} | grep ${PATTERN} | sort -u -r) 344 | if [ "${STRINGS}" != "" ] ; then 345 | echo "File '${FILE}' contain strings with '${PATTERN}' in them:" 346 | for OLD_STRING in ${STRINGS} ; do 347 | # Create the new string with a simple bash-replacement 348 | NEW_STRING=${OLD_STRING//${PATTERN}/${REPLACEMENT}} 349 | # Create null terminated ASCII HEX representations of the strings 350 | OLD_STRING_HEX="$(echo -n ${OLD_STRING} | xxd -g 0 -u -ps -c 256)00" 351 | NEW_STRING_HEX="$(echo -n ${NEW_STRING} | xxd -g 0 -u -ps -c 256)00" 352 | if [ ${#NEW_STRING_HEX} -le ${#OLD_STRING_HEX} ] ; then 353 | # Pad the replacement string with null terminations so the 354 | # length matches the original string 355 | while [ ${#NEW_STRING_HEX} -lt ${#OLD_STRING_HEX} ] ; do 356 | NEW_STRING_HEX="${NEW_STRING_HEX}00" 357 | done 358 | # Now, replace every occurrence of OLD_STRING with NEW_STRING 359 | echo -n "Replacing ${OLD_STRING} with ${NEW_STRING}... " 360 | hexdump -ve '1/1 "%.2X"' ${FILE} | \ 361 | sed "s/${OLD_STRING_HEX}/${NEW_STRING_HEX}/g" | \ 362 | xxd -r -p > ${FILE}.tmp 363 | chmod --reference ${FILE} ${FILE}.tmp 364 | mv ${FILE}.tmp ${FILE} 365 | echo "Done!" 366 | else 367 | echo "New string '${NEW_STRING}' is longer than old" \ 368 | "string '${OLD_STRING}'. Skipping." 369 | fi 370 | done 371 | fi 372 | } 373 | 374 | # Lightweight bash-only "apt update" and "apt download" replacement 375 | 376 | function apt-get.update(){ 377 | echo -n > cache.txt 378 | 379 | cat Packages.gz | gunzip -c | grep -E "^Package:|^Filename:|^Depends:|^Version:" >> cache.txt || true 380 | 381 | echo APT_GET_UPDATE 382 | while read line; do 383 | local line=$(echo "${line}" | sed 's|[[:space:]]| |g') 384 | local repo_info=($(echo ${line} | tr " " "\n")) 385 | local base_url=${repo_info[1]} 386 | local dist_name=${repo_info[2]} 387 | 388 | echo line=${line} 389 | echo repo_info=${repo_info} 390 | echo base_url=${base_url} 391 | echo dist_name=${dist_name} 392 | 393 | # Detect openSUSE Build Service (OBS) repositories, which are listed using a single / at the end (according to pkg2appimage documentation) 394 | if test "${dist_name}" = "/" ; then 395 | echo "Caching ${base_url} ${dist_name}..." 396 | local repo_url="${base_url}/Packages.gz" 397 | wget -q "${repo_url}" -O - | gunzip -c | grep -E "^Package:|^Filename:|^Depends:|^Version:" | sed "s|^Filename: |Filename: ${base_url}/|g" >> cache.txt 398 | else 399 | for i in $(seq 3 $((${#repo_info[@]} - 1))); do 400 | echo "Caching ${base_url} ${dist_name} ${repo_info[${i}]}..." 401 | local repo_url="${base_url}/dists/${dist_name}/${repo_info[${i}]}/binary-amd64/Packages.gz" 402 | wget -q "${repo_url}" -O - | gunzip -c | grep -E "^Package:|^Filename:|^Depends:|^Version:" | sed "s|^Filename: |Filename: ${base_url}/|g" >> cache.txt 403 | done 404 | fi 405 | done > teste_123 449 | } 450 | } 451 | 452 | unset package_url 453 | 454 | for depend in "${dependencies[@]}"; do 455 | apt-get.do-download ${depend} 456 | done 457 | } 458 | -------------------------------------------------------------------------------- /lum-qt.yml: -------------------------------------------------------------------------------- 1 | app: mx-live-usb-maker 2 | binpatch: true 3 | 4 | ingredients: 5 | packages: 6 | - cryptsetup 7 | - cryptsetup-bin 8 | - libgl1 9 | - libglib2.0-0 10 | - libxcb1 11 | - libqt5gui5 12 | - libqt5dbus5 13 | - libqt5widgets5 14 | - libqt5core5a 15 | - libpcre2-16-0 16 | - mx-live-usb-maker 17 | - ntfs-3g 18 | - libdouble-conversion1 19 | - libxcb-xinerama0 20 | - libqt5x11extras5 21 | - coreutils 22 | - live-usb-maker 23 | - cli-shell-utils 24 | - syslinux 25 | - syslinux-common 26 | - extlinux 27 | - util-linux 28 | - cpio 29 | - zlib1g 30 | - mx-viewer 31 | - pkexec 32 | dist: bullseye 33 | sources: 34 | - deb http://la.mxrepo.com/mx/repo/ bullseye main non-free 35 | - deb http://mxrepo.com/mx/repo/ bullseye main non-free 36 | - deb http://deb.debian.org/debian bullseye main contrib non-free 37 | 38 | script: 39 | - cp -R usr/local/lib/cli-shell-utils usr/lib/cli-shell-utils 40 | - cp usr/local/bin/* usr/bin 41 | -------------------------------------------------------------------------------- /old/README.md: -------------------------------------------------------------------------------- 1 | # lum-qt-appimage 2 | appimage package for the live-usb-maker system from antiX and MX, renamed here live-usb-maker-qt 3 | based on mx-live-usb-maker gui from MX and live-usb-maker from antiX 4 | 5 | this appimage version is no longer maintained. 6 | -------------------------------------------------------------------------------- /old/appdir-lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Checks AppDir for maximum compatibility with AppImage best practices. 4 | # This might evolve into a more formal specification one day. 5 | 6 | set -e 7 | 8 | HERE="$(dirname "$(readlink -f "${0}")")" 9 | APPDIR="${1}" 10 | 11 | fatal () { 12 | echo "FATAL: $1" 13 | exit 1 14 | } 15 | 16 | warn () { 17 | echo "WARNING: $1" 18 | } 19 | 20 | which desktop-file-validate >/dev/null 21 | if [ ! $? -eq 0 ] ; then 22 | fatal "desktop-file-validate is missing, please install it" 23 | fi 24 | 25 | if [ ! -e "${HERE}/excludelist" ] ; then 26 | fatal "excludelist missing, please install it" 27 | fi 28 | 29 | if [ ! -d "${APPDIR}" ] ; then 30 | fatal "${APPDIR} is no directory" 31 | fi 32 | 33 | if [ ! -e "${APPDIR}/AppRun" ] ; then 34 | fatal "AppRun is missing in ${APPDIR}" 35 | fi 36 | 37 | if [ ! -e "${APPDIR}/.DirIcon" ] ; then 38 | fatal ".DirIcon is missing in ${APPDIR}" 39 | fi 40 | 41 | DIR_ICON_MIME=$(mimetype $(readlink -f ${APPDIR}/.DirIcon) | awk '{print $2}') 42 | 43 | if [[ ! "$DIR_ICON_MIME" = "image/png" ]] ; then 44 | warn "Icon is not in PNG format. It should be so that it can be used as a thumbnail" 45 | fi 46 | 47 | if [ ! -x "${APPDIR}/AppRun" ] ; then 48 | fatal "AppRun is not executable" // This seems to generate false alarms? https://travis-ci.org/AppImage/AppImageHub/builds/266084511#L539 49 | fi 50 | 51 | NUM_DESKTOP=$(ls "${APPDIR}"/*.desktop 2>/dev/null | wc -l) 52 | if [ ${NUM_DESKTOP} != 1 ] ; then 53 | fatal "No .desktop file or multiple desktop files present" 54 | fi 55 | 56 | num_keys_fatal () { 57 | while IFS='=' read key val 58 | do 59 | if [[ $key == \[*\] ]] ; then 60 | # in a new section; confirm we saw the key once in [Desktop Entry] 61 | if [[ "${raw_section}" == "[Desktop Entry]" ]] ; then 62 | local seen_key="seen__${section}__${1}" 63 | if [[ "${!seen_key}" != "1" ]] ; then 64 | fatal "Key $1 is not in .desktop file exactly once in section $raw_section" 65 | fi 66 | fi 67 | local raw_section=$key 68 | local section="${key//[\[\]\- ]/_}" 69 | elif [[ $key == "$1" ]] ; then 70 | local seen_key="seen__${section}__${key}" 71 | printf -v "$seen_key" %s "$(( $seen_key + 1 ))" 72 | fi 73 | done < "${APPDIR}"/*.desktop 74 | 75 | 76 | # in case there is only one section 77 | # check for existence of key in [Desktop Entry] 78 | local seen_key="seen__${section}__${1}" 79 | if [[ "${section}" == "[Desktop Entry]" && "${!seen_key}" != "1" ]] ; then 80 | fatal "Key $1 is not in .desktop file exactly once in section $raw_section" 81 | fi 82 | } 83 | 84 | desktop-file-validate "${APPDIR}"/*.desktop 85 | if [ ! $? -eq 0 ] ; then 86 | fatal "desktop-file-validate did not exit cleanly on the .desktop file" 87 | fi 88 | 89 | num_keys_warn () { 90 | while IFS='=' read key val 91 | do 92 | if [[ $key == \[*\] ]] ; then 93 | # in a new section; confirm we saw the key once in [Desktop Entry] 94 | if [[ "${raw_section}" == "[Desktop Entry]" ]] ; then 95 | local seen_key="seen__${section}__${1}" 96 | if [[ "${!seen_key}" != "1" ]] ; then 97 | warn "Key $1 is not in .desktop file exactly once in section $raw_section" 98 | fi 99 | fi 100 | local raw_section=$key 101 | local section="${key//[\[\]\- ]/_}" 102 | elif [[ $key == "$1" ]] ; then 103 | local seen_key="seen__${section}__${key}" 104 | printf -v "$seen_key" %s "$(( $seen_key + 1 ))" 105 | fi 106 | done < "${APPDIR}"/*.desktop 107 | 108 | 109 | # in case there is only one section 110 | # check for existence of key in [Desktop Entry] 111 | local seen_key="seen__${section}__${1}" 112 | if [[ "${section}" == "[Desktop Entry]" && "${!seen_key}" != "1" ]] ; then 113 | warn "Key $1 is not in .desktop file exactly once in section $raw_section" 114 | fi 115 | } 116 | 117 | # num_keys_fatal Name # This is not a valid test since [Desktop Action ...] sections can also have Name= 118 | # num_keys_fatal Exec # This is not a valid test since [Desktop Action ...] sections can also have Name= 119 | # e.g, https://github.com/CDrummond/cantata/blob/master/cantata.desktop.cmake 120 | num_keys_fatal Icon 121 | num_keys_fatal Categories 122 | # num_keys_warn Comment 123 | 124 | # Find the relevant appdata.xml file; 125 | # according to ximion, usr/share/appdata is a legacy path replaced by usr/share/metainfo 126 | APPDATA=$(ls "${APPDIR}"/usr/share/metainfo/*appdata.xml 2>/dev/null | head -n 1) # TODO: Handle more than one better 127 | if [ -z "$APPDATA" ] ; then 128 | APPDATA=$(ls "${APPDIR}"/usr/share/appdata/*appdata.xml 2>/dev/null | head -n 1) # TODO: Handle more than one better 129 | fi 130 | if [ -z "$APPDATA" ] ; then 131 | warn 'No appdata file present. Please provide one in the AppImage as per the instructions on https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps' 132 | else 133 | if [ ! -z $(which appstreamcli) ] ; then 134 | appstreamcli validate-tree "${APPDIR}" 135 | else 136 | echo "Skipping AppStream validation since appstreamcli is not on the \$PATH" 137 | fi 138 | fi 139 | 140 | 141 | BLACKLISTED_FILES=$(cat "${HERE}/excludelist" | sed '/^\s*$/d ; /^#.*$/d ; s/\s*#.*$//') 142 | for FILE in $BLACKLISTED_FILES ; do 143 | if [ ! -z $(find "${APPDIR}" -name $FILE) ] ; then 144 | warn "Blacklisted file $FILE found" 145 | fi 146 | done 147 | 148 | echo "Lint found no fatal issues" 149 | exit 0 150 | -------------------------------------------------------------------------------- /old/bintray-tidy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # bintray-tidy.sh - delete old versions from a package hosted on Bintray. 4 | # 5 | # Note: There is no official quota for open source projects on Bintray, but 6 | # they will suspend the account if they think you are taking advantage. 7 | 8 | set -e # exit on error - don't want to accidently delete the wrong version! 9 | #set -x 10 | 11 | function showHelp() { 12 | cat < Keep newest versions and delete the rest. 21 | max-days Delete all versions created more than days ago. 22 | archive Keep some older versions for archival purposes. 23 | 24 | OPTIONS: 25 | -h, -?, --help Show this help. 26 | -s, --simulate Show what would be deleted without actually deleting it. 27 | 28 | ENVIRONMENT: 29 | * BINTRAY_USER, BINTRAY_API_KEY - required 30 | * BINTRAY_REPO, BINTRAY_REPO_OWNER - optional 31 | 32 | EXAMPLES: 33 | 34 | 1) Keep the 10 most recent versions and delete everything else: 35 | 36 | $ ./bintray-tidy.sh max-versions 10 MyRepo/CoolPackage 37 | 38 | 2) Simulate running the archive strategy to see what would be deleted: 39 | 40 | $ ./bintray-tidy.sh -s archive DreamTeam/TeamRepo/SharedPackage 41 | 42 | ~~~ bintray-tidy.sh ~~~ 43 | EOF 44 | } 45 | 46 | main() { 47 | initialize_variables 48 | 49 | echo "$0" 50 | echo "Tidying package '${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${package}'." 51 | 52 | set -x 53 | get_remote_versions 54 | echo "$REMOTE_VERSIONS" 55 | 56 | # Debugging for https://travis-ci.org/AppImage/AppImages/jobs/347101634#L2574 57 | get_version_date 58 | echo version_date_YMD="$version_date_YMD" 59 | echo version_date_Ywk="$version_date_Ywk" 60 | set +x 61 | 62 | [ "$arg_s" ] && echo "SIMULATION: No versions will actually be deleted from the server." || true 63 | 64 | case "${strategy}" in 65 | max-versions ) 66 | max_versions 67 | ;; 68 | max-days ) 69 | max_days 70 | ;; 71 | archive ) 72 | archive 73 | ;; 74 | * ) 75 | fatal_error "invalid strategy '${strategy}'" 76 | exit 1 77 | ;; 78 | esac 79 | 80 | [ "$arg_s" ] && echo "SIMULATION: Nothing was deleted. Rerun without '-s' to actually delete versions." || true 81 | } 82 | 83 | function initialize_variables() { 84 | # Constants 85 | API="https://api.bintray.com" 86 | 87 | # Required environment variables 88 | BINTRAY_USER="${BINTRAY_USER:?Environment variable missing/empty!}" # env 89 | BINTRAY_API_KEY="${BINTRAY_API_KEY:?Environment variable missing/empty!}" # env 90 | 91 | # Optional environment variables 92 | BINTRAY_REPO_OWNER="${BINTRAY_REPO_OWNER:-$BINTRAY_USER}" # env, or use BINTRAY_USER 93 | BINTRAY_REPO="${BINTRAY_REPO:?Not specified and not set in environment.}" # env or CLI 94 | 95 | # Variables 96 | PCK_URL="${API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${package}" 97 | CURL="curl --silent --show-error -u${BINTRAY_USER}:${BINTRAY_API_KEY} \ 98 | -H Content-Type:application/json \ 99 | -H Accept:application/json" 100 | } 101 | 102 | function get_remote_versions() { 103 | readarray -t REMOTE_VERSIONS < <( \ 104 | curl --silent --show-error -X GET "${PCK_URL}" \ 105 | | sed -nr 's|.*"versions":\["([^]]*)"\].*|\1|p' \ 106 | | sed 's|","|\n|g' ) 107 | echo "$0: ${#REMOTE_VERSIONS[@]} versions found on the remote server." 108 | } 109 | 110 | function max_versions() { 111 | # Enforce upper limit on the number of versions: 112 | for ((i=0;i<${#REMOTE_VERSIONS[@]};i++)); do 113 | if [ "$i" -lt "$max_versions" ]; then 114 | print_action "Keeping" "${REMOTE_VERSIONS[$i]}" 115 | else 116 | delete_version "${REMOTE_VERSIONS[$i]}" 117 | fi 118 | done 119 | } 120 | 121 | function max_days() { 122 | # Delete versions that are more than ${max_days} days old: 123 | cuttoff_date_YMD="$(date --utc -d "$max_days days ago" +%Y%m%d)" # YYYYMMDD 124 | for ((i=0;i<${#REMOTE_VERSIONS[@]};i++)); do 125 | get_version_date "${REMOTE_VERSIONS[$i]}" || continue # skip version 126 | 127 | if [ "$version_date_YMD" -ge "$cuttoff_date_YMD" ]; then 128 | print_action "Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 129 | else 130 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 131 | fi 132 | done 133 | } 134 | 135 | function archive() { 136 | # Delete old versions, but keep a few for archival purposes. 137 | # The algorithm that decides what to keep is hard-coded to prevent the stategy 138 | # being run with contradictory arguments that could have undesirable results. 139 | algorithm_last_changed="2016-01-01 00:00:00 UTC" # TODO: Keep this up-to-date! 140 | # No versions will be deleted that were created before an algorithm change. 141 | previous_version_date_YMD="" previous_version_date_Ywk="" # initialize values. 142 | for ((i=0;i<${#REMOTE_VERSIONS[@]};i++)); do 143 | get_version_date "${REMOTE_VERSIONS[$i]}" || continue # skip version 144 | 145 | [ "$version_date_YMD" -gt "$(date --utc -d "$algorithm_last_changed" +%Y%m%d)" ] || continue 146 | 147 | if [ "$version_date_YMD" -ge "$(date --utc -d "7 days ago" +%Y%m%d)" ]; then 148 | # Keep every version from last 7 days 149 | print_action "7D: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 150 | elif [ "$version_date_YMD" -ge "$(date --utc -d "1 month ago" +%Y%m%d)" ]; then 151 | # Keep maximum one version per day for past month 152 | if [ "$version_date_YMD" != "$previous_version_date_YMD" ]; then 153 | print_action "1pD: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 154 | else 155 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 156 | fi 157 | elif [ "$version_date_YMD" -ge "$(date --utc -d "3 months ago" +%Y%m%d)" ]; then 158 | # Keep maximum one version per week for past 3 months 159 | if [ "$version_date_Ywk" != "$previous_version_date_Ywk" ]; then 160 | print_action "1pW: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 161 | else 162 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 163 | fi 164 | else 165 | if [ "${version_date_YMD:0:6}" != "${previous_version_date_YMD:0:6}" ]; then 166 | # Maximum one version per month... 167 | if [ "$version_date_YMD" -ge "$(date --utc -d "1 year ago" +%Y%m%d)" ]; then 168 | # Keep it if less than a year old 169 | print_action "1pM: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 170 | elif [ "$((${version_date_YMD:4:2}%3))" == "0" ]; then 171 | # Otherwise only keep it every 3rd month. (Keep one every 3 months.) 172 | print_action "1p3M: Keeping" "${REMOTE_VERSIONS[$i]}" "$created" 173 | else 174 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 175 | fi 176 | else 177 | delete_version "${REMOTE_VERSIONS[$i]}" "$created" 178 | fi 179 | fi 180 | previous_version_date_YMD="$version_date_YMD" 181 | previous_version_date_Ywk="$version_date_Ywk" 182 | done 183 | } 184 | 185 | function get_version_date() { 186 | created="$(${CURL} -X GET "${PCK_URL}/versions/$1" 2>/dev/null | sed -nr \ 187 | 's|.*"created":"([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z)".*|\1|p' )" 188 | [ "$created" ] || return 1 # failed to fetch "created" field 189 | export version_date_YMD="$(date --utc -d "$created" +%Y%m%d)" # YYYYMMDD 190 | export version_date_Ywk="$(date --utc -d "$created" +%Y%V)" # YYYY 191 | [ "$version_date_YMD" ] || return 1 # "created" field was wrong format 192 | } 193 | 194 | function print_action() { 195 | if [ "$3" ]; then 196 | echo "$1 version $2 ($(date --utc -d "$3" "+%d-%b-%Y %T %Z"))" 197 | else 198 | echo "$1 version $2" 199 | fi 200 | } 201 | 202 | function delete_version() { 203 | print_action "Deleting" "$1" "$2" 204 | [ "$arg_s" ] && return 0 || true 205 | ${CURL} -X DELETE "${PCK_URL}/versions/$1" && echo "" 206 | } 207 | 208 | function fatal_error() { 209 | echo "$0: Error: $1. Try '-h' for help." >&2 210 | exit 1 211 | } 212 | 213 | # Get arguments & parameters that were passed in on the command line 214 | while [ "${1:0:1}" == "-" ]; do 215 | arg="${1:1}" # Could be passed in like: -i -e, -ie, or --argument-name 216 | while [ "${arg}" ]; do 217 | case "-${arg}" in 218 | -h*|-\?*|--help ) 219 | showHelp && exit 0 220 | ;; 221 | -s*|--simulate|--just-print|--dry-run|--recon|--no-act ) 222 | arg_s="true" 223 | ;; 224 | * ) 225 | [ "-${arg:0:1}" == "--" ] || arg="${arg:0:1}" 226 | echo fatal_error "unknown option '-${arg}'" 227 | ;; 228 | esac 229 | [ "-${arg:0:1}" == "--" ] && arg="" || arg="${arg:1}" # pop 1st character 230 | done 231 | shift 232 | done 233 | 234 | # Get strategy (passed in on the command line) 235 | strategy="$1" && shift || true 236 | case "${strategy}" in 237 | max-versions ) 238 | [ "$1" -eq "$1" ] 2>/dev/null || fatal_error "max-versions requires integer" 239 | max_versions="$1" && shift 240 | ;; 241 | max-days ) 242 | [ "$1" -eq "$1" ] 2>/dev/null || fatal_error "max-days requires integer" 243 | max_days="$1" && shift 244 | ;; 245 | archive ) 246 | ;; 247 | '' ) 248 | fatal_error "missing strategy" 249 | ;; 250 | * ) 251 | fatal_error "invalid strategy '${strategy}'" 252 | ;; 253 | esac 254 | 255 | # Get package (passed in on the command line) 256 | [ "$1" ] || fatal_error "missing package" 257 | package="$(sed -nr 's|^([^/]*/){0,2}([^/]*)$|\2|p' <<< "$1")" # required 258 | repo="$(sed -nr 's|^([^/]*/){0,1}([^/]*)/[^/]*$|\2|p' <<< "$1")" # optional 259 | owner="$(sed -nr 's|^([^/]*)/[^/]*/[^/]*$|\1|p' <<< "$1")" # optional 260 | [ "${package}" ] || fatal_error "package '$1' badly formed" 261 | [ "${repo}" ] && BINTRAY_REPO="${repo}" || true # override env 262 | [ "${owner}" ] && BINTRAY_REPO_OWNER="${owner}" || true # override env 263 | 264 | main "$@" 265 | -------------------------------------------------------------------------------- /old/bintray.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Push AppImages and related metadata to Bintray 4 | # https://bintray.com/docs/api/ 5 | 6 | set -e # Exit on errors 7 | trap 'exit 1' ERR 8 | 9 | API=https://api.bintray.com 10 | FILE="$1" 11 | 12 | [ -f "$FILE" ] || { echo "File '$FILE' doesn't exist"; exit; } 13 | 14 | if [ "${BINTRAY_API_KEY}" == "" ] ; then 15 | echo "BINTRAY_API_KEY is missing; assuming this is a PR, uploading to transfer.sh" 16 | curl --upload-file ./"$FILE" https://transfer.sh/$(basename "$FILE") 17 | exit 0 18 | fi 19 | 20 | PCK_NAME="$(basename "$1")" 21 | BINTRAY_USER="${BINTRAY_USER:-probono}" 22 | BINTRAY_API_KEY="$BINTRAY_API_KEY" # env 23 | BINTRAY_REPO="${BINTRAY_REPO:-AppImages}" 24 | BINTRAY_REPO_OWNER="${BINTRAY_REPO_OWNER:-$BINTRAY_USER}" # owner and user not always the same 25 | WEBSITE_URL="${WEBSITE_URL:-http://appimage.org}" 26 | ISSUE_TRACKER_URL="${ISSUE_TRACKER_URL:-https://github.com/AppImage/AppImages/issues}" 27 | VCS_URL="${VCS_URL:-https://github.com/AppImage/AppImages.git}" # Mandatory for packages in free Bintray repos 28 | 29 | # Figure out whether we should use sudo 30 | SUDO='' 31 | if (( EUID != 0 )); then 32 | SUDO='sudo' 33 | fi 34 | 35 | if [ -e /usr/bin/apt-get ] ; then 36 | $SUDO apt-get update >/dev/null 37 | $SUDO apt-get -y install curl bsdtar zsync 38 | fi 39 | 40 | if [ -e /usr/bin/yum ] ; then 41 | $SUDO yum -y install install curl bsdtar zsync 42 | fi 43 | 44 | if [ -e /usr/bin/pacman ] ; then 45 | builddeps=('curl' 'libarchive' 'zsync') 46 | for i in "${builddeps[@]}"; do 47 | if ! pacman -Q "$i" >/dev/null; then 48 | $SUDO pacman -S "$i" 49 | fi 50 | done 51 | fi 52 | 53 | which curl >/dev/null || exit 1 54 | which bsdtar >/dev/null || exit 1 # https://github.com/libarchive/libarchive/wiki/ManPageBsdtar1 ; isoinfo cannot read zisofs 55 | which grep >/dev/null || exit 1 56 | which zsyncmake >/dev/null || exit 1 57 | 58 | # Do not upload artefacts generated as part of a pull request 59 | if [ ! -z "$TRAVIS_PULL_REQUEST" ] ; then 60 | if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then 61 | echo "Not uploading since this is a pull request" 62 | exit 0 63 | fi 64 | fi 65 | 66 | CURL="curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -H Accept:application/json -w \n" 67 | 68 | set -x # Be verbose from here on 69 | 70 | IS_AN_APPIMAGE=$(file -kib "$FILE" | grep -q "application/x-executable" && file -kib "$FILE" | grep -q "application/x-iso9660-image" && echo 1 || true); 71 | if [ "$IS_AN_APPIMAGE" ] ; then 72 | # Get metadata from the desktop file inside the AppImage 73 | DESKTOP=$(bsdtar -tf "$FILE" | grep '^./[^/]*.desktop$' | head -n 1) 74 | # Extract the description from the desktop file 75 | 76 | echo "* DESKTOP $DESKTOP" 77 | 78 | PCK_NAME=$(bsdtar -f "$FILE" -O -x ./"${DESKTOP}" | grep -e "^Name=" | head -n 1 | sed s/Name=//g | cut -d " " -f 1 | xargs) 79 | if [ "$PCK_NAME" == "" ] ; then 80 | bsdtar -f "$FILE" -O -x ./"${DESKTOP}" 81 | echo "PCK_NAME missing in ${DESKTOP}" 82 | fi 83 | 84 | DESCRIPTION=$(bsdtar -f "$FILE" -O -x ./"${DESKTOP}" | grep -e "^Comment=" | sed s/Comment=//g) 85 | 86 | # Check if there is appstream data and use it 87 | APPDATANAME=$(echo "${DESKTOP}" | sed 's/.desktop/.appdata.xml/g' | sed 's|./||' ) 88 | APPDATAFILE=$(bsdtar -tf "$FILE" | grep "${APPDATANAME}$" | head -n 1 || true) 89 | APPDATA=$(bsdtar -f "$FILE" -O -x "${APPDATAFILE}" || true) 90 | if [ "$APPDATA" == "" ] ; then 91 | echo "* APPDATA missing" 92 | else 93 | echo "* APPDATA found" 94 | DESCRIPTION=$(echo "$APPDATA" | grep -o -e "" | sed -e 's/<[^>]*>//g') 95 | WEBSITE_URL=$(echo "$APPDATA" | grep "homepage" | head -n 1 | cut -d ">" -f 2 | cut -d "<" -f 1) 96 | fi 97 | 98 | if [ "$DESCRIPTION" == "" ] ; then 99 | bsdtar -f "$FILE" -O -x ./"${DESKTOP}" 100 | echo "DESCRIPTION missing and no Comment= in ${DESKTOP}" 101 | fi 102 | fi 103 | 104 | IS_TYPE2_APPIMAGE=$(dd if="$FILE" bs=1 skip=8 count=3 | xxd -u -ps | grep -q 414902 && echo 1 || true) 105 | if [ "$IS_TYPE2_APPIMAGE" ] ; then 106 | ./"$FILE" --appimage-mount & 107 | AIPID=$? 108 | echo Mounted with PID $AIPID 109 | AIMOUNTPOINT=$(mount | grep "$(readlink -f "$FILE")" | cut -d " " -f 3) 110 | echo "$AIMOUNTPOINT" 111 | 112 | # Get metadata from the desktop file inside the AppImage 113 | DESKTOP=$(find "$AIMOUNTPOINT" -maxdepth 1 -name '*.desktop' | head -n 1) 114 | # Extract the description from the desktop file 115 | echo "* DESKTOP $DESKTOP" 116 | 117 | PCK_NAME=$(cat "${DESKTOP}" | grep -e "^Name=" | head -n 1 | sed s/Name=//g | cut -d " " -f 1 | xargs) 118 | if [ "$PCK_NAME" == "" ] ; then 119 | echo "PCK_NAME missing in ${DESKTOP}" 120 | fi 121 | echo "* PCK_NAME PCK_NAME" 122 | 123 | DESCRIPTION=$(cat "${DESKTOP}" | grep -e "^Comment=" | sed s/Comment=//g) 124 | echo "* DESCRIPTION $DESCRIPTION" 125 | 126 | # Check if there is appstream data and use it 127 | APPDATA=$(echo "${DESKTOP}" | sed 's/.desktop/.appdata.xml/g' | sed 's|./||') 128 | if [ ! -e "$APPDATA" ] ; then 129 | echo "* APPDATA missing" 130 | else 131 | echo "* APPDATA found" 132 | DESCRIPTION=$(cat "$APPDATA" | grep -o -e "" | sed -e 's/<[^>]*>//g') 133 | WEBSITE_URL=$(cat "$APPDATA" | grep "homepage" | head -n 1 | cut -d ">" -f 2 | cut -d "<" -f 1) 134 | fi 135 | 136 | if [ "$DESCRIPTION" == "" ] ; then 137 | echo "No AppStream data and no Comment= in ${DESKTOP}" 138 | fi 139 | fi 140 | 141 | [ "$PCK_NAME" == "" ] && PCK_NAME=$(basename "$FILE" | cut -d "-" -f 1) 142 | [ "$VERSION" == "" ] && VERSION=$(basename "$FILE" | cut -d "-" -f 2) 143 | 144 | if [ "$PCK_NAME" == "" ] ; then 145 | echo "* PCK_NAME missing, exiting" 146 | exit 1 147 | else 148 | echo "* PCK_NAME $PCK_NAME" 149 | fi 150 | 151 | if [ "$VERSION" == "" ] ; then 152 | echo "* VERSION missing, exiting" 153 | exit 1 154 | else 155 | echo "* VERSION $VERSION" 156 | fi 157 | 158 | if [ "$DESCRIPTION" == "" ] ; then 159 | echo "* DESCRIPTION " 160 | else 161 | echo "* DESCRIPTION $DESCRIPTION" 162 | fi 163 | 164 | set +x # Do not be verbose from here on 165 | ########## 166 | 167 | echo "" 168 | echo "Creating package ${PCK_NAME}..." 169 | data="{ 170 | \"name\": \"${PCK_NAME}\", 171 | \"desc\": \"${DESCRIPTION}\", 172 | \"desc_url\": \"auto\", 173 | \"website_url\": [\"${WEBSITE_URL}\"], 174 | \"vcs_url\": [\"${VCS_URL}\"], 175 | \"issue_tracker_url\": [\"${ISSUE_TRACKER_URL}\"], 176 | \"licenses\": [\"MIT\"], 177 | \"labels\": [\"AppImage\", \"AppImageKit\"] 178 | }" 179 | ${CURL} -H Content-Type:application/json -X POST -d "${data}" "${API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}" 180 | 181 | if [ "$IS_AN_APPIMAGE" ] ; then 182 | # Eventually AppImageAssistant/package should do this. Do it manually in the meantime. 183 | echo "Embedding magic bytes for AppImage MIME type into ${FILE}..." 184 | printf "\x41\x49\x01" | dd bs=1 seek=8 conv=notrunc of="$FILE" 185 | if which zsyncmake > /dev/null 2>&1; then 186 | echo "" 187 | echo "Embedding update information into ${FILE}..." 188 | # Clear ISO 9660 Volume Descriptor #1 field "Application Used" 189 | # (contents not defined by ISO 9660) and write URL there 190 | dd if=/dev/zero of="$FILE" bs=1 seek=33651 count=512 conv=notrunc 191 | # Example for next line: Subsurface-_latestVersion-x86_64.AppImage 192 | NAMELATESTVERSION="$(basename "$FILE" | sed -e "s|${VERSION}|_latestVersion|g")" 193 | # Example for next line: bintray-zsync|probono|AppImages|Subsurface|Subsurface-_latestVersion-x86_64.AppImage.zsync 194 | LINE="bintray-zsync|${BINTRAY_REPO_OWNER}|${BINTRAY_REPO}|${PCK_NAME}|${NAMELATESTVERSION}.zsync" 195 | echo "$LINE" | dd of="$FILE" bs=1 seek=33651 count=512 conv=notrunc 196 | echo "" 197 | echo "Uploading and publishing zsync file for ${FILE}..." 198 | zsyncmake -u "http://dl.bintray.com/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$(basename "$FILE")" "$FILE" -o "${FILE}.zsync" 199 | ${CURL} -H Content-Type:application/octet-stream -T "${FILE}.zsync" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE").zsync?publish=1&override=1" 200 | else 201 | echo "zsyncmake not found, skipping zsync file generation and upload" 202 | fi 203 | fi 204 | 205 | if [ "$IS_TYPE2_APPIMAGE" ] ; then 206 | if which zsyncmake > /dev/null 2>&1; then 207 | echo "" 208 | echo "Sanity checking update information of ${FILE}..." 209 | HEXOFFSET=$(objdump -h "${FILE}" | grep .upd_info | awk '{print $6}') 210 | dd bs=1 if="${FILE}" skip=$((0x$HEXOFFSET)) count=7 | grep "bintray" || exit 1 211 | echo "" 212 | echo "Uploading and publishing zsync file for ${FILE}..." 213 | zsyncmake -u "http://dl.bintray.com/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$(basename "$FILE")" "$FILE" -o "${FILE}.zsync" 214 | ${CURL} -H Content-Type:application/octet-stream -T "${FILE}.zsync" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE").zsync?publish=1&override=1" 215 | else 216 | echo "zsyncmake not found, skipping zsync file generation and upload" 217 | fi 218 | fi 219 | 220 | echo "" 221 | echo "Uploading and publishing ${FILE}..." 222 | if [ -z "$IS_TYPE2_APPIMAGE" ] ; then 223 | ${CURL} -H Content-Type:application/x-iso9660-appimage -T "$FILE" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE")?publish=1&override=1" 224 | else 225 | ${CURL} -H Content-Type:application/octet-stream -T "$FILE" "${API}/content/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$(basename "$FILE")?publish=1&override=1" 226 | fi 227 | 228 | 229 | if [ "$TRAVIS_JOB_ID" ] ; then 230 | echo "" 231 | echo "Adding Travis CI log to release notes..." 232 | BUILD_LOG="https://api.travis-ci.org/jobs/${TRAVIS_JOB_ID}/log.txt?deansi=true" 233 | data='{ 234 | "bintray": { 235 | "syntax": "markdown", 236 | "content": "'${BUILD_LOG}'" 237 | } 238 | }' 239 | ${CURL} -H Content-Type:application/json -X POST -d "${data}" "${API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}/versions/${VERSION}/release_notes" 240 | fi 241 | 242 | HERE="$(dirname "$(readlink -f "${0}")")" 243 | "${HERE}/bintray-tidy.sh" archive "${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/${PCK_NAME}" # -s to simulate 244 | 245 | # Seemingly this works only after the second time running this script - thus disabling for now (FIXME) 246 | # echo "" 247 | # echo "Adding ${FILE} to download list..." 248 | # sleep 5 # Seemingly needed 249 | # data="{ 250 | # \"list_in_downloads\": true 251 | # }" 252 | # ${CURL} -H Content-Type:application/json -X PUT -d "${data}" ${API}/file_metadata/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$(basename ${FILE}) 253 | # echo "TODO: Remove earlier versions of the same architecture from the download list" 254 | 255 | # echo "" 256 | # echo "TODO: Uploading screenshot for ${FILE}..." 257 | -------------------------------------------------------------------------------- /old/dogfeeding.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Eating our own dogfood. Preparing an AppImage of pkg2appimage 4 | 5 | HERE="$(dirname "$(readlink -f "${0}")")" 6 | 7 | . ./functions.sh 8 | 9 | mkdir -p build/ 10 | 11 | cd build/ 12 | # apt download -y apt libapt-pkg5.0 libbz2-1.0 liblzma5 multiarch-support zlib1g dpkg 13 | apt download -y dpkg # We are still using dpkg-deb to extract debs, so we need to bundle it 14 | 15 | wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$SYSTEM_ARCH.AppImage" # FIXME: Make arch independent 16 | wget -c "https://github.com/ImageMagick/ImageMagick/releases/download/7.0.8-17/ImageMagick-0b0ce48-gcc-$SYSTEM_ARCH.AppImage" # FIXME: Make arch independent 17 | chmod +x ./*.AppImage 18 | 19 | ./appimagetool-*.AppImage --appimage-extract && mv ./squashfs-root ./pkg2appimage.AppDir 20 | cd ./pkg2appimage.AppDir 21 | 22 | find ../*.deb -exec dpkg-deb -x {} . \; || true 23 | 24 | rm *.desktop || true 25 | mv ./usr/share/applications/appimagetool.desktop ./usr/share/applications/pkg2appimage.desktop 26 | sed -i -e 's|Name=appimagetool|Name=pkg2appimage|g' ./usr/share/applications/pkg2appimage.desktop 27 | sed -i -e 's|Exec=appimagetool|Exec=pkg2appimage|g' ./usr/share/applications/pkg2appimage.desktop 28 | sed -i -e 's|Comment=.*|Comment=Create AppImages from Debian/Ubuntu repositories|g' ./usr/share/applications/pkg2appimage.desktop 29 | cp ./usr/share/applications/pkg2appimage.desktop . 30 | 31 | cp ../ImageMagick-*.AppImage usr/bin/convert 32 | 33 | # We don't suffer from NIH 34 | # mkdir -p usr/src/ 35 | # wget -q "https://raw.githubusercontent.com/mikix/deb2snap/master/src/preload.c" -O - | \ 36 | # sed -e 's|SNAPPY|UNION|g' | sed -e 's|SNAPP|UNION|g' | sed -e 's|SNAP|UNION|g' | \ 37 | # sed -e 's|snappy|union|g' > usr/src/libunionpreload.c 38 | # gcc -shared -fPIC usr/src/libunionpreload.c -o libunionpreload.so -ldl -DUNION_LIBNAME=\"libunionpreload.so\" 39 | # strip libunionpreload.so 40 | 41 | cp ../../pkg2appimage AppRun ; chmod + AppRun 42 | 43 | mkdir -p ./usr/share/pkg2appimage/ 44 | cp ../../{functions.sh,excludelist,excludedeblist,appdir-lint.sh} ./usr/share/pkg2appimage/ 45 | rm -rf ./usr/share/metainfo/* || true 46 | mkdir -p ./usr/share/metainfo 47 | cp ../../pkg2appimage.appdata.xml ./usr/share/metainfo/ 48 | 49 | copy_deps 50 | move_lib 51 | delete_blacklisted 52 | 53 | rm usr/lib/*-gnu/liblzma.so.5 54 | 55 | cd .. 56 | NO_GLIBC_VERSION=true APP=pkg2appimage VERSION=$TRAVIS_BUILD_NUMBER generate_type2_appimage # FIXME: This embeds bintray-zsync 57 | -------------------------------------------------------------------------------- /old/excludedeblist: -------------------------------------------------------------------------------- 1 | # The files contained in these debian packages and their dependencies 2 | # are assumed to be present in the base system (distribution) 3 | # in a "recent enough" version (or the end user has to install 4 | # missing ones from this manually using the distribution's 5 | # package manager if required). Note that this only works if 6 | # the ingredients to the AppImage do not require newer versions 7 | # of these packages than what can safely be assumed to be part 8 | # of the base system. This is why we recommend oldstable 9 | # ingredients for AppImages 10 | apt 11 | apt-transport-https 12 | dbus 13 | debconf 14 | dictionaries-common 15 | dpkg 16 | fontconfig 17 | fontconfig-config 18 | # gconf2 # elementary OS 0.4 Loki does NOT have libgconf-2-4 19 | # gconf2-common # elementary OS 0.4 Loki does NOT have libgconf-2-4 20 | # gconf-service # elementary OS 0.4 Loki does NOT have libgconf-2-4 21 | gvfs-backends # e.g., for Bluefish 22 | gksu 23 | glib-networking 24 | gstreamer1.0-plugins-base 25 | gstreamer1.0-plugins-good 26 | gstreamer1.0-plugins-ugly 27 | gstreamer1.0-pulseaudio 28 | gtk2-engines-pixbuf 29 | kde-runtime 30 | libasound2 31 | libatk1.0-0 32 | libc6 33 | libc6-dev 34 | libcairo2 35 | libcups2 36 | # libcurl3 # Does draw in a lot of libs including security relevant ones; e.g., in supertux2; but otherwise get ../lib/x86_64-linux-gnu/libssl.so.1.0.0: version `OPENSSL_1.0.2' not found (required by /usr/lib/x86_64-linux-gnu/libcurl.so.4) 37 | # libcurl3-gnutls # https://github.com/AppImage/AppImages/issues/120#issuecomment-261749714 38 | # libdbm2 # seems not to exist 39 | libdbus-1-3 40 | libdrm2 41 | libegl1-mesa 42 | libfontconfig1 43 | libgbm1 44 | libgcc1 45 | # libgconf-2-4 # elementary OS 0.4 Loki does NOT have it 46 | libgdk-pixbuf2.0-0 47 | libgl1 48 | libgl1-mesa 49 | libgl1-mesa-dri 50 | libgl1-mesa-glx 51 | # libglib2.0-0 # https://github.com/LibreCAD/LibreCAD/issues/858#issuecomment-345449318 52 | libglu1-mesa 53 | # libgnutls26 cannot be expected to be eveywhere, e.g., KDE neon 54 | # libgpg-error0 gives non-fatal errors on many systems and is low-level, can it be expected to be everywhere? 55 | libgpg-error0 56 | # libgstreamer1.0-0 57 | libgtk2.0-0 58 | libgtk-3-0 59 | libnss3 60 | libpango1.0-0 61 | libpango-1.0-0 62 | libpangocairo-1.0-0 # Workaround for: openSUSE: undefined symbol: hb_buffer_set_cluster_level?; commenting this out leads to square boxes instead of fonts 63 | libpangoft2-1.0-0 # Workaround for: openSUSE: undefined symbol: hb_buffer_set_cluster_level?; commenting this out leads to square boxes instead of fonts 64 | libstdc++6 65 | libtasn1-6 66 | libwayland-egl1-mesa # e.g., OpenRA 67 | lsb-base 68 | libxcb1 # Workaround for: Fedora 25: undefined symbol: xcb_send_request_with_fds, https://github.com/AppImage/AppImages/issues/128 69 | mime-support 70 | passwd 71 | udev 72 | uuid-runtime 73 | -------------------------------------------------------------------------------- /old/excludelist: -------------------------------------------------------------------------------- 1 | # This file lists libraries that we will assume to be present on the host system and hence 2 | # should NOT be bundled inside AppImages. This is a working document; expect it to change 3 | # over time. File format: one filename per line. Each entry should have a justification comment. 4 | 5 | # See the useful tool at https://abi-laboratory.pro/index.php?view=navigator&symbol=hb_buffer_set_cluster_level#result 6 | # to investigate issues with missing symbols. 7 | 8 | ld-linux.so.2 9 | ld-linux-x86-64.so.2 10 | libanl.so.1 11 | libBrokenLocale.so.1 12 | libcidn.so.1 13 | # libcrypt.so.1 # Not part of glibc anymore as of Fedora 30. See https://github.com/slic3r/Slic3r/issues/4798 and https://pagure.io/fedora-docs/release-notes/c/01d74b33564faa42959c035e1eee286940e9170e?branch=f28 14 | libc.so.6 15 | libdl.so.2 16 | libm.so.6 17 | libmvec.so.1 18 | # libnsl.so.1 # Not part of glibc anymore as of Fedora 28. See https://github.com/RPCS3/rpcs3/issues/5224#issuecomment-434930594 19 | libnss_compat.so.2 20 | # libnss_db.so.2 # Not part of neon-useredition-20190321-0530-amd64.iso 21 | libnss_dns.so.2 22 | libnss_files.so.2 23 | libnss_hesiod.so.2 24 | libnss_nisplus.so.2 25 | libnss_nis.so.2 26 | libpthread.so.0 27 | libresolv.so.2 28 | librt.so.1 29 | libthread_db.so.1 30 | libutil.so.1 31 | # These files are all part of the GNU C Library which should never be bundled. 32 | # List was generated from a fresh build of glibc 2.25. 33 | 34 | libstdc++.so.6 35 | # Workaround for: 36 | # usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found 37 | 38 | libGL.so.1 39 | # The above may be missing on Chrome OS, https://www.reddit.com/r/Crostini/comments/d1lp67/ultimaker_cura_no_longer_running_as_an_appimage/ 40 | libEGL.so.1 41 | # Part of the video driver (OpenGL); present on any regular 42 | # desktop system, may also be provided by proprietary drivers. 43 | # Known to cause issues if it's bundled. 44 | 45 | libGLdispatch.so.0 46 | libGLX.so.0 47 | # reported to be superfluent and conflicting system libraries (graphics driver) 48 | # see https://github.com/linuxdeploy/linuxdeploy/issues/89 49 | 50 | libOpenGL.so.0 51 | # Qt installed via install-qt.sh apparently links to this library 52 | # part of OpenGL like libGL/libEGL, so excluding it should not cause any problems 53 | # https://github.com/linuxdeploy/linuxdeploy/issues/152 54 | 55 | libdrm.so.2 56 | # Workaround for: 57 | # Antergos Linux release 2015.11 (ISO-Rolling) 58 | # /usr/lib/libdrm_amdgpu.so.1: error: symbol lookup error: undefined symbol: drmGetNodeTypeFromFd (fatal) 59 | # libGL error: unable to load driver: swrast_dri.so 60 | # libGL error: failed to load driver: swrast 61 | # Unrecognized OpenGL version 62 | 63 | libglapi.so.0 64 | # Part of mesa 65 | # known to cause problems with graphics, see https://github.com/RPCS3/rpcs3/issues/4427#issuecomment-381674910 66 | 67 | libgbm.so.1 68 | # Part of mesa 69 | # https://github.com/probonopd/linuxdeployqt/issues/390#issuecomment-529036305 70 | 71 | libxcb.so.1 72 | # Workaround for: 73 | # Fedora 23 74 | # symbol lookup error: /lib64/libxcb-dri3.so.0: undefined symbol: xcb_send_fd 75 | # Uncertain if this is required to be bundled for some distributions - if so we need to write a version check script and use LD_PRELOAD to load the system version if it is newer 76 | # Fedora 25: 77 | # undefined symbol: xcb_send_request_with_fds 78 | # https://github.com/AppImage/AppImages/issues/128 79 | 80 | libX11.so.6 81 | # Workaround for: 82 | # Fedora 23 83 | # symbol lookup error: ./lib/libX11.so.6: undefined symbol: xcb_wait_for_reply64 84 | # Uncertain if this is required to be bundled for some distributions - if so we need to write a version check script and use LD_PRELOAD to load the system version if it is newer 85 | 86 | libgio-2.0.so.0 87 | # Workaround for: 88 | # On Ubuntu, "symbol lookup error: /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/liboverlay-scrollbar.so: undefined symbol: g_settings_new" 89 | 90 | # libgdk-x11-2.0.so.0 # Missing on openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20170601-Media.iso 91 | # libgtk-x11-2.0.so.0 # Missing on openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20170601-Media.iso 92 | 93 | libasound.so.2 94 | # Workaround for: 95 | # No sound, e.g., in VLC.AppImage (does not find sound cards) 96 | 97 | # https://github.com/AppImage/pkg2appimage/issues/475 98 | # libgdk_pixbuf-2.0.so.0 99 | # Was: Workaround for: 100 | # On Ubuntu, get (inkscape:25621): GdkPixbuf-WARNING **: Error loading XPM image loader: Image type 'xpm' is not supported 101 | 102 | libfontconfig.so.1 103 | # Workaround for: 104 | # Application stalls when loading fonts during application launch; e.g., KiCad on ubuntu-mate 105 | 106 | libthai.so.0 107 | # Workaround for: 108 | # audacity: /tmp/.mount_AudaciUsFbON/usr/lib/libthai.so.0: version `LIBTHAI_0.1.25' not found (required by /usr/lib64/libpango-1.0.so.0) 109 | # on openSUSE Tumbleweed 110 | 111 | # other "low-level" font rendering libraries 112 | # should fix https://github.com/probonopd/linuxdeployqt/issues/261#issuecomment-377522251 113 | # and https://github.com/probonopd/linuxdeployqt/issues/157#issuecomment-320755694 114 | libfreetype.so.6 115 | libharfbuzz.so.0 116 | 117 | # Note, after discussion we do not exclude this, but we can use a dummy library that just does nothing 118 | # libselinux.so.1 119 | # Workaround for: 120 | # sed: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory 121 | # Some distributions, such as Arch Linux, do not come with libselinux.so.1 by default. 122 | # The solution is to bundle a dummy mock library: 123 | # echo "extern int is_selinux_enabled(void){return 0;}" >> selinux-mock.c 124 | # gcc -s -shared -o libselinux.so.1 -Wl,-soname,libselinux.so.1 selinux-mock.c 125 | # strip libselinux.so.1 126 | # More information: https://github.com/AppImage/AppImages/issues/83 127 | # and https://github.com/AppImage/AppImageKit/issues/775#issuecomment-614954821 128 | # https://gitlab.com/sulinos/devel/libselinux-dummy 129 | 130 | # The following are assumed to be part of the base system 131 | # Removing these has worked e.g., for Krita. Feel free to report if 132 | # you think that some of these should go into AppImages and why. 133 | libcom_err.so.2 134 | libexpat.so.1 135 | libgcc_s.so.1 136 | libglib-2.0.so.0 137 | libgpg-error.so.0 138 | # libgssapi_krb5.so.2 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there 139 | # libgssapi.so.3 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 140 | # libhcrypto.so.4 # Missing on openSUSE LEAP 42.0 141 | # libheimbase.so.1 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 142 | # libheimntlm.so.0 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 143 | # libhx509.so.5 # Missing on openSUSE LEAP 42.0 144 | libICE.so.6 145 | # libidn.so.11 # Does not come with Solus by default 146 | # libk5crypto.so.3 # Running AppImage built on Debian 9 or Ubuntu 16.04 on an Archlinux fails otherwise; https://github.com/AppImage/AppImages/issues/301 147 | # libkeyutils.so.1 # Does not come with Void Linux by default; https://github.com/Subsurface-divelog/subsurface/issues/1971#issuecomment-466606834 148 | # libkrb5.so.26 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there. Missing on openSUSE LEAP 42.0 149 | # libkrb5.so.3 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there 150 | # libkrb5support.so.0 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there 151 | libp11-kit.so.0 152 | # libpcre.so.3 # Missing on Fedora 24, SLED 12 SP1, and openSUSE Leap 42.2 153 | # libroken.so.18 # Mission on openSUSE LEAP 42.0 154 | # libsasl2.so.2 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 155 | libSM.so.6 156 | libusb-1.0.so.0 157 | libuuid.so.1 158 | # libwind.so.0 # Missing on openSUSE LEAP 42.0 159 | libz.so.1 160 | 161 | # Potentially dangerous libraries 162 | libgobject-2.0.so.0 163 | 164 | # Workaround for: 165 | # Rectangles instead of fonts 166 | # https://github.com/AppImage/AppImages/issues/240 167 | libpangoft2-1.0.so.0 168 | libpangocairo-1.0.so.0 169 | libpango-1.0.so.0 170 | 171 | # FIXME: 172 | # Can get symbol lookup error: /lib64/libpango-1.0.so.0: undefined symbol: g_log_structured_standard 173 | # if libcairo is bundled but libpango is not 174 | 175 | # Workaround for: 176 | # e.g., Spotify 177 | # relocation error: /lib/x86_64-linux-gnu/libgcrypt.so.20: 178 | # symbol gpgrt_lock_lock, version GPG_ERROR_1.0 not defined 179 | # in file libgpg-error.so.0 with link time reference 180 | libgpg-error.so.0 181 | 182 | libjack.so.0 183 | # it must match the ABI of the JACK server which is installed in the base system 184 | # rncbc confirmed this 185 | # However, this library is missing on Fedora-WS-Live-31-1-9 186 | # which means that we should avoid using JACK altogether if possible 187 | 188 | # Unsolved issue: 189 | # https://github.com/probonopd/linuxdeployqt/issues/35 190 | # Error initializing NSS with a persistent database (sql:/home/me/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory 191 | # Error initializing NSS without a persistent database: NSS error code: -5925 192 | # nss_error=-5925, os_error=0 193 | # libnss3.so should not be removed from the bundles, as this causes other issues, e.g., 194 | # https://github.com/probonopd/linuxdeployqt/issues/35#issuecomment-256213517 195 | # and https://github.com/AppImage/AppImages/pull/114 196 | # libnss3.so 197 | 198 | # The following cannot be excluded, see 199 | # https://github.com/AppImage/AppImages/commit/6c7473d8cdaaa2572248dcc53d7f617a577ade6b 200 | # http://stackoverflow.com/questions/32644157/forcing-a-binary-to-use-a-specific-newer-version-of-a-shared-library-so 201 | # libssl.so.1 202 | # libssl.so.1.0.0 203 | # libcrypto.so.1 204 | # libcrypto.so.1.0.0 205 | 206 | # According to https://github.com/RicardoEPRodrigues/3Engine/issues/4#issuecomment-511598362 207 | # libGLEW is not tied to a specific GPU. It's linked against libGL.so.1 208 | # and that one is different depending on the installed driver. 209 | # In fact libGLEW is changing its soversion very often, so you should always bundle libGLEW.so.2.0 210 | 211 | # libglut.so.3 # to be confirmed 212 | 213 | libxcb-dri3.so.0 # https://github.com/AppImage/AppImages/issues/348 214 | libxcb-dri2.so.0 # https://github.com/probonopd/linuxdeployqt/issues/331#issuecomment-442276277 215 | 216 | # If the next line turns out to cause issues, we will have to remove it again and find another solution 217 | libfribidi.so.0 # https://github.com/olive-editor/olive/issues/221 and https://github.com/knapsu/plex-media-player-appimage/issues/14 218 | 219 | # Workaround for: 220 | # symbol lookup error: /lib/x86_64-linux-gnu/libgnutls.so.30: undefined symbol: __gmpz_limbs_write 221 | # https://github.com/ONLYOFFICE/appimage-desktopeditors/issues/3 222 | # Apparently coreutils depends on it, so it should be safe to assume that it comes with every target system 223 | libgmp.so.10 224 | -------------------------------------------------------------------------------- /old/excludesuselist: -------------------------------------------------------------------------------- 1 | # Automatically generated by running on openSUSE 13.1: 2 | # wget https://github.com/AppImage/AppImages/raw/master/excludelist 3 | # FILES=$(cat excludelist | sed '/^\s*$/d' | sed '/^#.*$/d') 4 | # for FILE in $FILES; do zypper search -f "$FILE" | grep "| package" | head -n 1 | cut -d "|" -f 2 | cut -d " " -f 2 >> packages; done 5 | # cat packages | sort | uniq 6 | 7 | Mesa-libGL1 8 | fontconfig 9 | glibc 10 | # krb5 # openSUSE LEAP 42.0 has other .so filenames than other distributions 11 | libICE6 12 | libSM6 13 | libX11-6 14 | libasound2 15 | libcom_err2 16 | libdrm2 17 | libexpat1 18 | libgcc_s1 19 | libgdk_pixbuf-2_0-0 20 | libgio-2_0-0 21 | libglib-2_0-0 22 | libgobject-2_0-0 23 | libgpg-error0 24 | libgtk-2_0-0 25 | libidn11 26 | libkeyutils1 27 | libp11-kit0 28 | libselinux1 29 | libstdc++6 30 | libusb-1_0-0 31 | libuuid1 32 | libxcb1 33 | libz1 34 | -------------------------------------------------------------------------------- /old/functions.sh: -------------------------------------------------------------------------------- 1 | # This file is supposed to be sourced by each Recipe 2 | # that wants to use the functions contained herein 3 | # like so: 4 | # wget -q https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/functions.sh -O ./functions.sh 5 | # . ./functions.sh 6 | 7 | # RECIPE=$(realpath "$0") 8 | 9 | # Specify a certain commit if you do not want to use master 10 | # by using: 11 | # export PKG2AICOMMIT= 12 | if [ -z "$PKG2AICOMMIT" ] ; then 13 | PKG2AICOMMIT=master 14 | fi 15 | 16 | # Options for apt-get to use local files rather than the system ones 17 | OPTIONS="-o Debug::NoLocking=1 18 | -o APT::Cache-Limit=125829120 19 | -o Dir::Etc::sourcelist=./sources.list 20 | -o Dir::State=./tmp 21 | -o Dir::Cache=./tmp 22 | -o Dir::State::status=./status 23 | -o Dir::Etc::sourceparts=- 24 | -o APT::Get::List-Cleanup=0 25 | -o APT::Get::AllowUnauthenticated=1 26 | -o Debug::pkgProblemResolver=true 27 | -o Debug::pkgDepCache::AutoInstall=true 28 | -o APT::Install-Recommends=0 29 | -o APT::Install-Suggests=0 30 | " 31 | 32 | # Detect if we are running inside Docker 33 | grep docker /proc/1/cgroup >/dev/null && export DOCKER_BUILD=1 || true 34 | 35 | # Detect system architecture to know which binaries of AppImage tools 36 | # should be downloaded and used. 37 | case "$(uname -i)" in 38 | x86_64|amd64) 39 | # echo "x86-64 system architecture" 40 | SYSTEM_ARCH="x86_64";; 41 | i?86) 42 | # echo "x86 system architecture" 43 | SYSTEM_ARCH="i686";; 44 | # arm*) 45 | # echo "ARM system architecture" 46 | # SYSTEM_ARCH="";; 47 | unknown|AuthenticAMD|GenuineIntel) 48 | # uname -i not answer on debian, then: 49 | case "$(uname -m)" in 50 | x86_64|amd64) 51 | # echo "x86-64 system architecture" 52 | SYSTEM_ARCH="x86_64";; 53 | i?86) 54 | # echo "x86 system architecture" 55 | SYSTEM_ARCH="i686";; 56 | esac ;; 57 | *) 58 | echo "Unsupported system architecture" 59 | exit 1;; 60 | esac 61 | 62 | # Either get the file from remote or from a static place. 63 | # critical for builds without network access like in Open Build Service 64 | cat_file_from_url() 65 | { 66 | cat_excludelist="wget -q $1 -O -" 67 | [ -e "$STATIC_FILES/${1##*/}" ] && cat_excludelist="cat $STATIC_FILES/${1##*/}" 68 | $cat_excludelist 69 | } 70 | 71 | git_pull_rebase_helper() 72 | { 73 | git reset --hard HEAD 74 | git pull 75 | } 76 | 77 | # Patch /usr to ././ in ./usr 78 | # to make the contents of usr/ relocateable 79 | # (this requires us to cd ./usr before running the application; AppRun does that) 80 | patch_usr() 81 | { 82 | find usr/ -type f -executable -exec sed -i -e "s|/usr|././|g" {} \; 83 | } 84 | 85 | # Download AppRun and make it executable 86 | get_apprun() 87 | { 88 | TARGET_ARCH=${ARCH:-$SYSTEM_ARCH} 89 | wget -c https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${TARGET_ARCH} -O AppRun 90 | chmod a+x AppRun 91 | } 92 | 93 | # Copy the library dependencies of all exectuable files in the current directory 94 | # (it can be beneficial to run this multiple times) 95 | copy_deps() 96 | { 97 | PWD=$(readlink -f .) 98 | FILES=$(find . -type f -executable -or -name *.so.* -or -name *.so | sort | uniq ) 99 | for FILE in $FILES ; do 100 | ldd "${FILE}" | grep "=>" | awk '{print $3}' | xargs -I '{}' echo '{}' >> DEPSFILE 101 | done 102 | DEPS=$(cat DEPSFILE | sort | uniq) 103 | for FILE in $DEPS ; do 104 | if [ -e $FILE ] && [[ $(readlink -f $FILE)/ != $PWD/* ]] ; then 105 | cp -v --parents -rfL $FILE ./ || true 106 | fi 107 | done 108 | rm -f DEPSFILE 109 | } 110 | 111 | # Move ./lib/ tree to ./usr/lib/ 112 | move_lib() 113 | { 114 | mkdir -p ./usr/lib ./lib && find ./lib/ -exec cp -v --parents -rfL {} ./usr/ \; && rm -rf ./lib 115 | mkdir -p ./usr/lib ./lib64 && find ./lib64/ -exec cp -v --parents -rfL {} ./usr/ \; && rm -rf ./lib64 116 | } 117 | 118 | # Delete blacklisted files 119 | delete_blacklisted() 120 | { 121 | BLACKLISTED_FILES=$(cat_file_from_url https://github.com/AppImage/pkg2appimage/raw/${PKG2AICOMMIT}/excludelist | sed 's|#.*||g') 122 | echo $BLACKLISTED_FILES 123 | 124 | local DOT_DIR=$(readlink -f .) 125 | local TARGET 126 | for FILE in $BLACKLISTED_FILES ; do 127 | FILES="$(find . -name "${FILE}" -not -path "./usr/optional/*")" 128 | for FOUND in $FILES ; do 129 | TARGET=$(readlink -f "$FOUND") 130 | 131 | # Only delete files from inside the current dir. 132 | if [[ $TARGET = $DOT_DIR/* ]]; then 133 | rm -vf "$TARGET" 134 | fi 135 | 136 | rm -vf "$FOUND" 137 | done 138 | done 139 | 140 | # Do not bundle developer stuff 141 | rm -rf usr/include || true 142 | rm -rf usr/lib/cmake || true 143 | rm -rf usr/lib/pkgconfig || true 144 | find . -name '*.la' | xargs -i rm {} 145 | } 146 | 147 | # Echo highest glibc version needed by the executable files in the current directory 148 | glibc_needed() 149 | { 150 | find . -name *.so -or -name *.so.* -or -type f -executable -exec strings {} \; | grep ^GLIBC_2 | sed s/GLIBC_//g | sort --version-sort | uniq | tail -n 1 151 | # find . -name *.so -or -name *.so.* -or -type f -executable -exec readelf -s '{}' 2>/dev/null \; | sed -n 's/.*@GLIBC_//p'| awk '{print $1}' | sort --version-sort | tail -n 1 152 | } 153 | # Add desktop integration 154 | # Usage: get_desktopintegration name_of_desktop_file_and_exectuable 155 | get_desktopintegration() 156 | { 157 | # REALBIN=$(grep -o "^Exec=.*" *.desktop | sed -e 's|Exec=||g' | cut -d " " -f 1 | head -n 1) 158 | # cat_file_from_url https://raw.githubusercontent.com/AppImage/AppImageKit/deprecated/AppImageAssistant/desktopintegration > ./usr/bin/$REALBIN.wrapper 159 | # chmod a+x ./usr/bin/$REALBIN.wrapper 160 | echo "The desktopintegration script is deprecated. Please advise users to use https://github.com/AppImage/appimaged instead." 161 | # sed -i -e "s|^Exec=$REALBIN|Exec=$REALBIN.wrapper|g" $1.desktop 162 | } 163 | 164 | # Generate AppImage; this expects $ARCH, $APP and $VERSION to be set 165 | generate_appimage() 166 | { 167 | # Download AppImageAssistant 168 | URL="https://github.com/AppImage/AppImageKit/releases/download/6/AppImageAssistant_6-${SYSTEM_ARCH}.AppImage" 169 | wget -c "$URL" -O AppImageAssistant 170 | chmod a+x ./AppImageAssistant 171 | 172 | # if [[ "$RECIPE" == *ecipe ]] ; then 173 | # echo "#!/bin/bash -ex" > ./$APP.AppDir/Recipe 174 | # echo "# This recipe was used to generate this AppImage." >> ./$APP.AppDir/Recipe 175 | # echo "# See http://appimage.org for more information." >> ./$APP.AppDir/Recipe 176 | # echo "" >> ./$APP.AppDir/Recipe 177 | # cat $RECIPE >> ./$APP.AppDir/Recipe 178 | # fi 179 | # 180 | # Detect the architecture of what we are packaging. 181 | # The main binary could be a script, so let's use a .so library 182 | BIN=$(find . -name *.so* -type f | head -n 1) 183 | INFO=$(file "$BIN") 184 | if [ -z $ARCH ] ; then 185 | if [[ $INFO == *"x86-64"* ]] ; then 186 | ARCH=x86_64 187 | elif [[ $INFO == *"i686"* ]] ; then 188 | ARCH=i686 189 | elif [[ $INFO == *"armv6l"* ]] ; then 190 | ARCH=armhf 191 | else 192 | echo "Could not automatically detect the architecture." 193 | echo "Please set the \$ARCH environment variable." 194 | exit 1 195 | fi 196 | fi 197 | 198 | mkdir -p ../out || true 199 | rm ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage" 2>/dev/null || true 200 | GLIBC_NEEDED=$(glibc_needed) 201 | ./AppImageAssistant ./$APP.AppDir/ ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage" 202 | } 203 | 204 | # Generate AppImage type 2 205 | # Additional parameters given to this routine will be passed on to appimagetool 206 | # 207 | # If the environment variable NO_GLIBC_VERSION is set, the required glibc version 208 | # will not be added to the AppImage filename 209 | generate_type2_appimage() 210 | { 211 | # Get the ID of the last successful build on Travis CI 212 | # ID=$(wget -q https://api.travis-ci.org/repos/AppImage/appimagetool/builds -O - | head -n 1 | sed -e 's|}|\n|g' | grep '"result":0' | head -n 1 | sed -e 's|,|\n|g' | grep '"id"' | cut -d ":" -f 2) 213 | # Get the transfer.sh URL from the logfile of the last successful build on Travis CI 214 | # Only Travis knows why build ID and job ID don't match and why the above doesn't give both... 215 | # URL=$(wget -q "https://s3.amazonaws.com/archive.travis-ci.org/jobs/$((ID+1))/log.txt" -O - | grep "https://transfer.sh/.*/appimagetool" | tail -n 1 | sed -e 's|\r||g') 216 | # if [ -z "$URL" ] ; then 217 | # URL=$(wget -q "https://s3.amazonaws.com/archive.travis-ci.org/jobs/$((ID+2))/log.txt" -O - | grep "https://transfer.sh/.*/appimagetool" | tail -n 1 | sed -e 's|\r||g') 218 | # fi 219 | if [ -z "$(which appimagetool)" ] ; then 220 | URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${SYSTEM_ARCH}.AppImage" 221 | wget -c "$URL" -O appimagetool 222 | chmod a+x ./appimagetool 223 | appimagetool=$(readlink -f appimagetool) 224 | else 225 | appimagetool=$(which appimagetool) 226 | fi 227 | if [ "$DOCKER_BUILD" ]; then 228 | appimagetool_tempdir=$(mktemp -d) 229 | mv appimagetool "$appimagetool_tempdir" 230 | pushd "$appimagetool_tempdir" &>/dev/null 231 | ls -al 232 | ./appimagetool --appimage-extract 233 | rm appimagetool 234 | appimagetool=$(readlink -f squashfs-root/AppRun) 235 | popd &>/dev/null 236 | _appimagetool_cleanup() { [ -d "$appimagetool_tempdir" ] && rm -r "$appimagetool_tempdir"; } 237 | trap _appimagetool_cleanup EXIT 238 | fi 239 | 240 | if [ -z ${NO_GLIBC_VERSION+true} ]; then 241 | GLIBC_NEEDED=$(glibc_needed) 242 | VERSION_EXPANDED=$VERSION.glibc$GLIBC_NEEDED 243 | else 244 | VERSION_EXPANDED=$VERSION 245 | fi 246 | 247 | set +x 248 | 249 | GLIBC_NEEDED=$(glibc_needed) 250 | _APP_DIR="${PWD}/$APP.AppDir/" 251 | export OWD="${PWD}" 252 | 253 | if ( [ ! -z "$KEY" ] ) && ( ! -z "$TRAVIS" ) ; then 254 | wget https://github.com/AppImage/AppImageKit/files/584665/data.zip -O data.tar.gz.gpg 255 | ( set +x ; echo $KEY | gpg2 --batch --passphrase-fd 0 --no-tty --skip-verify --output data.tar.gz --decrypt data.tar.gz.gpg ) 256 | tar xf data.tar.gz 257 | sudo chown -R $USER .gnu* 258 | mv $HOME/.gnu* $HOME/.gnu_old ; mv .gnu* $HOME/ 259 | if [ -z "$RECIPE" ] ; then 260 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n -s -g -v "${_APP_DIR}" 261 | else 262 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n -s --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v "${_APP_DIR}" 263 | fi 264 | else 265 | if [ -z "$RECIPE" ] ; then 266 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n -g -v "${_APP_DIR}" 267 | else 268 | VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v "${_APP_DIR}" 269 | fi 270 | fi 271 | set -x 272 | mkdir -p ../out/ || true 273 | mv *.AppImage* ../out/ 274 | } 275 | 276 | # Generate status file for use by apt-get; assuming that the recipe uses no newer 277 | # ingredients than what would require more recent dependencies than what we assume 278 | # to be part of the base system 279 | generate_status() 280 | { 281 | mkdir -p ./tmp/archives/ 282 | mkdir -p ./tmp/lists/partial 283 | touch tmp/pkgcache.bin tmp/srcpkgcache.bin 284 | if [ -e "${HERE}/usr/share/pkg2appimage/excludedeblist" ] ; then 285 | EXCLUDEDEBLIST="${HERE}/usr/share/pkg2appimage/excludedeblist" 286 | else 287 | wget -q -c "https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/excludedeblist" 288 | EXCLUDEDEBLIST=excludedeblist 289 | fi 290 | rm status 2>/dev/null || true 291 | for PACKAGE in $(cat "$EXCLUDEDEBLIST" | cut -d "#" -f 1) ; do 292 | printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status 293 | done 294 | } 295 | 296 | # Find the desktop file and copy it to the AppDir 297 | get_desktop() 298 | { 299 | find usr/share/applications -iname "*${LOWERAPP}.desktop" -exec cp {} . \; || true 300 | } 301 | 302 | fix_desktop() { 303 | # fix trailing semicolons 304 | for key in Actions Categories Implements Keywords MimeType NotShowIn OnlyShowIn; do 305 | sed -i '/'"$key"'.*[^;]$/s/$/;/' $1 306 | done 307 | } 308 | 309 | # Find the icon file and copy it to the AppDir 310 | get_icon() 311 | { 312 | find ./usr/share/pixmaps/$LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 313 | find ./usr/share/icons -path *64* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 314 | find ./usr/share/icons -path *128* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 315 | find ./usr/share/icons -path *512* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 316 | find ./usr/share/icons -path *256* -name $LOWERAPP.png -exec cp {} . \; 2>/dev/null || true 317 | ls -lh $LOWERAPP.png || true 318 | } 319 | 320 | # Find out the version 321 | get_version() 322 | { 323 | THEDEB=$(find ../*.deb -name $LOWERAPP"_*" | head -n 1) 324 | if [ -z "$THEDEB" ] ; then 325 | echo "Version could not be determined from the .deb; you need to determine it manually" 326 | fi 327 | VERSION=$(echo $THEDEB | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' | sed -e 's|.dfsg||g' ) 328 | echo $VERSION 329 | } 330 | 331 | # transfer.sh 332 | transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi 333 | tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; } 334 | 335 | # Patch binary files; fill with padding if replacement is shorter than original 336 | # http://everydaywithlinux.blogspot.de/2012/11/patch-strings-in-binary-files-with-sed.html 337 | # Example: patch_strings_in_file foo "/usr/local/lib/foo" "/usr/lib/foo" 338 | patch_strings_in_file() { 339 | local FILE="$1" 340 | local PATTERN="$2" 341 | local REPLACEMENT="$3" 342 | # Find all unique strings in FILE that contain the pattern 343 | STRINGS=$(strings ${FILE} | grep ${PATTERN} | sort -u -r) 344 | if [ "${STRINGS}" != "" ] ; then 345 | echo "File '${FILE}' contain strings with '${PATTERN}' in them:" 346 | for OLD_STRING in ${STRINGS} ; do 347 | # Create the new string with a simple bash-replacement 348 | NEW_STRING=${OLD_STRING//${PATTERN}/${REPLACEMENT}} 349 | # Create null terminated ASCII HEX representations of the strings 350 | OLD_STRING_HEX="$(echo -n ${OLD_STRING} | xxd -g 0 -u -ps -c 256)00" 351 | NEW_STRING_HEX="$(echo -n ${NEW_STRING} | xxd -g 0 -u -ps -c 256)00" 352 | if [ ${#NEW_STRING_HEX} -le ${#OLD_STRING_HEX} ] ; then 353 | # Pad the replacement string with null terminations so the 354 | # length matches the original string 355 | while [ ${#NEW_STRING_HEX} -lt ${#OLD_STRING_HEX} ] ; do 356 | NEW_STRING_HEX="${NEW_STRING_HEX}00" 357 | done 358 | # Now, replace every occurrence of OLD_STRING with NEW_STRING 359 | echo -n "Replacing ${OLD_STRING} with ${NEW_STRING}... " 360 | hexdump -ve '1/1 "%.2X"' ${FILE} | \ 361 | sed "s/${OLD_STRING_HEX}/${NEW_STRING_HEX}/g" | \ 362 | xxd -r -p > ${FILE}.tmp 363 | chmod --reference ${FILE} ${FILE}.tmp 364 | mv ${FILE}.tmp ${FILE} 365 | echo "Done!" 366 | else 367 | echo "New string '${NEW_STRING}' is longer than old" \ 368 | "string '${OLD_STRING}'. Skipping." 369 | fi 370 | done 371 | fi 372 | } 373 | 374 | # Lightweight bash-only "apt update" and "apt download" replacement 375 | 376 | function apt-get.update(){ 377 | echo -n > cache.txt 378 | 379 | cat Packages.gz | gunzip -c | grep -E "^Package:|^Filename:|^Depends:|^Version:" >> cache.txt || true 380 | 381 | while read line; do 382 | local line=$(echo "${line}" | sed 's|[[:space:]]| |g') 383 | local repo_info=($(echo ${line} | tr " " "\n")) 384 | local base_url=${repo_info[1]} 385 | local dist_name=${repo_info[2]} 386 | 387 | for i in $(seq 3 $((${#repo_info[@]} - 1))); do 388 | echo "Caching ${base_url} ${dist_name} ${repo_info[${i}]}..." 389 | local repo_url="${base_url}/dists/${dist_name}/${repo_info[${i}]}/binary-amd64/Packages.gz" 390 | wget -q "${repo_url}" -O - | gunzip -c | grep -E "^Package:|^Filename:|^Depends:|^Version:" | sed "s|^Filename: |Filename: ${base_url}/|g" >> cache.txt 391 | done 392 | done > teste_123 421 | } 422 | } 423 | 424 | unset package_url 425 | 426 | for depend in "${dependencies[@]}"; do 427 | apt-get.do-download ${depend} 428 | done 429 | } 430 | -------------------------------------------------------------------------------- /old/lum-qt.yml: -------------------------------------------------------------------------------- 1 | app: mx-live-usb-maker 2 | binpatch: true 3 | 4 | ingredients: 5 | packages: 6 | - libgl1 7 | - libglib2.0-0 8 | - libxcb1 9 | - libqt5gui5 10 | - libqt5dbus5 11 | - libqt5widgets5 12 | - libqt5core5a 13 | - libpcre2-16-0 14 | - mx-live-usb-maker 15 | - libdouble-conversion1 16 | - libxcb-xinerama0 17 | - libqt5x11extras5 18 | - coreutils 19 | - live-usb-maker 20 | - cli-shell-utils 21 | - syslinux 22 | - syslinux-common 23 | - extlinux 24 | - util-linux 25 | - cpio 26 | - zlib1g 27 | - mx-viewer 28 | dist: bullseye 29 | sources: 30 | - deb http://la.mxrepo.com/mx/repo/ bullseye main non-free 31 | - deb http://mxrepo.com/mx/repo/ bullseye main non-free 32 | - deb http://deb.debian.org/debian bullseye main contrib non-free 33 | 34 | script: 35 | - cp -R usr/local/lib/cli-shell-utils usr/lib/cli-shell-utils 36 | - cp usr/local/bin/* usr/bin 37 | -------------------------------------------------------------------------------- /old/mx-live-usb-maker.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=MX Live USB Maker 4 | Name[am]=MX በ ቀጥታ-usb መፍጠሪያ 5 | Name[ar]=MX Live USB Maker 6 | Name[bg]=MX Live USB Maker 7 | Name[ca]=MX Creador de USB autònoms 8 | Name[cs]=MX Live USB Maker 9 | Name[da]=MX Live USB-skaber 10 | Name[de]=MX Live USB Erzeugung 11 | Name[el]=MX Δημιουργός Live-usb 12 | Name[es]=MX Construir Live-USB 13 | Name[et]=MX Live USB Maker 14 | Name[eu]=MX Live USB Maker 15 | Name[fa]=MX Live USB Maker 16 | Name[fi]=MX Live USB Maker 17 | Name[fr]=MX Créateur de Live-usb 18 | Name[he_IL]=MX Live USB Maker 19 | Name[hi]=MX Live USB Maker 20 | Name[hr]=MX Live USB Maker 21 | Name[hu]=MX Live USB Maker 22 | Name[id]=MX Live USB Maker 23 | Name[is]=MX Live USB Maker 24 | Name[it]=MX Crea Live USB 25 | Name[ja]=MX Live USB Maker 26 | Name[kk]=MX Live USB Maker 27 | Name[ko]=MX Live USB Maker 28 | Name[lt]=MX Live USB Maker 29 | Name[mk]=MX Live USB Maker 30 | Name[mr]=MX Live USB Maker 31 | Name[nb]=MX Live USB Maker 32 | Name[nl]=MX Live USB Maker 33 | Name[pl]=MX Live USB Maker 34 | Name[pt_BR]=MX Criador de USB executável 35 | Name[pt]=MX-Criar USB-executável 36 | Name[ro]=MX Live USB Maker 37 | Name[ru]=MX Live USB Maker 38 | Name[sk]=Vytvoriť LiveUSB 39 | Name[sl]=MX Ustvarjalec za živi-usb pogon 40 | Name[sq]=MX Live USB Maker 41 | Name[sr]=MX Live USB Maker 42 | Name[sv]=MX Live USB Maker 43 | Name[tr]=MX Live USB Maker 44 | Name[uk]=MX Live USB Maker 45 | Name[zh_CN]=MX Live USB Maker 46 | Name[zh_TW]=MX 製作現場版 USB 47 | Comment=Create a full-featured live-usb 48 | Comment[am]=ሙሉlገጽታ በ ቀጥታ-usb መፍጠሪያ 49 | Comment[ar]=Create a full-featured live-usb 50 | Comment[bg]=Създава live-usb 51 | Comment[ca]=Crea un USB autònom complert 52 | Comment[cs]=Create a full-featured live-usb 53 | Comment[da]=Opret en live-usb med det hele 54 | Comment[de]=Erzeugung eines voll ausgestatteten Live-USB-Sticks 55 | Comment[el]=Δημιούργησε live-usb με πλήρη χαρακτηριστικά 56 | Comment[es]=Construir Live-USB 57 | Comment[et]=Create a full-featured live-usb 58 | Comment[eu]=Create a full-featured live-usb 59 | Comment[fa]=Create a full-featured live-usb 60 | Comment[fi]=Create a full-featured live-usb 61 | Comment[fr]=Créer un live-usb complet 62 | Comment[he_IL]=Create a full-featured live-usb 63 | Comment[hi]=Create a full-featured live-usb 64 | Comment[hr]=Create a full-featured live-usb 65 | Comment[hu]=Create a full-featured live-usb 66 | Comment[id]=Create a full-featured live-usb 67 | Comment[is]=Create a full-featured live-usb 68 | Comment[it]=Crea una USB-Live con funzionalità completa 69 | Comment[ja]=Create a full-featured live-usb 70 | Comment[kk]=Create a full-featured live-usb 71 | Comment[ko]=Create a full-featured live-usb 72 | Comment[lt]=Create a full-featured live-usb 73 | Comment[mk]=Create a full-featured live-usb 74 | Comment[mr]=Create a full-featured live-usb 75 | Comment[nb]=Create a full-featured live-usb 76 | Comment[nl]=Maak een volledig voorziene live-usb 77 | Comment[pl]=Utwórz w pełni funkcjonalny Live-USB 78 | Comment[pt_BR]=Criar um sistema operacional, com todas suas funcionalidades, num dispositivo USB [mx-live-usb-maker] 79 | Comment[pt]=Criar um sistema operativo, com todas as funcionalidades, num dispositivo USB [mx-live-usb-maker] 80 | Comment[ro]=Create a full-featured live-usb 81 | Comment[ru]=Create a full-featured live-usb 82 | Comment[sk]=Tvorba LiveUSB s plno funkciami 83 | Comment[sl]=Ustvarite popolnoma uporaben živi usb pogon 84 | Comment[sq]=Create a full-featured live-usb 85 | Comment[sr]=Create a full-featured live-usb 86 | Comment[sv]=Skapa en live-usb med alla möjligheter 87 | Comment[tr]=Tam özellikli bir live-usb oluşturun 88 | Comment[uk]=Create a full-featured live-usb 89 | Comment[zh_CN]=Create a full-featured live-usb 90 | Comment[zh_TW]=創造功能完備的現場版 USB 91 | Exec=mx-live-usb-maker 92 | Terminal=false 93 | Type=Application 94 | Icon=mx-live-usb-maker 95 | Categories=System; 96 | NoDisplay=false 97 | MimeType=application/x-cd-image; 98 | -------------------------------------------------------------------------------- /old/pkg2appimage: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | HERE="$(dirname "$(readlink -f "${0}")")" 4 | 5 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 6 | export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" 7 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 8 | 9 | 10 | # Specify a certain commit if you do not want to use master 11 | # by using: 12 | # export PKG2AICOMMIT= 13 | if [ -z "$PKG2AICOMMIT" ] ; then 14 | PKG2AICOMMIT=master 15 | fi 16 | 17 | usage() { 18 | if [ -z "$APPIMAGE" ] ; then 19 | MYSELF="$0" 20 | else 21 | MYSELF="$APPIMAGE" 22 | fi 23 | echo "usage:" 24 | echo " $MYSELF [--di] META-NAME|YAMLFILE" 25 | echo "" 26 | echo "options:" 27 | echo " --di enable legacy desktop integration (unsupported)" 28 | exit 1 29 | } 30 | 31 | check_dependencies() { 32 | for executable in $@; do 33 | which "${executable}" >/dev/null 2>&1 || { 34 | (echo "${executable} missing"; exit 1) 35 | } 36 | done 37 | } 38 | 39 | if [ $# -eq 0 ] || [ "x${!#}" = "x--di" ] ; then 40 | usage 41 | fi 42 | if [ $# -eq 2 ] && [ "x$1" != "x--di" ] ; then 43 | usage 44 | fi 45 | 46 | if [ "x$1" = "x--di" ] ; then 47 | ENABLE_DI="yes" 48 | else 49 | ENABLE_DI="no" 50 | fi 51 | 52 | # Halt on errors 53 | set -e 54 | set -x 55 | 56 | # Check dependencies 57 | check_dependencies \ 58 | dpkg \ 59 | dpkg-deb \ 60 | convert \ 61 | wget \ 62 | grep \ 63 | sed \ 64 | cut \ 65 | file \ 66 | desktop-file-validate \ 67 | strings 68 | 69 | # If the yaml file doesn't exist locally, get it from GitHub 70 | if [ ! -f "${!#}" ] ; then 71 | YAMLFILE=/tmp/_recipe.yml 72 | rm -f "$YAMLFILE" 73 | wget -q "https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/recipes/${!#}.yml" -O "$YAMLFILE" 74 | else 75 | YAMLFILE=$(readlink -f "${!#}") 76 | fi 77 | 78 | # Lightweight bash-only dpkg-scanpackages replacement 79 | scanpackages() { 80 | for deb in *.deb ; do 81 | dpkg -I $deb | sed 's/^ *//g' | grep -i -E '(package|version|installed-size|architecture|depends|priority):' 82 | echo "Filename: $(readlink -f $deb)" 83 | echo "MD5sum: $(md5sum -b $deb | cut -d' ' -f1)" 84 | echo "SHA1: $(sha1sum -b $deb | cut -d' ' -f1)" 85 | echo "SHA256: $(sha256sum -b $deb | cut -d' ' -f1)" 86 | echo 87 | done 88 | } 89 | 90 | # Function to parse yaml 91 | # https://gist.github.com/epiloque/8cf512c6d64641bde388 92 | # based on https://gist.github.com/pkuczynski/8665367 93 | parse_yaml() { 94 | local prefix=$2 95 | local s 96 | local w 97 | local fs 98 | s='[[:blank:]]*' 99 | w='[a-zA-Z0-9_]*' 100 | fs="$(echo @|tr @ '\034')" 101 | sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ 102 | -e "s|^\($s\)\($w\)$s[:-]$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" | 103 | awk -F"$fs" '{ 104 | indent = length($1)/2; 105 | vname[indent] = $2; 106 | for (i in vname) {if (i > indent) {delete vname[i]}} 107 | if (length($3) > 0) { 108 | vn=""; for (i=0; i/dev/null || true 195 | generate_status 196 | 197 | # Some packages depend on packages which we do not want to bundle, 198 | # in addition to the global excludes defined in excludedeblist. 199 | # Use 200 | # ingredients: 201 | # exclude: 202 | # - packagename 203 | if [ ! -z "${_ingredients_exclude[0]}" ] ; then 204 | for PACKAGE in "${_ingredients_exclude[@]}" ; do 205 | printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status 206 | done 207 | fi 208 | 209 | # Some packages depend on an exact version of a dependency to be installed. 210 | # Use 211 | # ingredients: 212 | # pretend: 213 | # - packagename version_to_be_pretended 214 | if [ ! -z "${_ingredients_pretend[0]}" ] ; then 215 | for PRETEND in "${_ingredients_pretend[@]}" ; do 216 | P_PKG=$(echo "$PRETEND" | cut -d " " -f 1) 217 | P_VER=$(echo "$PRETEND" | cut -d " " -f 2) 218 | cat status | tr '\n' '@' | sed -e 's|@@|\n\n|g' | sed -e 's|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: 9:999.999.999|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: '"$P_VER"'|g' | sed -e 's|@|\n|g' > status.temp 219 | mv status.temp status 220 | done 221 | fi 222 | 223 | if [ -e sources.list ] ; then 224 | rm sources.list 225 | fi 226 | for PPA in "${_ingredients_ppas[@]}" ; do 227 | echo "deb http://ppa.launchpad.net/${PPA}/ubuntu/ ${_ingredients_dist} main" >> sources.list 228 | done 229 | for SOURCE in "${_ingredients_sources[@]}" ; do 230 | echo "${SOURCE}" >> sources.list 231 | done 232 | for DEBFILE in "${_ingredients_debs[@]}" ; do 233 | cp ${DEBFILE} . 234 | done 235 | # Use libcurl-slim to reduce AppImage size, thanks darealshinji 236 | # Not really compiled on xenial but CentOS 6, https://github.com/AppImage/AppImages/issues/187 237 | echo "deb http://ppa.launchpad.net/djcj/libcurl-slim/ubuntu xenial main" >> sources.list 238 | # Use gnutls-patched to have libgnutls look in various distributions' places for certificates, 239 | # https://github.com/darealshinji/vlc-AppImage/issues/1#issuecomment-321041496 240 | # echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu ${_ingredients_dist} main" >> sources.list 241 | ### echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu trusty main" >> sources.list # https://github.com/AppImage/pkg2appimage/issues/345 242 | fi 243 | 244 | if [ ! -z "${_ingredients_script[0]}" ] ; then 245 | # Execute extra steps defined in recipe 246 | shell_execute $YAMLFILE _ingredients_script 247 | fi 248 | 249 | if [ ! -z "${_ingredients_dist}" ] ; then 250 | # Some projects provide raw .deb files without a repository 251 | # hence we create our own local repository as part of 252 | # the AppImage creation process in order to "install" 253 | # the package using apt-get as normal 254 | if [ ! -z "${_ingredients_debs[0]}" ] ; then 255 | for DEB in "${_ingredients_debs[@]}" ; do 256 | if [ ! -f $(basename "$DEB") ] ; then 257 | wget -c $DEB 258 | fi 259 | done 260 | fi 261 | scanpackages | gzip -9c > Packages.gz 262 | echo "deb file:$(readlink -e $PWD) ./" >> sources.list 263 | 264 | INSTALL=$LOWERAPP 265 | if [ ! -z "${_ingredients_package}" ] ; then 266 | INSTALL="${_ingredients_package}" 267 | fi 268 | if [ ! -z "${_ingredients_packages}" ] ; then 269 | INSTALL="" 270 | fi 271 | 272 | # If packages are specifically listed, only install these, not a package with the name of the app 273 | if [ ! -z "${_ingredients_packages[0]}" ] ; then 274 | INSTALL=${_ingredients_packages[@]} 275 | fi 276 | 277 | # apt-get -o Acquire::AllowInsecureRepositories=true -o Acquire::Languages="none" -o Acquire::AllowDowngradeToInsecureRepositories=true $OPTIONS update || true 278 | # URLS=$(apt-get --allow-unauthenticated -o Apt::Get::AllowUnauthenticated=true $OPTIONS -y install --print-uris $INSTALL | cut -d "'" -f 2 | grep -e "^http") || true 279 | # if which aria2c &>/dev/null; then 280 | # dltool=aria2c 281 | # else 282 | # dltool=wget 283 | # fi 284 | 285 | # $dltool -c -i- <<<"$URLS" 286 | set +x 287 | apt-get.update 288 | 289 | INSTALL=$(echo "${INSTALL}" | sed "s| |\n|g") 290 | 291 | for pkg in ${INSTALL}; do 292 | apt-get.do-download ${pkg} 293 | done 294 | set -x 295 | fi 296 | 297 | if [ ! -z "${_ingredients_post_script[0]}" ] ; then 298 | # Execute extra steps defined in recipe 299 | shell_execute $YAMLFILE _ingredients_post_script 300 | fi 301 | 302 | mkdir -p ./$APP.AppDir/ 303 | cd ./$APP.AppDir/ 304 | 305 | mkdir -p usr/bin usr/lib 306 | find ../*.deb -exec dpkg-deb -X {} . \; || true 307 | 308 | unset LD_PRELOAD 309 | 310 | # Try to copy icons to standard locations where appimaged can pick them up 311 | mkdir -p usr/share/icons/hicolor/{22x22,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/ 312 | find . -path *icons* -path *22* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/22x22/apps/ \; || true 313 | find . -path *icons* -path *24* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/24x24/apps/ \; || true 314 | find . -path *icons* -path *32* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/32x32/apps/ \; || true 315 | find . -path *icons* -path *48* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/48x48/apps/ \; || true 316 | find . -path *icons* -path *64* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/64x64/apps/ \; || true 317 | find . -path *icons* -path *128* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/128x128/apps/ \; || true 318 | find . -path *icons* -path *256* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/256x256/apps/ \; || true 319 | find . -path *icons* -path *512* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/512x512/apps/ \; || true 320 | 321 | get_icon 322 | 323 | if [ -z "${_union}" ] ; then 324 | get_apprun 325 | else 326 | cat > AppRun <<\EOF 327 | #!/bin/sh 328 | HERE="$(dirname "$(readlink -f "${0}")")" 329 | export UNION_PRELOAD="${HERE}" 330 | export LD_PRELOAD="${HERE}/libunionpreload.so" 331 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 332 | export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" 333 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}" 334 | export PYTHONHOME="${HERE}"/usr/ 335 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 336 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 337 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 338 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 339 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 340 | exec ${EXEC} "$@" 341 | EOF 342 | chmod a+x AppRun 343 | fi 344 | 345 | get_desktop 346 | 347 | # Prevent Qt from loading plugins from the system 348 | unset QTPATH 349 | QTPATH=$(find usr/lib -type d -name qt4 -or -name qt5 | sed -e 's|usr/|../|g') 350 | if [ ! -z $QTPATH ] ; then 351 | cat > usr/bin/qt.conf < temp \; 367 | # Remove all absolute paths 368 | sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' temp 369 | SONAMES=$(cat temp | cut -d '"' -f 4 | grep ".so" || true) 370 | if [ "" != "$SONAMES" ] ; then 371 | for SONAME in $SONAMES; do 372 | find . -name "$SONAME" -exec mv {} usr/lib \; 373 | done 374 | fi 375 | rm temp 376 | PATH_OF_THE_EXE="usr/lib/mono/exe" 377 | mkdir -p "$PATH_OF_THE_EXE" 378 | # Force all dll files into PATH_OF_THE_EXE (or MONO_PATH which we would have to set) 379 | find . -name "*.dll" -and -not -name "mscorlib.dll" -exec mv {} "$PATH_OF_THE_EXE" \; 380 | # Edit all config files in place to remove absolute paths 381 | find . -name "*.dll.config" -exec sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' {} \; 382 | # Force all config files into the PATH_OF_THE_EXE (or MONO_PATH which we would have to set) 383 | find . -name "*.dll.config" -exec mv {} "$PATH_OF_THE_EXE" \; 384 | # Remove gac, we are not using it since it is convoluted 385 | rm -rf usr/lib/mono/gac/ 386 | fi 387 | 388 | if [ -d "./usr/lib/x86_64-linux-gnu/gstreamer-1.0/" ] ; then 389 | mv ./usr/lib/x86_64-linux-gnu/gstreamer-1.0/* ./usr/lib/x86_64-linux-gnu/ 390 | rm -r ./usr/lib/x86_64-linux-gnu/gstreamer-1.0 391 | fi 392 | 393 | if [ -d "./usr/lib/x86_64-linux-gnu/pulseaudio/" ] ; then 394 | mv ./usr/lib/x86_64-linux-gnu/pulseaudio/* ./usr/lib/x86_64-linux-gnu/ 395 | rm -r ./usr/lib/x86_64-linux-gnu/pulseaudio 396 | fi 397 | 398 | # Execute extra steps defined in recipe 399 | if [ ! -z "${_script}" ] ; then 400 | shell_execute $YAMLFILE _script 401 | fi 402 | 403 | DESKTOP=$(find . -name '*.desktop' | sort | head -n 1) 404 | 405 | # desktop-file-validate complains about missing trailing semicolons for some 406 | # keys although the format definition says that they are optional 407 | fix_desktop "$DESKTOP" 408 | 409 | # Some non-distribution provided applications have an absolute 410 | # path in the Exec= line which we remove for relocateability 411 | if [ -z "$DESKTOP" ] ; then 412 | echo "desktop file not found, aborting" 413 | exit 1 414 | else 415 | read -s -n 1 -p "Press any key to continue . . ." 416 | desktop-file-validate "$DESKTOP" || exit 1 417 | ORIG=$(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1| cut -d " " -f 1) 418 | REPL=$(basename $(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1 | cut -d " " -f 1 | sed -e 's|Exec=||g')) 419 | sed -i -e 's|'"${ORIG}"'|Exec='"${REPL}"'|g' "${DESKTOP}" 420 | fi 421 | 422 | # Compile GLib schemas if the subdirectory is present in the AppImage 423 | # AppRun has to export GSETTINGS_SCHEMA_DIR for this to work 424 | if [ -d usr/share/glib-2.0/schemas/ ] ; then 425 | ( cd usr/share/glib-2.0/schemas/ ; glib-compile-schemas . ) 426 | fi 427 | 428 | if [ -f ../VERSION ] ; then 429 | VERSION=$(cat ../VERSION) 430 | else 431 | get_version || true 432 | fi 433 | 434 | # patch_usr 435 | # Patching only the executable files seems not to be enough for some apps 436 | if [ ! -z "${_binpatch}" ] ; then 437 | find usr/ -type f -exec sed -i -e 's|/usr|././|g' {} \; 438 | find usr/ -type f -exec sed -i -e 's@././/bin/env@/usr/bin/env@g' {} \; 439 | fi 440 | 441 | # Don't suffer from NIH; use LD_PRELOAD to override calls to /usr paths 442 | if [ ! -z "${_union}" ] ; then 443 | mkdir -p usr/src/ 444 | wget -q "https://raw.githubusercontent.com/mikix/deb2snap/master/src/preload.c" -O - | \ 445 | sed -e 's|SNAPPY|UNION|g' | sed -e 's|SNAPP|UNION|g' | sed -e 's|SNAP|UNION|g' | \ 446 | sed -e 's|snappy|union|g' > usr/src/libunionpreload.c 447 | gcc -shared -fPIC usr/src/libunionpreload.c -o libunionpreload.so -ldl -DUNION_LIBNAME=\"libunionpreload.so\" 448 | strip libunionpreload.so 449 | fi 450 | 451 | delete_blacklisted 452 | 453 | if [ "$ENABLE_DI" = "yes" ] ; then 454 | get_desktopintegration $LOWERAPP 455 | fi 456 | 457 | # Fix desktop files that have file endings for icons 458 | sed -i -e 's|\.png||g' *.desktop || true 459 | sed -i -e 's|\.svg||g' *.desktop || true 460 | sed -i -e 's|\.svgz||g' *.desktop || true 461 | sed -i -e 's|\.xpm||g' *.desktop || true 462 | 463 | # Setting PYTHONHOME instead 464 | # Fix Python imports, 465 | # https://github.com/AppImage/AppImages/issues/172 466 | # SITECUSTOMIZEFILES=$(find . -name "sitecustomize.py") 467 | # for SITECUSTOMIZEFILE in $SITECUSTOMIZEFILES ; do 468 | # rm $SITECUSTOMIZEFILE # Remove symlinks, replace by files 469 | # cat > $SITECUSTOMIZEFILE <<\EOF 470 | # import sys,os 471 | # if sys.version_info[0] < 3: 472 | # prefix = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(sys.path[0])))) 473 | # sys.path = [ prefix+s for s in sys.path if not s.startswith(prefix) ] 474 | # EOF 475 | # done 476 | 477 | # Execute extra steps defined in recipe 478 | if [ ! -z "${_post_script[0]}" ] ; then 479 | shell_execute $YAMLFILE _post_script 480 | fi 481 | 482 | # Go out of AppImage 483 | cd .. 484 | 485 | if [ -z "${_updateinformation}" ] ; then 486 | generate_type2_appimage 487 | else 488 | generate_type2_appimage -u "${_updateinformation}" 489 | fi 490 | 491 | ls -lh ../out/*.AppImage 492 | -------------------------------------------------------------------------------- /old/set-up-ppas.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Sets up PPAs required for AppImage building. 4 | # They contain patched libraries and tools which significantly improve 5 | # AppImages and their building process. 6 | 7 | echo "deb http://ppa.launchpad.net/djcj/libcurl-slim/ubuntu xenial main" >> /etc/apt/sources.list 8 | 9 | cat > /etc/apt/preferences.d/appimage-pin <> log 2>&1 \; 14 | sudo find /isodevice/boot/iso/*_64*iso -exec bash ./AppImageKit/AppImageAssistant.AppDir/testappimage {} $HOME/Downloads/Subsurface_*_x86_64.AppImage >> log 2>&1 \; 15 | 16 | # Test 32-bit AppImage; works on a 64-bit host 17 | sudo find /isodevice/boot/iso/*i386*iso -exec linux32 ./AppImageKit/AppImageAssistant.AppDir/testappimage {} $HOME/Downloads/Subsurface_*_i386.AppImage >> log 2>&1 \; 18 | sudo find /isodevice/boot/iso/*i686*iso -exec linux32 ./AppImageKit/AppImageAssistant.AppDir/testappimage {} $HOME/Downloads/Subsurface_*_i386.AppImage >> log 2>&1 \; 19 | 20 | # Now have to close every Subsurface instance by hand 21 | 22 | # To get a summary 23 | grep -r SUCCESS log | cut -d " " -f 3 | cut -d "/" -f 5 | sort | uniq 24 | -------------------------------------------------------------------------------- /old/travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Build on Travis CI with or without Docker 4 | 5 | set -e 6 | 7 | if [ ! $(env | grep TRAVIS_JOB_ID ) ] ; then 8 | echo "This script is supposed to run on Travis CI" 9 | exit 1 10 | fi 11 | 12 | RECIPE="${1}" 13 | DOCKER=$(echo "${RECIPE}" | cut -d "-" -f 1) # Allow e.g., a recipe called "inkscape-standalone" to use the "inkscape" Docker image 14 | 15 | mkdir -p ./out/ 16 | 17 | if [ -f recipes/$RECIPE/Dockerfile ] && [ -f recipes/$RECIPE/Recipe ] ; then 18 | # There is a Dockerfile, hence build using Docker 19 | mv recipes/$RECIPE/Recipe ./out/Recipe 20 | sed -i -e 's|sudo ||g' ./out/Recipe # For subsurface recipe 21 | docker run -i -v ${PWD}/out:/out probonopd/appimages:$DOCKER /bin/bash -ex /out/Recipe 22 | elif [ -f recipes/$RECIPE.yml ] ; then 23 | # There is no Dockerfile but a YAML file for the meta Recipe 24 | bash -ex pkg2appimage recipes/$RECIPE.yml 25 | elif [ -f recipes/$RECIPE/Recipe ] ; then 26 | # There is no Dockerfile but a Recipe, hence build without Docker 27 | bash -ex recipes/$RECIPE/Recipe 28 | else 29 | # There is no Recipe 30 | echo "Recipe not found, is RECIPE missing?" 31 | exit 1 32 | fi 33 | 34 | ls -lh out/*.AppImage 35 | -------------------------------------------------------------------------------- /old/trigger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Trigger builds on travis using GitHub username and password 4 | # https://docs.travis-ci.com/api?http#creating-a-temporary-github-token 5 | # 6 | # For example, to build arduino: 7 | # bash <(curl -s https://raw.githubusercontent.com/AppImage/AppImages/master/trigger.sh) arduino 8 | 9 | [[ -z "$1" ]] && echo "Argument missing. Which AppImage do you want to build?" && exit 1 10 | 11 | set +e 12 | 13 | USERNAME=probonopd 14 | ORGANIZATION=AppImage 15 | PROJECT=pkg2appimage 16 | 17 | USER_AGENT='Travis/1.8.0 (Compatible; curl '$(curl --version | head -n 1 | cut -d " " -f 1-4)')' 18 | 19 | echo $@ 20 | MATRIX="" 21 | for RECIPE in $@ ; do 22 | MATRIX="\"RECIPE=$RECIPE\",$MATRIX" 23 | done 24 | MATRIX=$(echo -n $MATRIX | head -c -1 ) # Remove extra comma at the end 25 | 26 | read -s -p "GitHub Password: " PASSWORD 27 | if [ "$PASSWORD" == "" ] ; then 28 | exit 1 29 | else 30 | echo "" 31 | fi 32 | 33 | ######################################################### 34 | echo "Delete the GitHub authorization at the end" 35 | ######################################################### 36 | 37 | trap atexit EXIT 38 | 39 | atexit() 40 | { 41 | set +e 42 | 43 | RESL=$(curl -u $USERNAME:$PASSWORD -k -s -X DELETE \ 44 | -H "Content-Type: application/json" \ 45 | -H "Accept: application/json" \ 46 | $GH_AUTH_URL) 47 | 48 | echo $RESL 49 | } 50 | 51 | ######################################################### 52 | echo "Create a temporary GitHub authorization" 53 | ######################################################### 54 | 55 | body='{ 56 | "scopes": [ 57 | "read:org", "user:email", "repo_deployment", 58 | "repo:status", "write:repo_hook" 59 | ], 60 | "note": "temporary token to auth against travis" 61 | }' 62 | 63 | RES1=$(curl -k -u $USERNAME:$PASSWORD -s -X POST \ 64 | -H "Content-Type: application/json" \ 65 | -H "Accept: application/json" \ 66 | -d "$body" \ 67 | https://api.github.com/authorizations) 68 | 69 | echo $RES1 70 | 71 | GH_TOKEN=$(echo $RES1 | grep -Po '"token":.*?[^\\]",' | cut -d '"' -f 4 | head -n 1) 72 | GH_AUTH_URL=$(echo $RES1 | grep -Po '"url":.*?[^\\]",' | cut -d '"' -f 4| head -n 1) 73 | 74 | ######################################################### 75 | echo "Get a travis token using the GitHub token" 76 | ######################################################### 77 | 78 | RES2=$(curl -A "$USER_AGENT" -k -s -X POST \ 79 | -H "Content-Type: application/json" \ 80 | -H "Accept: application/json" \ 81 | -d '{"github_token":"'$GH_TOKEN'"}' \ 82 | https://api.travis-ci.org/auth/github) 83 | 84 | echo $RES2 85 | 86 | TRAVIS_TOKEN=$(echo $RES2 | cut -d '"' -f 4 | head -n 1) 87 | echo $TRAVIS_TOKEN 88 | 89 | [ $TRAVIS_TOKEN == "error" ] && exit 1 90 | 91 | ######################################################### 92 | echo "Trigger a build" 93 | ######################################################### 94 | 95 | body='{ 96 | "request": { 97 | "message": "Build triggered by api request", 98 | "branch":"master", 99 | "config": { 100 | "env": { 101 | "matrix": ['$MATRIX'] 102 | } 103 | } 104 | } 105 | }' 106 | echo $body 107 | curl -A "$USER_AGENT" -k -s -X POST \ 108 | -H "Content-Type: application/json" \ 109 | -H "Accept: application/json" \ 110 | -H "Travis-API-Version: 3" \ 111 | -H "Authorization: token $TRAVIS_TOKEN" \ 112 | -d "$body" \ 113 | https://api.travis-ci.org/repo/$ORGANIZATION%2F$PROJECT/requests 114 | -------------------------------------------------------------------------------- /pkg2appimage: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | HERE="$(dirname "$(readlink -f "${0}")")" 4 | 5 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 6 | export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" 7 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 8 | 9 | 10 | # Specify a certain commit if you do not want to use master 11 | # by using: 12 | # export PKG2AICOMMIT= 13 | if [ -z "$PKG2AICOMMIT" ] ; then 14 | PKG2AICOMMIT=master 15 | fi 16 | 17 | usage() { 18 | if [ -z "$APPIMAGE" ] ; then 19 | MYSELF="$0" 20 | else 21 | MYSELF="$APPIMAGE" 22 | fi 23 | echo "usage:" 24 | echo " $MYSELF [--di] META-NAME|YAMLFILE" 25 | echo "" 26 | echo "options:" 27 | echo " --di enable legacy desktop integration (unsupported)" 28 | exit 1 29 | } 30 | 31 | check_dependencies() { 32 | for executable in $@; do 33 | which "${executable}" >/dev/null 2>&1 || { 34 | (echo "${executable} missing"; exit 1) 35 | } 36 | done 37 | } 38 | 39 | if [ $# -eq 0 ] || [ "x${!#}" = "x--di" ] ; then 40 | usage 41 | fi 42 | if [ $# -eq 2 ] && [ "x$1" != "x--di" ] ; then 43 | usage 44 | fi 45 | 46 | if [ "x$1" = "x--di" ] ; then 47 | ENABLE_DI="yes" 48 | else 49 | ENABLE_DI="no" 50 | fi 51 | 52 | # Halt on errors 53 | set -e 54 | set -x 55 | 56 | # Check dependencies 57 | check_dependencies \ 58 | dpkg \ 59 | dpkg-deb \ 60 | convert \ 61 | wget \ 62 | grep \ 63 | sed \ 64 | cut \ 65 | file \ 66 | desktop-file-validate \ 67 | strings 68 | 69 | # If the yaml file doesn't exist locally, get it from GitHub 70 | if [ ! -f "${!#}" ] ; then 71 | YAMLFILE=/tmp/_recipe.yml 72 | rm -f "$YAMLFILE" 73 | wget -q "https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/recipes/${!#}.yml" -O "$YAMLFILE" 74 | else 75 | YAMLFILE=$(readlink -f "${!#}") 76 | fi 77 | 78 | # Lightweight bash-only dpkg-scanpackages replacement 79 | scanpackages() { 80 | for deb in *.deb ; do 81 | dpkg -I $deb | sed 's/^ *//g' | grep -i -E '(package|version|installed-size|architecture|depends|priority):' 82 | echo "Filename: $(readlink -f $deb)" 83 | echo "MD5sum: $(md5sum -b $deb | cut -d' ' -f1)" 84 | echo "SHA1: $(sha1sum -b $deb | cut -d' ' -f1)" 85 | echo "SHA256: $(sha256sum -b $deb | cut -d' ' -f1)" 86 | echo 87 | done 88 | } 89 | 90 | # Function to parse yaml 91 | # https://gist.github.com/epiloque/8cf512c6d64641bde388 92 | # based on https://gist.github.com/pkuczynski/8665367 93 | parse_yaml() { 94 | local prefix=$2 95 | local s 96 | local w 97 | local fs 98 | s='[[:blank:]]*' 99 | w='[a-zA-Z0-9_]*' 100 | fs="$(echo @|tr @ '\034')" 101 | sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ 102 | -e "s|^\($s\)\($w\)$s[:-]$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" | 103 | awk -F"$fs" '{ 104 | indent = length($1)/2; 105 | vname[indent] = $2; 106 | for (i in vname) {if (i > indent) {delete vname[i]}} 107 | if (length($3) > 0) { 108 | vn=""; for (i=0; i/dev/null || true 195 | generate_status 196 | 197 | # Some packages depend on packages which we do not want to bundle, 198 | # in addition to the global excludes defined in excludedeblist. 199 | # Use 200 | # ingredients: 201 | # exclude: 202 | # - packagename 203 | if [ ! -z "${_ingredients_exclude[0]}" ] ; then 204 | for PACKAGE in "${_ingredients_exclude[@]}" ; do 205 | printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status 206 | done 207 | fi 208 | 209 | # Some packages depend on an exact version of a dependency to be installed. 210 | # Use 211 | # ingredients: 212 | # pretend: 213 | # - packagename version_to_be_pretended 214 | if [ ! -z "${_ingredients_pretend[0]}" ] ; then 215 | for PRETEND in "${_ingredients_pretend[@]}" ; do 216 | P_PKG=$(echo "$PRETEND" | cut -d " " -f 1) 217 | P_VER=$(echo "$PRETEND" | cut -d " " -f 2) 218 | cat status | tr '\n' '@' | sed -e 's|@@|\n\n|g' | sed -e 's|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: 9:999.999.999|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: '"$P_VER"'|g' | sed -e 's|@|\n|g' > status.temp 219 | mv status.temp status 220 | done 221 | fi 222 | 223 | if [ -e sources.list ] ; then 224 | rm sources.list 225 | fi 226 | for PPA in "${_ingredients_ppas[@]}" ; do 227 | echo "deb http://ppa.launchpad.net/${PPA}/ubuntu/ ${_ingredients_dist} main" >> sources.list 228 | done 229 | for SOURCE in "${_ingredients_sources[@]}" ; do 230 | echo "${SOURCE}" >> sources.list 231 | done 232 | for DEBFILE in "${_ingredients_debs[@]}" ; do 233 | cp ${DEBFILE} . 234 | done 235 | # Use libcurl-slim to reduce AppImage size, thanks darealshinji 236 | # Not really compiled on xenial but CentOS 6, https://github.com/AppImage/AppImages/issues/187 237 | echo "deb http://ppa.launchpad.net/djcj/libcurl-slim/ubuntu xenial main" >> sources.list 238 | # Use gnutls-patched to have libgnutls look in various distributions' places for certificates, 239 | # https://github.com/darealshinji/vlc-AppImage/issues/1#issuecomment-321041496 240 | # echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu ${_ingredients_dist} main" >> sources.list 241 | ### echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu trusty main" >> sources.list # https://github.com/AppImage/pkg2appimage/issues/345 242 | fi 243 | 244 | if [ ! -z "${_ingredients_script[0]}" ] ; then 245 | # Execute extra steps defined in recipe 246 | shell_execute $YAMLFILE _ingredients_script 247 | fi 248 | 249 | if [ ! -z "${_ingredients_dist}" ] ; then 250 | # Some projects provide raw .deb files without a repository 251 | # hence we create our own local repository as part of 252 | # the AppImage creation process in order to "install" 253 | # the package using apt-get as normal 254 | if [ ! -z "${_ingredients_debs[0]}" ] ; then 255 | for DEB in "${_ingredients_debs[@]}" ; do 256 | if [ ! -f $(basename "$DEB") ] ; then 257 | wget -c $DEB 258 | fi 259 | done 260 | fi 261 | scanpackages | gzip -9c > Packages.gz 262 | echo "deb file:$(readlink -e $PWD) ./" >> sources.list 263 | 264 | INSTALL=$LOWERAPP 265 | if [ ! -z "${_ingredients_package}" ] ; then 266 | INSTALL="${_ingredients_package}" 267 | fi 268 | if [ ! -z "${_ingredients_packages}" ] ; then 269 | INSTALL="" 270 | fi 271 | 272 | # If packages are specifically listed, only install these, not a package with the name of the app 273 | if [ ! -z "${_ingredients_packages[0]}" ] ; then 274 | INSTALL=${_ingredients_packages[@]} 275 | fi 276 | 277 | # apt-get -o Acquire::AllowInsecureRepositories=true -o Acquire::Languages="none" -o Acquire::AllowDowngradeToInsecureRepositories=true $OPTIONS update || true 278 | # URLS=$(apt-get --allow-unauthenticated -o Apt::Get::AllowUnauthenticated=true $OPTIONS -y install --print-uris $INSTALL | cut -d "'" -f 2 | grep -e "^http") || true 279 | # if which aria2c &>/dev/null; then 280 | # dltool=aria2c 281 | # else 282 | # dltool=wget 283 | # fi 284 | 285 | # $dltool -c -i- <<<"$URLS" 286 | set +x 287 | apt-get.update 288 | 289 | INSTALL=$(echo "${INSTALL}" | sed "s| |\n|g") 290 | 291 | for pkg in ${INSTALL}; do 292 | apt-get.do-download ${pkg} 293 | done 294 | set -x 295 | fi 296 | 297 | if [ ! -z "${_ingredients_post_script[0]}" ] ; then 298 | # Execute extra steps defined in recipe 299 | shell_execute $YAMLFILE _ingredients_post_script 300 | fi 301 | 302 | mkdir -p ./$APP.AppDir/ 303 | cd ./$APP.AppDir/ 304 | 305 | mkdir -p usr/bin usr/lib 306 | find ../*.deb -exec dpkg-deb -X {} . \; || true 307 | 308 | unset LD_PRELOAD 309 | 310 | # Try to copy icons to standard locations where appimaged can pick them up 311 | mkdir -p usr/share/icons/hicolor/{22x22,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/ 312 | find . -path *icons* -path *22* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/22x22/apps/ \; || true 313 | find . -path *icons* -path *24* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/24x24/apps/ \; || true 314 | find . -path *icons* -path *32* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/32x32/apps/ \; || true 315 | find . -path *icons* -path *48* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/48x48/apps/ \; || true 316 | find . -path *icons* -path *64* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/64x64/apps/ \; || true 317 | find . -path *icons* -path *128* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/128x128/apps/ \; || true 318 | find . -path *icons* -path *256* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/256x256/apps/ \; || true 319 | find . -path *icons* -path *512* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/512x512/apps/ \; || true 320 | 321 | get_icon 322 | 323 | if [ -z "${_union}" ] ; then 324 | get_apprun 325 | else 326 | cat > AppRun <<\EOF 327 | #!/bin/sh 328 | HERE="$(dirname "$(readlink -f "${0}")")" 329 | export UNION_PRELOAD="${HERE}" 330 | export LD_PRELOAD="${HERE}/libunionpreload.so" 331 | export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}" 332 | export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}" 333 | export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}" 334 | export PYTHONHOME="${HERE}"/usr/ 335 | export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}" 336 | export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}" 337 | export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}" 338 | export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}" 339 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g') 340 | exec ${EXEC} "$@" 341 | EOF 342 | chmod a+x AppRun 343 | fi 344 | 345 | get_desktop 346 | 347 | # Prevent Qt from loading plugins from the system 348 | unset QTPATH 349 | QTPATH=$(find usr/lib -type d -name qt4 -or -name qt5 | sed -e 's|usr/|../|g') 350 | if [ ! -z $QTPATH ] ; then 351 | cat > usr/bin/qt.conf < temp \; 367 | # Remove all absolute paths 368 | sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' temp 369 | SONAMES=$(cat temp | cut -d '"' -f 4 | grep ".so" || true) 370 | if [ "" != "$SONAMES" ] ; then 371 | for SONAME in $SONAMES; do 372 | find . -name "$SONAME" -exec mv {} usr/lib \; 373 | done 374 | fi 375 | rm temp 376 | PATH_OF_THE_EXE="usr/lib/mono/exe" 377 | mkdir -p "$PATH_OF_THE_EXE" 378 | # Force all dll files into PATH_OF_THE_EXE (or MONO_PATH which we would have to set) 379 | find . -name "*.dll" -and -not -name "mscorlib.dll" -exec mv {} "$PATH_OF_THE_EXE" \; 380 | # Edit all config files in place to remove absolute paths 381 | find . -name "*.dll.config" -exec sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' {} \; 382 | # Force all config files into the PATH_OF_THE_EXE (or MONO_PATH which we would have to set) 383 | find . -name "*.dll.config" -exec mv {} "$PATH_OF_THE_EXE" \; 384 | # Remove gac, we are not using it since it is convoluted 385 | rm -rf usr/lib/mono/gac/ 386 | fi 387 | 388 | if [ -d "./usr/lib/x86_64-linux-gnu/gstreamer-1.0/" ] ; then 389 | mv ./usr/lib/x86_64-linux-gnu/gstreamer-1.0/* ./usr/lib/x86_64-linux-gnu/ 390 | rm -r ./usr/lib/x86_64-linux-gnu/gstreamer-1.0 391 | fi 392 | 393 | if [ -d "./usr/lib/x86_64-linux-gnu/pulseaudio/" ] ; then 394 | mv ./usr/lib/x86_64-linux-gnu/pulseaudio/* ./usr/lib/x86_64-linux-gnu/ 395 | rm -r ./usr/lib/x86_64-linux-gnu/pulseaudio 396 | fi 397 | 398 | # Execute extra steps defined in recipe 399 | if [ ! -z "${_script}" ] ; then 400 | shell_execute $YAMLFILE _script 401 | fi 402 | 403 | DESKTOP=$(find . -name '*.desktop' | sort | head -n 1) 404 | 405 | # desktop-file-validate complains about missing trailing semicolons for some 406 | # keys although the format definition says that they are optional 407 | fix_desktop "$DESKTOP" 408 | 409 | # Some non-distribution provided applications have an absolute 410 | # path in the Exec= line which we remove for relocateability 411 | if [ -z "$DESKTOP" ] ; then 412 | echo "desktop file not found, aborting" 413 | exit 1 414 | else 415 | read -s -n 1 -p "Press any key to continue . . ." 416 | desktop-file-validate "$DESKTOP" || exit 1 417 | ORIG=$(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1| cut -d " " -f 1) 418 | REPL=$(basename $(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1 | cut -d " " -f 1 | sed -e 's|Exec=||g')) 419 | sed -i -e 's|'"${ORIG}"'|Exec='"${REPL}"'|g' "${DESKTOP}" 420 | fi 421 | 422 | # Compile GLib schemas if the subdirectory is present in the AppImage 423 | # AppRun has to export GSETTINGS_SCHEMA_DIR for this to work 424 | if [ -d usr/share/glib-2.0/schemas/ ] ; then 425 | ( cd usr/share/glib-2.0/schemas/ ; glib-compile-schemas . ) 426 | fi 427 | 428 | if [ -f ../VERSION ] ; then 429 | VERSION=$(cat ../VERSION) 430 | else 431 | get_version || true 432 | fi 433 | 434 | # patch_usr 435 | # Patching only the executable files seems not to be enough for some apps 436 | if [ ! -z "${_binpatch}" ] ; then 437 | find usr/ -type f -exec sed -i -e 's|/usr|././|g' {} \; 438 | find usr/ -type f -exec sed -i -e 's@././/bin/env@/usr/bin/env@g' {} \; 439 | fi 440 | 441 | # Don't suffer from NIH; use LD_PRELOAD to override calls to /usr paths 442 | if [ ! -z "${_union}" ] ; then 443 | mkdir -p usr/src/ 444 | wget -q "https://raw.githubusercontent.com/mikix/deb2snap/master/src/preload.c" -O - | \ 445 | sed -e 's|SNAPPY|UNION|g' | sed -e 's|SNAPP|UNION|g' | sed -e 's|SNAP|UNION|g' | \ 446 | sed -e 's|snappy|union|g' > usr/src/libunionpreload.c 447 | gcc -shared -fPIC usr/src/libunionpreload.c -o libunionpreload.so -ldl -DUNION_LIBNAME=\"libunionpreload.so\" 448 | strip libunionpreload.so 449 | fi 450 | 451 | delete_blacklisted 452 | 453 | if [ "$ENABLE_DI" = "yes" ] ; then 454 | get_desktopintegration $LOWERAPP 455 | fi 456 | 457 | # Fix desktop files that have file endings for icons 458 | sed -i -e 's|\.png||g' *.desktop || true 459 | sed -i -e 's|\.svg||g' *.desktop || true 460 | sed -i -e 's|\.svgz||g' *.desktop || true 461 | sed -i -e 's|\.xpm||g' *.desktop || true 462 | 463 | # Setting PYTHONHOME instead 464 | # Fix Python imports, 465 | # https://github.com/AppImage/AppImages/issues/172 466 | # SITECUSTOMIZEFILES=$(find . -name "sitecustomize.py") 467 | # for SITECUSTOMIZEFILE in $SITECUSTOMIZEFILES ; do 468 | # rm $SITECUSTOMIZEFILE # Remove symlinks, replace by files 469 | # cat > $SITECUSTOMIZEFILE <<\EOF 470 | # import sys,os 471 | # if sys.version_info[0] < 3: 472 | # prefix = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(sys.path[0])))) 473 | # sys.path = [ prefix+s for s in sys.path if not s.startswith(prefix) ] 474 | # EOF 475 | # done 476 | 477 | # Execute extra steps defined in recipe 478 | if [ ! -z "${_post_script[0]}" ] ; then 479 | shell_execute $YAMLFILE _post_script 480 | fi 481 | 482 | # Go out of AppImage 483 | cd .. 484 | 485 | if [ -z "${_updateinformation}" ] ; then 486 | generate_type2_appimage 487 | else 488 | generate_type2_appimage -u "${_updateinformation}" 489 | fi 490 | 491 | ls -lh ../out/*.AppImage 492 | -------------------------------------------------------------------------------- /pkg2appimage.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | pkg2appimage.desktop 4 | MIT 5 | MIT 6 | pkg2appimage 7 | Convert existing binary packages into AppImaegs 8 | 9 |

10 | pkg2appimage is a tool that lets you generate AppImage files from existing packages. An AppImage 11 | is a self-running bundle that contains an application and everything 12 | it needs to run that cannot reasonably expected to be part of each target system. 13 |

14 |

15 | This can include libraries that are not commonly available on target systems, 16 | resources such as translations, icons, fonts, and other auxiliary files. 17 | pkg2appimage makes it easy to take an existing package (e.g., a deb) 18 | and turn it into an AppImage. 19 |

20 |
21 | https://github.com/AppImage/pkg2appimage 22 | AppImage 23 | 24 | pkg2appimage 25 | 26 |
27 | -------------------------------------------------------------------------------- /set-up-ppas.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Sets up PPAs required for AppImage building. 4 | # They contain patched libraries and tools which significantly improve 5 | # AppImages and their building process. 6 | 7 | echo "deb http://ppa.launchpad.net/djcj/libcurl-slim/ubuntu xenial main" >> /etc/apt/sources.list 8 | 9 | cat > /etc/apt/preferences.d/appimage-pin <> log 2>&1 \; 14 | sudo find /isodevice/boot/iso/*_64*iso -exec bash ./AppImageKit/AppImageAssistant.AppDir/testappimage {} $HOME/Downloads/Subsurface_*_x86_64.AppImage >> log 2>&1 \; 15 | 16 | # Test 32-bit AppImage; works on a 64-bit host 17 | sudo find /isodevice/boot/iso/*i386*iso -exec linux32 ./AppImageKit/AppImageAssistant.AppDir/testappimage {} $HOME/Downloads/Subsurface_*_i386.AppImage >> log 2>&1 \; 18 | sudo find /isodevice/boot/iso/*i686*iso -exec linux32 ./AppImageKit/AppImageAssistant.AppDir/testappimage {} $HOME/Downloads/Subsurface_*_i386.AppImage >> log 2>&1 \; 19 | 20 | # Now have to close every Subsurface instance by hand 21 | 22 | # To get a summary 23 | grep -r SUCCESS log | cut -d " " -f 3 | cut -d "/" -f 5 | sort | uniq 24 | -------------------------------------------------------------------------------- /travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Build on Travis CI with or without Docker 4 | 5 | set -e 6 | 7 | if [ ! $(env | grep TRAVIS_JOB_ID ) ] ; then 8 | echo "This script is supposed to run on Travis CI" 9 | exit 1 10 | fi 11 | 12 | RECIPE="${1}" 13 | DOCKER=$(echo "${RECIPE}" | cut -d "-" -f 1) # Allow e.g., a recipe called "inkscape-standalone" to use the "inkscape" Docker image 14 | 15 | mkdir -p ./out/ 16 | 17 | if [ -f recipes/$RECIPE/Dockerfile ] && [ -f recipes/$RECIPE/Recipe ] ; then 18 | # There is a Dockerfile, hence build using Docker 19 | mv recipes/$RECIPE/Recipe ./out/Recipe 20 | sed -i -e 's|sudo ||g' ./out/Recipe # For subsurface recipe 21 | docker run -i -v ${PWD}/out:/out probonopd/appimages:$DOCKER /bin/bash -ex /out/Recipe 22 | elif [ -f recipes/$RECIPE.yml ] ; then 23 | # There is no Dockerfile but a YAML file for the meta Recipe 24 | bash -ex pkg2appimage recipes/$RECIPE.yml 25 | elif [ -f recipes/$RECIPE/Recipe ] ; then 26 | # There is no Dockerfile but a Recipe, hence build without Docker 27 | bash -ex recipes/$RECIPE/Recipe 28 | else 29 | # There is no Recipe 30 | echo "Recipe not found, is RECIPE missing?" 31 | exit 1 32 | fi 33 | 34 | ls -lh out/*.AppImage 35 | -------------------------------------------------------------------------------- /trigger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Trigger builds on travis using GitHub username and password 4 | # https://docs.travis-ci.com/api?http#creating-a-temporary-github-token 5 | # 6 | # For example, to build arduino: 7 | # bash <(curl -s https://raw.githubusercontent.com/AppImage/AppImages/master/trigger.sh) arduino 8 | 9 | [[ -z "$1" ]] && echo "Argument missing. Which AppImage do you want to build?" && exit 1 10 | 11 | set +e 12 | 13 | USERNAME=probonopd 14 | ORGANIZATION=AppImage 15 | PROJECT=pkg2appimage 16 | 17 | USER_AGENT='Travis/1.8.0 (Compatible; curl '$(curl --version | head -n 1 | cut -d " " -f 1-4)')' 18 | 19 | echo $@ 20 | MATRIX="" 21 | for RECIPE in $@ ; do 22 | MATRIX="\"RECIPE=$RECIPE\",$MATRIX" 23 | done 24 | MATRIX=$(echo -n $MATRIX | head -c -1 ) # Remove extra comma at the end 25 | 26 | read -s -p "GitHub Password: " PASSWORD 27 | if [ "$PASSWORD" == "" ] ; then 28 | exit 1 29 | else 30 | echo "" 31 | fi 32 | 33 | ######################################################### 34 | echo "Delete the GitHub authorization at the end" 35 | ######################################################### 36 | 37 | trap atexit EXIT 38 | 39 | atexit() 40 | { 41 | set +e 42 | 43 | RESL=$(curl -u $USERNAME:$PASSWORD -k -s -X DELETE \ 44 | -H "Content-Type: application/json" \ 45 | -H "Accept: application/json" \ 46 | $GH_AUTH_URL) 47 | 48 | echo $RESL 49 | } 50 | 51 | ######################################################### 52 | echo "Create a temporary GitHub authorization" 53 | ######################################################### 54 | 55 | body='{ 56 | "scopes": [ 57 | "read:org", "user:email", "repo_deployment", 58 | "repo:status", "write:repo_hook" 59 | ], 60 | "note": "temporary token to auth against travis" 61 | }' 62 | 63 | RES1=$(curl -k -u $USERNAME:$PASSWORD -s -X POST \ 64 | -H "Content-Type: application/json" \ 65 | -H "Accept: application/json" \ 66 | -d "$body" \ 67 | https://api.github.com/authorizations) 68 | 69 | echo $RES1 70 | 71 | GH_TOKEN=$(echo $RES1 | grep -Po '"token":.*?[^\\]",' | cut -d '"' -f 4 | head -n 1) 72 | GH_AUTH_URL=$(echo $RES1 | grep -Po '"url":.*?[^\\]",' | cut -d '"' -f 4| head -n 1) 73 | 74 | ######################################################### 75 | echo "Get a travis token using the GitHub token" 76 | ######################################################### 77 | 78 | RES2=$(curl -A "$USER_AGENT" -k -s -X POST \ 79 | -H "Content-Type: application/json" \ 80 | -H "Accept: application/json" \ 81 | -d '{"github_token":"'$GH_TOKEN'"}' \ 82 | https://api.travis-ci.org/auth/github) 83 | 84 | echo $RES2 85 | 86 | TRAVIS_TOKEN=$(echo $RES2 | cut -d '"' -f 4 | head -n 1) 87 | echo $TRAVIS_TOKEN 88 | 89 | [ $TRAVIS_TOKEN == "error" ] && exit 1 90 | 91 | ######################################################### 92 | echo "Trigger a build" 93 | ######################################################### 94 | 95 | body='{ 96 | "request": { 97 | "message": "Build triggered by api request", 98 | "branch":"master", 99 | "config": { 100 | "env": { 101 | "matrix": ['$MATRIX'] 102 | } 103 | } 104 | } 105 | }' 106 | echo $body 107 | curl -A "$USER_AGENT" -k -s -X POST \ 108 | -H "Content-Type: application/json" \ 109 | -H "Accept: application/json" \ 110 | -H "Travis-API-Version: 3" \ 111 | -H "Authorization: token $TRAVIS_TOKEN" \ 112 | -d "$body" \ 113 | https://api.travis-ci.org/repo/$ORGANIZATION%2F$PROJECT/requests 114 | --------------------------------------------------------------------------------