# trigger rebuild
---
name: konsole
confinement: classic
grade: stable
base: core22
adopt-info: konsole
icon: $CRAFT_PROJECT_DIR/snap/gui/konsole.png
apps:
    konsole:
        # extensions:
        # - kde-neon
        command: usr/bin/konsole
        common-id: org.kde.konsole.desktop
        desktop: usr/share/applications/org.kde.konsole.desktop
assumes:
- snapd2.58.3
compression: lzo
environment:
    QTWEBENGINEPROCESS_PATH: "$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/qt5/libexec/QtWebEngineProcess"
    XDG_DATA_DIRS: "$XDG_DATA_DIRS:$SNAP/usr/share"
    XDG_CONFIG_DIRS: "$XDG_CONFIG_DIRS:$SNAP/etc/xdg"
    __EGL_VENDOR_LIBRARY_DIRS: "$SNAP/etc/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d"
    LIBGL_DRIVERS_PATH: "$SNAP/usr/lib/${CRAFT_ARCH_TRIPLET}/dri"
    HOME: $SNAP_REAL_HOME
    XDG_CACHE_HOME: $SNAP_USER_COMMON/.cache
    XDG_CONFIG_HOME: $SNAP_USER_COMMON/.config
    XDG_DATA_HOME: $SNAP_USER_COMMON/.local/share
layout:
    /usr/share/X11:
        symlink: $SNAP/usr/share/X11
    /usr/share/qt5:
        bind: $SNAP/usr/share/qt5
package-repositories:
-   type: apt
    components:
    - main
    suites:
    - jammy
    key-id: 444DABCF3667D0283F894EDDE6D4736255751E5D
    url: http://origin.archive.neon.kde.org/user
    key-server: keyserver.ubuntu.com
parts:
    mesa-patchelf:
        plugin: nil
        stage-packages:
        - libgl1-mesa-dri
        - freeglut3
        - libglu1-mesa
        stage:
        - "-usr/lib/${CRAFT_ARCH_TRIPLET}/dri"
    mesa-no-patchelf:
        plugin: nil
        stage-packages:
        - libgl1-mesa-dri
        build-attributes:
        - no-patchelf
        stage:
        - usr/lib/${CRAFT_ARCH_TRIPLET}/dri
    qtconf:
        plugin: nil
        override-build: |
            mkdir -p $CRAFT_PART_INSTALL/usr/bin/xdg
            cat <<EOF > $CRAFT_PART_INSTALL/usr/bin/qt.conf
            [Paths]
            Prefix = ../../
            LibraryExecutables = usr/lib/$CRAFT_ARCH_TRIPLET/qt5/libexec
            Plugins = usr/lib/$CRAFT_ARCH_TRIPLET/qt5/plugins
            Qml2Imports = usr/lib/$CRAFT_ARCH_TRIPLET/qt5/qml
            Translations = usr/share/qt5/translations
            Data = usr/share/qt5
            EOF
    konsole:
        after:
        - qtconf
        parse-info:
        - usr/share/metainfo/org.kde.konsole.appdata.xml
        plugin: cmake
        build-packages:
        - cmake
        - extra-cmake-modules
        - qtbase5-dev
        - libicu-dev
        - libkf5bookmarks-dev
        - libkf5config-dev
        - libkf5coreaddons-dev
        - libkf5crash-dev
        - libkf5doctools-dev
        - libkf5globalaccel-dev
        - libkf5guiaddons-dev
        - libkf5dbusaddons-dev
        - libkf5i18n-dev
        - libkf5iconthemes-dev
        - libkf5kio-dev
        - libkf5newstuff-dev
        - libkf5notifications-dev
        - libkf5notifyconfig-dev
        - libkf5parts-dev
        - libkf5pty-dev
        - libkf5service-dev
        - libkf5textwidgets-dev
        - libkf5widgetsaddons-dev
        - libkf5windowsystem-dev
        - libkf5xmlgui-dev
        - qtmultimedia5-dev
        - gettext
        - freeglut3-dev
        - libglu1-mesa-dev
        stage-packages:
        - libqt5core5a
        - libkf5bookmarks5
        - libkf5configcore5
        - libkf5configwidgets5
        - libkf5coreaddons5
        - libkf5crash5
        - libkf5globalaccel5
        - libkf5guiaddons5
        - libkf5dbusaddons5
        - libkf5i18n5
        - libkf5iconthemes5
        - libkf5kiocore5
        - kio
        - kio-extras
        - libkf5newstuff5
        - libkf5newstuffcore5
        - libkf5notifications5
        - libkf5newstuffwidgets5
        - libkf5notifyconfig5
        - libkf5parts5
        - libkf5pty5
        - libkf5service5
        - libkf5textwidgets5
        - libkf5widgetsaddons5
        - libkf5windowsystem5
        - libkf5xmlgui5
        - libqt5multimedia5
        - libqt5quick5
        - libqt5qmlmodels5
        - libicu70
        - gettext
        - breeze-icon-theme
        - freeglut3
        - libglu1-mesa
        - bash
        - breeze
        source: .
        source-type: local
        cmake-parameters:
        - -DKDE_INSTALL_USE_QT_SYS_PATHS=FALSE
        - "-DCMAKE_INSTALL_PREFIX=/usr"
        - "-DCMAKE_BUILD_TYPE=Release"
        - "-DENABLE_TESTING=OFF"
        - "-DBUILD_TESTING=OFF"
        - "-DKDE_SKIP_TEST_SETTINGS=ON"
        build-environment:
        - XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}
        - XDG_CONFIG_HOME: $CRAFT_STAGE/etc/xdg:/etc/xdg${XDG_CONFIG_HOME:+:$XDG_CONFIG_HOME}
        build-attributes:
        - enable-patchelf
        prime:
        - "-usr/lib/*/cmake/*"
        - "-usr/include/*"
        - "-usr/share/ECM/*"
        - "-usr/share/doc/*"
        - "-usr/share/man/*"
        - "-usr/share/icons/breeze-dark*"
        - "-usr/bin/X11"
        - "-usr/lib/gcc/$CRAFT_ARCH_TRIPLET/6.0.0"
        - "-usr/lib/aspell/*"
        - "-usr/lib/${CRAFT_ARCH_TRIPLET}/dri"

