name: btop
adopt-info: btop
summary: Resource monitor that shows usage and stats
description: |
  Resource monitor that shows usage and stats for processor, memory, disks, network and processes.
  C++ version and continuation of bashtop and bpytop.
license: Apache-2.0

base: core20
grade: stable
confinement: strict
compression: lzo

architectures:
  - build-on: amd64
  - build-on: arm64
  - build-on: armhf
  - build-on: ppc64el
  - build-on: s390x

package-repositories:
 - type: apt
   ppa: ubuntu-toolchain-r/test

apps:
  btop:
    command: usr/local/bin/btop
    environment:
      LC_ALL: C.UTF-8
      LANG: C.UTF-8
    plugs:
      - mount-observe
      - process-control
      - system-observe
      - hardware-observe
      - network
      - network-observe
      - home
      - removable-media

parts:
  btop:
    source: https://github.com/aristocratos/btop
    source-type: git
    plugin: make
    make-parameters:
      - PREFIX=/usr/local
      - STATIC=true
      - ADDFLAGS="-D SNAPPED"
      
    build-packages:
      - coreutils
      - sed
      - git
      - build-essential
      - gcc-11
      - g++-11
      
    override-pull: |
      snapcraftctl pull
      snapcraftctl set-version "$(git describe --tags | sed 's/^v//' | cut -d "-" -f1)"
