Upgrade to Pro — share decks privately, control downloads, hide ads and more …

openSUSE Conference 2017: Your desktop application as a cross-distribution AppImage

openSUSE Conference 2017: Your desktop application as a cross-distribution AppImage

Let's bundle your desktop application as a cross-distribution "one app = one file" AppImage. In this workshop, you will learn from AppImage lead developer Simon Peter and Open Build Service lead developer Adrian Schröter how to build your application in a reproducible, secure way, and how to distribute it in the AppImage format, including digital signatures and binary delta updates.

What to bring: Your desktop application, ideally already building on Travis CI or Open Build Service. A notebook. An open mind, persistence, and willingness to experiment.

probonopd

May 27, 2017
Tweet

More Decks by probonopd

Other Decks in Programming

Transcript

  1. WORKSHOP
    openSUSE Conference
    May 27, 2017
    Simon Peter
    AppImage
    Adrian Schröter
    Open Build Service
    Your desktop application as a cross-distribution
    AppImage

    View full-size slide

  2. "As a developer, I want to reach
    users with minimal effort"

    View full-size slide

  3. .exe .dmg .AppImage

    View full-size slide

  4. EXECUTABLE
    EXECUTABLE
    SQUASHFS IMAGE
    SQUASHFS IMAGE
    AppImage
    • One file per app
    and version

    View full-size slide

  5. EXECUTABLE
    EXECUTABLE
    SQUASHFS IMAGE
    SQUASHFS IMAGE
    AppImage
    • Binary
    • Mounts the image
    with FUSE when
    executed

    View full-size slide

  6. EXECUTABLE
    EXECUTABLE
    SQUASHFS IMAGE
    SQUASHFS IMAGE
    AppImage • Bundle app and
    everything that is not
    part of all target
    systems: icons, i18n,
    Qt 5, KF5,…
    • Built on host that as
    old as the oldest target
    systems

    View full-size slide

  7. APPIMAGE SPEC
    https://github.com/AppImage/AppImageSpec

    View full-size slide

  8. MAKING
    APPIMAGES

    View full-size slide

  9. APPIMAGETOOL
    Turns an AppDir into an AppImage
    Get it from
    https://github.com/probonopd/AppImageKit/releases
    Usage in a nutshell, assuming that you already have an
    AppDir in place:
    chmod a+x appimagetool­x86_64.AppImage
    ./appimagetool­x86_64.AppImage some.AppDir

    View full-size slide

  10. mkdir ­p leafpad/leafpad.AppDir && cd leafpad
    # Get existing binary
    wget ­c „http://.../leafpad_0.8.17­2_amd64.deb“
    # Turn into an AppDir
    cd leafpad.AppDir
    dpkg ­x ../leafpad_*.deb .
    cp ./usr/share/icons/hicolor/scalable/apps/leafpad.svg .
    cp ./usr/share/applications/leafpad.desktop .
    wget ­c https://.../AppRun
    chmod a+x AppRun
    cd ..
    # Package as an AppImage
    wget ­c https://.../appimagetool.AppImage
    chmod a+x appimagetool.AppImage
    ./appimagetool.AppImageleafpad.AppDir/
    HELLO WORLD,…

    View full-size slide

  11. …MORE LIKE THIS
    # Build on an „old enough“ build system
    (for which recent compilers and build tools exist, e.g., CentOS 6.x)
    # Make sure it is relocatable (no hardcoded „/usr“); otherwise patch it
    # Turn into an AppDir
    ...
    chmod a+x AppRun
    # Bundle any libraries that might not be there in a recent enough version
    # on each target system
    # Package the AppDir as an AppImage
    ...
    ./appimagetool.AppImage leafpad.AppDir ./Leafpad­x86_64.AppImage
    # Test on each target system ­ really! (I use Live ISOs)

    View full-size slide

  12. live demo:
    Download and extract
    AppImage, re-generate
    AppImage

    View full-size slide

  13. LINUXDEPLOYQT
    Turns a usr/ filesystem tree into an AppDir, and the AppDir
    in into an AppImage (using appimagetool)
    Originally focused on Qt desktop applications but can also
    be used for non-Qt applications
    Get it from
    github.com/probonopd/linuxdeployqt/releases/
    Recommended to run on Travis CI or OBS

    View full-size slide

  14. Making appdir/usr/… tree
    Using qmake:
    qmake PREFIX=/usr
    make ­j4
    make INSTALL_ROOT=appdir install ; find appdir/
    Using CMake:
    cmake . ­DCMAKE_INSTALL_PREFIX=/usr
    make ­j4
    make DESTDIR=appdir install ; find appdir/
    Using autotools:
    ./configure ­­prefix=/usr
    make ­j4
    make install DESTDIR=$(readlink ­f appdir)
    find appdir/

    View full-size slide

  15. LINUXDEPLOYQT
    wget ­c
    "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/
    linuxdeployqt­continuous­x86_64.AppImage"
    chmod a+x linuxdeployqt*.AppImage
    unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
    ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop
    ­bundle­non­qt­libs
    ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop
    ­appimage

    View full-size slide

  16. CONTINUOUS APPIMAGE WORKFLOW
    2
    Push
    commit to
    GitHub
    1
    Prepare
    build sys-
    tem, e.g.,
    CentOS 6
    with Qt5,…
    3
    Build and
    package
    as an
    AppImage
    4
    Upload to,
    e.g., Bintray,
    GitHub
    Releases
    5
    Post
    download
    link on
    Project
    homepage

    View full-size slide

  17. OBS AppImage

    View full-size slide

  18. OBS: trusted, reliable, auditable build system
    that tracks security updates of dependencies,
    ensures licensing compliance, and hosts build
    products
    An ideal match!
    OBS APPIMAGE

    View full-size slide

  19. Let‘s walk through
    https://github.com/probonopd/AppImageKit/
    wiki/Using-Open-Build-Service
    OBS APPIMAGE

    View full-size slide

  20. live demo of the
    QtQuickApp on OBS „hello
    world“

    View full-size slide

  21. Your turn now…
    Can we get it to work with your app?
    https://github.com/probonopd/AppImageKit/
    wiki/Using-Open-Build-Service
    OBS APPIMAGE

    View full-size slide

  22. appimage.org
    #AppImage
    build.opensuse.org
    #opensuse-buildservice

    View full-size slide

  23. Works for all common Linux distributions
    Run the latest applications on mature (e.g.,
    enterprise) OSes
    One app = one file
    Super simple for users: just download one
    AppImage file, make it executable, and run
    No unpacking or installation necessary
    SOLVES...

    View full-size slide

  24. No root needed
    No system libraries changed
    Works out of the box, no installation of runtimes
    needed
    Works on Live ISOs, university lab computers,...
    Can use the same AppImages when dual-booting
    multiple distributions
    SOLVES...

    View full-size slide

  25. „This is just very cool.“
    https://plus.google.com/+LinusTorvalds/posts/WyrATKUnmrS

    View full-size slide

  26. Krita
    OFFICIAL APPIMAGES
    Microsoft
    PowerShell
    KDevelop
    Scribus
    OpenShot
    digiKam
    JetBrains
    Toolbox
    MuseScore
    Kdenlive
    Subsurface
    ImagePlay
    Drawpile
    ...hundreds more
    Avidemux

    View full-size slide

  27. BUT...
    FOSDEM 2017

    View full-size slide

  28. MORE
    • Binary delta updates
    using AppImageUpdate – only download what has
    changed
    • Sandboxing
    using, e.g., Firejail
    • Optional appimaged daemon
    for desktop integration (menus, icons, MIME types,
    updates,...)

    View full-size slide

  29. "As a tester, I want to run
    multiple builds without
    messing up my system.“

    View full-size slide

  30. "As a user, I want to
    download an application
    from the original author
    and run it, now!“

    View full-size slide