File appimage.yml of Package zoom

# Yaml script tested with Zoom as of March 8, 2024 version 5.17.11
# See https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0068973
# for latest Zoom version.

app: zoom
binpatch: true

ingredients:
  packages:
    - zoom

build:
  packages:
    - bash
    - awk
    - rsync
    - linuxdeployqt
    - linuxdeploy
    - Mesa-gallium
    - libqt5-qtbase-common-devel
    - libQt5Multimedia5
    - libQt5Svg5
    - libQt5X11Extras5
    - libQt5Network5
    - libQt5Xml5
    - libv4l1-0
    - libGLEW2_2
    - syslog-ng
    - deadbeef
    - mozilla-nss
    - libxcb-cursor0
    - libxcb-xtest0
    - libxcb-image0
    - libxcb-keysyms1
    - libxcb-xfixes0
    - libxcb-shape0
    - libxcb-shm0
    - libxcb-randr0
    - libxcb-util1
    - libxkbcommon-x11-0

script:
  - echo "--- Yaml script start ---"
  - echo "\$BUILD_APPDIR=$BUILD_APPDIR"
  - echo "Find out which libraries that are missing and add them to build packages on row 9:"
  - echo "/opt/zoom/cef/lib*.so* libraries and libraries that are located elsewhere"
  - echo "will likely not be found by ldd if the directories are not specified. Put:"
  - echo "LD_LIBRARY_PATH=$BUILD_APPDIR/opt/zoom/cef:$BUILD_APPDIR/opt/zoom/path/to/libs"
  - echo "in front of the command to help finding libraries"
  - LD_LIBRARY_PATH=$BUILD_APPDIR/opt/zoom/cef ldd $BUILD_APPDIR/opt/zoom/zoom
  - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
  - export appName=Zoom
  - export executable=${appName}Launcher
  - export desktopFileName=${appName}
  - export iconFileName=zoom-appimage
  - ls -al $BUILD_APPDIR/usr/bin/
  - rm -fv $BUILD_APPDIR/usr/bin/*
  - echo "Structure the files so that ldd can find them, typically in /usr/lib or /usr/lib64. (Maybe not neccessary)"
  - echo "Move all misplaced libraries to $BUILD_APPDIR/usr/lib64/"
  - mv -v $BUILD_APPDIR/opt/zoom/* $BUILD_APPDIR/usr/bin/.
  - mv -v $BUILD_APPDIR/usr/bin/lib*.so* $BUILD_APPDIR/usr/lib64/.
  - ls -al $BUILD_APPDIR
  - echo "${desktopFileName}.desktop should be placed in $BUILD_APPDIR"
  - echo "This is the existing *.desktop file:"
  - echo ls -al $BUILD_APPDIR/usr/share/applications/*.desktop
  - ls -al $BUILD_APPDIR/usr/share/applications/*.desktop
  - echo "Show current .desktop file content:"
  - echo "cat $BUILD_APPDIR/usr/share/applications/*.desktop"
  - cat $BUILD_APPDIR/usr/share/applications/*.desktop
  - echo "Cleanup the desktop file in the package:"
  - sed -i -e 's|/usr/bin/zoom %U|ZoomLauncher %U|g' $BUILD_APPDIR/usr/share/applications/Zoom.desktop
  - sed -i -e 's|^MimeType=.*$|MimeType=x-scheme-handler/zoommtg;x-scheme-handler/zoomus;x-scheme-handler/tel;|g' $BUILD_APPDIR/usr/share/applications/Zoom.desktop
  - cp -v $BUILD_APPDIR/usr/bin/version.txt $BUILD_APPDIR/usr/VERSION
  - rm -rf $BUILD_APPDIR/usr/share/icons/hicolor
  - #mkdir -pv $BUILD_APPDIR/usr/share/icons/hicolor/256x256/apps/
  - #cp -v $BUILD_APPDIR/usr/share/pixmaps/Zoom.png $BUILD_APPDIR/usr/share/icons/hicolor/256x256/apps/
  - #cp -v $BUILD_APPDIR/usr/share/pixmaps/Zoom.png $BUILD_APPDIR/.
  - cp -v $BUILD_SOURCE_DIR/icon $BUILD_APPDIR/${iconFileName}.svg
  - mkdir -pv $BUILD_APPDIR/usr/share/applications/
  - mkdir -pv $BUILD_APPDIR/usr/share/icons/hicolor/scalable/apps/
  - echo ls -al $BUILD_APPDIR/usr/share/icons/hicolor/scalable/apps
  - ls -al $BUILD_APPDIR/usr/share/icons/hicolor/scalable/apps
  - echo "Remove (vector) app icon(s):"
  - echo "rm -fv $BUILD_APPDIR/usr/share/icons/hicolor/scalable/apps/*"
  - rm -fv $BUILD_APPDIR/usr/share/icons/hicolor/scalable/apps/*
  - echo ls -al $BUILD_APPDIR/usr/share/applications/
  - ls -al $BUILD_APPDIR/usr/share/applications/
  - echo "Remove current .desktop file:"
  - echo "rm -fv $BUILD_APPDIR/usr/share/applications/*.desktop"
  - rm -fv $BUILD_APPDIR/usr/share/applications/*.desktop
  - echo "Use the uploaded desktop file:"
  - cp -v $BUILD_SOURCE_DIR/desktop $BUILD_APPDIR/${desktopFileName}.desktop
  - echo "Sometimes it works better with linuxdeployqt:"
  - echo linuxdeployqt $BUILD_APPDIR/${desktopFileName}.desktop -executable=/usr/bin/${executable} -no-copy-copyright-files -qmake=/usr/bin/qmake-qt5 -qmldir=/usr/lib64/qt5/qml -no-copy-copyright-files -exclude-libs=ffmpeg.so
  - echo "Sometimes it works better with linuxdeploy:"
  - echo LD_LIBRARY_PATH=$BUILD_APPDIR/usr/bin/cef linuxdeploy --verbosity=1 --appdir=$BUILD_APPDIR --desktop-file=$BUILD_APPDIR/${desktopFileName}.desktop --icon-file=$BUILD_APPDIR/${iconFileName}.svg
  - echo "--- linuxdeploy starts here ---"
  - LD_LIBRARY_PATH=$BUILD_APPDIR/usr/bin/cef linuxdeploy --verbosity=1 --appdir=$BUILD_APPDIR --desktop-file=$BUILD_APPDIR/${desktopFileName}.desktop --icon-file=$BUILD_APPDIR/${iconFileName}.svg
  - echo "--- linuxdeploy should have finnished here ---"
  - echo "--- Files that will be packaged in AppImage ---"
  - find $BUILD_APPDIR | sed "s|$BUILD_APPDIR||g"
  - echo "--- Files that will be packaged in AppImage ---"
  - echo "You should soon see an *.AppImage file being saved."
  - echo "--- End of Yaml script ---"
openSUSE Build Service is sponsored by