2

I'm working to get my application in a flatpak package. My application (https://sourceforge.net/p/audiocuesheet) is a mono build which uses gtk-sharp2. I'm really new to flatpak and started to build a manifest like this:

{
    "app-id": "net.sourceforge.audiocuesheet",
    "runtime": "org.gnome.Platform",
    "runtime-version": "3.26",
    "sdk": "org.gnome.Sdk",
    "command": "AudioCuesheetEditor",
    "modules": [
        {
            "name": "AudioCuesheetEditor",
            "buildsystem": "simple",
            "build-commands": [
                "cp -r AudioCuesheetEditor /home/sven/Dokumente"
            ],
            "sources": [
                {
                    "type": "archive",
                    "path": "AudioCuesheetEditor-linux-x64-v2.4.0.zip",
                    "dest": "AudioCuesheetEditor"
                }
            ]
        }
    ]
}

When I run the flatpack-builder, I get this output:

[sven@localhost flatpak]$ flatpak-builder --force-clean build net.sourceforge.audiocuesheet.json 
Downloading sources
Starting build of net.sourceforge.audiocuesheet
Cache miss, checking out last cache hit
========================================================================
Building module AudioCuesheetEditor in /home/sven/Downloads/flatpak/.flatpak-builder/build/AudioCuesheetEditor-16
========================================================================
Archive:  /home/sven/Downloads/flatpak/AudioCuesheetEditor-linux-x64-v2.4.0.zip
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/AudioCuesheetEditor  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/AudioCuesheetEditor.exe  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/CHANGELOG.TXT  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/KNOWN_ISSUES.TXT  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-audio.so  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-audio.so.2.3  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-audio.so.2.3.0  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-graphics.so  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-graphics.so.2.3  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-graphics.so.2.3.0  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-network.so  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-network.so.2.3  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-network.so.2.3.0  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-system.so  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-system.so.2.3  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-system.so.2.3.0  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-window.so  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-window.so.2.3  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/libcsfml-window.so.2.3.0  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/LICENCE.TXT  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/locale/de/LC_MESSAGES/AudioCuesheetEditor.mo  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/locale/en/LC_MESSAGES/AudioCuesheetEditor.mo  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/MPG123Wrapper.dll  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/MPG123Wrapper.dll.config  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/README.TXT  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-128.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-16.ico  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-16.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-22.ico  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-22.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-24.ico  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-24.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-32.ico  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-32.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-48.ico  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-48.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/application-x-cue-64.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/audio-volume-high.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/audio-volume-low.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/audio-volume-medium.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/audio-volume-muted.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/icons/emblem-money.png  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/resources/logging.properties  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/samples/Sample_Inputfile.txt  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/samples/Sample_Inputfile2.txt  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/samples/Sample_Project.ace  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-audio-2.dll  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-audio-2.dll.config  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-graphics-2.dll  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-graphics-2.dll.config  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-system-2.dll  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-system-2.dll.config  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-window-2.dll  
  inflating: AudioCuesheetEditor-linux-x64-v2.4.0/sfmlnet-window-2.dll.config  
Running: cp -r AudioCuesheetEditor /home/sven/Dokumente
Committing stage build-AudioCuesheetEditor to cache
Cleaning up
Committing stage cleanup to cache
Finishing app
Error: Command 'AudioCuesheetEditor' not found

So, you see the error I get. "AudioCuesheetEditor" is a wrapper shell script, which starts mono with some parameters, it is generated automatically from monodevelop. But why does the builder not find the script?

Basically my idea for the flatpak package was this: 1. I already have a linux build (x64 or x86) with all dependencies (libraries). 2. Just extract this build (which is available on sourceforge) and copy it to the correct places inside the system. 3. Done

Can somebody tell me, what is going wrong here? Thanks for your help Sven

Sven
  • 447
  • 1
  • 6
  • 22

1 Answers1

1

You have the right idea:

  1. Just extract this build (which is available on sourceforge) and copy it to the correct places inside the system.

This is correct, but you are not copying them to the correct places. /home/sven/Dokumente is not a valid location inside a Flatpak package, since each Flatpak has its own directory structure which does not include your home directory. Try a path beginning with /app.

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • Well, thanks for the information. With extracting to "/app/AudioCuesheetEditor" the error still occured. I manged now to change "command": "/AudioCuesheetEditor", so the build runs, but shouldn't there be a single file output? – Sven Sep 30 '18 at 17:50
  • 1
    Not sure I understand what you mean by "a single file output." – ptomato Sep 30 '18 at 18:04
  • I thought the builder would output a single file, but now I see, it doesn't. I wanted to test my build with this command "flatpak-builder --run build net.sourceforge.audiocuesheet.json /app/AudioCuesheetEditor " but that doesn't run, I get the error: "bwrap: execvp /app/AudioCuesheetEditor: Permission denied". Also is there a possibility to get dependencies (I need mono, gtk-sharp2)? – Sven Sep 30 '18 at 18:48
  • 1
    You may have to use `chmod` to set the permissions of the AudioCuesheetEditor script, to be executable. I understood from your earlier post that all the dependencies were included in the tarball, but you may need to move them into /app/lib or something for them to be found correctly. – ptomato Sep 30 '18 at 19:06
  • Ok, thanks for your help. I will go on, but now I'm sure, that the idea is good :). – Sven Oct 12 '18 at 11:14