name: vcard-studio
title: vCard Studio
version: '1.5.0'
summary: A contact management application with support for vCard file format.
description: |
  A contact management application with support for vCard file format (.vcf).

  **Features**:
  * Add, Edit, Clone or Remove contacts and contact properties
  * Shows contact fields in multiple tabs General, Home, Work, Social, Chat and Others
  * Contact photo displayed and can be changed (supported image types JPEG, PNG, GIF and BMP)
  * Quick filter by table columns in contacts list
  * Combine multiple contact files together
  * Split contacts to separate files
  * Find any value in contacts
  * Find duplicate contacts to merge
  * Copy, Cut and Paste contacts from/to clipboard
  * Multilingual interface (English, Czech, Swedish)
  * Contact QR code
  * View contact source with syntax highlighting
  * Export to CSV, XML, MediaWiki, Excel, JSON, HTML and plain text.
  * Import from CSV, XML, MediaWiki and JSON.
  * Compare with another vCard file.
confinement: strict
base: core20
grade: stable
icon: "Images/vCard Studio.png"
license: NLPL

parts:
  vcard-studio:
    plugin: nil
    source: .
    source-type: local
    override-build: |
      snapcraftctl build
      lazbuild --build-mode=Release vCardStudio.lpi
      install -Dm755 vCardStudio -t $SNAPCRAFT_PART_INSTALL/usr/share/vCardStudio
      install -d $SNAPCRAFT_PART_INSTALL/usr/bin
      ln -s ../share/vCardStudio/vCardStudio $SNAPCRAFT_PART_INSTALL/usr/bin/vCardStudio
      install -Dm644 Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/vCardStudio/Languages
      install -Dm644 Packages/Common/Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/vCardStudio/Languages
      install -Dm644 Packages/VCard/Languages/*.po -t $SNAPCRAFT_PART_INSTALL/usr/share/vCardStudio/Languages
      install -Dm644 Images/Profile.png -t $SNAPCRAFT_PART_INSTALL/usr/share/vCardStudio/Images
      install -Dm644 Install/deb/vCardStudio.desktop -t $SNAPCRAFT_PART_INSTALL/usr/share/applications
      install -Dm644 Images/vCard\ Studio.png -t $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
    after:
    - lazarus
    - desktop-gtk2
    stage:
    - etc
    - usr
    - usr/bin
    - usr/share/vCardStudio
    - usr/share/applications/vCardStudio.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

  lazarus:
    plugin: nil
    source: .
    source-type: local
    build-packages:
    - wget
    - libgtk2.0-dev
    override-build: |
      wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.4/lazarus-project_3.4.0-0_amd64.deb
      wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.4/fpc-laz_3.2.2-210709_amd64.deb
      wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.4/fpc-src_3.2.2-210709_amd64.deb
      apt install ./lazarus-project_3.4.0-0_amd64.deb ./fpc-laz_3.2.2-210709_amd64.deb ./fpc-src_3.2.2-210709_amd64.deb
    stage: [-*]
    prime: [-*]

  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:
  vcard-studio:
    command: usr/bin/vCardStudio
    command-chain:
    - bin/desktop-launch
    desktop: usr/share/applications/vCardStudio.desktop
    plugs:
    - desktop
    - x11
    - home

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