Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written an application and I would like to package it via FLATPAK. I put the files that make up the program inside a folder called "files", inside which there are three folders "bin", "share" and "lib". I then created the "manifest.json" file in which I wrote the following code:
JSON
"app-id": "org.tarro.lamiavideoteca",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "23.08",
  "sdk": "org.freedesktop.Sdk",
  "command": "lamiavideoteca",
  "modules": [
    {
      "name": "lamiavideoteca",
      "buildsystem": "simple",
      "build-commands": [ 
		"cp -r files/lib build-dir/", 
		"cp -r files/bin build-dir/",
        "cp -r files/share build-dir/" ], 
      "sources": [ 
        { 
          "type": "dir", 
          "path": "files/lib" 
        }, 
        { 
          "type": "dir", 
          "path": "files/share" 
        }, 
        {
          "type": "dir",
          "path": "files/bin"
        }
      ]
    }
  ]



From the terminal I give the following command:

flatpak-builder build-dir manifest.json

However, I get the following error:

Running: cp -r files/lib build-dir/ cp: cannot stat 'files/lib': No such file or directory Error: module lamiavideoteca: Processo figlio uscito con codice 1

The folder exists so I can't figure it out

PS. I've already tried to package my application via SNAP, but even though the package is generated, the executable doesn't look for libraries in the "lib" directory within the snap, but in the operating system's /usr/lib directory. So after a week and several questions asked on the net I decided to abandon (momentarily the SNAP) and to find with FLATPAK. I would also like to add that I was able to use deb and AppImage, but I would like to learn how to do it through FLATPAK as I think it is a great packaging system to spread your applications in the Linux world. Thanks for the help.

What I have tried:

I tried everything. I even relied on ChatGPT to review the code, but I couldn't.
Posted
Updated 29-Mar-24 20:08pm
v2

Note that, according to the Official Documentation[^], these directories are blacklisted - /lib, /lib32, /lib64, /bin, /sbin, /usr, /boot, /root, /tmp, /etc, /app, /run, /proc, /sys, /dev, /var, meaning you can't give an app access to them even using the override method.

Quote:
It is common for applications to require access to different parts of the host filesystem, and Flatpak provides a flexible set of options for this. Some examples include:

--filesystem=host - access normal files on the host, not including host os or system internals described below

--filesystem=home - access the user’s home directory

--filesystem=/path/path - access specific paths

--filesystem=xdg-download - access a specific XDG folder

As a general rule, Filesystem access should be limited as much as possible.


You can also see if this page will work for you - How to give a Flatpak app access to a directory[^]
 
Share this answer
 
Bo, I can't understand... I manage to compile it with this code:

id: org.flatpak.LaMiaVideoteca
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: LaMiaVideoteca
modules:
- name: LaMiaVideoteca
buildsystem: simple
build-commands:
- install -D LaMiaVideoteca /app/bin/LaMiaVideoteca
sources:
- type: file
path: LaMiaVideoteca

It creates two folders "build-dir" and ".flatpak-builder", I can't find any I'll leave it at that. I use debs, at least I can create those.
 
Share this answer
 
Comments
Pete O'Hanlon 2-Apr-24 3:22am    
If you are replying to Andre, he won't be notified that you are doing so because you haven't actually replied to his answer. Don't add answers of your own if they are meant to be replies.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900