name: acronym-decoder
title: Acronym Decoder
version: '1.7.0'
summary: A simple tool for quick searching of acronyms and abbreviations meaning.
description: |
  A tool for quick searching of acronym or abbreviation meanings.

  **Features:**
  * Acronym database management
  * Quick searching by acronym name, meaning or category. Exact or partial match.
  * Acronym categories
  * Database stored as project file in open XML format
  * Configurable import from external web pages (http, https) with custom text parsing rules
  * Support for import from MS Access database file
  * Localized interface (English, Czech)
  * Allows minimization to system tray
  * Document check for acronyms occurrence, definitions and summary section
confinement: strict
base: core24
grade: stable
icon: "Images/256x256/AcronymDecoder.png"
license: NLPL

parts:
  acronym-decoder:
    plugin: nil
    source: .
    source-type: local
    build-packages:
    - fpc
    - lazarus
    - lcl
    - lcl-utils
    override-build: |
      snapcraftctl build
      lazbuild --build-mode=Release AcronymDecoder.lpi
      install -Dm755 AcronymDecoder -t $SNAPCRAFT_PART_INSTALL/usr/bin
      install -Dm644 Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/AcronymDecoder/Languages
      install -Dm644 Packages/Common/Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/AcronymDecoder/Languages
      install -Dm644 Install/shared/acronym-decoder.xml -t $SNAPCRAFT_PART_INSTALL/usr/share/mime/packages
      install -Dm644 Install/shared/AcronymDecoder.desktop -t $SNAPCRAFT_PART_INSTALL/usr/share/applications
      install -Dm644 Images/256x256/AcronymDecoder.png -t $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
      install -Dm644 Images/256x256/AcronymDecoder.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/application-adp.png
      install -Dm644 Examples/*.adp -t $SNAPCRAFT_PART_INSTALL/usr/share/AcronymDecoder/Examples
    after:
    - desktop-gtk2
    stage:
    - etc
    - usr
    - usr/bin
    - usr/share/AcronymDecoder
    - usr/share/applications/AcronymDecoder.desktop
    - usr/share/pixmaps
    stage-packages:
    - libatk1.0-0
    - libcairo2
    - libdatrie1
    - libfontconfig1
    - libfreetype6
    - libfribidi0
    - libgdk-pixbuf2.0-0
    - libgraphite2-3
    - libgtk2.0-0
    - libharfbuzz0b
    - libpango-1.0-0
    - libpangocairo-1.0-0
    - libpangoft2-1.0-0
    - libpixman-1-0
    - libpng16-16
    - libthai0
    - libx11-6
    - libxau6
    - libxcb-render0
    - libxcb-shm0
    - libxcb1
    - libxcomposite1
    - libxcursor1
    - libxdamage1
    - libxdmcp6
    - libxext6
    - libxfixes3
    - libxi6
    - libxinerama1
    - libxrandr2
    - libxrender1

  desktop-gtk2:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk
    plugin: make
    make-parameters: ["FLAVOR=gtk2"]
    build-packages:
    - build-essential
    - libgtk2.0-dev
    stage-packages:
    - libxkbcommon0  # XKB_CONFIG_ROOT
    #- ttf-ubuntu-font-family
    - dmz-cursor-theme
    - light-themes
    - adwaita-icon-theme
    #- gnome-themes-standard
    - shared-mime-info
    - libgtk2.0-0
    - libgdk-pixbuf2.0-0
    - libglib2.0-bin
    - libgtk2.0-bin
    - unity-gtk2-module
    - locales-all
    #- libappindicator1
    - xdg-user-dirs
    - ibus-gtk
    - libibus-1.0-5

# Additional plugs to pick up the GTK theme and icons from the system
plugs:
  icon-themes:
    interface: content
    target: $SNAP/data-dir/icons
    default-provider: gtk-common-themes
  sound-themes:
    interface: content
    target: $SNAP/data-dir/sounds
    default-provider: gtk-common-themes
  gtk-2-engines:
    interface: content
    target: $SNAP/lib/gtk-2.0
    default-provider: gtk2-common-themes:gtk-2-engines
  gtk-2-themes:
    interface: content
    target: $SNAP/usr/share/themes
    default-provider: gtk2-common-themes:gtk-2-themes

environment:
  XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS
  GTK_PATH: $SNAP/lib/gtk-2.0

apps:
  acronym-decoder:
    command: usr/bin/AcronymDecoder
    command-chain:
    - bin/desktop-launch
    desktop: usr/share/applications/AcronymDecoder.desktop
    plugs:
    - desktop
    - x11
    - home

layout:
  /usr/share/AcronymDecoder:
    bind: $SNAP/usr/share/AcronymDecoder
