eteran/edb-debugger

Distribution as flatpak

Lunarequest opened this issue ยท 36 comments

I've made a quick flatpak manifest for edb-debugger. However I've run into the issue edb only ships with pixmaps when flatpaks require icons. Could pngs be provided for this?

the manifest is complete with support for fedc so dependencies and edb-debugger can be updated automatically

app-id: io.github.eteran.edb-debugger
runtime: org.kde.Platform
runtime-version: '5.15'
sdk: org.kde.Sdk
command: edb
rename-desktop-file: edb.desktop
rename-appdata-file: edb.appdata.xml
finish-args:
  - --share=ipc
  - --socket=wayland
  - --socket=fallback-x11
  - --filesystem=host
  - --device=dri
modules:
  - name: boost
    buildsystem: simple
    build-commands:
      - ./bootstrap.sh PREFIX=/app
      - ./b2 headers
      - ./b2 install --prefix=/app
    sources:
      - type: archive
        url: https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz
        sha256: 5347464af5b14ac54bb945dc68f1dd7c56f0dad7262816b956138fc53bcc0131
        x-checker-data:
            type: anitya
            project-id: 6845
            stable-only: true
            url-template: https://boostorg.jfrog.io/artifactory/main/release/$version/source/boost_${version0}_${version1}_${version2}.tar.gz
    cleanup:
      - /include
      - /lib/cmake
  - name: capstone
    buildsystem: simple
    build-commands:
        - make V=1 PREFIX=/app
        - make DESTDIR=/app install
        - mv /app/usr/lib/* /app/lib/
        - mv /app/usr/include/* /app/include/
        - mv /app/usr/bin /app/
    sources:
      - type: git
        url: https://github.com/aquynh/capstone.git
        tag: "4.0.2"
        commit: 1d230532840a37ac032c6ab80128238fc930c6c1
        x-checker-data:
          type: git
          tag-pattern: (\d+\.\d+\.\d+)
    cleanup:
      - /usr/include
      - /usr/lib
  - name: edb
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=RelWithDebInfo
      - -DCMAKE_INSTALL_PREFIX=/app
    sources:
      - type: archive
        url: https://github.com/eteran/edb-debugger/releases/download/1.3.0/edb-debugger-1.3.0.tgz
        sha256: 86df4a0940a39c1480a6fc789f167f94e87a7a330f2d8163fe871f42c754afe8
        x-checker-data:
            type: json
            url: https://api.github.com/repos/eteran/edb-debugger/releases/latest
            version-query: .tag_name
            url-query: ".assets[] | .browser_download_url"
    post-install:
      - install -D edb.appdata.xml -t /app/share/metainfo/
    cleanup:
      - /share/man

Very cool! We can definitely give you some PNGs. Let me look into how this all works and we'll figure it out :-)

according to the flathub requirements edb-debugger needs to provide 64ร—64px and 128ร—128px sized icons. They can also be svgs

Sorry for the delay, been very busy lately. But... we do have some things which are "close" in the source tree already:

https://github.com/eteran/edb-debugger/tree/master/src/res/images

Maybe we can just take the edb100-logo.png image and resize it as needed? Not ideal, but it will get the ball rolling?

Note that resizing 100px โ†’ 128px will blur the icon. This may be not too bad if we use a suitable upsampling algorithm (e.g. GIMP's NoHalo), but it will still be suboptimal.

Maybe we can just take the edb100-logo.png image and resize it as needed? Not ideal, but it will get the ball rolling?

To get started with it would work.

Yea definitely expecting some minor bluring, but it's just to get this unblocked until we sort out a better solution.

bztd commented

@Lunarequest Hello, why was the application not made to Flatpak?

Sorry, yeah this kinda got lost in the mix. I agree that it's a good idea to do though. If you guys follow up with me every now and then to make sure I don't forget I'll try to get it in there ๐Ÿ˜

bztd commented

This would be a more updated version of the manifesto:

app-id: io.github.eteran.edb-debugger
runtime: org.kde.Platform
runtime-version: '5.15-23.08'
sdk: org.kde.Sdk
command: edb
rename-desktop-file: edb.desktop
rename-appdata-file: edb.appdata.xml
finish-args:
  - --share=ipc
  - --socket=wayland
  - --socket=fallback-x11
  - --filesystem=home
  - --device=dri
modules:
  - name: boost
    buildsystem: simple
    build-commands:
      - ./bootstrap.sh PREFIX=/app
      - ./b2 headers
      - ./b2 install --prefix=/app
    sources:
      - type: archive
        url: https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz
        sha256: 5347464af5b14ac54bb945dc68f1dd7c56f0dad7262816b956138fc53bcc0131
        x-checker-data:
            type: anitya
            project-id: 6845
            stable-only: true
            url-template: https://boostorg.jfrog.io/artifactory/main/release/$version/source/boost_${version0}_${version1}_${version2}.tar.gz
    cleanup:
      - /include
      - /lib/cmake
  - name: capstone
    buildsystem: simple
    build-commands:
        - make V=1 PREFIX=/app
        - make DESTDIR=/app install
        - mv /app/usr/lib/* /app/lib/
        - mv /app/usr/include/* /app/include/
        - mv /app/usr/bin /app/
    sources:
      - type: git
        url: https://github.com/aquynh/capstone.git
        tag: "5.0.1"
        commit: 097c04d9413c59a58b00d4d1c8d5dc0ac158ffaa
        x-checker-data:
          type: git
          tag-pattern: (\d+\.\d+\.\d+)
    cleanup:
      - /usr/include
      - /usr/lib
  - name: edb
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=RelWithDebInfo
      - -DCMAKE_INSTALL_PREFIX=/app
    sources:
      - type: archive
        url: https://github.com/eteran/edb-debugger/releases/download/1.4.0/edb-debugger-1.4.0.tgz
        sha256: 0eb2c5d17493ab0e7e0a0748eefa5733ec90329631cc8db87f2943e90f91b726
        x-checker-data:
            type: json
            url: https://api.github.com/repos/eteran/edb-debugger/releases/latest
            version-query: .tag_name
            url-query: ".assets[] | .browser_download_url"
    post-install:
      - install -D edb.appdata.xml -t /app/share/metainfo/
    cleanup:
      - /share/man
bztd commented

You also have to update the appdata to something like:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2024 Evan Teran <evan.teran@gmail.com> -->
<component type="desktop">
    <id>io.github.eteran.edb-debugger</id>
    <metadata_license>CC0-1.0</metadata_license>
    <project_license>GPL-2.0</project_license>
    <name>edb</name>
    <summary>Reverse engineer's debugger</summary>
    <description>
		<p>edb is a cross platform x86/x86-64 debugger. It was inspired by OllyDbg, but aims to function on x86 and x86-64 as well as multiple OS's.</p>
		<p>Linux is the only officially supported platform at the moment, but FreeBSD, OpenBSD, OSX and Windows ports are underway with varying degrees of functionality.</p>
    </description>
    <screenshots>
        <screenshot type="default" width="1121" height="839">http://codef00.com/img/debugger.png</screenshot>
    </screenshots>
    <updatecontact>evan.teran_at_gmail.com</updatecontact>
    <url type="homepage">https://github.com/eteran/edb-debugger</url>
    <developer_name>edb-debugger</developer_name>
    <launchable type="desktop-id">edb.desktop</launchable>
    <provides>
        <binary>edb</binary>
    </provides>
    <content_rating type="oars-1.1">
        <content_attribute id="social-info">mild</content_attribute>
    </content_rating>
    <releases>
        <release version="1.4.0" date="2023-06-30"></release>
    </releases>
</component>

@bztd it's worth noting that more recent versions of edb actually don't require boost anymore (I believe) as the only features we needed it for are ones that are now just part of c++17.

bztd commented

@eteran I have made other modifications to the manifesto.
The compilation has finished successfully.
The program opens but I'm not sure how it behaves in the sandbox.

I think xterm should be added.It would be best if there is compatibility with Wayland.

Should I attach the manifest directly here or is it more convenient if I fork the flathub repository?

bztd commented

manifest:

app-id: io.github.eteran.edb-debugger
runtime: org.kde.Platform
runtime-version: '5.15-23.08'
sdk: org.kde.Sdk
command: edb
rename-icon: edb
rename-desktop-file: edb.desktop
rename-appdata-file: edb.appdata.xml
finish-args:
  - --allow=devel
  - --share=ipc
  - --socket=x11
  - --filesystem=xdg-documents
  - --device=dri

modules:
  - name: capstone
    buildsystem: simple
    build-commands:
      - make V=1 PREFIX=/app/
      - make DESTDIR=/app install
      - mkdir /app/lib /app/include /app/bin
      - mv /app/usr/lib/* /app/lib/
      - mv /app/usr/include/* /app/include/
      - mv /app/usr/bin/* /app/bin/
    post-install:
      - rm -r /app/usr
    sources:
      - type: git
        url: https://github.com/aquynh/capstone.git
        tag: "5.0.1"
        commit: 097c04d9413c59a58b00d4d1c8d5dc0ac158ffaa

  - name: libXmu-xterm
    buildsystem: autotools
    sources:
      - type: archive
        url: https://xorg.freedesktop.org/releases/individual/lib/libXmu-1.1.4.tar.gz
        sha256: 3091d711cdc1d8ea0f545a13b90d1464c3c3ab64778fd121f0d789b277a80289

  - name: libXaw-xterm
    buildsystem: autotools
    sources:
      - type: archive
        url: https://xorg.freedesktop.org/releases/individual/lib/libXaw-1.0.16.tar.gz
        sha256: 012f90adf8739f2f023d63a5fee1528949cf2aba92ef7ac1abcfc2ae9cf28798

  - name: xterm
    buildsystem: autotools
    config-opts:
      - --disable-full-tgetent
    sources:
      - type: archive
        url: https://invisible-island.net/datafiles/release/xterm.tar.gz
        sha256: 75117c3cc5174a09c425ef106e69404d72f5ef05e03a5da00aaf15792d6f9c0f

  - name: edb
    buildsystem: cmake-ninja
    post-install:
      - install -Dm644 edb.appdata.xml /app/share/appdata/edb.appdata.xml
      - install -Dm644 edb.svg /app/share/icons/hicolor/scalable/apps/edb.svg
    sources:
      - type: archive
        url: https://github.com/eteran/edb-debugger/releases/download/1.4.0/edb-debugger-1.4.0.tgz
        sha256: 0eb2c5d17493ab0e7e0a0748eefa5733ec90329631cc8db87f2943e90f91b726
      - type: file
        path: edb.svg
      - type: file
        path: edb.appdata.xml

looks great, but keep in mind that all the changes we've made don't apply to version 1.4.0. We'll need to cut a new release for it to automatically included.

bztd commented

Yes, that's why I included the necessary files separately in the manifest. It can be left like this temporarily if you prefer.

I have tried edb and it seems to work.

bztd commented

@eteran If you agree, I can make the request to flathub for you.

I'm away until Tuesday, but I say lemme do a 1.4.1 release when I get back and we can have the flatpak target that since it'll have the new icon built-in.

@bztd OK, I've bumped the version to 1.5.0, please feel free to updte the manifest to match and make a request to flathub!

bztd commented

I'll do the local tests and I will proceed

bztd commented

@eteran edb has been compiled in arm?

the build threw an error: https://buildbot.flathub.org/#/builders/30/builds/10009

bztd commented

sorry, I see that arm64 is not supported

That and the arm32 branch is likely in need of some love.

Really x86/x86-64 on Linux is really the only WELL supported platform

bztd commented

I think this is an almost definitive version of the package: flatpak install --user https://dl.flathub.org/build-repo/92200/io.github.eteran.edb-debugger.flatpakref

edb only has permission for the documents folder. The user can change it with commands or with flatseal.

Ok, does that mean it's done? Awesome, thanks for your efforts.

Is this process something we can automate in the future?

bztd commented

They still need to accept the request and add it to edb on flathub, which could take some time, but I think that what could be corrected has already been corrected.

As for automation, I have seen that a bot is usually used to update the sources, that is also configured in the manifest.
On the other hand, I do not know if any automation process can be configured from the edb-debugger repository.

Great, I'll close any related issues, but please do update when it gets approved!

bztd commented

@eteran Reviewers ask if it is possible to run edb on arm64 by removing the restrictions?

flathub/flathub#5078

according to the flathub requirements edb-debugger needs to provide 64ร—64px and 128ร—128px sized icons. They can also be svgs

128x128 is the minimum size.

@eteran Reviewers ask if it is possible to run edb on arm64 by removing the restrictions?

flathub/flathub#5078

Not possible, the code is not yet implemented.

However, it is worth noting that 32 but x86 IS supported, not just x86-64 (was reading the backlog of comments)

For flathub it doesn't matter i386 has been unsupported for longer than arm which has been unsupported since 2020.

We have all moved to 64-bits architectures.

BTW, I saw a lot of little things in the comments. If there are changes you think we should make on our end going forward, please do let us know!

Thanks for getting this done!

bztd commented

voila, edb was included to flathub.

Hell yeah, thanks for your help!