### Define ingredients from a binary archive Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Example of using a script within the ingredients section to dynamically fetch and extract a binary archive. ```yaml ingredients: script: - DLD=$(wget -q "https://api.github.com/repos/atom/atom/releases/latest" -O - | grep -E "https.*atom-amd64.tar.gz" | cut -d'"' -f4) - wget -c $DLD - tar zxvf atom*tar.gz ``` -------------------------------- ### Normalize filesystem structure Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Use the script section to move files or update desktop entries when packages install binaries in non-standard locations. ```yaml ingredients: dist: trusty sources: - deb http://archive.ubuntu.com/ubuntu/ trusty main universe script: - DLD=$(wget -q "https://github.com/feross/webtorrent-desktop/releases/" -O - | grep _amd64.deb | head -n 1 | cut -d '"' -f 2) - wget -c "https://github.com/$DLD" script: - mv opt/webtorrent-desktop/* usr/bin/ - sed -i -e 's|/opt/webtorrent-desktop/||g' webtorrent-desktop.desktop ``` -------------------------------- ### Build an AppImage from a local recipe Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/README.md Downloads the latest pkg2appimage tool and executes it using a local .yml recipe file path. ```bash 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) chmod +x ./pkg2appimage-*.AppImage ./pkg2appimage-*.AppImage recipes/XXX.yml ``` -------------------------------- ### Creating a desktop file in YML Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Use a heredoc to generate a .desktop file if one is missing from the application package. ```yaml script: - # Workaround for: - # https://bugzilla.mozilla.org/show_bug.cgi?id=296568 - cat > firefox.desktop < VERSION ``` -------------------------------- ### Rearranging AppDir for desktop integration Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Rename files and update desktop entry contents to match the naming convention required by the desktopintegration script. ```yaml script: - cp ./usr/share/applications/FBReader.desktop fbreader.desktop - sed -i -e 's|Exec=FBReader|Exec=fbreader|g' fbreader.desktop - sed -i -e 's|Name=.*|Name=FBReader|g' fbreader.desktop - sed -i -e 's|Icon=.*|Icon=fbreader|g' fbreader.desktop - mv usr/bin/FBReader usr/bin/fbreader - cp usr/share/pixmaps/FBReader.png fbreader.png ``` -------------------------------- ### Copy ingredients into AppDir Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Commands in the script section execute inside the AppDir root, so files downloaded in the ingredients section are accessed via the parent directory. ```yaml ingredients: script: - wget -c "https://telegram.org/dl/desktop/linux" --trust-server-names - tar xf tsetup.*.tar.xz script: - cp ../Telegram/Telegram ./usr/bin/telegram-desktop ``` -------------------------------- ### Copying desktop files and icons in YML Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Use shell commands in the script section to move existing desktop files and icons to the top-level directory of the AppDir. ```yaml script: - tar xf ../fritzing* -C usr/bin/ --strip 1 - mv usr/bin/fritzing.desktop . ``` -------------------------------- ### Define the general structure of a .yml file Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md The basic template for a .yml file, consisting of app metadata, ingredients, and build scripts. ```yaml app: (name of the application) (optional flags) ingredients: (instructions that describe from where to get the binary ingredients used for the AppImage) script: (instuctions on how to convert these ingredients to an AppImage) ``` -------------------------------- ### Pretend dependency versions in ingredients Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Use the pretend key to bypass package manager version checks by simulating the presence of specific dependency versions. ```yaml ingredients: dist: trusty sources: - deb http://archive.ubuntu.com/ubuntu/ trusty main universe ppas: - otto-kesselgulasch/gimp-edge pretend: - libcups2 1.7.2-0ubuntu1 ``` -------------------------------- ### Include local deb files Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Specifies local file paths or directories containing .deb files to be used instead of remote downloads. ```yaml ingredients: dist: trusty sources: - deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe debs: - /home/area42/kdenlive.deb - /home/area42/kdenlive/* ``` ```yaml - /path/to/file.deb ``` ```yaml - /path/to/local/repo/* ``` -------------------------------- ### Define Debian repository ingredients Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Specifies the base distribution and external Debian repositories for package resolution. ```yaml ingredients: dist: trusty sources: - deb http://archive.ubuntu.com/ubuntu/ trusty main universe - deb http://download.opensuse.org/repositories/isv:/KDAB/xUbuntu_14.04/ / ``` -------------------------------- ### Execute arbitrary retrieval scripts Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Add shell commands to the script section within ingredients to facilitate complex binary downloads, such as those requiring cookies or dynamic URL parsing. ```yaml ingredients: script: - URL=$(wget -q https://www.fosshub.com/JabRef.html -O - | grep jar | cut -d '"' -f 10) - wget -c "$URL" - 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 ``` -------------------------------- ### Exclude specific packages Source: https://github.com/appimagecommunity/pkg2appimage/blob/master/YML.md Prevents unwanted dependencies from being included in the AppImage by listing them in the exclude key. ```yaml ingredients: dist: trusty packages: - multisystem - gksu sources: - deb http://us.archive.ubuntu.com/ubuntu/ trusty main universe - deb http://liveusb.info/multisystem/depot all main exclude: - qemu - qemu-kvm - cryptsetup - libwebkitgtk-3.0-0 - dmsetup ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.