name: rizin
version: '4.5.0'
base: core18
summary: Rizin reverse engineering framework and tool
description: |
  Rizin is a complete framework for reverse-engineering
  and analyzing binaries; composed of a set of small utilities
  that can be used together or independently from the command line.
  Built around a disassembler for computer software which generates
  assembly language source code from machine-executable code,
  it supports a variety of executable formats for different processors
  and operating systems.

grade: devel # Development version, can only publish to beta/candidate channels.
confinement: devmode # Unrestricted access, only to beta/candidate channels.

# rizin requires in most cases privileged access to resources.
# The following "plugs" are thus superfluous because the "devmode" confinement
# gives full access to the system as if it were a DEB/RPM package.
# With the following plugs though, and the "strict" confinement, rizin
# would be able to do things like editing an executable file in the $HOME folder.

apps:
  rizin:
    command: usr/bin/rizin
    plugs: [home]
  rz-pm:
    command: usr/bin/rz-pm
    plugs: [home]
  rz_agent:
    command: usr/bin/rz_agent
    plugs: [home, network-bind]
  rz_find:
    command: usr/bin/rz_find
    plugs: [home]
  rz_hash:
    command: usr/bin/rz_hash
    plugs: [home]
  rz_asm:
    command: usr/bin/rz_asm
    plugs: [home]
  rz_bin:
    command: usr/bin/rz_bin
    plugs: [home]
  rz_diff:
    command: usr/bin/rz_diff
    plugs: [home]
  rz_gg:
    command: usr/bin/rz_gg
    plugs: [home]
  rz_run:
    command: usr/bin/rz_run
    plugs: [home]
  rz_ax:
    command: usr/bin/rz_ax
    plugs: [home]
  rz_sign:
    command: usr/bin/rz_sign
    plugs: [home]

parts:
  rizin:
    source: https://github.com/rizinorg/rizin.git
    source-tag: '4.5.0'
    plugin: meson
    meson-parameters: [--prefix=/usr]
    override-build: |
      pip3 install --system meson
      snapcraftctl build
    build-packages:
      - python3-pip
      - python3-setuptools
      - libmagic-dev
      - pkg-config
      - libzip-dev
      - liblz4-dev
      - libssl-dev
      - libbsd-dev
      - libcapstone-dev
      - libuv1-dev
    stage-packages:
      - libuv1
