├── Makefile ├── .github ├── dependabot.yml ├── scripts │ └── update-versions.sh └── workflows │ └── update.yaml ├── .gitignore ├── README.md └── snap └── snapcraft.yaml /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: snap clean 2 | 3 | snap: 4 | snapcraft -v 5 | 6 | clean: 7 | snapcraft clean -v 8 | rm -vf *.snap 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # gitginore template for creating Snap packages 2 | # website: https://snapcraft.io/ 3 | 4 | parts/ 5 | prime/ 6 | stage/ 7 | *.snap 8 | 9 | # Snapcraft global state tracking data(automatically generated) 10 | # https://forum.snapcraft.io/t/location-to-save-global-state/768 11 | /snap/.snapcraft/ 12 | 13 | # Source archive packed by `snapcraft cleanbuild` before pushing to the LXD container 14 | /*_source.tar.bz2 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iaito snap repository 2 | 3 | [![snap: iaito](https://snapcraft.io/iaito/badge.svg "snap latest stable version")](https://snapcraft.io/iaito) 4 | 5 | This repository contains the recipie to build the snap version of [iaito](https://github.com/radareorg/iaito). 6 | 7 | [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/iaito) 8 | 9 | To install the snap version of iaito run: 10 | 11 | ```sh 12 | sudo snap install iaito --classic 13 | ``` 14 | -------------------------------------------------------------------------------- /.github/scripts/update-versions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ae 4 | 5 | cd "$(dirname "$0")/../.." 6 | 7 | getLatestReleaseTag() { 8 | echo "Checking latest release version for $1..." > /dev/stderr 9 | gh release view --repo "$1" --json tagName --template '{{.tagName}}' 10 | } 11 | 12 | IAITO_VERSION=$(getLatestReleaseTag radareorg/iaito) 13 | TRANSLATIONS_VERSION=$(getLatestReleaseTag radareorg/iaito-translations) 14 | 15 | echo "Updating versions in snap/snapcraft.yaml..." > /dev/stderr 16 | yq eval -i '.parts.iaito.source-tag=strenv(IAITO_VERSION) | 17 | .parts.iaito-translations.source-tag=strenv(TRANSLATIONS_VERSION) 18 | ' snap/snapcraft.yaml 19 | -------------------------------------------------------------------------------- /.github/workflows/update.yaml: -------------------------------------------------------------------------------- 1 | name: Check for updates 2 | on: 3 | schedule: # for scheduling to work this file must be in the default branch 4 | - cron: "30 */6 * * *" # run every 6 hours 5 | workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab 6 | 7 | jobs: 8 | update-versions: 9 | runs-on: ubuntu-latest 10 | 11 | permissions: 12 | # Give the default GITHUB_TOKEN write permission to commit and push the 13 | # added or changed files to the repository. 14 | contents: write 15 | 16 | steps: 17 | # Install version checker dependencies 18 | - name: Install required dependencies 19 | run: | 20 | curl -Ls https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64.tar.gz | tar -xzC /tmp 21 | sudo cp -v /tmp/yq_linux_* /usr/local/bin/yq 22 | 23 | # Perform the checkout of the main branch 24 | - name: Checkout 25 | uses: actions/checkout@v5 26 | with: 27 | ref: main 28 | 29 | # Perform the actual version check 30 | - name: Check for new versions for all parts 31 | run: .github/scripts/update-versions.sh 32 | env: 33 | GH_TOKEN: ${{ github.token }} 34 | 35 | # Commit changed file back to the repository 36 | - name: Commit changes 37 | id: commit 38 | uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1 39 | with: 40 | commit_message: Automatic update versions 41 | #commit_user_name: 'github-actions[bot]' 42 | #commit_user_email: '41898282+github-actions[bot]@users.noreply.github.com' 43 | commit_author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>' 44 | 45 | # Try to autopromote old builds 46 | - name: Install snapcraft 47 | if: steps.commit.outputs.changes_detected == 'false' 48 | run: sudo snap install snapcraft --channel=8.x/stable --classic 49 | 50 | # Check latest snap revision at edge channel for the slowest building channel (arm64) 51 | - name: Check latest snapcraft build revision 52 | if: steps.commit.outputs.changes_detected == 'false' 53 | id: snap 54 | env: 55 | SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} 56 | run: snapcraft list-revisions iaito --arch arm64 | awk 'NR==2{print "channels="$5}' >> $GITHUB_OUTPUT 57 | 58 | # Automatically promote to stable only if not already and no new build has been started 59 | - name: Promote Snap to stable if not yet promoted 60 | if: steps.commit.outputs.changes_detected == 'false' && steps.snap.outputs.channels == 'latest/edge*' 61 | env: 62 | SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} 63 | # Workaround for https://github.com/snapcore/snapcraft/issues/4439 64 | SNAPCRAFT_HAS_TTY: "true" 65 | run: yes | snapcraft promote iaito --from-channel edge --to-channel stable 66 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: iaito 2 | adopt-info: iaito 3 | confinement: classic 4 | compression: lzo 5 | grade: stable 6 | base: core24 7 | platforms: 8 | amd64: 9 | build-on: [amd64] 10 | build-for: amd64 11 | arm64: 12 | build-on: [arm64] 13 | build-for: arm64 14 | # ppc64el: 15 | # build-on: [ppc64el] 16 | # build-for: ppc64el 17 | # riscv64: 18 | # build-on: [riscv64] 19 | # build-for: riscv64 20 | # s390x: 21 | # build-on: [s390x] 22 | # build-for: s390x 23 | apps: 24 | iaito: 25 | command: bin/iaito 26 | common-id: org.radare.iaito 27 | desktop: share/applications/org.radare.iaito.desktop 28 | r2: 29 | command: bin/r2 30 | r2agent: 31 | command: bin/r2agent 32 | r2frida-compile: 33 | command: bin/r2frida-compile 34 | r2p: 35 | command: bin/r2p 36 | r2pm: 37 | command: bin/r2pm 38 | r2r: 39 | command: bin/r2r 40 | r2sdb: 41 | command: bin/r2sdb 42 | rabin2: 43 | command: bin/rabin2 44 | radare2: 45 | command: bin/radare2 46 | radiff2: 47 | command: bin/radiff2 48 | rafind2: 49 | command: bin/rafind2 50 | ragg2: 51 | command: bin/ragg2 52 | rahash2: 53 | command: bin/rahash2 54 | rapatch2: 55 | command: bin/rapatch2 56 | rarun2: 57 | command: bin/rarun2 58 | rasign2: 59 | command: bin/rasign2 60 | rasm2: 61 | command: bin/rasm2 62 | ravc2: 63 | command: bin/ravc2 64 | rax2: 65 | command: bin/rax2 66 | sleighc: 67 | command: bin/sleighc 68 | yara: 69 | command: bin/yara 70 | yarac: 71 | command: bin/yarac 72 | environment: 73 | R2_PREFIX: "$SNAP" 74 | SLEIGHHOME: "$SNAP/lib/radare2/last/r2ghidra_sleigh" 75 | PATH: "$SNAP/bin:$SNAP/usr/bin:${PATH}" 76 | XDG_DATA_DIRS: "$SNAP/share:$SNAP/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}:/usr/local/share:/usr/share" 77 | PKG_CONFIG_PATH: "$SNAP/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" 78 | LD_LIBRARY_PATH: "${SNAP_LIBRARY_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}:$SNAP/lib" 79 | LIBGL_DRIVERS_PATH: "$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/dri${LIBGL_DRIVERS_PATH:+:$LIBGL_DRIVERS_PATH}" 80 | __EGL_VENDOR_LIBRARY_DIRS: "$SNAP/usr/share/glvnd/egl_vendor.d${__EGL_VENDOR_LIBRARY_DIRS:+:$__EGL_VENDOR_LIBRARY_DIRS}:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d" 81 | __EGL_EXTERNAL_PLATFORM_CONFIG_DIRS: "$SNAP/usr/share/egl/egl_external_platform.d${__EGL_EXTERNAL_PLATFORM_CONFIG_DIRS:+:$__EGL_EXTERNAL_PLATFORM_CONFIG_DIRS}:/etc/egl/egl_external_platform.d:/usr/share/egl/egl_external_platform.d" 82 | parts: 83 | radare2: 84 | plugin: nil 85 | build-attributes: 86 | - no-patchelf 87 | stage-snaps: 88 | - radare2 89 | stage: 90 | - "-share/sbom" 91 | override-stage: | 92 | craftctl default 93 | sed -i "s,$CRAFT_STAGE/snap/radare2/current,$CRAFT_STAGE," "$CRAFT_STAGE/lib/pkgconfig/"*.pc 94 | sed -i "s,/snap/radare2/current,$CRAFT_STAGE," "$CRAFT_STAGE/include/libr/r_userconf.h" "$CRAFT_STAGE/lib/libyara.la" 95 | override-prime: | 96 | craftctl default 97 | sed -i "s,$CRAFT_STAGE,/snap/$SNAPCRAFT_PROJECT_NAME/current," "$CRAFT_PRIME/lib/pkgconfig/"*.pc "$CRAFT_PRIME/include/libr/r_userconf.h" "$CRAFT_PRIME/lib/libyara.la" 98 | iaito: 99 | after: 100 | - radare2 101 | plugin: qmake 102 | source: https://github.com/radareorg/iaito.git 103 | source-type: git 104 | source-depth: 1 105 | source-tag: '6.0.4' 106 | parse-info: 107 | - src/org.radare.iaito.appdata.xml 108 | qmake-project-file: src/Iaito.pro 109 | qmake-parameters: 110 | - PREFIX=/ 111 | - -config 112 | - release 113 | build-attributes: 114 | - enable-patchelf 115 | build-environment: 116 | - PATH: "/usr/lib/qt6/bin:${PATH}" 117 | build-packages: 118 | - pkgconf 119 | - libgraphviz-dev 120 | - qt6-base-dev 121 | - qt6-declarative-dev 122 | - qt6-svg-dev 123 | override-build: | 124 | craftctl default 125 | sed -i -e "s,Icon=\(.*\)\$,Icon=/share/icons/hicolor/scalable/apps/\1.svg," "$CRAFT_PART_INSTALL"/share/applications/org.radare.iaito.desktop 126 | stage-packages: 127 | - graphviz 128 | # X11 + wayland 129 | - xkb-data 130 | - libx11-6 131 | - libxcb1 132 | - libxkbcommon0 133 | - libglvnd0 134 | - libnvidia-egl-wayland1 135 | # Theming 136 | # qt6-xdgdesktopportal-platformtheme # added in manual-patchelf 137 | - libqt6dbus6t64 138 | # QT6 139 | - qt6-wayland 140 | - libqt6core6t64 141 | - libqt6gui6t64 142 | - libqt6network6t64 143 | - libqt6widgets6t64 144 | - libqt6svg6 # also for loading icon themes which are svg 145 | - libqt6svgwidgets6 146 | prime: 147 | # Remove nondesired base paths 148 | - "-etc" 149 | - "-usr/bin/X11" 150 | - "-usr/include" 151 | # The libraries in .../qt6/plugins will be primed in manual-patchelf 152 | - "-usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins" 153 | # Remove nondesired library files 154 | - "-usr/lib/X11" # already empty 155 | - "-usr/lib/sasl2" # already empty 156 | - "-lib/udev" 157 | - "-usr/lib/udev" 158 | # The libraries in .../dri will be primed in manual-patchelf 159 | - "-usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/dri" 160 | - "-usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/libgallium-*.so" 161 | # The JSON needs to be modified on prime will do in manual-patchelf 162 | - "-usr/share/egl/egl_external_platform.d" 163 | - "-usr/share/glvnd/egl_vendor.d" 164 | # Remove nondesired metadata 165 | - "-usr/share/apport" 166 | - "-usr/share/bug" 167 | - "-usr/share/doc" 168 | - "-usr/share/doc-base" 169 | - "-usr/share/lintian" 170 | - "-usr/share/man" 171 | - "-usr/share/menu" 172 | - "-usr/share/pkgconfig" 173 | - "-usr/share/upstart" 174 | iaito-translations: 175 | plugin: nil 176 | source: https://github.com/radareorg/iaito-translations.git 177 | source-type: git 178 | source-depth: 1 179 | source-tag: '20221114' 180 | build-environment: 181 | - PATH: "/usr/lib/qt6/bin:${PATH}" 182 | build-packages: 183 | - qt6-l10n-tools 184 | build-attributes: 185 | - no-patchelf 186 | override-build: make install PREFIX=$CRAFT_PART_INSTALL 187 | manual-patchelf: 188 | # QT plugins and Mesa drivers need to be patched manually 189 | # snapcraft automatic patchelf strips the QT metadata and Mesa BuildID 190 | # not allowing them to load or crash 191 | plugin: nil 192 | build-attributes: 193 | - no-patchelf 194 | build-packages: 195 | - patchelf 196 | - jq 197 | stage-packages: 198 | - qt6-wayland 199 | - qt6-xdgdesktopportal-platformtheme 200 | - libqt6gui6t64 201 | - libqt6network6t64 202 | - libqt6svg6 203 | - libnvidia-egl-wayland1 204 | - libgl1-mesa-dri 205 | - mesa-libgallium 206 | stage: 207 | - usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins 208 | - usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/dri 209 | - usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/libgallium-*.so 210 | - usr/share/glvnd/egl_vendor.d 211 | - usr/share/egl/egl_external_platform.d 212 | override-prime: | 213 | craftctl default 214 | LIBRARY_PATH="/snap/core24/current/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}" 215 | patchelf --force-rpath --set-rpath "\$ORIGIN/../..:\$ORIGIN/../../..:\$ORIGIN/../../../libproxy:$LIBRARY_PATH" "$CRAFT_PRIME/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/qt6/plugins/"*/*.so 216 | patchelf --force-rpath --set-rpath "\$ORIGIN/..:$LIBRARY_PATH" "$CRAFT_PRIME/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/dri/"*.so 217 | patchelf --force-rpath --set-rpath "\$ORIGIN:$LIBRARY_PATH" "$CRAFT_PRIME/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/"libgallium-*.so 218 | for json in "$CRAFT_PRIME/usr/share/glvnd/egl_vendor.d/"*.json "$CRAFT_PRIME/usr/share/egl/egl_external_platform.d/"*.json; do 219 | jq '.ICD.library_path=("'"../../../lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/"'"+.ICD.library_path)' "$json" > "$json".new 220 | mv "$json".new "$json" 221 | done 222 | qtconf: 223 | plugin: nil 224 | override-build: | 225 | mkdir -p "$CRAFT_PART_INSTALL"/bin 226 | cat < "$CRAFT_PART_INSTALL"/bin/qt.conf 227 | [Paths] 228 | Prefix = .. 229 | ArchData=usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6 230 | Binaries=usr/lib/qt6/bin 231 | Data=usr/share/qt6 232 | Documentation=usr/share/qt6/doc 233 | Headers=include/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6 234 | HostBinaries=usr/lib/qt6/bin 235 | HostData=usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6 236 | HostLibraries=usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR 237 | Libraries=usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR 238 | LibraryExecutables=usr/lib/qt6/libexec 239 | Plugins=usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins 240 | Qml2Imports=usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/qml 241 | Settings=etc/xdg 242 | Translations=share/iaito/translations 243 | EOF 244 | --------------------------------------------------------------------------------