Problem with building a new package and then running the app in the sandbox

I tried to build a flatpak package from ffDiaporama without success. (The app is from here: https://ffdiaporama.tuxfamily.org)

I used org.kde.Platform/x86_64/5.12 and org.kde.Sdk/x86_64/5.12 and I built with the command
flatpak-builder –force-clean –repo=~/flatpak/ffdiarepo ~/flatpak/myflatbuilddir2 ~/flatpak/yaml-files/ffDiaporama.yaml
in Ubuntu 20.04.

After building the app ~/flatpak/myflatbuilddir2/files/bin/ffDiaporama works in Ubuntu 20.04.
But (in the sandbox)
flatpak build ~/flatpak/myflatbuilddir2 ffDiaporama doesn’t work.
The same is with flatpak run --devel --command=bash …

The gdb says:
Thread 1 “ffDiaporama” received signal SIGSEGV, Segmentation fault.
0x00007fffdd7e238c in ?? () from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0

I built and published a snap packages from ffDiaporama with success. The same in Flatpak would be nice.

I hope someone from here can help me to fix the problem.

2 Likes

This runtime has been EOL for a long time. Use 5.15-22.08

2 Likes

the other thing is I don’t see how you run it, nor do I see if you actually installed the flatpak.

flatpak install --reinstall ffdiarepo fh.frank.ffdiaporama
flatpak install ffdiarepo fh.frank.ffdiaporama.Debug
flatpak run --devel --command=bash fh.frank.ffdiaporama
gdb ffDiaporama
r -loglevel=1

I built and ran it with version 5.15-22.08 with the same problem.

In Ubuntu 20.04 is libQt5Core.so.5.12.8 installed.
When I use version 5.12, I can compare with Ubuntu 20.04.

so my guess is there is a bug in your program.

1 Like

This is not my program. The stable version of ffDiaporama is 9 years old and from here: https://ffdiaporama.tuxfamily.org
I just want to build a Flatpak package like I did with a Snap package and I just want to be the packager.

I think it would be much easier to help if you provide your Flatpak manifest. Maybe there is an issue how the application is build.

app-id: fh.frank.ffdiaporama
runtime: org.kde.Platform
runtime-version: '5.12'
sdk: org.kde.Sdk
command: ffDiaporama
copy-icon: true
finish-args:
  - --share=ipc
  - --share=network
  - --socket=x11
  - --socket=pulseaudio
  - --socket=wayland
  - --filesystem=host
  - --device=dri
  - --env=PATH=/app/bin:/usr/bin
modules:
  - ffmpeg.yaml

  - name: exiv2
    buildsystem: cmake-ninja
    builddir: true
    config-opts:
      - -DCMAKE_BUILD_TYPE=RelWithDebInfo
      - -DEXIV2_BUILD_DOC:BOOL=OFF
      - -DEXIV2_BUILD_SAMPLES:BOOL=OFF
      - -DEXIV2_BUILD_EXIV2_COMMAND:BOOL=OFF
    sources:
      - type: archive
        url: https://github.com/Exiv2/exiv2/releases/download/v0.27.5/exiv2-0.27.5-Source.tar.gz
        sha256: 35a58618ab236a901ca4928b0ad8b31007ebdc0386d904409d825024e45ea6e2
        
  - /home/frank/flatpak/flat-src/ffdiaporama-flat/shared-modules/SDL/SDL-1.2.15.json

  - name: ffdiaporama
    buildsystem: qmake
    config-opts:
      - LIBS+=-L/app/lib
    sources:
      - type: dir
        path: /home/frank/flatpak/flat-src/ffdiaporama-flat/ffDiaporama

I will soon put the source code of ffDiaporama on GitLab. And I will inform you about that here.

The source code is here:

I was able to build & start the application with the following manifest (I only added two patches from your repository). But I didn’t test anything more.

---
app-id: fh.frank.ffdiaporama
runtime: org.kde.Platform
runtime-version: '5.15-22.08'
sdk: org.kde.Sdk
command: ffDiaporama
copy-icon: true
finish-args:
  - --share=ipc
  - --share=network
  - --socket=x11
  - --socket=pulseaudio
  - --socket=wayland
#  - --filesystem=host
  - --device=dri
#  - --env=PATH=/app/bin:/usr/bin
modules:
  - name: ffmpeg,
    config-opts:
      - --enable-gpl
      - --disable-static
      - --enable-shared
      - --disable-doc
      - --disable-ffplay
      - --disable-ffprobe
    cleanup:
      - /share/ffmpeg/examples
    sources:
      - type: archive
        url: "https://ffmpeg.org/releases/ffmpeg-2.1.8.tar.gz"
        sha256: "96855a237291ed7390137bfeaf4ebdb114aa62261f14f914f4d00dd930cfb446"

  - name: exiv2
    buildsystem: cmake-ninja
    builddir: true
    config-opts:
      - -DCMAKE_BUILD_TYPE=RelWithDebInfo
      - -DEXIV2_BUILD_DOC:BOOL=OFF
      - -DEXIV2_BUILD_SAMPLES:BOOL=OFF
      - -DEXIV2_BUILD_EXIV2_COMMAND:BOOL=OFF
    sources:
      - type: archive
        url: https://github.com/Exiv2/exiv2/releases/download/v0.27.5/exiv2-0.27.5-Source.tar.gz
        sha256: 35a58618ab236a901ca4928b0ad8b31007ebdc0386d904409d825024e45ea6e2
        
  - shared-modules/SDL/SDL-1.2.15.json

  - name: ffdiaporama
    buildsystem: qmake
    config-opts:
      - LIBS+=-L/app/lib
    sources:
      - type: archive
        url: http://download.tuxfamily.org/ffdiaporama/Packages/Stable/ffdiaporama_bin_2.1.2014.0209.tar.gz
        sha256: a1f55367a3d915045a5f4ce5db20419c2e8ea26a8cd4d56bef2e3d525e55acaa
      - type: patch
        path: 8a3e887ee1a87c53ee8415f6961a4e787d5528e3.patch
      - type: patch
        path: 1a093b91a04fa64dc2a2d50c6d14f125f3016711.patch

Since you are using an absolute path on your filesystem: Are you certain that it’s clean & doesn’t contain anything incompatible from a previous build?

I tried it with the new manifest. Thanks. After
flatpak run --devel --command=bash --filesystem=xdg-documents --filesystem=xdg-pictures fh.frank.ffdiaporama and ffDiaporama
I cannot open pictures or a project file in the folder documents. I saw the same problem with the database as before.
After exit, the folder .ffDiaporama disapears.

I think myflatpakbuildir2 is clean because I use
flatpak-builder --force-clean …
I switched to relative paths.

I went a different way and built my own runtime. I built the packages without the flatpak-builder. The package of ffDiaporama works with flatpak version 1.15 (Arch Linux) but is not stable yet.

Hera are my steps:
Building fh.frank.myBaseSdk on Ubuntu 20.04

mkdir -p myflatpakbuilddir-u20/ffdiaruntime/usr

cd myflatpakbuilddir-u20

flatpak build-init myBaseSdk fh.frank.myBaseSdk org.kde.Sdk/x86_64/5.12 org.kde.Sdk/x86_64/5.12

fakechroot fakeroot debootstrap --variant=minbase --arch=amd64 focal myBaseSdk/usr http://de.archive.ubuntu.com/ubuntu

fakeroot fakechroot chroot myBaseSdk/usr apt install nano

fakeroot fakechroot chroot myBaseSdk/usr apt install locales

nano myBaseSdk/usr/etc/locale.gen and I removed the appropriate comment marks

fakechroot chroot myBaseSdk/usr locale-gen

fakechroot chroot myBaseSdk/usr apt-get clean

I changed in myBaseSdk/metadata [Application] in [Runtime]

flatpak build-finish myBaseSdk

flatpak build-export -r …/ffdiarepo myBaseSdk

flatpak --user remote-add --no-gpg-verify …/ffdiarepo ffdiarepo

flatpak install ffdiarepo fh.frank.myBaseSdk

Runtime test:
flatpak run --command=/usr/bin/bash --filesystem=home fh.frank.myBaseSdk
exit


Building ffdiaruntime:
flatpak build-init -w ffdiaruntime fh.frank.ffdiaruntime fh.frank.myBaseSdk fh.frank.myBaseSdk

flatpak build ffdiaruntime ln -s /usr/usr/share /usr/share

flatpak build ffdiaruntime ln -s /usr/usr/include /usr/include

flatpak build ffdiaruntime ln -s /usr/usr/local /usr/local

flatpak build ffdiaruntime ln -s /usr/var/lib /var/lib

flatpak build ffdiaruntime ln -s /usr/usr/lib/apt /usr/lib/apt

flatpak build ffdiaruntime ln -s /usr/usr/lib/x86_64-linux-gnu/coreutils /usr/lib/x86_64-linux-gnu/coreutils

fakeroot fakechroot chroot ffdiaruntime/usr/
nano /etc/apt/sources.list
changed in deb http://de.archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
apt update
apt upgrade
apt install ffdiaporama
apt install libqt5concurrent5
ln -s /usr/usr/lib/locale /usr/lib/locale
ln -s /usr/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0 /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0
exit


Patching ffdiaporama_2.1+dfsg-1build2_amd64.deb because of ‘Unable to find codec h264’:
sudo apt-get source ffdiaporama

cd ffdiaporama-2.1+dfsg

sudo nano src/ffDiaporama/engine/_EncodeVideo.cpp:

t349c349,351
<     *codec=avcodec_find_encoder_by_name(CodecName);
---
>     if (strcmp(CodecName,"h264") == 0) *codec=avcodec_find_encoder_by_name("libx264");
>         else *codec=avcodec_find_encoder_by_name(CodecName);
>

sudo apt-get -y build-dep ffdiaporama

sudo dpkg-source --commit

sudo debuild

cp ffdiaporama_2.1+dfsg-1build2_amd64.deb ffdiaruntime/usr/home/

fakeroot fakechroot chroot ffdiaruntime/usr/

apt remove ffdiaporama
dpkg -i /home/ffdiaporama_2.1+dfsg-1build2_amd64.deb
exit


Finishing runtime on Arch Linux with flatpak 1.15:
nano ffdiaruntime/metadata (changed [Application] in [Runtime])

flatpak build-finish ffdiaruntime

flatpak build-export -r …/ffdiarepo ffdiaruntime

flatpak install --user ffdiarepo fh.frank.ffdiaruntime

Dummy App:
flatpak build-init ffdiaapp fh.frank.u20.ffdiaporama fh.frank.ffdiaruntime fh.frank.ffdiaruntime

flatpak build-finish ffdiaapp –share=network --share=ipc --socket=x11 --socket=pulseaudio –filesystem=home --command=ffDiaporama

flatpak build-export …/ffdiarepo ffdiaapp

flatpak install --user ffdiarepo fh.frank.u20.ffdiaporama


This website (point 4) helped me: Flatpak - ArchWiki
And also Installation mit debootstrap › Wiki › ubuntuusers.de

I changed my steps here:

1 Like