name: tunneler
title: Tunneler
version: '1.0.0'
summary: A real-time digging and shooting multi-player tank battle game
description: |
  This is remake of famous MS-DOS Tunneler game originally written in Pascal language. https://tunneler.org/
  Now it has been written from scratch in Lazarus/FPC to run natively on Linux.
confinement: strict
base: core22
grade: stable
icon: "Images/64x64/Tunneler.png"
license: NLPL

parts:
  tunneler:
    plugin: nil
    source: .
    source-type: local
    build-packages: 
    - fpc
    - lazarus
    - lcl
    - lcl-utils
    override-build: |
      snapcraftctl build
      lazbuild --build-mode=Release tunneler.lpi
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin
      install -s -m 755 Tunneler $SNAPCRAFT_PART_INSTALL/usr/bin
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications
      install -m 755 Install/common/Tunneler.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
      install -m 644 Images/64x64/Tunneler.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
      install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/Tunneler/Languages
      install -D -m 755 Languages/*.pot $SNAPCRAFT_PART_INSTALL/usr/share/Tunneler/Languages
      install -D -m 755 Languages/*.po $SNAPCRAFT_PART_INSTALL/usr/share/Tunneler/Languages
    stage:
    - usr
    - usr/bin
    - usr/share/Tunneler
    - usr/share/applications/Tunneler.desktop
    - usr/share/pixmaps
    stage-packages:
    # Autodetected dependencies
    - 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
    - libbrotli1

apps:
  tunneler:
    command: usr/bin/Tunneler
    desktop: usr/share/applications/Tunneler.desktop
    plugs:
    - desktop
    - x11

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