name: 2048x
title: 2048x
version: '1.5.0'
summary: A classic 2048 block sliding puzzle game
description: |
  Features:
  * Selectable board size (from 2x2 to 12x12).
  * Last move undo.
  * Keep game between application restarts.
  * Localization support (English, Czech).
  * High DPI support.
  * Moves history recording.
  * Dark and light themes.
  * Tiles move, merge and creation animation.
  * Selectable tile skins (linear, exponential, alpha, binary, Roman)
confinement: strict
base: core22
grade: stable
icon: "Images/Logo 64x64.png"
license: NLPL

plugs:
  gnome-3-38-2004:
    interface: content
    target: $SNAP/gnome-platform
    default-provider: gnome-3-38-2004
  gtk-3-themes:
    interface: content
    target: $SNAP/data-dir/themes
    default-provider: gtk-common-themes
  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

parts:
  2048x:
    plugin: nil
    source: .
    source-type: local
    build-packages:
    - fpc
    - lazarus
    - lcl
    - lcl-utils
    override-build: |
      snapcraftctl build
      lazbuild --build-mode=Release Game2048.lpi
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin
      install -s -m 755 Game2048 $SNAPCRAFT_PART_INSTALL/usr/bin/Game2048
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/Game2048/languages
      install -m 755 Languages/*.po $SNAPCRAFT_PART_INSTALL/usr/share/Game2048/languages
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications
      install -m 755 Install/snap/local/2048.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
      install -m 755 Images/2048.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
    stage:
      - etc
      - usr
      - usr/bin
      - usr/share/Game2048
      - usr/share/applications/2048.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

apps:
  2048x:
    command: usr/bin/Game2048
    desktop: usr/share/applications/2048.desktop
    plugs:
      - desktop
      - x11

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